htt.h 416 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189
  1. /*
  2. * Copyright (c) 2011-2016 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 <a_types.h> /* A_UINT32 */
  34. #include <a_osapi.h> /* PREPACK, POSTPACK */
  35. #ifdef ATHR_WIN_NWF
  36. #pragma warning(disable:4214) /* bit field types other than int */
  37. #endif
  38. #include "wlan_defs.h"
  39. #include <htt_common.h>
  40. /*
  41. * Unless explicitly specified to use 64 bits to represent physical addresses
  42. * (or more precisely, bus addresses), default to 32 bits.
  43. */
  44. #ifndef HTT_PADDR64
  45. #define HTT_PADDR64 0
  46. #endif
  47. #ifndef offsetof
  48. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  49. #endif
  50. /*
  51. * HTT version history:
  52. * 1.0 initial numbered version
  53. * 1.1 modifications to STATS messages.
  54. * These modifications are not backwards compatible, but since the
  55. * STATS messages themselves are non-essential (they are for debugging),
  56. * the 1.1 version of the HTT message library as a whole is compatible
  57. * with the 1.0 version.
  58. * 1.2 reset mask IE added to STATS_REQ message
  59. * 1.3 stat config IE added to STATS_REQ message
  60. *----
  61. * 2.0 FW rx PPDU desc added to RX_IND message
  62. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  63. *----
  64. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  65. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  66. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  67. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  68. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  69. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  70. * 3.5 Added flush and fail stats in rx_reorder stats structure
  71. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  72. * 3.7 Made changes to support EOS Mac_core 3.0
  73. * 3.8 Added txq_group information element definition;
  74. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  75. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  76. * Allow buffer addresses in bus-address format to be stored as
  77. * either 32 bits or 64 bits.
  78. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  79. * messages to specify which HTT options to use.
  80. * Initial TLV options cover:
  81. * - whether to use 32 or 64 bits to represent LL bus addresses
  82. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  83. * - how many tx queue groups to use
  84. * 3.11 Expand rx debug stats:
  85. * - Expand the rx_reorder_stats struct with stats about successful and
  86. * failed rx buffer allcoations.
  87. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  88. * the supply, allocation, use, and recycling of rx buffers for the
  89. * "remote ring" of rx buffers in host member in LL systems.
  90. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  91. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  92. * 3.13 Add constants + macros to support 64-bit address format for the
  93. * tx fragments descriptor, the rx ring buffer, and the rx ring
  94. * index shadow register.
  95. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  96. * - Add htt_tx_msdu_desc_ext_t struct def.
  97. * - Add TLV to specify whether the target supports the HTT tx MSDU
  98. * extension descriptor.
  99. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  100. * "extension" bit, to specify whether a HTT tx MSDU extension
  101. * descriptor is present.
  102. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  103. * (This allows the host to obtain key information about the MSDU
  104. * from a memory location already in the cache, rather than taking a
  105. * cache miss for each MSDU by reading the HW rx descs.)
  106. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  107. * whether a copy-engine classification result is appended to TX_FRM.
  108. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  109. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  110. * tx frames in the target after the peer has already been deleted.
  111. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  112. * 3.20 Expand rx_reorder_stats.
  113. * 3.21 Add optional rx channel spec to HL RX_IND.
  114. * 3.22 Expand rx_reorder_stats
  115. * (distinguish duplicates within vs. outside block ack window)
  116. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  117. * The justified rate is calculated by two steps. The first is to multiply
  118. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  119. * by a low pass filter.
  120. * This change allows HL download scheduling to consider the WLAN rate
  121. * that will be used for transmitting the downloaded frames.
  122. * 3.24 Expand rx_reorder_stats
  123. * (add counter for decrypt / MIC errors)
  124. * 3.25 Expand rx_reorder_stats
  125. * (add counter of frames received into both local + remote rings)
  126. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  127. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  128. * 3.27 Add a new interface for flow-control. The following t2h messages have
  129. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  130. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  131. * 3.28 Add a new interface for ring interface change. The following two h2t
  132. * and one t2h messages have been included:
  133. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  134. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  135. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  136. * information elements passed from the host to a Lithium target,
  137. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  138. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  139. * targets).
  140. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  141. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  142. */
  143. #define HTT_CURRENT_VERSION_MAJOR 3
  144. #define HTT_CURRENT_VERSION_MINOR 31
  145. #define HTT_NUM_TX_FRAG_DESC 1024
  146. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  147. #define HTT_CHECK_SET_VAL(field, val) \
  148. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  149. /* macros to assist in sign-extending fields from HTT messages */
  150. #define HTT_SIGN_BIT_MASK(field) \
  151. ((field ## _M + (1 << field ## _S)) >> 1)
  152. #define HTT_SIGN_BIT(_val, field) \
  153. (_val & HTT_SIGN_BIT_MASK(field))
  154. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  155. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  156. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  157. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  158. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  159. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  160. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  161. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  162. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  163. /*
  164. * TEMPORARY:
  165. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  166. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  167. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  168. * updated.
  169. */
  170. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  171. /*
  172. * TEMPORARY:
  173. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  174. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  175. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  176. * updated.
  177. */
  178. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  179. /* HTT Access Category values */
  180. enum HTT_AC_WMM {
  181. /* WMM Access Categories */
  182. HTT_AC_WMM_BE = 0x0,
  183. HTT_AC_WMM_BK = 0x1,
  184. HTT_AC_WMM_VI = 0x2,
  185. HTT_AC_WMM_VO = 0x3,
  186. /* extension Access Categories */
  187. HTT_AC_EXT_NON_QOS = 0x4,
  188. HTT_AC_EXT_UCAST_MGMT = 0x5,
  189. HTT_AC_EXT_MCAST_DATA = 0x6,
  190. HTT_AC_EXT_MCAST_MGMT = 0x7,
  191. };
  192. enum HTT_AC_WMM_MASK {
  193. /* WMM Access Categories */
  194. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  195. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  196. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  197. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  198. /* extension Access Categories */
  199. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  200. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  201. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  202. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  203. };
  204. #define HTT_AC_MASK_WMM \
  205. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  206. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  207. #define HTT_AC_MASK_EXT \
  208. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  209. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  210. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  211. /*
  212. * htt_dbg_stats_type -
  213. * bit positions for each stats type within a stats type bitmask
  214. * The bitmask contains 24 bits.
  215. */
  216. enum htt_dbg_stats_type {
  217. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  218. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  219. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  220. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  221. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  222. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  223. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  224. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  225. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  226. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  227. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  228. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  229. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  230. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  231. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  232. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  233. /* bits 16-23 currently reserved */
  234. /* keep this last */
  235. HTT_DBG_NUM_STATS
  236. };
  237. /*=== HTT option selection TLVs ===
  238. * Certain HTT messages have alternatives or options.
  239. * For such cases, the host and target need to agree on which option to use.
  240. * Option specification TLVs can be appended to the VERSION_REQ and
  241. * VERSION_CONF messages to select options other than the default.
  242. * These TLVs are entirely optional - if they are not provided, there is a
  243. * well-defined default for each option. If they are provided, they can be
  244. * provided in any order. Each TLV can be present or absent independent of
  245. * the presence / absence of other TLVs.
  246. *
  247. * The HTT option selection TLVs use the following format:
  248. * |31 16|15 8|7 0|
  249. * |---------------------------------+----------------+----------------|
  250. * | value (payload) | length | tag |
  251. * |-------------------------------------------------------------------|
  252. * The value portion need not be only 2 bytes; it can be extended by any
  253. * integer number of 4-byte units. The total length of the TLV, including
  254. * the tag and length fields, must be a multiple of 4 bytes. The length
  255. * field specifies the total TLV size in 4-byte units. Thus, the typical
  256. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  257. * field, would store 0x1 in its length field, to show that the TLV occupies
  258. * a single 4-byte unit.
  259. */
  260. /*--- TLV header format - applies to all HTT option TLVs ---*/
  261. enum HTT_OPTION_TLV_TAGS {
  262. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  263. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  264. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  265. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  266. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  267. };
  268. PREPACK struct htt_option_tlv_header_t {
  269. A_UINT8 tag;
  270. A_UINT8 length;
  271. } POSTPACK;
  272. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  273. #define HTT_OPTION_TLV_TAG_S 0
  274. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  275. #define HTT_OPTION_TLV_LENGTH_S 8
  276. /*
  277. * value0 - 16 bit value field stored in word0
  278. * The TLV's value field may be longer than 2 bytes, in which case
  279. * the remainder of the value is stored in word1, word2, etc.
  280. */
  281. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  282. #define HTT_OPTION_TLV_VALUE0_S 16
  283. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  284. do { \
  285. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  286. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  287. } while (0)
  288. #define HTT_OPTION_TLV_TAG_GET(word) \
  289. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  290. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  291. do { \
  292. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  293. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  294. } while (0)
  295. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  296. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  297. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  298. do { \
  299. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  300. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  301. } while (0)
  302. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  303. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  304. /*--- format of specific HTT option TLVs ---*/
  305. /*
  306. * HTT option TLV for specifying LL bus address size
  307. * Some chips require bus addresses used by the target to access buffers
  308. * within the host's memory to be 32 bits; others require bus addresses
  309. * used by the target to access buffers within the host's memory to be
  310. * 64 bits.
  311. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  312. * a suffix to the VERSION_CONF message to specify which bus address format
  313. * the target requires.
  314. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  315. * default to providing bus addresses to the target in 32-bit format.
  316. */
  317. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  318. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  319. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  320. };
  321. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  322. struct htt_option_tlv_header_t hdr;
  323. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  324. } POSTPACK;
  325. /*
  326. * HTT option TLV for specifying whether HL systems should indicate
  327. * over-the-air tx completion for individual frames, or should instead
  328. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  329. * requests an OTA tx completion for a particular tx frame.
  330. * This option does not apply to LL systems, where the TX_COMPL_IND
  331. * is mandatory.
  332. * This option is primarily intended for HL systems in which the tx frame
  333. * downloads over the host --> target bus are as slow as or slower than
  334. * the transmissions over the WLAN PHY. For cases where the bus is faster
  335. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  336. * and consquently will send one TX_COMPL_IND message that covers several
  337. * tx frames. For cases where the WLAN PHY is faster than the bus,
  338. * the target will end up transmitting very short A-MPDUs, and consequently
  339. * sending many TX_COMPL_IND messages, which each cover a very small number
  340. * of tx frames.
  341. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  342. * a suffix to the VERSION_REQ message to request whether the host desires to
  343. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  344. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  345. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  346. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  347. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  348. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  349. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  350. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  351. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  352. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  353. * TLV.
  354. */
  355. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  356. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  357. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  358. };
  359. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  360. struct htt_option_tlv_header_t hdr;
  361. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  362. } POSTPACK;
  363. /*
  364. * HTT option TLV for specifying how many tx queue groups the target
  365. * may establish.
  366. * This TLV specifies the maximum value the target may send in the
  367. * txq_group_id field of any TXQ_GROUP information elements sent by
  368. * the target to the host. This allows the host to pre-allocate an
  369. * appropriate number of tx queue group structs.
  370. *
  371. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  372. * a suffix to the VERSION_REQ message to specify whether the host supports
  373. * tx queue groups at all, and if so if there is any limit on the number of
  374. * tx queue groups that the host supports.
  375. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  376. * a suffix to the VERSION_CONF message. If the host has specified in the
  377. * VER_REQ message a limit on the number of tx queue groups the host can
  378. * supprt, the target shall limit its specification of the maximum tx groups
  379. * to be no larger than this host-specified limit.
  380. *
  381. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  382. * shall preallocate 4 tx queue group structs, and the target shall not
  383. * specify a txq_group_id larger than 3.
  384. */
  385. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  386. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  387. /*
  388. * values 1 through N specify the max number of tx queue groups
  389. * the sender supports
  390. */
  391. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  392. };
  393. /* TEMPORARY backwards-compatibility alias for a typo fix -
  394. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  395. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  396. * to support the old name (with the typo) until all references to the
  397. * old name are replaced with the new name.
  398. */
  399. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  400. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  401. struct htt_option_tlv_header_t hdr;
  402. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  403. } POSTPACK;
  404. /*
  405. * HTT option TLV for specifying whether the target supports an extended
  406. * version of the HTT tx descriptor. If the target provides this TLV
  407. * and specifies in the TLV that the target supports an extended version
  408. * of the HTT tx descriptor, the target must check the "extension" bit in
  409. * the HTT tx descriptor, and if the extension bit is set, to expect a
  410. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  411. * descriptor. Furthermore, the target must provide room for the HTT
  412. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  413. * This option is intended for systems where the host needs to explicitly
  414. * control the transmission parameters such as tx power for individual
  415. * tx frames.
  416. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  417. * as a suffix to the VERSION_CONF message to explicitly specify whether
  418. * the target supports the HTT tx MSDU extension descriptor.
  419. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  420. * by the host as lack of target support for the HTT tx MSDU extension
  421. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  422. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  423. * the HTT tx MSDU extension descriptor.
  424. * The host is not required to provide the HTT tx MSDU extension descriptor
  425. * just because the target supports it; the target must check the
  426. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  427. * extension descriptor is present.
  428. */
  429. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  430. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  431. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  432. };
  433. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  434. struct htt_option_tlv_header_t hdr;
  435. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  436. } POSTPACK;
  437. /*=== host -> target messages ===============================================*/
  438. enum htt_h2t_msg_type {
  439. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  440. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  441. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  442. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  443. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  444. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  445. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  446. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  447. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  448. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  449. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  450. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  451. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  452. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  453. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  454. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  455. /* keep this last */
  456. HTT_H2T_NUM_MSGS
  457. };
  458. /*
  459. * HTT host to target message type -
  460. * stored in bits 7:0 of the first word of the message
  461. */
  462. #define HTT_H2T_MSG_TYPE_M 0xff
  463. #define HTT_H2T_MSG_TYPE_S 0
  464. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  465. do { \
  466. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  467. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  468. } while (0)
  469. #define HTT_H2T_MSG_TYPE_GET(word) \
  470. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  471. /**
  472. * @brief host -> target version number request message definition
  473. *
  474. * |31 24|23 16|15 8|7 0|
  475. * |----------------+----------------+----------------+----------------|
  476. * | reserved | msg type |
  477. * |-------------------------------------------------------------------|
  478. * : option request TLV (optional) |
  479. * :...................................................................:
  480. *
  481. * The VER_REQ message may consist of a single 4-byte word, or may be
  482. * extended with TLVs that specify which HTT options the host is requesting
  483. * from the target.
  484. * The following option TLVs may be appended to the VER_REQ message:
  485. * - HL_SUPPRESS_TX_COMPL_IND
  486. * - HL_MAX_TX_QUEUE_GROUPS
  487. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  488. * may be appended to the VER_REQ message (but only one TLV of each type).
  489. *
  490. * Header fields:
  491. * - MSG_TYPE
  492. * Bits 7:0
  493. * Purpose: identifies this as a version number request message
  494. * Value: 0x0
  495. */
  496. #define HTT_VER_REQ_BYTES 4
  497. /* TBDXXX: figure out a reasonable number */
  498. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  499. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  500. /**
  501. * @brief HTT tx MSDU descriptor
  502. *
  503. * @details
  504. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  505. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  506. * the target firmware needs for the FW's tx processing, particularly
  507. * for creating the HW msdu descriptor.
  508. * The same HTT tx descriptor is used for HL and LL systems, though
  509. * a few fields within the tx descriptor are used only by LL or
  510. * only by HL.
  511. * The HTT tx descriptor is defined in two manners: by a struct with
  512. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  513. * definitions.
  514. * The target should use the struct def, for simplicitly and clarity,
  515. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  516. * neutral. Specifically, the host shall use the get/set macros built
  517. * around the mask + shift defs.
  518. */
  519. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  520. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  521. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  522. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  523. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  524. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  525. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  526. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  527. #define HTT_TX_VDEV_ID_WORD 0
  528. #define HTT_TX_VDEV_ID_MASK 0x3f
  529. #define HTT_TX_VDEV_ID_SHIFT 16
  530. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  531. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  532. #define HTT_TX_MSDU_LEN_DWORD 1
  533. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  534. /*
  535. * HTT_VAR_PADDR macros
  536. * Allow physical / bus addresses to be either a single 32-bit value,
  537. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  538. */
  539. #define HTT_VAR_PADDR32(var_name) \
  540. A_UINT32 var_name
  541. #define HTT_VAR_PADDR64_LE(var_name) \
  542. struct { \
  543. /* little-endian: lo precedes hi */ \
  544. A_UINT32 lo; \
  545. A_UINT32 hi; \
  546. } var_name
  547. /*
  548. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  549. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  550. * addresses are stored in a XXX-bit field.
  551. * This macro is used to define both htt_tx_msdu_desc32_t and
  552. * htt_tx_msdu_desc64_t structs.
  553. */
  554. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  555. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  556. { \
  557. /* DWORD 0: flags and meta-data */ \
  558. A_UINT32 \
  559. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  560. \
  561. /* pkt_subtype - \
  562. * Detailed specification of the tx frame contents, extending the \
  563. * general specification provided by pkt_type. \
  564. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  565. * pkt_type | pkt_subtype \
  566. * ============================================================== \
  567. * 802.3 | bit 0:3 - Reserved \
  568. * | bit 4: 0x0 - Copy-Engine Classification Results \
  569. * | not appended to the HTT message \
  570. * | 0x1 - Copy-Engine Classification Results \
  571. * | appended to the HTT message in the \
  572. * | format: \
  573. * | [HTT tx desc, frame header, \
  574. * | CE classification results] \
  575. * | The CE classification results begin \
  576. * | at the next 4-byte boundary after \
  577. * | the frame header. \
  578. * ------------+------------------------------------------------- \
  579. * Eth2 | bit 0:3 - Reserved \
  580. * | bit 4: 0x0 - Copy-Engine Classification Results \
  581. * | not appended to the HTT message \
  582. * | 0x1 - Copy-Engine Classification Results \
  583. * | appended to the HTT message. \
  584. * | See the above specification of the \
  585. * | CE classification results location. \
  586. * ------------+------------------------------------------------- \
  587. * native WiFi | bit 0:3 - Reserved \
  588. * | bit 4: 0x0 - Copy-Engine Classification Results \
  589. * | not appended to the HTT message \
  590. * | 0x1 - Copy-Engine Classification Results \
  591. * | appended to the HTT message. \
  592. * | See the above specification of the \
  593. * | CE classification results location. \
  594. * ------------+------------------------------------------------- \
  595. * mgmt | 0x0 - 802.11 MAC header absent \
  596. * | 0x1 - 802.11 MAC header present \
  597. * ------------+------------------------------------------------- \
  598. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  599. * | 0x1 - 802.11 MAC header present \
  600. * | bit 1: 0x0 - allow aggregation \
  601. * | 0x1 - don't allow aggregation \
  602. * | bit 2: 0x0 - perform encryption \
  603. * | 0x1 - don't perform encryption \
  604. * | bit 3: 0x0 - perform tx classification / queuing \
  605. * | 0x1 - don't perform tx classification; \
  606. * | insert the frame into the "misc" \
  607. * | tx queue \
  608. * | bit 4: 0x0 - Copy-Engine Classification Results \
  609. * | not appended to the HTT message \
  610. * | 0x1 - Copy-Engine Classification Results \
  611. * | appended to the HTT message. \
  612. * | See the above specification of the \
  613. * | CE classification results location. \
  614. */ \
  615. pkt_subtype: 5, \
  616. \
  617. /* pkt_type - \
  618. * General specification of the tx frame contents. \
  619. * The htt_pkt_type enum should be used to specify and check the \
  620. * value of this field. \
  621. */ \
  622. pkt_type: 3, \
  623. \
  624. /* vdev_id - \
  625. * ID for the vdev that is sending this tx frame. \
  626. * For certain non-standard packet types, e.g. pkt_type == raw \
  627. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  628. * This field is used primarily for determining where to queue \
  629. * broadcast and multicast frames. \
  630. */ \
  631. vdev_id: 6, \
  632. /* ext_tid - \
  633. * The extended traffic ID. \
  634. * If the TID is unknown, the extended TID is set to \
  635. * HTT_TX_EXT_TID_INVALID. \
  636. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  637. * value of the QoS TID. \
  638. * If the tx frame is non-QoS data, then the extended TID is set to \
  639. * HTT_TX_EXT_TID_NON_QOS. \
  640. * If the tx frame is multicast or broadcast, then the extended TID \
  641. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  642. */ \
  643. ext_tid: 5, \
  644. \
  645. /* postponed - \
  646. * This flag indicates whether the tx frame has been downloaded to \
  647. * the target before but discarded by the target, and now is being \
  648. * downloaded again; or if this is a new frame that is being \
  649. * downloaded for the first time. \
  650. * This flag allows the target to determine the correct order for \
  651. * transmitting new vs. old frames. \
  652. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  653. * This flag only applies to HL systems, since in LL systems, \
  654. * the tx flow control is handled entirely within the target. \
  655. */ \
  656. postponed: 1, \
  657. \
  658. /* extension - \
  659. * This flag indicates whether a HTT tx MSDU extension descriptor \
  660. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  661. * \
  662. * 0x0 - no extension MSDU descriptor is present \
  663. * 0x1 - an extension MSDU descriptor immediately follows the \
  664. * regular MSDU descriptor \
  665. */ \
  666. extension: 1, \
  667. \
  668. /* cksum_offload - \
  669. * This flag indicates whether checksum offload is enabled or not \
  670. * for this frame. Target FW use this flag to turn on HW checksumming \
  671. * 0x0 - No checksum offload \
  672. * 0x1 - L3 header checksum only \
  673. * 0x2 - L4 checksum only \
  674. * 0x3 - L3 header checksum + L4 checksum \
  675. */ \
  676. cksum_offload: 2, \
  677. \
  678. /* tx_comp_req - \
  679. * This flag indicates whether Tx Completion \
  680. * from fw is required or not. \
  681. * This flag is only relevant if tx completion is not \
  682. * universally enabled. \
  683. * For all LL systems, tx completion is mandatory, \
  684. * so this flag will be irrelevant. \
  685. * For HL systems tx completion is optional, but HL systems in which \
  686. * the bus throughput exceeds the WLAN throughput will \
  687. * probably want to always use tx completion, and thus \
  688. * would not check this flag. \
  689. * This flag is required when tx completions are not used universally, \
  690. * but are still required for certain tx frames for which \
  691. * an OTA delivery acknowledgment is needed by the host. \
  692. * In practice, this would be for HL systems in which the \
  693. * bus throughput is less than the WLAN throughput. \
  694. * \
  695. * 0x0 - Tx Completion Indication from Fw not required \
  696. * 0x1 - Tx Completion Indication from Fw is required \
  697. */ \
  698. tx_compl_req: 1; \
  699. \
  700. \
  701. /* DWORD 1: MSDU length and ID */ \
  702. A_UINT32 \
  703. len: 16, /* MSDU length, in bytes */ \
  704. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  705. * and this id is used to calculate fragmentation \
  706. * descriptor pointer inside the target based on \
  707. * the base address, configured inside the target. \
  708. */ \
  709. \
  710. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  711. /* frags_desc_ptr - \
  712. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  713. * where the tx frame's fragments reside in memory. \
  714. * This field only applies to LL systems, since in HL systems the \
  715. * (degenerate single-fragment) fragmentation descriptor is created \
  716. * within the target. \
  717. */ \
  718. _paddr__frags_desc_ptr_; \
  719. \
  720. /* DWORD 3 (or 4): peerid, chanfreq */ \
  721. /* \
  722. * Peer ID : Target can use this value to know which peer-id packet \
  723. * destined to. \
  724. * It's intended to be specified by host in case of NAWDS. \
  725. */ \
  726. A_UINT16 peerid; \
  727. \
  728. /* \
  729. * Channel frequency: This identifies the desired channel \
  730. * frequency (in mhz) for tx frames. This is used by FW to help \
  731. * determine when it is safe to transmit or drop frames for \
  732. * off-channel operation. \
  733. * The default value of zero indicates to FW that the corresponding \
  734. * VDEV's home channel (if there is one) is the desired channel \
  735. * frequency. \
  736. */ \
  737. A_UINT16 chanfreq; \
  738. \
  739. /* Reason reserved is commented is increasing the htt structure size \
  740. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  741. * A_UINT32 reserved_dword3_bits0_31; \
  742. */ \
  743. } POSTPACK
  744. /* define a htt_tx_msdu_desc32_t type */
  745. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  746. /* define a htt_tx_msdu_desc64_t type */
  747. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  748. /*
  749. * Make htt_tx_msdu_desc_t be an alias for either
  750. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  751. */
  752. #if HTT_PADDR64
  753. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  754. #else
  755. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  756. #endif
  757. /* decriptor information for Management frame*/
  758. /*
  759. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  760. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  761. */
  762. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  763. extern A_UINT32 mgmt_hdr_len;
  764. PREPACK struct htt_mgmt_tx_desc_t {
  765. A_UINT32 msg_type;
  766. #if HTT_PADDR64
  767. A_UINT64 frag_paddr; /* DMAble address of the data */
  768. #else
  769. A_UINT32 frag_paddr; /* DMAble address of the data */
  770. #endif
  771. A_UINT32 desc_id; /* returned to host during completion
  772. * to free the meory*/
  773. A_UINT32 len; /* Fragment length */
  774. A_UINT32 vdev_id; /* virtual device ID*/
  775. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  776. } POSTPACK;
  777. PREPACK struct htt_mgmt_tx_compl_ind {
  778. A_UINT32 desc_id;
  779. A_UINT32 status;
  780. } POSTPACK;
  781. /*
  782. * This SDU header size comes from the summation of the following:
  783. * 1. Max of:
  784. * a. Native WiFi header, for native WiFi frames: 24 bytes
  785. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  786. * b. 802.11 header, for raw frames: 36 bytes
  787. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  788. * QoS header, HT header)
  789. * c. 802.3 header, for ethernet frames: 14 bytes
  790. * (destination address, source address, ethertype / length)
  791. * 2. Max of:
  792. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  793. * b. IPv6 header, up through the Traffic Class: 2 bytes
  794. * 3. 802.1Q VLAN header: 4 bytes
  795. * 4. LLC/SNAP header: 8 bytes
  796. */
  797. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  798. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  799. #define HTT_TX_HDR_SIZE_ETHERNET 14
  800. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  801. A_COMPILE_TIME_ASSERT(
  802. htt_encap_hdr_size_max_check_nwifi,
  803. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  804. A_COMPILE_TIME_ASSERT(
  805. htt_encap_hdr_size_max_check_enet,
  806. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  807. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  808. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  809. #define HTT_TX_HDR_SIZE_802_1Q 4
  810. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  811. #define HTT_COMMON_TX_FRM_HDR_LEN \
  812. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  813. HTT_TX_HDR_SIZE_802_1Q + \
  814. HTT_TX_HDR_SIZE_LLC_SNAP)
  815. #define HTT_HL_TX_FRM_HDR_LEN \
  816. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  817. #define HTT_LL_TX_FRM_HDR_LEN \
  818. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  819. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  820. /* dword 0 */
  821. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  822. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  823. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  824. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  825. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  826. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  827. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  828. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  829. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  830. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  831. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  832. #define HTT_TX_DESC_PKT_TYPE_S 13
  833. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  834. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  835. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  836. #define HTT_TX_DESC_VDEV_ID_S 16
  837. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  838. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  839. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  840. #define HTT_TX_DESC_EXT_TID_S 22
  841. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  842. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  843. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  844. #define HTT_TX_DESC_POSTPONED_S 27
  845. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  846. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  847. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  848. #define HTT_TX_DESC_EXTENSION_S 28
  849. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  850. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  851. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  852. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  853. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  854. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  855. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  856. #define HTT_TX_DESC_TX_COMP_S 31
  857. /* dword 1 */
  858. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  859. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  860. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  861. #define HTT_TX_DESC_FRM_LEN_S 0
  862. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  863. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  864. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  865. #define HTT_TX_DESC_FRM_ID_S 16
  866. /* dword 2 */
  867. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  868. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  869. /* for systems using 64-bit format for bus addresses */
  870. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  871. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  872. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  873. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  874. /* for systems using 32-bit format for bus addresses */
  875. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  876. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  877. /* dword 3 */
  878. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  879. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  880. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  881. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  882. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  883. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  884. #if HTT_PADDR64
  885. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  886. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  887. #else
  888. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  889. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  890. #endif
  891. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  892. #define HTT_TX_DESC_PEER_ID_S 0
  893. /*
  894. * TEMPORARY:
  895. * The original definitions for the PEER_ID fields contained typos
  896. * (with _DESC_PADDR appended to this PEER_ID field name).
  897. * Retain deprecated original names for PEER_ID fields until all code that
  898. * refers to them has been updated.
  899. */
  900. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  901. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  902. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  903. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  904. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  905. HTT_TX_DESC_PEER_ID_M
  906. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  907. HTT_TX_DESC_PEER_ID_S
  908. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  909. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  910. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  911. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  912. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  913. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  914. #if HTT_PADDR64
  915. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  916. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  917. #else
  918. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  919. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  920. #endif
  921. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  922. #define HTT_TX_DESC_CHAN_FREQ_S 16
  923. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  924. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  925. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  926. do { \
  927. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  928. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  929. } while (0)
  930. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  931. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  932. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  933. do { \
  934. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  935. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  936. } while (0)
  937. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  938. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  939. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  940. do { \
  941. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  942. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  943. } while (0)
  944. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  945. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  946. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  947. do { \
  948. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  949. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  950. } while (0)
  951. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  952. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  953. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  954. do { \
  955. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  956. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  957. } while (0)
  958. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  959. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  960. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  961. do { \
  962. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  963. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  964. } while (0)
  965. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  966. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  967. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  968. do { \
  969. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  970. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  971. } while (0)
  972. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  973. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  974. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  975. do { \
  976. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  977. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  978. } while (0)
  979. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  980. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  981. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  982. do { \
  983. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  984. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  985. } while (0)
  986. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  987. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  988. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  989. do { \
  990. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  991. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  992. } while (0)
  993. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  994. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  995. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  996. do { \
  997. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  998. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  999. } while (0)
  1000. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1001. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1002. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1003. do { \
  1004. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1005. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1006. } while (0)
  1007. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1008. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1009. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1010. do { \
  1011. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1012. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1013. } while (0)
  1014. /* enums used in the HTT tx MSDU extension descriptor */
  1015. enum {
  1016. htt_tx_guard_interval_regular = 0,
  1017. htt_tx_guard_interval_short = 1,
  1018. };
  1019. enum {
  1020. htt_tx_preamble_type_ofdm = 0,
  1021. htt_tx_preamble_type_cck = 1,
  1022. htt_tx_preamble_type_ht = 2,
  1023. htt_tx_preamble_type_vht = 3,
  1024. };
  1025. enum {
  1026. htt_tx_bandwidth_5MHz = 0,
  1027. htt_tx_bandwidth_10MHz = 1,
  1028. htt_tx_bandwidth_20MHz = 2,
  1029. htt_tx_bandwidth_40MHz = 3,
  1030. htt_tx_bandwidth_80MHz = 4,
  1031. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1032. };
  1033. /**
  1034. * @brief HTT tx MSDU extension descriptor
  1035. * @details
  1036. * If the target supports HTT tx MSDU extension descriptors, the host has
  1037. * the option of appending the following struct following the regular
  1038. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1039. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1040. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1041. * tx specs for each frame.
  1042. */
  1043. PREPACK struct htt_tx_msdu_desc_ext_t {
  1044. /* DWORD 0: flags */
  1045. A_UINT32
  1046. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1047. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1048. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1049. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1050. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1051. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1052. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1053. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1054. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1055. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1056. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1057. /* DWORD 1: tx power, tx rate, tx BW */
  1058. A_UINT32
  1059. /* pwr -
  1060. * Specify what power the tx frame needs to be transmitted at.
  1061. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1062. * The value needs to be appropriately sign-extended when extracting
  1063. * the value from the message and storing it in a variable that is
  1064. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1065. * automatically handles this sign-extension.)
  1066. * If the transmission uses multiple tx chains, this power spec is
  1067. * the total transmit power, assuming incoherent combination of
  1068. * per-chain power to produce the total power.
  1069. */
  1070. pwr: 8,
  1071. /* mcs_mask -
  1072. * Specify the allowable values for MCS index (modulation and coding)
  1073. * to use for transmitting the frame.
  1074. *
  1075. * For HT / VHT preamble types, this mask directly corresponds to
  1076. * the HT or VHT MCS indices that are allowed. For each bit N set
  1077. * within the mask, MCS index N is allowed for transmitting the frame.
  1078. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1079. * rates versus OFDM rates, so the host has the option of specifying
  1080. * that the target must transmit the frame with CCK or OFDM rates
  1081. * (not HT or VHT), but leaving the decision to the target whether
  1082. * to use CCK or OFDM.
  1083. *
  1084. * For CCK and OFDM, the bits within this mask are interpreted as
  1085. * follows:
  1086. * bit 0 -> CCK 1 Mbps rate is allowed
  1087. * bit 1 -> CCK 2 Mbps rate is allowed
  1088. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1089. * bit 3 -> CCK 11 Mbps rate is allowed
  1090. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1091. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1092. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1093. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1094. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1095. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1096. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1097. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1098. *
  1099. * The MCS index specification needs to be compatible with the
  1100. * bandwidth mask specification. For example, a MCS index == 9
  1101. * specification is inconsistent with a preamble type == VHT,
  1102. * Nss == 1, and channel bandwidth == 20 MHz.
  1103. *
  1104. * Furthermore, the host has only a limited ability to specify to
  1105. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1106. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1107. */
  1108. mcs_mask: 12,
  1109. /* nss_mask -
  1110. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1111. * Each bit in this mask corresponds to a Nss value:
  1112. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1113. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1114. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1115. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1116. * The values in the Nss mask must be suitable for the recipient, e.g.
  1117. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1118. * recipient which only supports 2x2 MIMO.
  1119. */
  1120. nss_mask: 4,
  1121. /* guard_interval -
  1122. * Specify a htt_tx_guard_interval enum value to indicate whether
  1123. * the transmission should use a regular guard interval or a
  1124. * short guard interval.
  1125. */
  1126. guard_interval: 1,
  1127. /* preamble_type_mask -
  1128. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1129. * may choose from for transmitting this frame.
  1130. * The bits in this mask correspond to the values in the
  1131. * htt_tx_preamble_type enum. For example, to allow the target
  1132. * to transmit the frame as either CCK or OFDM, this field would
  1133. * be set to
  1134. * (1 << htt_tx_preamble_type_ofdm) |
  1135. * (1 << htt_tx_preamble_type_cck)
  1136. */
  1137. preamble_type_mask: 4,
  1138. reserved1_31_29: 3; /* unused, set to 0x0 */
  1139. /* DWORD 2: tx chain mask, tx retries */
  1140. A_UINT32
  1141. /* chain_mask - specify which chains to transmit from */
  1142. chain_mask: 4,
  1143. /* retry_limit -
  1144. * Specify the maximum number of transmissions, including the
  1145. * initial transmission, to attempt before giving up if no ack
  1146. * is received.
  1147. * If the tx rate is specified, then all retries shall use the
  1148. * same rate as the initial transmission.
  1149. * If no tx rate is specified, the target can choose whether to
  1150. * retain the original rate during the retransmissions, or to
  1151. * fall back to a more robust rate.
  1152. */
  1153. retry_limit: 4,
  1154. /* bandwidth_mask -
  1155. * Specify what channel widths may be used for the transmission.
  1156. * A value of zero indicates "don't care" - the target may choose
  1157. * the transmission bandwidth.
  1158. * The bits within this mask correspond to the htt_tx_bandwidth
  1159. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1160. * The bandwidth_mask must be consistent with the preamble_type_mask
  1161. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1162. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1163. */
  1164. bandwidth_mask: 6,
  1165. reserved2_31_14: 18; /* unused, set to 0x0 */
  1166. /* DWORD 3: tx expiry time (TSF) LSBs */
  1167. A_UINT32 expire_tsf_lo;
  1168. /* DWORD 4: tx expiry time (TSF) MSBs */
  1169. A_UINT32 expire_tsf_hi;
  1170. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1171. } POSTPACK;
  1172. /* DWORD 0 */
  1173. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1174. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1175. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1176. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1177. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1178. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1179. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1180. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1181. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1182. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1183. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1184. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1185. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1186. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1187. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1188. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1189. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1190. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1191. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1192. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1193. /* DWORD 1 */
  1194. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1195. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1196. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1197. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1198. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1199. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1200. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1201. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1202. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1203. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1204. /* DWORD 2 */
  1205. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1206. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1207. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1208. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1209. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1210. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1211. /* DWORD 0 */
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1213. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1214. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1216. do { \
  1217. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1218. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1219. } while (0)
  1220. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1221. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1222. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1223. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1224. do { \
  1225. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1226. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1227. } while (0)
  1228. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1229. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1230. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1231. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1232. do { \
  1233. HTT_CHECK_SET_VAL( \
  1234. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1235. ((_var) |= ((_val) \
  1236. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1237. } while (0)
  1238. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1239. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1240. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1241. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1242. do { \
  1243. HTT_CHECK_SET_VAL( \
  1244. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1245. ((_var) |= ((_val) \
  1246. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1247. } while (0)
  1248. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1249. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1250. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1251. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1252. do { \
  1253. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1254. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1255. } while (0)
  1256. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1257. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1258. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1259. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1260. do { \
  1261. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1262. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1263. } while (0)
  1264. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1265. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1266. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1267. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1268. do { \
  1269. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1270. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1271. } while (0)
  1272. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1273. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1274. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1275. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1276. do { \
  1277. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1278. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1279. } while (0)
  1280. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1281. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1282. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1283. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1284. do { \
  1285. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1286. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1287. } while (0)
  1288. /* DWORD 1 */
  1289. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1290. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1291. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1292. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1293. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1294. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1295. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1296. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1297. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1298. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1299. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1300. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1301. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1302. do { \
  1303. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1304. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1305. } while (0)
  1306. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1307. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1308. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1309. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1310. do { \
  1311. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1312. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1313. } while (0)
  1314. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1315. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1316. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1317. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1318. do { \
  1319. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1320. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1321. } while (0)
  1322. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1323. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1324. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1325. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1326. do { \
  1327. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1328. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1329. } while (0)
  1330. /* DWORD 2 */
  1331. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1332. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1333. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1334. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1335. do { \
  1336. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1337. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1338. } while (0)
  1339. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1340. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1341. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1342. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1343. do { \
  1344. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1345. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1346. } while (0)
  1347. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1348. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1349. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1350. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1351. do { \
  1352. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1353. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1354. } while (0)
  1355. typedef enum {
  1356. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1357. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1358. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1359. } htt_11ax_ltf_subtype_t;
  1360. typedef enum {
  1361. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1362. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1363. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1364. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1365. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1366. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1367. } htt_tx_ext2_preamble_type_t;
  1368. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1369. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1370. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1371. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1372. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1373. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1374. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1375. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1376. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1377. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1378. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1379. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1380. /**
  1381. * @brief HTT tx MSDU extension descriptor v2
  1382. * @details
  1383. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1384. * is received as tcl_exit_base->host_meta_info in firmware.
  1385. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1386. * are already part of tcl_exit_base.
  1387. */
  1388. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1389. /* DWORD 0: flags */
  1390. A_UINT32
  1391. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1392. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1393. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1394. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1395. valid_retries : 1, /* if set, tx retries spec is valid */
  1396. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1397. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1398. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1399. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1400. valid_key_flags : 1, /* if set, key flags is valid */
  1401. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1402. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1403. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1404. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1405. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1406. 1 = ENCRYPT,
  1407. 2 ~ 3 - Reserved */
  1408. /* retry_limit -
  1409. * Specify the maximum number of transmissions, including the
  1410. * initial transmission, to attempt before giving up if no ack
  1411. * is received.
  1412. * If the tx rate is specified, then all retries shall use the
  1413. * same rate as the initial transmission.
  1414. * If no tx rate is specified, the target can choose whether to
  1415. * retain the original rate during the retransmissions, or to
  1416. * fall back to a more robust rate.
  1417. */
  1418. retry_limit : 4,
  1419. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1420. * Valid only for 11ax preamble types HE_SU
  1421. * and HE_EXT_SU
  1422. */
  1423. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1424. * Valid only for 11ax preamble types HE_SU
  1425. * and HE_EXT_SU
  1426. */
  1427. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1428. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1429. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1430. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1431. */
  1432. reserved0_31 : 1;
  1433. /* DWORD 1: tx power, tx rate */
  1434. A_UINT32
  1435. power : 8, /* unit of the power field is 0.5 dbm
  1436. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1437. * signed value ranging from -64dbm to 63.5 dbm
  1438. */
  1439. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1440. * Setting more than one MCS isn't currently
  1441. * supported by the target (but is supported
  1442. * in the interface in case in the future
  1443. * the target supports specifications of
  1444. * a limited set of MCS values.
  1445. */
  1446. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1447. * Setting more than one Nss isn't currently
  1448. * supported by the target (but is supported
  1449. * in the interface in case in the future
  1450. * the target supports specifications of
  1451. * a limited set of Nss values.
  1452. */
  1453. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1454. reserved1_31 : 1;
  1455. /* DWORD 2: tx chain mask, tx retries */
  1456. A_UINT32
  1457. /* chain_mask - specify which chains to transmit from */
  1458. chain_mask : 8,
  1459. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1460. * TODO: Update Enum values for key_flags
  1461. */
  1462. /*
  1463. * Channel frequency: This identifies the desired channel
  1464. * frequency (in MHz) for tx frames. This is used by FW to help
  1465. * determine when it is safe to transmit or drop frames for
  1466. * off-channel operation.
  1467. * The default value of zero indicates to FW that the corresponding
  1468. * VDEV's home channel (if there is one) is the desired channel
  1469. * frequency.
  1470. */
  1471. chanfreq : 16;
  1472. /* DWORD 3: tx expiry time (TSF) LSBs */
  1473. A_UINT32 expire_tsf_lo;
  1474. /* DWORD 4: tx expiry time (TSF) MSBs */
  1475. A_UINT32 expire_tsf_hi;
  1476. } POSTPACK;
  1477. /* DWORD 0 */
  1478. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1479. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1480. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1481. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1482. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1483. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1484. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1485. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1486. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1487. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1488. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1489. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1490. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1491. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1492. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1493. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1494. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1495. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1496. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1497. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1498. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1499. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1500. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1501. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1502. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1503. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1504. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1505. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1506. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1507. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1508. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1509. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1510. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1511. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1512. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1513. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1514. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1515. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1516. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1517. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1518. /* DWORD 1 */
  1519. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1520. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1521. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1522. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1523. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1524. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1525. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1526. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1527. /* DWORD 2 */
  1528. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1529. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1530. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1531. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1532. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1533. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1534. /* DWORD 0 */
  1535. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1536. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1537. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1538. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1539. do { \
  1540. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1541. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1542. } while (0)
  1543. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1544. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1545. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1546. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1547. do { \
  1548. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1549. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1550. } while (0)
  1551. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1552. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1553. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1554. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1555. do { \
  1556. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1557. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1558. } while (0)
  1559. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1560. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1561. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1562. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1563. do { \
  1564. HTT_CHECK_SET_VAL( \
  1565. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1566. ((_var) |= ((_val) \
  1567. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1568. } while (0)
  1569. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1570. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1571. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1572. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1573. do { \
  1574. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1575. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1576. } while (0)
  1577. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1578. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1579. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1580. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1581. do { \
  1582. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1583. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1584. } while (0)
  1585. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1586. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1587. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1588. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1589. do { \
  1590. HTT_CHECK_SET_VAL( \
  1591. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1592. ((_var) |= ((_val) \
  1593. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1594. } while (0)
  1595. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1596. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1597. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1598. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1599. do { \
  1600. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1601. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1602. } while (0)
  1603. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1604. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1605. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1606. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1607. do { \
  1608. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1609. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1610. } while (0)
  1611. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1612. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1613. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1614. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1615. do { \
  1616. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1617. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1618. } while (0)
  1619. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1620. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1621. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1622. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1623. do { \
  1624. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1625. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1626. } while (0)
  1627. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1628. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1629. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1630. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1631. do { \
  1632. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1633. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1634. } while (0)
  1635. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1636. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1637. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1638. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1639. do { \
  1640. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1641. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1642. } while (0)
  1643. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1644. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1645. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1646. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1647. do { \
  1648. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1649. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1650. } while (0)
  1651. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1652. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1653. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1654. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1655. do { \
  1656. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1657. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1658. } while (0)
  1659. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1660. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1661. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1662. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1663. do { \
  1664. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1665. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1666. } while (0)
  1667. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1668. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1669. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1670. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1671. do { \
  1672. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1673. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1674. } while (0)
  1675. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1676. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1677. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1678. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1679. do { \
  1680. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1681. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1682. } while (0)
  1683. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1684. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1685. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1686. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1687. do { \
  1688. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1689. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1690. } while (0)
  1691. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1692. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1693. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1694. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1695. do { \
  1696. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1697. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1698. } while (0)
  1699. /* DWORD 1 */
  1700. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1701. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1702. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1703. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1704. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1705. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1706. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1707. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1708. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1709. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1710. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1711. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1712. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1713. do { \
  1714. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1715. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1716. } while (0)
  1717. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1718. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1719. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1720. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1721. do { \
  1722. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1723. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1724. } while (0)
  1725. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1726. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1727. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1728. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1729. do { \
  1730. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1731. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1732. } while (0)
  1733. /* DWORD 2 */
  1734. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1735. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1736. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1737. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1738. do { \
  1739. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1740. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1741. } while (0)
  1742. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1743. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1744. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1745. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1746. do { \
  1747. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1748. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1749. } while (0)
  1750. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1751. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1752. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1753. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1754. do { \
  1755. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1756. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1757. } while (0)
  1758. typedef enum {
  1759. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1760. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1761. } htt_tcl_metadata_type;
  1762. /**
  1763. * @brief HTT TCL command number format
  1764. * @details
  1765. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1766. * available to firmware as tcl_exit_base->tcl_status_number.
  1767. * For regular / multicast packets host will send vdev and mac id and for
  1768. * NAWDS packets, host will send peer id.
  1769. * A_UINT32 is used to avoid endianness conversion problems.
  1770. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1771. */
  1772. typedef struct {
  1773. A_UINT32
  1774. type: 1, /* vdev_id based or peer_id based */
  1775. rsvd: 31;
  1776. } htt_tx_tcl_vdev_or_peer_t;
  1777. typedef struct {
  1778. A_UINT32
  1779. type: 1, /* vdev_id based or peer_id based */
  1780. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1781. vdev_id: 8,
  1782. pdev_id: 2,
  1783. rsvd: 20;
  1784. } htt_tx_tcl_vdev_metadata;
  1785. typedef struct {
  1786. A_UINT32
  1787. type: 1, /* vdev_id based or peer_id based */
  1788. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1789. peer_id: 14,
  1790. rsvd: 16;
  1791. } htt_tx_tcl_peer_metadata;
  1792. PREPACK struct htt_tx_tcl_metadata {
  1793. union {
  1794. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1795. htt_tx_tcl_vdev_metadata vdev_meta;
  1796. htt_tx_tcl_peer_metadata peer_meta;
  1797. };
  1798. } POSTPACK;
  1799. /* DWORD 0 */
  1800. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1801. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1802. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1803. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1804. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1805. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1806. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1807. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1808. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1809. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1810. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1811. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1812. HTT_TX_TCL_METADATA_TYPE_S)
  1813. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1814. do { \
  1815. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1816. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1817. } while (0)
  1818. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1819. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1820. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1821. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1822. do { \
  1823. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1824. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1825. } while (0)
  1826. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1827. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1828. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1829. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1830. do { \
  1831. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1832. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1833. } while (0)
  1834. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1835. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1836. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1837. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1838. do { \
  1839. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1840. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1841. } while (0)
  1842. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1843. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1844. HTT_TX_TCL_METADATA_PEER_ID_S)
  1845. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1846. do { \
  1847. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1848. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1849. } while (0)
  1850. typedef enum {
  1851. HTT_TX_FW2WBM_TX_STATUS_OK,
  1852. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1853. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1854. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1855. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1856. HTT_TX_FW2WBM_TX_STATUS_MAX
  1857. } htt_tx_fw2wbm_tx_status_t;
  1858. typedef enum {
  1859. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1860. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1861. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1862. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1863. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1864. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1865. } htt_tx_fw2wbm_reinject_reason_t;
  1866. /**
  1867. * @brief HTT TX WBM Completion from firmware to host
  1868. * @details
  1869. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1870. * DWORD 3 and 4 for software based completions (Exception frames and
  1871. * TQM bypass frames)
  1872. * For software based completions, wbm_release_ring->release_source_module will
  1873. * be set to release_source_fw
  1874. */
  1875. PREPACK struct htt_tx_wbm_completion {
  1876. A_UINT32
  1877. sch_cmd_id: 24,
  1878. exception_frame: 1, /* If set, this packet was queued via exception path */
  1879. rsvd0_31_25: 7;
  1880. A_UINT32
  1881. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1882. * reception of an ACK or BA, this field indicates
  1883. * the RSSI of the received ACK or BA frame.
  1884. * When the frame is removed as result of a direct
  1885. * remove command from the SW, this field is set
  1886. * to 0x0 (which is never a valid value when real
  1887. * RSSI is available).
  1888. * Units: dB w.r.t noise floor
  1889. */
  1890. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1891. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1892. rsvd1_31_16: 16;
  1893. } POSTPACK;
  1894. /* DWORD 0 */
  1895. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1896. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1897. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1898. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1899. /* DWORD 1 */
  1900. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1901. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1902. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1903. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1904. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1905. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  1906. /* DWORD 0 */
  1907. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  1908. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  1909. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  1910. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  1911. do { \
  1912. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  1913. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  1914. } while (0)
  1915. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  1916. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  1917. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  1918. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  1919. do { \
  1920. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  1921. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  1922. } while (0)
  1923. /* DWORD 1 */
  1924. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  1925. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  1926. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  1927. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  1928. do { \
  1929. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  1930. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  1931. } while (0)
  1932. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  1933. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  1934. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  1935. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  1936. do { \
  1937. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  1938. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  1939. } while (0)
  1940. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  1941. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  1942. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  1943. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  1944. do { \
  1945. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  1946. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  1947. } while (0)
  1948. typedef enum {
  1949. TX_FLOW_PRIORITY_BE,
  1950. TX_FLOW_PRIORITY_HIGH,
  1951. TX_FLOW_PRIORITY_LOW,
  1952. } htt_tx_flow_priority_t;
  1953. typedef enum {
  1954. TX_FLOW_LATENCY_SENSITIVE,
  1955. TX_FLOW_LATENCY_INSENSITIVE,
  1956. } htt_tx_flow_latency_t;
  1957. typedef enum {
  1958. TX_FLOW_BEST_EFFORT_TRAFFIC,
  1959. TX_FLOW_INTERACTIVE_TRAFFIC,
  1960. TX_FLOW_PERIODIC_TRAFFIC,
  1961. TX_FLOW_BURSTY_TRAFFIC,
  1962. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  1963. } htt_tx_flow_traffic_pattern_t;
  1964. /**
  1965. * @brief HTT TX Flow search metadata format
  1966. * @details
  1967. * Host will set this metadata in flow table's flow search entry along with
  1968. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  1969. * firmware and TQM ring if the flow search entry wins.
  1970. * This metadata is available to firmware in that first MSDU's
  1971. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  1972. * to one of the available flows for specific tid and returns the tqm flow
  1973. * pointer as part of htt_tx_map_flow_info message.
  1974. */
  1975. PREPACK struct htt_tx_flow_metadata {
  1976. A_UINT32
  1977. rsvd0_1_0: 2,
  1978. tid: 4,
  1979. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  1980. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  1981. tid_override: 1, /* If set, tid field in this struct is the final tid.
  1982. * Else choose final tid based on latency, priority.
  1983. */
  1984. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  1985. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  1986. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  1987. } POSTPACK;
  1988. /* DWORD 0 */
  1989. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  1990. #define HTT_TX_FLOW_METADATA_TID_S 2
  1991. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  1992. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  1993. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  1994. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  1995. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  1996. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  1997. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  1998. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  1999. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2000. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2001. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2002. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2003. /* DWORD 0 */
  2004. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2005. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2006. HTT_TX_FLOW_METADATA_TID_S)
  2007. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2008. do { \
  2009. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2010. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2011. } while (0)
  2012. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2013. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2014. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2015. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2016. do { \
  2017. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2018. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2019. } while (0)
  2020. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2021. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2022. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2023. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2024. do { \
  2025. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2026. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2027. } while (0)
  2028. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2029. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2030. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2031. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2032. do { \
  2033. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2034. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2035. } while (0)
  2036. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2037. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2038. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2039. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2040. do { \
  2041. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2042. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2043. } while (0)
  2044. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2045. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2046. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2047. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2048. do { \
  2049. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2050. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2051. } while (0)
  2052. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2053. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2054. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2055. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2056. do { \
  2057. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2058. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2059. } while (0)
  2060. /**
  2061. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2062. *
  2063. * @details
  2064. * HTT wds entry from source port learning
  2065. * Host will learn wds entries from rx and send this message to firmware
  2066. * to enable firmware to configure/delete AST entries for wds clients.
  2067. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2068. * and when SA's entry is deleted, firmware removes this AST entry
  2069. *
  2070. * The message would appear as follows:
  2071. *
  2072. * |31 30|29 |17 16|15 8|7 0|
  2073. * |----------------+----------------+----------------+----------------|
  2074. * | rsvd0 |PDVID| vdev_id | msg_type |
  2075. * |-------------------------------------------------------------------|
  2076. * | sa_addr_31_0 |
  2077. * |-------------------------------------------------------------------|
  2078. * | | ta_peer_id | sa_addr_47_32 |
  2079. * |-------------------------------------------------------------------|
  2080. * Where PDVID = pdev_id
  2081. *
  2082. * The message is interpreted as follows:
  2083. *
  2084. * dword0 - b'0:7 - msg_type: This will be set to
  2085. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2086. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2087. *
  2088. * dword0 - b'8:15 - vdev_id
  2089. *
  2090. * dword0 - b'16:17 - pdev_id
  2091. *
  2092. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2093. *
  2094. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2095. *
  2096. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2097. *
  2098. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2099. */
  2100. PREPACK struct htt_wds_entry {
  2101. A_UINT32
  2102. msg_type: 8,
  2103. vdev_id: 8,
  2104. pdev_id: 2,
  2105. rsvd0: 14;
  2106. A_UINT32 sa_addr_31_0;
  2107. A_UINT32
  2108. sa_addr_47_32: 16,
  2109. ta_peer_id: 14,
  2110. rsvd2: 2;
  2111. } POSTPACK;
  2112. /* DWORD 0 */
  2113. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2114. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2115. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2116. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2117. /* DWORD 2 */
  2118. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2119. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2120. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2121. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2122. /* DWORD 0 */
  2123. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2124. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2125. HTT_WDS_ENTRY_VDEV_ID_S)
  2126. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2127. do { \
  2128. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2129. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2130. } while (0)
  2131. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2132. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2133. HTT_WDS_ENTRY_PDEV_ID_S)
  2134. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2135. do { \
  2136. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2137. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2138. } while (0)
  2139. /* DWORD 2 */
  2140. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2141. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2142. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2143. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2144. do { \
  2145. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2146. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2147. } while (0)
  2148. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2149. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2150. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2151. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2152. do { \
  2153. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2154. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2155. } while (0)
  2156. /**
  2157. * @brief MAC DMA rx ring setup specification
  2158. * @details
  2159. * To allow for dynamic rx ring reconfiguration and to avoid race
  2160. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2161. * it uses. Instead, it sends this message to the target, indicating how
  2162. * the rx ring used by the host should be set up and maintained.
  2163. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2164. * specifications.
  2165. *
  2166. * |31 16|15 8|7 0|
  2167. * |---------------------------------------------------------------|
  2168. * header: | reserved | num rings | msg type |
  2169. * |---------------------------------------------------------------|
  2170. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2171. #if HTT_PADDR64
  2172. * | FW_IDX shadow register physical address (bits 63:32) |
  2173. #endif
  2174. * |---------------------------------------------------------------|
  2175. * | rx ring base physical address (bits 31:0) |
  2176. #if HTT_PADDR64
  2177. * | rx ring base physical address (bits 63:32) |
  2178. #endif
  2179. * |---------------------------------------------------------------|
  2180. * | rx ring buffer size | rx ring length |
  2181. * |---------------------------------------------------------------|
  2182. * | FW_IDX initial value | enabled flags |
  2183. * |---------------------------------------------------------------|
  2184. * | MSDU payload offset | 802.11 header offset |
  2185. * |---------------------------------------------------------------|
  2186. * | PPDU end offset | PPDU start offset |
  2187. * |---------------------------------------------------------------|
  2188. * | MPDU end offset | MPDU start offset |
  2189. * |---------------------------------------------------------------|
  2190. * | MSDU end offset | MSDU start offset |
  2191. * |---------------------------------------------------------------|
  2192. * | frag info offset | rx attention offset |
  2193. * |---------------------------------------------------------------|
  2194. * payload 2, if present, has the same format as payload 1
  2195. * Header fields:
  2196. * - MSG_TYPE
  2197. * Bits 7:0
  2198. * Purpose: identifies this as an rx ring configuration message
  2199. * Value: 0x2
  2200. * - NUM_RINGS
  2201. * Bits 15:8
  2202. * Purpose: indicates whether the host is setting up one rx ring or two
  2203. * Value: 1 or 2
  2204. * Payload:
  2205. * for systems using 64-bit format for bus addresses:
  2206. * - IDX_SHADOW_REG_PADDR_LO
  2207. * Bits 31:0
  2208. * Value: lower 4 bytes of physical address of the host's
  2209. * FW_IDX shadow register
  2210. * - IDX_SHADOW_REG_PADDR_HI
  2211. * Bits 31:0
  2212. * Value: upper 4 bytes of physical address of the host's
  2213. * FW_IDX shadow register
  2214. * - RING_BASE_PADDR_LO
  2215. * Bits 31:0
  2216. * Value: lower 4 bytes of physical address of the host's rx ring
  2217. * - RING_BASE_PADDR_HI
  2218. * Bits 31:0
  2219. * Value: uppper 4 bytes of physical address of the host's rx ring
  2220. * for systems using 32-bit format for bus addresses:
  2221. * - IDX_SHADOW_REG_PADDR
  2222. * Bits 31:0
  2223. * Value: physical address of the host's FW_IDX shadow register
  2224. * - RING_BASE_PADDR
  2225. * Bits 31:0
  2226. * Value: physical address of the host's rx ring
  2227. * - RING_LEN
  2228. * Bits 15:0
  2229. * Value: number of elements in the rx ring
  2230. * - RING_BUF_SZ
  2231. * Bits 31:16
  2232. * Value: size of the buffers referenced by the rx ring, in byte units
  2233. * - ENABLED_FLAGS
  2234. * Bits 15:0
  2235. * Value: 1-bit flags to show whether different rx fields are enabled
  2236. * bit 0: 802.11 header enabled (1) or disabled (0)
  2237. * bit 1: MSDU payload enabled (1) or disabled (0)
  2238. * bit 2: PPDU start enabled (1) or disabled (0)
  2239. * bit 3: PPDU end enabled (1) or disabled (0)
  2240. * bit 4: MPDU start enabled (1) or disabled (0)
  2241. * bit 5: MPDU end enabled (1) or disabled (0)
  2242. * bit 6: MSDU start enabled (1) or disabled (0)
  2243. * bit 7: MSDU end enabled (1) or disabled (0)
  2244. * bit 8: rx attention enabled (1) or disabled (0)
  2245. * bit 9: frag info enabled (1) or disabled (0)
  2246. * bit 10: unicast rx enabled (1) or disabled (0)
  2247. * bit 11: multicast rx enabled (1) or disabled (0)
  2248. * bit 12: ctrl rx enabled (1) or disabled (0)
  2249. * bit 13: mgmt rx enabled (1) or disabled (0)
  2250. * bit 14: null rx enabled (1) or disabled (0)
  2251. * bit 15: phy data rx enabled (1) or disabled (0)
  2252. * - IDX_INIT_VAL
  2253. * Bits 31:16
  2254. * Purpose: Specify the initial value for the FW_IDX.
  2255. * Value: the number of buffers initially present in the host's rx ring
  2256. * - OFFSET_802_11_HDR
  2257. * Bits 15:0
  2258. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2259. * - OFFSET_MSDU_PAYLOAD
  2260. * Bits 31:16
  2261. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2262. * - OFFSET_PPDU_START
  2263. * Bits 15:0
  2264. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2265. * - OFFSET_PPDU_END
  2266. * Bits 31:16
  2267. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2268. * - OFFSET_MPDU_START
  2269. * Bits 15:0
  2270. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2271. * - OFFSET_MPDU_END
  2272. * Bits 31:16
  2273. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2274. * - OFFSET_MSDU_START
  2275. * Bits 15:0
  2276. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2277. * - OFFSET_MSDU_END
  2278. * Bits 31:16
  2279. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2280. * - OFFSET_RX_ATTN
  2281. * Bits 15:0
  2282. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2283. * - OFFSET_FRAG_INFO
  2284. * Bits 31:16
  2285. * Value: offset in QUAD-bytes of frag info table
  2286. */
  2287. /* header fields */
  2288. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2289. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2290. /* payload fields */
  2291. /* for systems using a 64-bit format for bus addresses */
  2292. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2293. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2294. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2295. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2296. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2297. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2298. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2299. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2300. /* for systems using a 32-bit format for bus addresses */
  2301. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2302. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2303. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2304. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2305. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2306. #define HTT_RX_RING_CFG_LEN_S 0
  2307. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2308. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2309. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2310. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2311. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2312. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2313. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2314. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2315. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2316. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2317. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2318. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2319. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2320. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2321. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2322. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2323. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2324. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2325. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2326. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2327. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2328. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2329. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2330. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2331. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2332. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2333. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2334. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2335. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2336. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2337. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2338. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2339. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2340. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2341. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2342. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2343. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2344. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2345. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2346. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2347. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2348. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2349. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2350. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2351. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2352. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2353. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2354. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2355. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2356. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2357. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2358. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2359. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2360. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2361. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2362. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2363. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2364. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2365. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2366. #if HTT_PADDR64
  2367. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2368. #else
  2369. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2370. #endif
  2371. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2372. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2373. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2374. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2375. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2376. do { \
  2377. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2378. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2379. } while (0)
  2380. /* degenerate case for 32-bit fields */
  2381. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2382. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2383. ((_var) = (_val))
  2384. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2385. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2386. ((_var) = (_val))
  2387. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2388. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2389. ((_var) = (_val))
  2390. /* degenerate case for 32-bit fields */
  2391. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2392. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2393. ((_var) = (_val))
  2394. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2395. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2396. ((_var) = (_val))
  2397. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2398. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2399. ((_var) = (_val))
  2400. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2401. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2402. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2403. do { \
  2404. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2405. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2406. } while (0)
  2407. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2408. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2409. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2410. do { \
  2411. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2412. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2413. } while (0)
  2414. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2415. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2416. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2417. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2418. do { \
  2419. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2420. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2421. } while (0)
  2422. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2423. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2424. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2425. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2426. do { \
  2427. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2428. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2429. } while (0)
  2430. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2431. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2432. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2433. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2434. do { \
  2435. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2436. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2437. } while (0)
  2438. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2439. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2440. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2441. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2442. do { \
  2443. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2444. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2445. } while (0)
  2446. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2447. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2448. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2449. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2450. do { \
  2451. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2452. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2453. } while (0)
  2454. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2455. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2456. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2457. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2458. do { \
  2459. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2460. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2461. } while (0)
  2462. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2463. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2464. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2465. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2466. do { \
  2467. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2468. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2469. } while (0)
  2470. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2471. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2472. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2473. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2474. do { \
  2475. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2476. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2477. } while (0)
  2478. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2479. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2480. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2481. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2482. do { \
  2483. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2484. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2485. } while (0)
  2486. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2487. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2488. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2489. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2490. do { \
  2491. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2492. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2493. } while (0)
  2494. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2495. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2496. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2497. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2498. do { \
  2499. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2500. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2501. } while (0)
  2502. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2503. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2504. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2505. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2506. do { \
  2507. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2508. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2509. } while (0)
  2510. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2511. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2512. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2513. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2514. do { \
  2515. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2516. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2517. } while (0)
  2518. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2519. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2520. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2521. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2522. do { \
  2523. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2524. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2525. } while (0)
  2526. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2527. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2528. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2529. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2530. do { \
  2531. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2532. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2533. } while (0)
  2534. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2535. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2536. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2537. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2538. do { \
  2539. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2540. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2541. } while (0)
  2542. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2543. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2544. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2545. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2546. do { \
  2547. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2548. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2549. } while (0)
  2550. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2551. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2552. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2553. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2554. do { \
  2555. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2556. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2557. } while (0)
  2558. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2559. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2560. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2561. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2562. do { \
  2563. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2564. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2565. } while (0)
  2566. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2567. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2568. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2569. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2570. do { \
  2571. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2572. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2573. } while (0)
  2574. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2575. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2576. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2577. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2578. do { \
  2579. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2580. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2581. } while (0)
  2582. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2583. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2584. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2585. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2586. do { \
  2587. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2588. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2589. } while (0)
  2590. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2591. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2592. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2593. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2594. do { \
  2595. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2596. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2597. } while (0)
  2598. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2599. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2600. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2601. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2602. do { \
  2603. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2604. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2605. } while (0)
  2606. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2607. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2608. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2609. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2610. do { \
  2611. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2612. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2613. } while (0)
  2614. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2615. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2616. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2617. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2618. do { \
  2619. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2620. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2621. } while (0)
  2622. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2623. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2624. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2625. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2626. do { \
  2627. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2628. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2629. } while (0)
  2630. /**
  2631. * @brief host -> target FW statistics retrieve
  2632. *
  2633. * @details
  2634. * The following field definitions describe the format of the HTT host
  2635. * to target FW stats retrieve message. The message specifies the type of
  2636. * stats host wants to retrieve.
  2637. *
  2638. * |31 24|23 16|15 8|7 0|
  2639. * |-----------------------------------------------------------|
  2640. * | stats types request bitmask | msg type |
  2641. * |-----------------------------------------------------------|
  2642. * | stats types reset bitmask | reserved |
  2643. * |-----------------------------------------------------------|
  2644. * | stats type | config value |
  2645. * |-----------------------------------------------------------|
  2646. * | cookie LSBs |
  2647. * |-----------------------------------------------------------|
  2648. * | cookie MSBs |
  2649. * |-----------------------------------------------------------|
  2650. * Header fields:
  2651. * - MSG_TYPE
  2652. * Bits 7:0
  2653. * Purpose: identifies this is a stats upload request message
  2654. * Value: 0x3
  2655. * - UPLOAD_TYPES
  2656. * Bits 31:8
  2657. * Purpose: identifies which types of FW statistics to upload
  2658. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2659. * - RESET_TYPES
  2660. * Bits 31:8
  2661. * Purpose: identifies which types of FW statistics to reset
  2662. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2663. * - CFG_VAL
  2664. * Bits 23:0
  2665. * Purpose: give an opaque configuration value to the specified stats type
  2666. * Value: stats-type specific configuration value
  2667. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  2668. * bits 7:0 - how many per-MPDU byte counts to include in a record
  2669. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  2670. * bits 23:16 - how many per-MSDU byte counts to include in a record
  2671. * - CFG_STAT_TYPE
  2672. * Bits 31:24
  2673. * Purpose: specify which stats type (if any) the config value applies to
  2674. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  2675. * a valid configuration specification
  2676. * - COOKIE_LSBS
  2677. * Bits 31:0
  2678. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2679. * message with its preceding host->target stats request message.
  2680. * Value: LSBs of the opaque cookie specified by the host-side requestor
  2681. * - COOKIE_MSBS
  2682. * Bits 31:0
  2683. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2684. * message with its preceding host->target stats request message.
  2685. * Value: MSBs of the opaque cookie specified by the host-side requestor
  2686. */
  2687. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  2688. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  2689. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  2690. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  2691. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  2692. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  2693. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  2694. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  2695. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  2696. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  2697. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  2698. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  2699. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  2700. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  2701. do { \
  2702. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  2703. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  2704. } while (0)
  2705. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  2706. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  2707. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  2708. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  2709. do { \
  2710. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  2711. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  2712. } while (0)
  2713. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  2714. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  2715. HTT_H2T_STATS_REQ_CFG_VAL_S)
  2716. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  2717. do { \
  2718. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  2719. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  2720. } while (0)
  2721. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  2722. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  2723. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  2724. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  2725. do { \
  2726. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  2727. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  2728. } while (0)
  2729. /**
  2730. * @brief host -> target HTT out-of-band sync request
  2731. *
  2732. * @details
  2733. * The HTT SYNC tells the target to suspend processing of subsequent
  2734. * HTT host-to-target messages until some other target agent locally
  2735. * informs the target HTT FW that the current sync counter is equal to
  2736. * or greater than (in a modulo sense) the sync counter specified in
  2737. * the SYNC message.
  2738. * This allows other host-target components to synchronize their operation
  2739. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  2740. * security key has been downloaded to and activated by the target.
  2741. * In the absence of any explicit synchronization counter value
  2742. * specification, the target HTT FW will use zero as the default current
  2743. * sync value.
  2744. *
  2745. * |31 24|23 16|15 8|7 0|
  2746. * |-----------------------------------------------------------|
  2747. * | reserved | sync count | msg type |
  2748. * |-----------------------------------------------------------|
  2749. * Header fields:
  2750. * - MSG_TYPE
  2751. * Bits 7:0
  2752. * Purpose: identifies this as a sync message
  2753. * Value: 0x4
  2754. * - SYNC_COUNT
  2755. * Bits 15:8
  2756. * Purpose: specifies what sync value the HTT FW will wait for from
  2757. * an out-of-band specification to resume its operation
  2758. * Value: in-band sync counter value to compare against the out-of-band
  2759. * counter spec.
  2760. * The HTT target FW will suspend its host->target message processing
  2761. * as long as
  2762. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  2763. */
  2764. #define HTT_H2T_SYNC_MSG_SZ 4
  2765. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  2766. #define HTT_H2T_SYNC_COUNT_S 8
  2767. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  2768. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  2769. HTT_H2T_SYNC_COUNT_S)
  2770. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  2771. do { \
  2772. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  2773. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  2774. } while (0)
  2775. /**
  2776. * @brief HTT aggregation configuration
  2777. */
  2778. #define HTT_AGGR_CFG_MSG_SZ 4
  2779. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  2780. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  2781. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  2782. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  2783. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  2784. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  2785. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  2786. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  2787. do { \
  2788. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  2789. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  2790. } while (0)
  2791. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  2792. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  2793. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  2794. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  2795. do { \
  2796. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  2797. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  2798. } while (0)
  2799. /**
  2800. * @brief host -> target HTT configure max amsdu info per vdev
  2801. *
  2802. * @details
  2803. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  2804. *
  2805. * |31 21|20 16|15 8|7 0|
  2806. * |-----------------------------------------------------------|
  2807. * | reserved | vdev id | max amsdu | msg type |
  2808. * |-----------------------------------------------------------|
  2809. * Header fields:
  2810. * - MSG_TYPE
  2811. * Bits 7:0
  2812. * Purpose: identifies this as a aggr cfg ex message
  2813. * Value: 0xa
  2814. * - MAX_NUM_AMSDU_SUBFRM
  2815. * Bits 15:8
  2816. * Purpose: max MSDUs per A-MSDU
  2817. * - VDEV_ID
  2818. * Bits 20:16
  2819. * Purpose: ID of the vdev to which this limit is applied
  2820. */
  2821. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  2822. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  2823. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  2824. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  2825. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  2826. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  2827. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  2828. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  2829. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  2830. do { \
  2831. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  2832. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  2833. } while (0)
  2834. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  2835. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  2836. HTT_AGGR_CFG_EX_VDEV_ID_S)
  2837. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  2838. do { \
  2839. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  2840. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  2841. } while (0)
  2842. /**
  2843. * @brief HTT WDI_IPA Config Message
  2844. *
  2845. * @details
  2846. * The HTT WDI_IPA config message is created/sent by host at driver
  2847. * init time. It contains information about data structures used on
  2848. * WDI_IPA TX and RX path.
  2849. * TX CE ring is used for pushing packet metadata from IPA uC
  2850. * to WLAN FW
  2851. * TX Completion ring is used for generating TX completions from
  2852. * WLAN FW to IPA uC
  2853. * RX Indication ring is used for indicating RX packets from FW
  2854. * to IPA uC
  2855. * RX Ring2 is used as either completion ring or as second
  2856. * indication ring. when Ring2 is used as completion ring, IPA uC
  2857. * puts completed RX packet meta data to Ring2. when Ring2 is used
  2858. * as second indication ring, RX packets for LTE-WLAN aggregation are
  2859. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  2860. * indicated in RX Indication ring. Please see WDI_IPA specification
  2861. * for more details.
  2862. * |31 24|23 16|15 8|7 0|
  2863. * |----------------+----------------+----------------+----------------|
  2864. * | tx pkt pool size | Rsvd | msg_type |
  2865. * |-------------------------------------------------------------------|
  2866. * | tx comp ring base (bits 31:0) |
  2867. #if HTT_PADDR64
  2868. * | tx comp ring base (bits 63:32) |
  2869. #endif
  2870. * |-------------------------------------------------------------------|
  2871. * | tx comp ring size |
  2872. * |-------------------------------------------------------------------|
  2873. * | tx comp WR_IDX physical address (bits 31:0) |
  2874. #if HTT_PADDR64
  2875. * | tx comp WR_IDX physical address (bits 63:32) |
  2876. #endif
  2877. * |-------------------------------------------------------------------|
  2878. * | tx CE WR_IDX physical address (bits 31:0) |
  2879. #if HTT_PADDR64
  2880. * | tx CE WR_IDX physical address (bits 63:32) |
  2881. #endif
  2882. * |-------------------------------------------------------------------|
  2883. * | rx indication ring base (bits 31:0) |
  2884. #if HTT_PADDR64
  2885. * | rx indication ring base (bits 63:32) |
  2886. #endif
  2887. * |-------------------------------------------------------------------|
  2888. * | rx indication ring size |
  2889. * |-------------------------------------------------------------------|
  2890. * | rx ind RD_IDX physical address (bits 31:0) |
  2891. #if HTT_PADDR64
  2892. * | rx ind RD_IDX physical address (bits 63:32) |
  2893. #endif
  2894. * |-------------------------------------------------------------------|
  2895. * | rx ind WR_IDX physical address (bits 31:0) |
  2896. #if HTT_PADDR64
  2897. * | rx ind WR_IDX physical address (bits 63:32) |
  2898. #endif
  2899. * |-------------------------------------------------------------------|
  2900. * |-------------------------------------------------------------------|
  2901. * | rx ring2 base (bits 31:0) |
  2902. #if HTT_PADDR64
  2903. * | rx ring2 base (bits 63:32) |
  2904. #endif
  2905. * |-------------------------------------------------------------------|
  2906. * | rx ring2 size |
  2907. * |-------------------------------------------------------------------|
  2908. * | rx ring2 RD_IDX physical address (bits 31:0) |
  2909. #if HTT_PADDR64
  2910. * | rx ring2 RD_IDX physical address (bits 63:32) |
  2911. #endif
  2912. * |-------------------------------------------------------------------|
  2913. * | rx ring2 WR_IDX physical address (bits 31:0) |
  2914. #if HTT_PADDR64
  2915. * | rx ring2 WR_IDX physical address (bits 63:32) |
  2916. #endif
  2917. * |-------------------------------------------------------------------|
  2918. *
  2919. * Header fields:
  2920. * Header fields:
  2921. * - MSG_TYPE
  2922. * Bits 7:0
  2923. * Purpose: Identifies this as WDI_IPA config message
  2924. * value: = 0x8
  2925. * - TX_PKT_POOL_SIZE
  2926. * Bits 15:0
  2927. * Purpose: Total number of TX packet buffer pool allocated by Host for
  2928. * WDI_IPA TX path
  2929. * For systems using 32-bit format for bus addresses:
  2930. * - TX_COMP_RING_BASE_ADDR
  2931. * Bits 31:0
  2932. * Purpose: TX Completion Ring base address in DDR
  2933. * - TX_COMP_RING_SIZE
  2934. * Bits 31:0
  2935. * Purpose: TX Completion Ring size (must be power of 2)
  2936. * - TX_COMP_WR_IDX_ADDR
  2937. * Bits 31:0
  2938. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  2939. * updates the Write Index for WDI_IPA TX completion ring
  2940. * - TX_CE_WR_IDX_ADDR
  2941. * Bits 31:0
  2942. * Purpose: DDR address where IPA uC
  2943. * updates the WR Index for TX CE ring
  2944. * (needed for fusion platforms)
  2945. * - RX_IND_RING_BASE_ADDR
  2946. * Bits 31:0
  2947. * Purpose: RX Indication Ring base address in DDR
  2948. * - RX_IND_RING_SIZE
  2949. * Bits 31:0
  2950. * Purpose: RX Indication Ring size
  2951. * - RX_IND_RD_IDX_ADDR
  2952. * Bits 31:0
  2953. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  2954. * RX indication ring
  2955. * - RX_IND_WR_IDX_ADDR
  2956. * Bits 31:0
  2957. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  2958. * updates the Write Index for WDI_IPA RX indication ring
  2959. * - RX_RING2_BASE_ADDR
  2960. * Bits 31:0
  2961. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  2962. * - RX_RING2_SIZE
  2963. * Bits 31:0
  2964. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  2965. * - RX_RING2_RD_IDX_ADDR
  2966. * Bits 31:0
  2967. * Purpose: If Second RX ring is Indication ring, DDR address where
  2968. * IPA uC updates the Read Index for Ring2.
  2969. * If Second RX ring is completion ring, this is NOT used
  2970. * - RX_RING2_WR_IDX_ADDR
  2971. * Bits 31:0
  2972. * Purpose: If Second RX ring is Indication ring, DDR address where
  2973. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  2974. * If second RX ring is completion ring, DDR address where
  2975. * IPA uC updates the Write Index for Ring 2.
  2976. * For systems using 64-bit format for bus addresses:
  2977. * - TX_COMP_RING_BASE_ADDR_LO
  2978. * Bits 31:0
  2979. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  2980. * - TX_COMP_RING_BASE_ADDR_HI
  2981. * Bits 31:0
  2982. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  2983. * - TX_COMP_RING_SIZE
  2984. * Bits 31:0
  2985. * Purpose: TX Completion Ring size (must be power of 2)
  2986. * - TX_COMP_WR_IDX_ADDR_LO
  2987. * Bits 31:0
  2988. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  2989. * Lower 4 bytes of DDR address where WIFI FW
  2990. * updates the Write Index for WDI_IPA TX completion ring
  2991. * - TX_COMP_WR_IDX_ADDR_HI
  2992. * Bits 31:0
  2993. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  2994. * Higher 4 bytes of DDR address where WIFI FW
  2995. * updates the Write Index for WDI_IPA TX completion ring
  2996. * - TX_CE_WR_IDX_ADDR_LO
  2997. * Bits 31:0
  2998. * Purpose: Lower 4 bytes of DDR address where IPA uC
  2999. * updates the WR Index for TX CE ring
  3000. * (needed for fusion platforms)
  3001. * - TX_CE_WR_IDX_ADDR_HI
  3002. * Bits 31:0
  3003. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3004. * updates the WR Index for TX CE ring
  3005. * (needed for fusion platforms)
  3006. * - RX_IND_RING_BASE_ADDR_LO
  3007. * Bits 31:0
  3008. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3009. * - RX_IND_RING_BASE_ADDR_HI
  3010. * Bits 31:0
  3011. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3012. * - RX_IND_RING_SIZE
  3013. * Bits 31:0
  3014. * Purpose: RX Indication Ring size
  3015. * - RX_IND_RD_IDX_ADDR_LO
  3016. * Bits 31:0
  3017. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3018. * for WDI_IPA RX indication ring
  3019. * - RX_IND_RD_IDX_ADDR_HI
  3020. * Bits 31:0
  3021. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3022. * for WDI_IPA RX indication ring
  3023. * - RX_IND_WR_IDX_ADDR_LO
  3024. * Bits 31:0
  3025. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3026. * Lower 4 bytes of DDR address where WIFI FW
  3027. * updates the Write Index for WDI_IPA RX indication ring
  3028. * - RX_IND_WR_IDX_ADDR_HI
  3029. * Bits 31:0
  3030. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3031. * Higher 4 bytes of DDR address where WIFI FW
  3032. * updates the Write Index for WDI_IPA RX indication ring
  3033. * - RX_RING2_BASE_ADDR_LO
  3034. * Bits 31:0
  3035. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3036. * - RX_RING2_BASE_ADDR_HI
  3037. * Bits 31:0
  3038. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3039. * - RX_RING2_SIZE
  3040. * Bits 31:0
  3041. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3042. * - RX_RING2_RD_IDX_ADDR_LO
  3043. * Bits 31:0
  3044. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3045. * DDR address where IPA uC updates the Read Index for Ring2.
  3046. * If Second RX ring is completion ring, this is NOT used
  3047. * - RX_RING2_RD_IDX_ADDR_HI
  3048. * Bits 31:0
  3049. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3050. * DDR address where IPA uC updates the Read Index for Ring2.
  3051. * If Second RX ring is completion ring, this is NOT used
  3052. * - RX_RING2_WR_IDX_ADDR_LO
  3053. * Bits 31:0
  3054. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3055. * DDR address where WIFI FW updates the Write Index
  3056. * for WDI_IPA RX ring2
  3057. * If second RX ring is completion ring, lower 4 bytes of
  3058. * DDR address where IPA uC updates the Write Index for Ring 2.
  3059. * - RX_RING2_WR_IDX_ADDR_HI
  3060. * Bits 31:0
  3061. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3062. * DDR address where WIFI FW updates the Write Index
  3063. * for WDI_IPA RX ring2
  3064. * If second RX ring is completion ring, higher 4 bytes of
  3065. * DDR address where IPA uC updates the Write Index for Ring 2.
  3066. */
  3067. #if HTT_PADDR64
  3068. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3069. #else
  3070. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3071. #endif
  3072. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3073. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3074. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3075. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3076. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3077. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3078. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3079. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3080. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3081. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3082. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3083. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3084. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3085. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3086. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3087. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3088. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3089. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3090. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3091. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3092. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3093. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3094. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3095. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3096. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3097. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3098. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3099. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3100. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3101. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3102. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3103. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3104. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3105. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3106. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3107. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3108. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3109. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3110. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3111. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3112. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3113. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3114. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3115. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3116. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3117. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3118. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3119. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3120. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3121. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3122. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3123. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3124. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3125. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3126. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3127. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3128. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3129. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3130. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3131. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3132. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3133. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3134. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3135. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3136. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3137. do { \
  3138. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3139. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3140. } while (0)
  3141. /* for systems using 32-bit format for bus addr */
  3142. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3143. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3144. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3145. do { \
  3146. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3147. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3148. } while (0)
  3149. /* for systems using 64-bit format for bus addr */
  3150. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3151. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3152. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3153. do { \
  3154. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3155. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3156. } while (0)
  3157. /* for systems using 64-bit format for bus addr */
  3158. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3159. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3160. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3161. do { \
  3162. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3163. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3164. } while (0)
  3165. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3166. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3167. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3168. do { \
  3169. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3170. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3171. } while (0)
  3172. /* for systems using 32-bit format for bus addr */
  3173. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3174. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3175. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3176. do { \
  3177. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3178. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3179. } while (0)
  3180. /* for systems using 64-bit format for bus addr */
  3181. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3182. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3183. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3184. do { \
  3185. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3186. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3187. } while (0)
  3188. /* for systems using 64-bit format for bus addr */
  3189. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3190. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3191. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3192. do { \
  3193. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3194. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3195. } while (0)
  3196. /* for systems using 32-bit format for bus addr */
  3197. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3198. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3199. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3200. do { \
  3201. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3202. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3203. } while (0)
  3204. /* for systems using 64-bit format for bus addr */
  3205. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3206. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3207. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3208. do { \
  3209. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3210. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3211. } while (0)
  3212. /* for systems using 64-bit format for bus addr */
  3213. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3214. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3215. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3216. do { \
  3217. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3218. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3219. } while (0)
  3220. /* for systems using 32-bit format for bus addr */
  3221. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3222. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3223. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3224. do { \
  3225. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3226. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3227. } while (0)
  3228. /* for systems using 64-bit format for bus addr */
  3229. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3230. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3231. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3232. do { \
  3233. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3234. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3235. } while (0)
  3236. /* for systems using 64-bit format for bus addr */
  3237. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3238. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3239. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3240. do { \
  3241. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3242. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3243. } while (0)
  3244. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3245. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3246. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3247. do { \
  3248. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3249. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3250. } while (0)
  3251. /* for systems using 32-bit format for bus addr */
  3252. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3253. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3254. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3255. do { \
  3256. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3257. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3258. } while (0)
  3259. /* for systems using 64-bit format for bus addr */
  3260. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3261. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3262. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3263. do { \
  3264. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3265. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3266. } while (0)
  3267. /* for systems using 64-bit format for bus addr */
  3268. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3269. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3270. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3271. do { \
  3272. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3273. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3274. } while (0)
  3275. /* for systems using 32-bit format for bus addr */
  3276. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3277. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3278. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3279. do { \
  3280. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3281. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3282. } while (0)
  3283. /* for systems using 64-bit format for bus addr */
  3284. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3285. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3286. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3287. do { \
  3288. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3289. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3290. } while (0)
  3291. /* for systems using 64-bit format for bus addr */
  3292. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3293. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3294. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3295. do { \
  3296. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3297. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3298. } while (0)
  3299. /* for systems using 32-bit format for bus addr */
  3300. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3301. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3302. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3303. do { \
  3304. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3305. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3306. } while (0)
  3307. /* for systems using 64-bit format for bus addr */
  3308. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3309. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3310. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3311. do { \
  3312. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3313. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3314. } while (0)
  3315. /* for systems using 64-bit format for bus addr */
  3316. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3317. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3318. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3319. do { \
  3320. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3321. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3322. } while (0)
  3323. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3324. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3325. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3326. do { \
  3327. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3328. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3329. } while (0)
  3330. /* for systems using 32-bit format for bus addr */
  3331. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3332. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3333. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3334. do { \
  3335. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3336. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3337. } while (0)
  3338. /* for systems using 64-bit format for bus addr */
  3339. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3340. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3341. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3342. do { \
  3343. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3344. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3345. } while (0)
  3346. /* for systems using 64-bit format for bus addr */
  3347. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3348. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3349. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3350. do { \
  3351. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3352. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3353. } while (0)
  3354. /* for systems using 32-bit format for bus addr */
  3355. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3356. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3357. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3358. do { \
  3359. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3360. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3361. } while (0)
  3362. /* for systems using 64-bit format for bus addr */
  3363. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3364. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3365. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3366. do { \
  3367. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3368. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3369. } while (0)
  3370. /* for systems using 64-bit format for bus addr */
  3371. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3372. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3373. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3374. do { \
  3375. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3376. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3377. } while (0)
  3378. /*
  3379. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3380. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3381. * addresses are stored in a XXX-bit field.
  3382. * This macro is used to define both htt_wdi_ipa_config32_t and
  3383. * htt_wdi_ipa_config64_t structs.
  3384. */
  3385. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3386. _paddr__tx_comp_ring_base_addr_, \
  3387. _paddr__tx_comp_wr_idx_addr_, \
  3388. _paddr__tx_ce_wr_idx_addr_, \
  3389. _paddr__rx_ind_ring_base_addr_, \
  3390. _paddr__rx_ind_rd_idx_addr_, \
  3391. _paddr__rx_ind_wr_idx_addr_, \
  3392. _paddr__rx_ring2_base_addr_,\
  3393. _paddr__rx_ring2_rd_idx_addr_,\
  3394. _paddr__rx_ring2_wr_idx_addr_) \
  3395. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3396. { \
  3397. /* DWORD 0: flags and meta-data */ \
  3398. A_UINT32 \
  3399. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3400. reserved: 8, \
  3401. tx_pkt_pool_size: 16;\
  3402. /* DWORD 1 */\
  3403. _paddr__tx_comp_ring_base_addr_;\
  3404. /* DWORD 2 (or 3)*/\
  3405. A_UINT32 tx_comp_ring_size;\
  3406. /* DWORD 3 (or 4)*/\
  3407. _paddr__tx_comp_wr_idx_addr_;\
  3408. /* DWORD 4 (or 6)*/\
  3409. _paddr__tx_ce_wr_idx_addr_;\
  3410. /* DWORD 5 (or 8)*/\
  3411. _paddr__rx_ind_ring_base_addr_;\
  3412. /* DWORD 6 (or 10)*/\
  3413. A_UINT32 rx_ind_ring_size;\
  3414. /* DWORD 7 (or 11)*/\
  3415. _paddr__rx_ind_rd_idx_addr_;\
  3416. /* DWORD 8 (or 13)*/\
  3417. _paddr__rx_ind_wr_idx_addr_;\
  3418. /* DWORD 9 (or 15)*/\
  3419. _paddr__rx_ring2_base_addr_;\
  3420. /* DWORD 10 (or 17) */\
  3421. A_UINT32 rx_ring2_size;\
  3422. /* DWORD 11 (or 18) */\
  3423. _paddr__rx_ring2_rd_idx_addr_;\
  3424. /* DWORD 12 (or 20) */\
  3425. _paddr__rx_ring2_wr_idx_addr_;\
  3426. } POSTPACK
  3427. /* define a htt_wdi_ipa_config32_t type */
  3428. 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));
  3429. /* define a htt_wdi_ipa_config64_t type */
  3430. 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));
  3431. #if HTT_PADDR64
  3432. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3433. #else
  3434. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3435. #endif
  3436. enum htt_wdi_ipa_op_code {
  3437. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3438. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3439. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3440. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3441. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3442. /* keep this last */
  3443. HTT_WDI_IPA_OPCODE_MAX
  3444. };
  3445. /**
  3446. * @brief HTT WDI_IPA Operation Request Message
  3447. *
  3448. * @details
  3449. * HTT WDI_IPA Operation Request message is sent by host
  3450. * to either suspend or resume WDI_IPA TX or RX path.
  3451. * |31 24|23 16|15 8|7 0|
  3452. * |----------------+----------------+----------------+----------------|
  3453. * | op_code | Rsvd | msg_type |
  3454. * |-------------------------------------------------------------------|
  3455. *
  3456. * Header fields:
  3457. * - MSG_TYPE
  3458. * Bits 7:0
  3459. * Purpose: Identifies this as WDI_IPA Operation Request message
  3460. * value: = 0x9
  3461. * - OP_CODE
  3462. * Bits 31:16
  3463. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3464. * value: = enum htt_wdi_ipa_op_code
  3465. */
  3466. PREPACK struct htt_wdi_ipa_op_request_t
  3467. {
  3468. /* DWORD 0: flags and meta-data */
  3469. A_UINT32
  3470. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3471. reserved: 8,
  3472. op_code: 16;
  3473. } POSTPACK;
  3474. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3475. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3476. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3477. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3478. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3479. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3480. do { \
  3481. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3482. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3483. } while (0)
  3484. /*
  3485. * @brief host -> target HTT_SRING_SETUP message
  3486. *
  3487. * @details
  3488. * After target is booted up, Host can send SRING setup message for
  3489. * each host facing LMAC SRING. Target setups up HW registers based
  3490. * on setup message and confirms back to Host if response_required is set.
  3491. * Host should wait for confirmation message before sending new SRING
  3492. * setup message
  3493. *
  3494. * The message would appear as follows:
  3495. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3496. * |--------------- +-----------------+----------------+------------------|
  3497. * | ring_type | ring_id | pdev_id | msg_type |
  3498. * |----------------------------------------------------------------------|
  3499. * | ring_base_addr_lo |
  3500. * |----------------------------------------------------------------------|
  3501. * | ring_base_addr_hi |
  3502. * |----------------------------------------------------------------------|
  3503. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3504. * |----------------------------------------------------------------------|
  3505. * | ring_head_offset32_remote_addr_lo |
  3506. * |----------------------------------------------------------------------|
  3507. * | ring_head_offset32_remote_addr_hi |
  3508. * |----------------------------------------------------------------------|
  3509. * | ring_tail_offset32_remote_addr_lo |
  3510. * |----------------------------------------------------------------------|
  3511. * | ring_tail_offset32_remote_addr_hi |
  3512. * |----------------------------------------------------------------------|
  3513. * | ring_msi_addr_lo |
  3514. * |----------------------------------------------------------------------|
  3515. * | ring_msi_addr_hi |
  3516. * |----------------------------------------------------------------------|
  3517. * | ring_msi_data |
  3518. * |----------------------------------------------------------------------|
  3519. * | intr_timer_th |IM| intr_batch_counter_th |
  3520. * |----------------------------------------------------------------------|
  3521. * | reserved |RR|PTCF| intr_low_threshold |
  3522. * |----------------------------------------------------------------------|
  3523. * Where
  3524. * IM = sw_intr_mode
  3525. * RR = response_required
  3526. * PTCF = prefetch_timer_cfg
  3527. *
  3528. * The message is interpreted as follows:
  3529. * dword0 - b'0:7 - msg_type: This will be set to
  3530. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3531. * b'8:15 - pdev_id:
  3532. * 0 (for rings at SOC/UMAC level),
  3533. * 1/2/3 mac id (for rings at LMAC level)
  3534. * b'16:23 - ring_id: identify which ring is to setup,
  3535. * more details can be got from enum htt_srng_ring_id
  3536. * b'24:31 - ring_type: identify type of host rings,
  3537. * more details can be got from enum htt_srng_ring_type
  3538. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3539. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3540. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3541. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3542. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3543. * SW_TO_HW_RING.
  3544. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3545. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3546. * Lower 32 bits of memory address of the remote variable
  3547. * storing the 4-byte word offset that identifies the head
  3548. * element within the ring.
  3549. * (The head offset variable has type A_UINT32.)
  3550. * Valid for HW_TO_SW and SW_TO_SW rings.
  3551. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3552. * Upper 32 bits of memory address of the remote variable
  3553. * storing the 4-byte word offset that identifies the head
  3554. * element within the ring.
  3555. * (The head offset variable has type A_UINT32.)
  3556. * Valid for HW_TO_SW and SW_TO_SW rings.
  3557. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3558. * Lower 32 bits of memory address of the remote variable
  3559. * storing the 4-byte word offset that identifies the tail
  3560. * element within the ring.
  3561. * (The tail offset variable has type A_UINT32.)
  3562. * Valid for HW_TO_SW and SW_TO_SW rings.
  3563. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3564. * Upper 32 bits of memory address of the remote variable
  3565. * storing the 4-byte word offset that identifies the tail
  3566. * element within the ring.
  3567. * (The tail offset variable has type A_UINT32.)
  3568. * Valid for HW_TO_SW and SW_TO_SW rings.
  3569. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3570. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3571. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3572. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3573. * dword10 - b'0:31 - ring_msi_data: MSI data
  3574. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3575. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3576. * dword11 - b'0:14 - intr_batch_counter_th:
  3577. * batch counter threshold is in units of 4-byte words.
  3578. * HW internally maintains and increments batch count.
  3579. * (see SRING spec for detail description).
  3580. * When batch count reaches threshold value, an interrupt
  3581. * is generated by HW.
  3582. * b'15 - sw_intr_mode:
  3583. * This configuration shall be static.
  3584. * Only programmed at power up.
  3585. * 0: generate pulse style sw interrupts
  3586. * 1: generate level style sw interrupts
  3587. * b'16:31 - intr_timer_th:
  3588. * The timer init value when timer is idle or is
  3589. * initialized to start downcounting.
  3590. * In 8us units (to cover a range of 0 to 524 ms)
  3591. * dword12 - b'0:15 - intr_low_threshold:
  3592. * Used only by Consumer ring to generate ring_sw_int_p.
  3593. * Ring entries low threshold water mark, that is used
  3594. * in combination with the interrupt timer as well as
  3595. * the the clearing of the level interrupt.
  3596. * b'16:18 - prefetch_timer_cfg:
  3597. * Used only by Consumer ring to set timer mode to
  3598. * support Application prefetch handling.
  3599. * The external tail offset/pointer will be updated
  3600. * at following intervals:
  3601. * 3'b000: (Prefetch feature disabled; used only for debug)
  3602. * 3'b001: 1 usec
  3603. * 3'b010: 4 usec
  3604. * 3'b011: 8 usec (default)
  3605. * 3'b100: 16 usec
  3606. * Others: Reserverd
  3607. * b'19 - response_required:
  3608. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3609. * b'20:31 - reserved: reserved for future use
  3610. */
  3611. PREPACK struct htt_sring_setup_t {
  3612. A_UINT32 msg_type: 8,
  3613. pdev_id: 8,
  3614. ring_id: 8,
  3615. ring_type: 8;
  3616. A_UINT32 ring_base_addr_lo;
  3617. A_UINT32 ring_base_addr_hi;
  3618. A_UINT32 ring_size: 16,
  3619. ring_entry_size: 8,
  3620. ring_misc_cfg_flag: 8;
  3621. A_UINT32 ring_head_offset32_remote_addr_lo;
  3622. A_UINT32 ring_head_offset32_remote_addr_hi;
  3623. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3624. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3625. A_UINT32 ring_msi_addr_lo;
  3626. A_UINT32 ring_msi_addr_hi;
  3627. A_UINT32 ring_msi_data;
  3628. A_UINT32 intr_batch_counter_th: 15,
  3629. sw_intr_mode: 1,
  3630. intr_timer_th: 16;
  3631. A_UINT32 intr_low_threshold: 16,
  3632. prefetch_timer_cfg: 3,
  3633. response_required: 1,
  3634. reserved1: 12;
  3635. } POSTPACK;
  3636. enum htt_srng_ring_type {
  3637. HTT_HW_TO_SW_RING = 0,
  3638. HTT_SW_TO_HW_RING,
  3639. HTT_SW_TO_SW_RING,
  3640. /* Insert new ring types above this line */
  3641. };
  3642. enum htt_srng_ring_id {
  3643. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  3644. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  3645. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3646. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3647. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  3648. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  3649. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  3650. /* Add Other SRING which can't be directly configured by host software above this line */
  3651. };
  3652. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  3653. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  3654. #define HTT_SRING_SETUP_PDEV_ID_S 8
  3655. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  3656. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  3657. HTT_SRING_SETUP_PDEV_ID_S)
  3658. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  3659. do { \
  3660. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  3661. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  3662. } while (0)
  3663. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  3664. #define HTT_SRING_SETUP_RING_ID_S 16
  3665. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  3666. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  3667. HTT_SRING_SETUP_RING_ID_S)
  3668. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  3669. do { \
  3670. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  3671. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  3672. } while (0)
  3673. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  3674. #define HTT_SRING_SETUP_RING_TYPE_S 24
  3675. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  3676. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  3677. HTT_SRING_SETUP_RING_TYPE_S)
  3678. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  3679. do { \
  3680. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  3681. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  3682. } while (0)
  3683. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  3684. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  3685. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  3686. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  3687. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  3688. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3689. do { \
  3690. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  3691. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  3692. } while (0)
  3693. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  3694. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  3695. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  3696. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  3697. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  3698. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3699. do { \
  3700. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  3701. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  3702. } while (0)
  3703. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  3704. #define HTT_SRING_SETUP_RING_SIZE_S 0
  3705. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  3706. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  3707. HTT_SRING_SETUP_RING_SIZE_S)
  3708. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  3709. do { \
  3710. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  3711. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  3712. } while (0)
  3713. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff00000
  3714. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  3715. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  3716. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  3717. HTT_SRING_SETUP_ENTRY_SIZE_S)
  3718. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  3719. do { \
  3720. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  3721. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  3722. } while (0)
  3723. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff0000000
  3724. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  3725. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  3726. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  3727. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  3728. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  3729. do { \
  3730. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  3731. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  3732. } while (0)
  3733. /* This control bit is applicable to only Producer, which updates Ring ID field
  3734. * of each descriptor before pushing into the ring.
  3735. * 0: updates ring_id(default)
  3736. * 1: ring_id updating disabled */
  3737. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01
  3738. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 0
  3739. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  3740. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  3741. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  3742. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  3743. do { \
  3744. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  3745. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  3746. } while (0)
  3747. /* This control bit is applicable to only Producer, which updates Loopcnt field
  3748. * of each descriptor before pushing into the ring.
  3749. * 0: updates Loopcnt(default)
  3750. * 1: Loopcnt updating disabled */
  3751. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02
  3752. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 1
  3753. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  3754. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  3755. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  3756. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  3757. do { \
  3758. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  3759. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  3760. } while (0)
  3761. /* Secured access enable/disable bit. SRNG drives value of this register bit
  3762. * into security_id port of GXI/AXI. */
  3763. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04
  3764. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 2
  3765. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  3766. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  3767. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  3768. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  3769. do { \
  3770. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  3771. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  3772. } while (0)
  3773. /* During MSI write operation, SRNG drives value of this register bit into
  3774. * swap bit of GXI/AXI. */
  3775. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08
  3776. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 3
  3777. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  3778. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  3779. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  3780. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  3781. do { \
  3782. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  3783. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  3784. } while (0)
  3785. /* During Pointer write operation, SRNG drives value of this register bit into
  3786. * swap bit of GXI/AXI. */
  3787. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10
  3788. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 4
  3789. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  3790. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  3791. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  3792. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  3793. do { \
  3794. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  3795. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  3796. } while (0)
  3797. /* During any data or TLV write operation, SRNG drives value of this register
  3798. * bit into swap bit of GXI/AXI. */
  3799. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20
  3800. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 5
  3801. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  3802. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  3803. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  3804. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  3805. do { \
  3806. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  3807. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  3808. } while (0)
  3809. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40
  3810. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80
  3811. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  3812. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  3813. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  3814. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  3815. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  3816. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  3817. do { \
  3818. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  3819. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  3820. } while (0)
  3821. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  3822. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  3823. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  3824. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  3825. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  3826. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  3827. do { \
  3828. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  3829. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  3830. } while (0)
  3831. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  3832. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  3833. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  3834. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  3835. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  3836. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  3837. do { \
  3838. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  3839. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  3840. } while (0)
  3841. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  3842. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  3843. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  3844. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  3845. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  3846. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  3847. do { \
  3848. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  3849. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  3850. } while (0)
  3851. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  3852. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  3853. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  3854. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  3855. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  3856. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  3857. do { \
  3858. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  3859. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  3860. } while (0)
  3861. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  3862. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  3863. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  3864. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  3865. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  3866. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  3867. do { \
  3868. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  3869. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  3870. } while (0)
  3871. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  3872. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  3873. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  3874. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  3875. HTT_SRING_SETUP_RING_MSI_DATA_S)
  3876. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  3877. do { \
  3878. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  3879. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  3880. } while (0)
  3881. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  3882. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  3883. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  3884. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  3885. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  3886. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  3887. do { \
  3888. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  3889. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  3890. } while (0)
  3891. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  3892. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  3893. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  3894. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  3895. HTT_SRING_SETUP_SW_INTR_MODE_S)
  3896. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  3897. do { \
  3898. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  3899. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  3900. } while (0)
  3901. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  3902. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  3903. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  3904. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  3905. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  3906. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  3907. do { \
  3908. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  3909. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  3910. } while (0)
  3911. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  3912. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  3913. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  3914. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  3915. HTT_SRING_SETUP_INTR_LOW_TH_S)
  3916. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  3917. do { \
  3918. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  3919. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  3920. } while (0)
  3921. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  3922. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  3923. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  3924. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  3925. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  3926. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  3927. do { \
  3928. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  3929. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  3930. } while (0)
  3931. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  3932. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  3933. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  3934. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  3935. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  3936. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  3937. do { \
  3938. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  3939. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  3940. } while (0)
  3941. /**
  3942. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  3943. *
  3944. * @details
  3945. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  3946. * configure RXDMA rings.
  3947. * The configuration is per ring based and includes both packet subtypes
  3948. * and PPDU/MPDU TLVs.
  3949. *
  3950. * The message would appear as follows:
  3951. *
  3952. * |31 26|25|24|23 16|15 8|7 0|
  3953. * |-----------------+----------------+----------------+---------------|
  3954. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  3955. * |-------------------------------------------------------------------|
  3956. * | rsvd2 | ring_buffer_size |
  3957. * |-------------------------------------------------------------------|
  3958. * | packet_type_enable_flags_0 |
  3959. * |-------------------------------------------------------------------|
  3960. * | packet_type_enable_flags_1 |
  3961. * |-------------------------------------------------------------------|
  3962. * | packet_type_enable_flags_2 |
  3963. * |-------------------------------------------------------------------|
  3964. * | packet_type_enable_flags_3 |
  3965. * |-------------------------------------------------------------------|
  3966. * | tlv_filter_in_flags |
  3967. * |-------------------------------------------------------------------|
  3968. * Where:
  3969. * PS = pkt_swap
  3970. * SS = status_swap
  3971. * The message is interpreted as follows:
  3972. * dword0 - b'0:7 - msg_type: This will be set to
  3973. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  3974. * b'8:15 - pdev_id:
  3975. * 0 (for rings at SOC/UMAC level),
  3976. * 1/2/3 mac id (for rings at LMAC level)
  3977. * b'16:23 - ring_id : Identify the ring to configure.
  3978. * More details can be got from enum htt_srng_ring_id
  3979. * b'24 - status_swap: 1 is to swap status TLV
  3980. * b'25 - pkt_swap: 1 is to swap packet TLV
  3981. * b'26:31 - rsvd1: reserved for future use
  3982. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  3983. * in byte units.
  3984. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3985. * - b'16:31 - rsvd2: Reserved for future use
  3986. * dword2 - b'0:31 - packet_type_enable_flags_0:
  3987. * Enable MGMT packet from 0b0000 to 0b1001
  3988. * bits from low to high: FP, MD, MO - 3 bits
  3989. * FP: Filter_Pass
  3990. * MD: Monitor_Direct
  3991. * MO: Monitor_Other
  3992. * 10 mgmt subtypes * 3 bits -> 30 bits
  3993. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  3994. * dword3 - b'0:31 - packet_type_enable_flags_1:
  3995. * Enable MGMT packet from 0b1010 to 0b1111
  3996. * bits from low to high: FP, MD, MO - 3 bits
  3997. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  3998. * dword4 - b'0:31 - packet_type_enable_flags_2:
  3999. * Enable CTRL packet from 0b0000 to 0b1001
  4000. * bits from low to high: FP, MD, MO - 3 bits
  4001. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4002. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4003. * Enable CTRL packet from 0b1010 to 0b1111,
  4004. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4005. * bits from low to high: FP, MD, MO - 3 bits
  4006. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4007. * dword6 - b'0:31 - tlv_filter_in_flags:
  4008. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4009. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4010. */
  4011. PREPACK struct htt_rx_ring_selection_cfg_t {
  4012. A_UINT32 msg_type: 8,
  4013. pdev_id: 8,
  4014. ring_id: 8,
  4015. status_swap: 1,
  4016. pkt_swap: 1,
  4017. rsvd1: 6;
  4018. A_UINT32 ring_buffer_size: 16,
  4019. rsvd2: 16;
  4020. A_UINT32 packet_type_enable_flags_0;
  4021. A_UINT32 packet_type_enable_flags_1;
  4022. A_UINT32 packet_type_enable_flags_2;
  4023. A_UINT32 packet_type_enable_flags_3;
  4024. A_UINT32 tlv_filter_in_flags;
  4025. } POSTPACK;
  4026. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4027. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4028. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4029. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4030. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4031. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4032. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4033. do { \
  4034. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4035. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4036. } while (0)
  4037. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4038. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4039. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4040. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4041. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4042. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4043. do { \
  4044. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4045. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4046. } while (0)
  4047. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4048. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4049. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4050. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4051. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4052. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4053. do { \
  4054. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4055. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4056. } while (0)
  4057. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4058. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4059. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4060. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4061. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4062. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4063. do { \
  4064. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4065. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4066. } while (0)
  4067. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4068. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4069. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4070. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4071. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4072. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4073. do { \
  4074. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4075. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4076. } while (0)
  4077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4080. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4081. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4082. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4083. do { \
  4084. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4085. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4086. } while (0)
  4087. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4088. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4089. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4090. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4091. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4093. do { \
  4094. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4095. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4096. } while (0)
  4097. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4100. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4101. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4102. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4103. do { \
  4104. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4105. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4106. } while (0)
  4107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4108. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4109. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4110. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4111. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4113. do { \
  4114. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4115. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4116. } while (0)
  4117. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4118. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4119. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4120. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4121. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4122. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4123. do { \
  4124. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4125. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4126. } while (0)
  4127. /*
  4128. * Subtype based MGMT frames enable bits.
  4129. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4130. */
  4131. /* association request */
  4132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4135. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4136. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4138. /* association response */
  4139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4142. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4143. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4145. /* Reassociation request */
  4146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4152. /* Reassociation response */
  4153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4159. /* Probe request */
  4160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4164. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4166. /* Probe response */
  4167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4170. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4171. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4173. /* Timing Advertisement */
  4174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4177. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4178. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4180. /* Reserved */
  4181. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4183. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4184. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4185. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4186. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4187. /* Beacon */
  4188. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000001
  4189. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4190. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000001
  4191. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4192. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x00000001
  4193. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4194. /* ATIM */
  4195. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x00000001
  4196. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4197. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x00000001
  4198. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4199. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x00000001
  4200. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4201. /* Disassociation */
  4202. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4203. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4204. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4205. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4206. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4207. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4208. /* Authentication */
  4209. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4210. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4211. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4212. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4213. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4214. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4215. /* Deauthentication */
  4216. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4217. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4218. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4219. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4220. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4221. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4222. /* Action */
  4223. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4224. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4225. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4226. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4227. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4228. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4229. /* Action No Ack */
  4230. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4231. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4232. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4233. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4234. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4235. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4236. /* Reserved */
  4237. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4238. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4239. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4240. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4241. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4242. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4243. /*
  4244. * Subtype based CTRL frames enable bits.
  4245. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4246. */
  4247. /* Reserved */
  4248. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4249. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4250. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4251. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4252. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4253. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4254. /* Reserved */
  4255. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4256. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4257. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4258. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4259. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4260. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4261. /* Reserved */
  4262. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4263. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4264. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4265. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4266. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4267. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4268. /* Reserved */
  4269. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4270. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4271. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4272. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4273. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4274. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4275. /* Reserved */
  4276. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4277. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4278. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4279. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4280. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4281. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4282. /* Reserved */
  4283. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4284. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4285. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4286. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4287. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4288. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4289. /* Reserved */
  4290. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4291. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4292. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4293. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4294. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4295. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4296. /* Control Wrapper */
  4297. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4298. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4299. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4300. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4301. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4302. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4303. /* Block Ack Request */
  4304. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000001
  4305. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4306. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000001
  4307. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4308. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x00000001
  4309. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4310. /* Block Ack*/
  4311. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x00000001
  4312. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4313. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x00000001
  4314. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4315. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x00000001
  4316. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4317. /* PS-POLL */
  4318. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4319. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4320. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4321. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4322. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4323. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4324. /* RTS */
  4325. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4326. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4327. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4328. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4329. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4330. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4331. /* CTS */
  4332. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4333. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4334. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4335. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4336. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4337. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4338. /* ACK */
  4339. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4340. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4341. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4342. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4343. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4344. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4345. /* CF-END */
  4346. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4347. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4348. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4349. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4350. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4351. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4352. /* CF-END + CF-ACK */
  4353. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4354. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4355. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4356. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4357. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4358. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4359. /* Multicast data */
  4360. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4361. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4362. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4363. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4364. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4365. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4366. /* Unicast data */
  4367. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4368. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4369. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4370. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4371. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4372. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4373. /* NULL data */
  4374. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4375. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4376. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4377. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4378. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4379. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4380. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4381. do { \
  4382. HTT_CHECK_SET_VAL(httsym, value); \
  4383. (word) |= (value) << httsym##_S; \
  4384. } while (0)
  4385. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4386. (((word) & httsym##_M) >> httsym##_S)
  4387. #define htt_rx_ring_pkt_enable_subtype_set( \
  4388. word, flag, mode, type, subtype, val) \
  4389. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4390. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4391. #define htt_rx_ring_pkt_enable_subtype_get( \
  4392. word, flag, mode, type, subtype) \
  4393. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4394. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4395. /* Definition to filter in TLVs */
  4396. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4397. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4398. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4399. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4400. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4401. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4402. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4403. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4404. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4405. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4406. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4407. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4408. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4409. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4410. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4411. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4412. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4413. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4414. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4415. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4416. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4417. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4418. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4419. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4420. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4421. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4422. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4423. do { \
  4424. HTT_CHECK_SET_VAL(httsym, enable); \
  4425. (word) |= (enable) << httsym##_S; \
  4426. } while (0)
  4427. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4428. (((word) & httsym##_M) >> httsym##_S)
  4429. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4430. HTT_RX_RING_TLV_ENABLE_SET( \
  4431. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4432. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4433. HTT_RX_RING_TLV_ENABLE_GET( \
  4434. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4435. /**
  4436. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4437. * host --> target Receive Flow Steering configuration message definition.
  4438. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4439. * The reason for this is we want RFS to be configured and ready before MAC
  4440. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4441. *
  4442. * |31 24|23 16|15 9|8|7 0|
  4443. * |----------------+----------------+----------------+----------------|
  4444. * | reserved |E| msg type |
  4445. * |-------------------------------------------------------------------|
  4446. * Where E = RFS enable flag
  4447. *
  4448. * The RFS_CONFIG message consists of a single 4-byte word.
  4449. *
  4450. * Header fields:
  4451. * - MSG_TYPE
  4452. * Bits 7:0
  4453. * Purpose: identifies this as a RFS config msg
  4454. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4455. * - RFS_CONFIG
  4456. * Bit 8
  4457. * Purpose: Tells target whether to enable (1) or disable (0)
  4458. * flow steering feature when sending rx indication messages to host
  4459. */
  4460. #define HTT_H2T_RFS_CONFIG_M 0x100
  4461. #define HTT_H2T_RFS_CONFIG_S 8
  4462. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4463. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4464. HTT_H2T_RFS_CONFIG_S)
  4465. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4466. do { \
  4467. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4468. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4469. } while (0)
  4470. /*=== target -> host messages ===============================================*/
  4471. enum htt_t2h_msg_type {
  4472. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  4473. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  4474. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  4475. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  4476. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  4477. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  4478. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  4479. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  4480. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  4481. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  4482. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  4483. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  4484. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  4485. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  4486. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  4487. /* only used for HL, add HTT MSG for HTT CREDIT update */
  4488. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  4489. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  4490. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  4491. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  4492. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  4493. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  4494. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  4495. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  4496. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  4497. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  4498. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  4499. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  4500. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  4501. HTT_T2H_MSG_TYPE_TEST,
  4502. /* keep this last */
  4503. HTT_T2H_NUM_MSGS
  4504. };
  4505. /*
  4506. * HTT target to host message type -
  4507. * stored in bits 7:0 of the first word of the message
  4508. */
  4509. #define HTT_T2H_MSG_TYPE_M 0xff
  4510. #define HTT_T2H_MSG_TYPE_S 0
  4511. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  4512. do { \
  4513. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  4514. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  4515. } while (0)
  4516. #define HTT_T2H_MSG_TYPE_GET(word) \
  4517. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  4518. /**
  4519. * @brief target -> host version number confirmation message definition
  4520. *
  4521. * |31 24|23 16|15 8|7 0|
  4522. * |----------------+----------------+----------------+----------------|
  4523. * | reserved | major number | minor number | msg type |
  4524. * |-------------------------------------------------------------------|
  4525. * : option request TLV (optional) |
  4526. * :...................................................................:
  4527. *
  4528. * The VER_CONF message may consist of a single 4-byte word, or may be
  4529. * extended with TLVs that specify HTT options selected by the target.
  4530. * The following option TLVs may be appended to the VER_CONF message:
  4531. * - LL_BUS_ADDR_SIZE
  4532. * - HL_SUPPRESS_TX_COMPL_IND
  4533. * - MAX_TX_QUEUE_GROUPS
  4534. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  4535. * may be appended to the VER_CONF message (but only one TLV of each type).
  4536. *
  4537. * Header fields:
  4538. * - MSG_TYPE
  4539. * Bits 7:0
  4540. * Purpose: identifies this as a version number confirmation message
  4541. * Value: 0x0
  4542. * - VER_MINOR
  4543. * Bits 15:8
  4544. * Purpose: Specify the minor number of the HTT message library version
  4545. * in use by the target firmware.
  4546. * The minor number specifies the specific revision within a range
  4547. * of fundamentally compatible HTT message definition revisions.
  4548. * Compatible revisions involve adding new messages or perhaps
  4549. * adding new fields to existing messages, in a backwards-compatible
  4550. * manner.
  4551. * Incompatible revisions involve changing the message type values,
  4552. * or redefining existing messages.
  4553. * Value: minor number
  4554. * - VER_MAJOR
  4555. * Bits 15:8
  4556. * Purpose: Specify the major number of the HTT message library version
  4557. * in use by the target firmware.
  4558. * The major number specifies the family of minor revisions that are
  4559. * fundamentally compatible with each other, but not with prior or
  4560. * later families.
  4561. * Value: major number
  4562. */
  4563. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  4564. #define HTT_VER_CONF_MINOR_S 8
  4565. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  4566. #define HTT_VER_CONF_MAJOR_S 16
  4567. #define HTT_VER_CONF_MINOR_SET(word, value) \
  4568. do { \
  4569. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  4570. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  4571. } while (0)
  4572. #define HTT_VER_CONF_MINOR_GET(word) \
  4573. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  4574. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  4575. do { \
  4576. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  4577. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  4578. } while (0)
  4579. #define HTT_VER_CONF_MAJOR_GET(word) \
  4580. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  4581. #define HTT_VER_CONF_BYTES 4
  4582. /**
  4583. * @brief - target -> host HTT Rx In order indication message
  4584. *
  4585. * @details
  4586. *
  4587. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  4588. * |----------------+-------------------+---------------------+---------------|
  4589. * | peer ID | P| F| O| ext TID | msg type |
  4590. * |--------------------------------------------------------------------------|
  4591. * | MSDU count | Reserved | vdev id |
  4592. * |--------------------------------------------------------------------------|
  4593. * | MSDU 0 bus address (bits 31:0) |
  4594. #if HTT_PADDR64
  4595. * | MSDU 0 bus address (bits 63:32) |
  4596. #endif
  4597. * |--------------------------------------------------------------------------|
  4598. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  4599. * |--------------------------------------------------------------------------|
  4600. * | MSDU 1 bus address (bits 31:0) |
  4601. #if HTT_PADDR64
  4602. * | MSDU 1 bus address (bits 63:32) |
  4603. #endif
  4604. * |--------------------------------------------------------------------------|
  4605. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  4606. * |--------------------------------------------------------------------------|
  4607. */
  4608. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  4609. *
  4610. * @details
  4611. * bits
  4612. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  4613. * |-----+----+-------+--------+--------+---------+---------+-----------|
  4614. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  4615. * | | frag | | | | fail |chksum fail|
  4616. * |-----+----+-------+--------+--------+---------+---------+-----------|
  4617. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  4618. */
  4619. struct htt_rx_in_ord_paddr_ind_hdr_t
  4620. {
  4621. A_UINT32 /* word 0 */
  4622. msg_type: 8,
  4623. ext_tid: 5,
  4624. offload: 1,
  4625. frag: 1,
  4626. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  4627. peer_id: 16;
  4628. A_UINT32 /* word 1 */
  4629. vap_id: 8,
  4630. reserved_1: 8,
  4631. msdu_cnt: 16;
  4632. };
  4633. struct htt_rx_in_ord_paddr_ind_msdu32_t
  4634. {
  4635. A_UINT32 dma_addr;
  4636. A_UINT32
  4637. length: 16,
  4638. fw_desc: 8,
  4639. msdu_info:8;
  4640. };
  4641. struct htt_rx_in_ord_paddr_ind_msdu64_t
  4642. {
  4643. A_UINT32 dma_addr_lo;
  4644. A_UINT32 dma_addr_hi;
  4645. A_UINT32
  4646. length: 16,
  4647. fw_desc: 8,
  4648. msdu_info:8;
  4649. };
  4650. #if HTT_PADDR64
  4651. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  4652. #else
  4653. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  4654. #endif
  4655. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  4656. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  4657. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  4658. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  4659. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  4660. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  4661. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  4662. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  4663. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  4664. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  4665. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  4666. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  4667. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  4668. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  4669. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  4670. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  4671. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  4672. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  4673. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  4674. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  4675. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  4676. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  4677. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  4678. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  4679. /* for systems using 64-bit format for bus addresses */
  4680. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  4681. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  4682. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  4683. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  4684. /* for systems using 32-bit format for bus addresses */
  4685. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  4686. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  4687. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  4688. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  4689. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  4690. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  4691. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  4692. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  4693. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  4694. do { \
  4695. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  4696. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  4697. } while (0)
  4698. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  4699. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  4700. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  4701. do { \
  4702. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  4703. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  4704. } while (0)
  4705. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  4706. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  4707. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  4708. do { \
  4709. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  4710. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  4711. } while (0)
  4712. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  4713. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  4714. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  4715. do { \
  4716. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  4717. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  4718. } while (0)
  4719. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  4720. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  4721. /* for systems using 64-bit format for bus addresses */
  4722. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  4723. do { \
  4724. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  4725. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  4726. } while (0)
  4727. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  4728. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  4729. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  4730. do { \
  4731. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  4732. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  4733. } while (0)
  4734. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  4735. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  4736. /* for systems using 32-bit format for bus addresses */
  4737. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  4738. do { \
  4739. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  4740. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  4741. } while (0)
  4742. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  4743. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  4744. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  4745. do { \
  4746. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  4747. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  4748. } while (0)
  4749. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  4750. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  4751. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  4752. do { \
  4753. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  4754. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  4755. } while (0)
  4756. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  4757. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  4758. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  4759. do { \
  4760. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  4761. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  4762. } while (0)
  4763. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  4764. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  4765. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  4766. do { \
  4767. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  4768. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  4769. } while (0)
  4770. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  4771. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  4772. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  4773. do { \
  4774. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  4775. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  4776. } while (0)
  4777. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  4778. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  4779. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  4780. do { \
  4781. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  4782. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  4783. } while (0)
  4784. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  4785. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  4786. /* definitions used within target -> host rx indication message */
  4787. PREPACK struct htt_rx_ind_hdr_prefix_t
  4788. {
  4789. A_UINT32 /* word 0 */
  4790. msg_type: 8,
  4791. ext_tid: 5,
  4792. release_valid: 1,
  4793. flush_valid: 1,
  4794. reserved0: 1,
  4795. peer_id: 16;
  4796. A_UINT32 /* word 1 */
  4797. flush_start_seq_num: 6,
  4798. flush_end_seq_num: 6,
  4799. release_start_seq_num: 6,
  4800. release_end_seq_num: 6,
  4801. num_mpdu_ranges: 8;
  4802. } POSTPACK;
  4803. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  4804. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  4805. #define HTT_TGT_RSSI_INVALID 0x80
  4806. PREPACK struct htt_rx_ppdu_desc_t
  4807. {
  4808. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  4809. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  4810. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  4811. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  4812. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  4813. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  4814. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  4815. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  4816. A_UINT32 /* word 0 */
  4817. rssi_cmb: 8,
  4818. timestamp_submicrosec: 8,
  4819. phy_err_code: 8,
  4820. phy_err: 1,
  4821. legacy_rate: 4,
  4822. legacy_rate_sel: 1,
  4823. end_valid: 1,
  4824. start_valid: 1;
  4825. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  4826. union {
  4827. A_UINT32 /* word 1 */
  4828. rssi0_pri20: 8,
  4829. rssi0_ext20: 8,
  4830. rssi0_ext40: 8,
  4831. rssi0_ext80: 8;
  4832. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  4833. } u0;
  4834. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  4835. union {
  4836. A_UINT32 /* word 2 */
  4837. rssi1_pri20: 8,
  4838. rssi1_ext20: 8,
  4839. rssi1_ext40: 8,
  4840. rssi1_ext80: 8;
  4841. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  4842. } u1;
  4843. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  4844. union {
  4845. A_UINT32 /* word 3 */
  4846. rssi2_pri20: 8,
  4847. rssi2_ext20: 8,
  4848. rssi2_ext40: 8,
  4849. rssi2_ext80: 8;
  4850. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  4851. } u2;
  4852. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  4853. union {
  4854. A_UINT32 /* word 4 */
  4855. rssi3_pri20: 8,
  4856. rssi3_ext20: 8,
  4857. rssi3_ext40: 8,
  4858. rssi3_ext80: 8;
  4859. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  4860. } u3;
  4861. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  4862. A_UINT32 tsf32; /* word 5 */
  4863. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  4864. A_UINT32 timestamp_microsec; /* word 6 */
  4865. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  4866. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  4867. A_UINT32 /* word 7 */
  4868. vht_sig_a1: 24,
  4869. preamble_type: 8;
  4870. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  4871. A_UINT32 /* word 8 */
  4872. vht_sig_a2: 24,
  4873. reserved0: 8;
  4874. } POSTPACK;
  4875. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  4876. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  4877. PREPACK struct htt_rx_ind_hdr_suffix_t
  4878. {
  4879. A_UINT32 /* word 0 */
  4880. fw_rx_desc_bytes: 16,
  4881. reserved0: 16;
  4882. } POSTPACK;
  4883. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  4884. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  4885. PREPACK struct htt_rx_ind_hdr_t
  4886. {
  4887. struct htt_rx_ind_hdr_prefix_t prefix;
  4888. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  4889. struct htt_rx_ind_hdr_suffix_t suffix;
  4890. } POSTPACK;
  4891. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  4892. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  4893. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  4894. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  4895. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  4896. /*
  4897. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  4898. * the offset into the HTT rx indication message at which the
  4899. * FW rx PPDU descriptor resides
  4900. */
  4901. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  4902. /*
  4903. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  4904. * the offset into the HTT rx indication message at which the
  4905. * header suffix (FW rx MSDU byte count) resides
  4906. */
  4907. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  4908. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  4909. /*
  4910. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  4911. * the offset into the HTT rx indication message at which the per-MSDU
  4912. * information starts
  4913. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  4914. * per-MSDU information portion of the message. The per-MSDU info itself
  4915. * starts at byte 12.
  4916. */
  4917. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  4918. /**
  4919. * @brief target -> host rx indication message definition
  4920. *
  4921. * @details
  4922. * The following field definitions describe the format of the rx indication
  4923. * message sent from the target to the host.
  4924. * The message consists of three major sections:
  4925. * 1. a fixed-length header
  4926. * 2. a variable-length list of firmware rx MSDU descriptors
  4927. * 3. one or more 4-octet MPDU range information elements
  4928. * The fixed length header itself has two sub-sections
  4929. * 1. the message meta-information, including identification of the
  4930. * sender and type of the received data, and a 4-octet flush/release IE
  4931. * 2. the firmware rx PPDU descriptor
  4932. *
  4933. * The format of the message is depicted below.
  4934. * in this depiction, the following abbreviations are used for information
  4935. * elements within the message:
  4936. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  4937. * elements associated with the PPDU start are valid.
  4938. * Specifically, the following fields are valid only if SV is set:
  4939. * RSSI (all variants), L, legacy rate, preamble type, service,
  4940. * VHT-SIG-A
  4941. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  4942. * elements associated with the PPDU end are valid.
  4943. * Specifically, the following fields are valid only if EV is set:
  4944. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  4945. * - L - Legacy rate selector - if legacy rates are used, this flag
  4946. * indicates whether the rate is from a CCK (L == 1) or OFDM
  4947. * (L == 0) PHY.
  4948. * - P - PHY error flag - boolean indication of whether the rx frame had
  4949. * a PHY error
  4950. *
  4951. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  4952. * |----------------+-------------------+---------------------+---------------|
  4953. * | peer ID | |RV|FV| ext TID | msg type |
  4954. * |--------------------------------------------------------------------------|
  4955. * | num | release | release | flush | flush |
  4956. * | MPDU | end | start | end | start |
  4957. * | ranges | seq num | seq num | seq num | seq num |
  4958. * |==========================================================================|
  4959. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  4960. * |V|V| | rate | | | timestamp | RSSI |
  4961. * |--------------------------------------------------------------------------|
  4962. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  4963. * |--------------------------------------------------------------------------|
  4964. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  4965. * |--------------------------------------------------------------------------|
  4966. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  4967. * |--------------------------------------------------------------------------|
  4968. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  4969. * |--------------------------------------------------------------------------|
  4970. * | TSF LSBs |
  4971. * |--------------------------------------------------------------------------|
  4972. * | microsec timestamp |
  4973. * |--------------------------------------------------------------------------|
  4974. * | preamble type | HT-SIG / VHT-SIG-A1 |
  4975. * |--------------------------------------------------------------------------|
  4976. * | service | HT-SIG / VHT-SIG-A2 |
  4977. * |==========================================================================|
  4978. * | reserved | FW rx desc bytes |
  4979. * |--------------------------------------------------------------------------|
  4980. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  4981. * | desc B3 | desc B2 | desc B1 | desc B0 |
  4982. * |--------------------------------------------------------------------------|
  4983. * : : :
  4984. * |--------------------------------------------------------------------------|
  4985. * | alignment | MSDU Rx |
  4986. * | padding | desc Bn |
  4987. * |--------------------------------------------------------------------------|
  4988. * | reserved | MPDU range status | MPDU count |
  4989. * |--------------------------------------------------------------------------|
  4990. * : reserved : MPDU range status : MPDU count :
  4991. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  4992. *
  4993. * Header fields:
  4994. * - MSG_TYPE
  4995. * Bits 7:0
  4996. * Purpose: identifies this as an rx indication message
  4997. * Value: 0x1
  4998. * - EXT_TID
  4999. * Bits 12:8
  5000. * Purpose: identify the traffic ID of the rx data, including
  5001. * special "extended" TID values for multicast, broadcast, and
  5002. * non-QoS data frames
  5003. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5004. * - FLUSH_VALID (FV)
  5005. * Bit 13
  5006. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5007. * is valid
  5008. * Value:
  5009. * 1 -> flush IE is valid and needs to be processed
  5010. * 0 -> flush IE is not valid and should be ignored
  5011. * - REL_VALID (RV)
  5012. * Bit 13
  5013. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5014. * is valid
  5015. * Value:
  5016. * 1 -> release IE is valid and needs to be processed
  5017. * 0 -> release IE is not valid and should be ignored
  5018. * - PEER_ID
  5019. * Bits 31:16
  5020. * Purpose: Identify, by ID, which peer sent the rx data
  5021. * Value: ID of the peer who sent the rx data
  5022. * - FLUSH_SEQ_NUM_START
  5023. * Bits 5:0
  5024. * Purpose: Indicate the start of a series of MPDUs to flush
  5025. * Not all MPDUs within this series are necessarily valid - the host
  5026. * must check each sequence number within this range to see if the
  5027. * corresponding MPDU is actually present.
  5028. * This field is only valid if the FV bit is set.
  5029. * Value:
  5030. * The sequence number for the first MPDUs to check to flush.
  5031. * The sequence number is masked by 0x3f.
  5032. * - FLUSH_SEQ_NUM_END
  5033. * Bits 11:6
  5034. * Purpose: Indicate the end of a series of MPDUs to flush
  5035. * Value:
  5036. * The sequence number one larger than the sequence number of the
  5037. * last MPDU to check to flush.
  5038. * The sequence number is masked by 0x3f.
  5039. * Not all MPDUs within this series are necessarily valid - the host
  5040. * must check each sequence number within this range to see if the
  5041. * corresponding MPDU is actually present.
  5042. * This field is only valid if the FV bit is set.
  5043. * - REL_SEQ_NUM_START
  5044. * Bits 17:12
  5045. * Purpose: Indicate the start of a series of MPDUs to release.
  5046. * All MPDUs within this series are present and valid - the host
  5047. * need not check each sequence number within this range to see if
  5048. * the corresponding MPDU is actually present.
  5049. * This field is only valid if the RV bit is set.
  5050. * Value:
  5051. * The sequence number for the first MPDUs to check to release.
  5052. * The sequence number is masked by 0x3f.
  5053. * - REL_SEQ_NUM_END
  5054. * Bits 23:18
  5055. * Purpose: Indicate the end of a series of MPDUs to release.
  5056. * Value:
  5057. * The sequence number one larger than the sequence number of the
  5058. * last MPDU to check to release.
  5059. * The sequence number is masked by 0x3f.
  5060. * All MPDUs within this series are present and valid - the host
  5061. * need not check each sequence number within this range to see if
  5062. * the corresponding MPDU is actually present.
  5063. * This field is only valid if the RV bit is set.
  5064. * - NUM_MPDU_RANGES
  5065. * Bits 31:24
  5066. * Purpose: Indicate how many ranges of MPDUs are present.
  5067. * Each MPDU range consists of a series of contiguous MPDUs within the
  5068. * rx frame sequence which all have the same MPDU status.
  5069. * Value: 1-63 (typically a small number, like 1-3)
  5070. *
  5071. * Rx PPDU descriptor fields:
  5072. * - RSSI_CMB
  5073. * Bits 7:0
  5074. * Purpose: Combined RSSI from all active rx chains, across the active
  5075. * bandwidth.
  5076. * Value: RSSI dB units w.r.t. noise floor
  5077. * - TIMESTAMP_SUBMICROSEC
  5078. * Bits 15:8
  5079. * Purpose: high-resolution timestamp
  5080. * Value:
  5081. * Sub-microsecond time of PPDU reception.
  5082. * This timestamp ranges from [0,MAC clock MHz).
  5083. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5084. * to form a high-resolution, large range rx timestamp.
  5085. * - PHY_ERR_CODE
  5086. * Bits 23:16
  5087. * Purpose:
  5088. * If the rx frame processing resulted in a PHY error, indicate what
  5089. * type of rx PHY error occurred.
  5090. * Value:
  5091. * This field is valid if the "P" (PHY_ERR) flag is set.
  5092. * TBD: document/specify the values for this field
  5093. * - PHY_ERR
  5094. * Bit 24
  5095. * Purpose: indicate whether the rx PPDU had a PHY error
  5096. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5097. * - LEGACY_RATE
  5098. * Bits 28:25
  5099. * Purpose:
  5100. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5101. * specify which rate was used.
  5102. * Value:
  5103. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5104. * flag.
  5105. * If LEGACY_RATE_SEL is 0:
  5106. * 0x8: OFDM 48 Mbps
  5107. * 0x9: OFDM 24 Mbps
  5108. * 0xA: OFDM 12 Mbps
  5109. * 0xB: OFDM 6 Mbps
  5110. * 0xC: OFDM 54 Mbps
  5111. * 0xD: OFDM 36 Mbps
  5112. * 0xE: OFDM 18 Mbps
  5113. * 0xF: OFDM 9 Mbps
  5114. * If LEGACY_RATE_SEL is 1:
  5115. * 0x8: CCK 11 Mbps long preamble
  5116. * 0x9: CCK 5.5 Mbps long preamble
  5117. * 0xA: CCK 2 Mbps long preamble
  5118. * 0xB: CCK 1 Mbps long preamble
  5119. * 0xC: CCK 11 Mbps short preamble
  5120. * 0xD: CCK 5.5 Mbps short preamble
  5121. * 0xE: CCK 2 Mbps short preamble
  5122. * - LEGACY_RATE_SEL
  5123. * Bit 29
  5124. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5125. * Value:
  5126. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5127. * used a legacy rate.
  5128. * 0 -> OFDM, 1 -> CCK
  5129. * - END_VALID
  5130. * Bit 30
  5131. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5132. * the start of the PPDU are valid. Specifically, the following
  5133. * fields are only valid if END_VALID is set:
  5134. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5135. * TIMESTAMP_SUBMICROSEC
  5136. * Value:
  5137. * 0 -> rx PPDU desc end fields are not valid
  5138. * 1 -> rx PPDU desc end fields are valid
  5139. * - START_VALID
  5140. * Bit 31
  5141. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5142. * the end of the PPDU are valid. Specifically, the following
  5143. * fields are only valid if START_VALID is set:
  5144. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5145. * VHT-SIG-A
  5146. * Value:
  5147. * 0 -> rx PPDU desc start fields are not valid
  5148. * 1 -> rx PPDU desc start fields are valid
  5149. * - RSSI0_PRI20
  5150. * Bits 7:0
  5151. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5152. * Value: RSSI dB units w.r.t. noise floor
  5153. *
  5154. * - RSSI0_EXT20
  5155. * Bits 7:0
  5156. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5157. * (if the rx bandwidth was >= 40 MHz)
  5158. * Value: RSSI dB units w.r.t. noise floor
  5159. * - RSSI0_EXT40
  5160. * Bits 7:0
  5161. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5162. * (if the rx bandwidth was >= 80 MHz)
  5163. * Value: RSSI dB units w.r.t. noise floor
  5164. * - RSSI0_EXT80
  5165. * Bits 7:0
  5166. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5167. * (if the rx bandwidth was >= 160 MHz)
  5168. * Value: RSSI dB units w.r.t. noise floor
  5169. *
  5170. * - RSSI1_PRI20
  5171. * Bits 7:0
  5172. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5173. * Value: RSSI dB units w.r.t. noise floor
  5174. * - RSSI1_EXT20
  5175. * Bits 7:0
  5176. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5177. * (if the rx bandwidth was >= 40 MHz)
  5178. * Value: RSSI dB units w.r.t. noise floor
  5179. * - RSSI1_EXT40
  5180. * Bits 7:0
  5181. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5182. * (if the rx bandwidth was >= 80 MHz)
  5183. * Value: RSSI dB units w.r.t. noise floor
  5184. * - RSSI1_EXT80
  5185. * Bits 7:0
  5186. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5187. * (if the rx bandwidth was >= 160 MHz)
  5188. * Value: RSSI dB units w.r.t. noise floor
  5189. *
  5190. * - RSSI2_PRI20
  5191. * Bits 7:0
  5192. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5193. * Value: RSSI dB units w.r.t. noise floor
  5194. * - RSSI2_EXT20
  5195. * Bits 7:0
  5196. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5197. * (if the rx bandwidth was >= 40 MHz)
  5198. * Value: RSSI dB units w.r.t. noise floor
  5199. * - RSSI2_EXT40
  5200. * Bits 7:0
  5201. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5202. * (if the rx bandwidth was >= 80 MHz)
  5203. * Value: RSSI dB units w.r.t. noise floor
  5204. * - RSSI2_EXT80
  5205. * Bits 7:0
  5206. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5207. * (if the rx bandwidth was >= 160 MHz)
  5208. * Value: RSSI dB units w.r.t. noise floor
  5209. *
  5210. * - RSSI3_PRI20
  5211. * Bits 7:0
  5212. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5213. * Value: RSSI dB units w.r.t. noise floor
  5214. * - RSSI3_EXT20
  5215. * Bits 7:0
  5216. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5217. * (if the rx bandwidth was >= 40 MHz)
  5218. * Value: RSSI dB units w.r.t. noise floor
  5219. * - RSSI3_EXT40
  5220. * Bits 7:0
  5221. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5222. * (if the rx bandwidth was >= 80 MHz)
  5223. * Value: RSSI dB units w.r.t. noise floor
  5224. * - RSSI3_EXT80
  5225. * Bits 7:0
  5226. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5227. * (if the rx bandwidth was >= 160 MHz)
  5228. * Value: RSSI dB units w.r.t. noise floor
  5229. *
  5230. * - TSF32
  5231. * Bits 31:0
  5232. * Purpose: specify the time the rx PPDU was received, in TSF units
  5233. * Value: 32 LSBs of the TSF
  5234. * - TIMESTAMP_MICROSEC
  5235. * Bits 31:0
  5236. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5237. * Value: PPDU rx time, in microseconds
  5238. * - VHT_SIG_A1
  5239. * Bits 23:0
  5240. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5241. * from the rx PPDU
  5242. * Value:
  5243. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5244. * VHT-SIG-A1 data.
  5245. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5246. * first 24 bits of the HT-SIG data.
  5247. * Otherwise, this field is invalid.
  5248. * Refer to the the 802.11 protocol for the definition of the
  5249. * HT-SIG and VHT-SIG-A1 fields
  5250. * - VHT_SIG_A2
  5251. * Bits 23:0
  5252. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5253. * from the rx PPDU
  5254. * Value:
  5255. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5256. * VHT-SIG-A2 data.
  5257. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5258. * last 24 bits of the HT-SIG data.
  5259. * Otherwise, this field is invalid.
  5260. * Refer to the the 802.11 protocol for the definition of the
  5261. * HT-SIG and VHT-SIG-A2 fields
  5262. * - PREAMBLE_TYPE
  5263. * Bits 31:24
  5264. * Purpose: indicate the PHY format of the received burst
  5265. * Value:
  5266. * 0x4: Legacy (OFDM/CCK)
  5267. * 0x8: HT
  5268. * 0x9: HT with TxBF
  5269. * 0xC: VHT
  5270. * 0xD: VHT with TxBF
  5271. * - SERVICE
  5272. * Bits 31:24
  5273. * Purpose: TBD
  5274. * Value: TBD
  5275. *
  5276. * Rx MSDU descriptor fields:
  5277. * - FW_RX_DESC_BYTES
  5278. * Bits 15:0
  5279. * Purpose: Indicate how many bytes in the Rx indication are used for
  5280. * FW Rx descriptors
  5281. *
  5282. * Payload fields:
  5283. * - MPDU_COUNT
  5284. * Bits 7:0
  5285. * Purpose: Indicate how many sequential MPDUs share the same status.
  5286. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5287. * - MPDU_STATUS
  5288. * Bits 15:8
  5289. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5290. * received successfully.
  5291. * Value:
  5292. * 0x1: success
  5293. * 0x2: FCS error
  5294. * 0x3: duplicate error
  5295. * 0x4: replay error
  5296. * 0x5: invalid peer
  5297. */
  5298. /* header fields */
  5299. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5300. #define HTT_RX_IND_EXT_TID_S 8
  5301. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5302. #define HTT_RX_IND_FLUSH_VALID_S 13
  5303. #define HTT_RX_IND_REL_VALID_M 0x4000
  5304. #define HTT_RX_IND_REL_VALID_S 14
  5305. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5306. #define HTT_RX_IND_PEER_ID_S 16
  5307. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5308. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5309. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5310. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5311. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5312. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5313. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5314. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5315. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5316. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5317. /* rx PPDU descriptor fields */
  5318. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5319. #define HTT_RX_IND_RSSI_CMB_S 0
  5320. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5321. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5322. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5323. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5324. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5325. #define HTT_RX_IND_PHY_ERR_S 24
  5326. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5327. #define HTT_RX_IND_LEGACY_RATE_S 25
  5328. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5329. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  5330. #define HTT_RX_IND_END_VALID_M 0x40000000
  5331. #define HTT_RX_IND_END_VALID_S 30
  5332. #define HTT_RX_IND_START_VALID_M 0x80000000
  5333. #define HTT_RX_IND_START_VALID_S 31
  5334. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  5335. #define HTT_RX_IND_RSSI_PRI20_S 0
  5336. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  5337. #define HTT_RX_IND_RSSI_EXT20_S 8
  5338. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  5339. #define HTT_RX_IND_RSSI_EXT40_S 16
  5340. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  5341. #define HTT_RX_IND_RSSI_EXT80_S 24
  5342. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  5343. #define HTT_RX_IND_VHT_SIG_A1_S 0
  5344. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  5345. #define HTT_RX_IND_VHT_SIG_A2_S 0
  5346. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  5347. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  5348. #define HTT_RX_IND_SERVICE_M 0xff000000
  5349. #define HTT_RX_IND_SERVICE_S 24
  5350. /* rx MSDU descriptor fields */
  5351. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  5352. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  5353. /* payload fields */
  5354. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  5355. #define HTT_RX_IND_MPDU_COUNT_S 0
  5356. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  5357. #define HTT_RX_IND_MPDU_STATUS_S 8
  5358. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  5359. do { \
  5360. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  5361. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  5362. } while (0)
  5363. #define HTT_RX_IND_EXT_TID_GET(word) \
  5364. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  5365. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  5366. do { \
  5367. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  5368. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  5369. } while (0)
  5370. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  5371. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  5372. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  5373. do { \
  5374. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  5375. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  5376. } while (0)
  5377. #define HTT_RX_IND_REL_VALID_GET(word) \
  5378. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  5379. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  5380. do { \
  5381. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  5382. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  5383. } while (0)
  5384. #define HTT_RX_IND_PEER_ID_GET(word) \
  5385. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  5386. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  5387. do { \
  5388. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  5389. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  5390. } while (0)
  5391. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  5392. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  5393. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  5394. do { \
  5395. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  5396. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  5397. } while (0)
  5398. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  5399. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  5400. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  5401. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  5402. do { \
  5403. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  5404. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  5405. } while (0)
  5406. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  5407. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  5408. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  5409. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  5410. do { \
  5411. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  5412. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  5413. } while (0)
  5414. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  5415. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  5416. HTT_RX_IND_REL_SEQ_NUM_START_S)
  5417. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  5418. do { \
  5419. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  5420. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  5421. } while (0)
  5422. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  5423. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  5424. HTT_RX_IND_REL_SEQ_NUM_END_S)
  5425. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  5426. do { \
  5427. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  5428. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  5429. } while (0)
  5430. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  5431. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  5432. HTT_RX_IND_NUM_MPDU_RANGES_S)
  5433. /* FW rx PPDU descriptor fields */
  5434. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  5435. do { \
  5436. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  5437. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  5438. } while (0)
  5439. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  5440. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  5441. HTT_RX_IND_RSSI_CMB_S)
  5442. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  5443. do { \
  5444. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  5445. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  5446. } while (0)
  5447. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  5448. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  5449. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  5450. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  5451. do { \
  5452. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  5453. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  5454. } while (0)
  5455. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  5456. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  5457. HTT_RX_IND_PHY_ERR_CODE_S)
  5458. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  5459. do { \
  5460. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  5461. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  5462. } while (0)
  5463. #define HTT_RX_IND_PHY_ERR_GET(word) \
  5464. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  5465. HTT_RX_IND_PHY_ERR_S)
  5466. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  5467. do { \
  5468. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  5469. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  5470. } while (0)
  5471. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  5472. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  5473. HTT_RX_IND_LEGACY_RATE_S)
  5474. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  5475. do { \
  5476. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  5477. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  5478. } while (0)
  5479. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  5480. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  5481. HTT_RX_IND_LEGACY_RATE_SEL_S)
  5482. #define HTT_RX_IND_END_VALID_SET(word, value) \
  5483. do { \
  5484. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  5485. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  5486. } while (0)
  5487. #define HTT_RX_IND_END_VALID_GET(word) \
  5488. (((word) & HTT_RX_IND_END_VALID_M) >> \
  5489. HTT_RX_IND_END_VALID_S)
  5490. #define HTT_RX_IND_START_VALID_SET(word, value) \
  5491. do { \
  5492. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  5493. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  5494. } while (0)
  5495. #define HTT_RX_IND_START_VALID_GET(word) \
  5496. (((word) & HTT_RX_IND_START_VALID_M) >> \
  5497. HTT_RX_IND_START_VALID_S)
  5498. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  5499. do { \
  5500. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  5501. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  5502. } while (0)
  5503. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  5504. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  5505. HTT_RX_IND_RSSI_PRI20_S)
  5506. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  5507. do { \
  5508. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  5509. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  5510. } while (0)
  5511. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  5512. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  5513. HTT_RX_IND_RSSI_EXT20_S)
  5514. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  5515. do { \
  5516. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  5517. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  5518. } while (0)
  5519. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  5520. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  5521. HTT_RX_IND_RSSI_EXT40_S)
  5522. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  5523. do { \
  5524. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  5525. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  5526. } while (0)
  5527. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  5528. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  5529. HTT_RX_IND_RSSI_EXT80_S)
  5530. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  5531. do { \
  5532. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  5533. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  5534. } while (0)
  5535. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  5536. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  5537. HTT_RX_IND_VHT_SIG_A1_S)
  5538. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  5539. do { \
  5540. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  5541. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  5542. } while (0)
  5543. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  5544. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  5545. HTT_RX_IND_VHT_SIG_A2_S)
  5546. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  5547. do { \
  5548. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  5549. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  5550. } while (0)
  5551. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  5552. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  5553. HTT_RX_IND_PREAMBLE_TYPE_S)
  5554. #define HTT_RX_IND_SERVICE_SET(word, value) \
  5555. do { \
  5556. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  5557. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  5558. } while (0)
  5559. #define HTT_RX_IND_SERVICE_GET(word) \
  5560. (((word) & HTT_RX_IND_SERVICE_M) >> \
  5561. HTT_RX_IND_SERVICE_S)
  5562. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  5563. do { \
  5564. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  5565. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  5566. } while (0)
  5567. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  5568. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  5569. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  5570. do { \
  5571. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  5572. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  5573. } while (0)
  5574. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  5575. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  5576. #define HTT_RX_IND_HL_BYTES \
  5577. (HTT_RX_IND_HDR_BYTES + \
  5578. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  5579. 4 /* single MPDU range information element */)
  5580. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  5581. /* Could we use one macro entry? */
  5582. #define HTT_WORD_SET(word, field, value) \
  5583. do { \
  5584. HTT_CHECK_SET_VAL(field, value); \
  5585. (word) |= ((value) << field ## _S); \
  5586. } while (0)
  5587. #define HTT_WORD_GET(word, field) \
  5588. (((word) & field ## _M) >> field ## _S)
  5589. PREPACK struct hl_htt_rx_ind_base {
  5590. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  5591. } POSTPACK;
  5592. /*
  5593. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  5594. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  5595. * HL host needed info. The field is just after the msdu fw rx desc.
  5596. */
  5597. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  5598. struct htt_rx_ind_hl_rx_desc_t {
  5599. A_UINT8 ver;
  5600. A_UINT8 len;
  5601. struct {
  5602. A_UINT8
  5603. first_msdu: 1,
  5604. last_msdu: 1,
  5605. c3_failed: 1,
  5606. c4_failed: 1,
  5607. ipv6: 1,
  5608. tcp: 1,
  5609. udp: 1,
  5610. reserved: 1;
  5611. } flags;
  5612. };
  5613. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  5614. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  5615. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  5616. #define HTT_RX_IND_HL_RX_DESC_VER 0
  5617. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  5618. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  5619. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  5620. #define HTT_RX_IND_HL_FLAG_OFFSET \
  5621. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  5622. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  5623. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  5624. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  5625. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  5626. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  5627. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  5628. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  5629. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  5630. /* This structure is used in HL, the basic descriptor information
  5631. * used by host. the structure is translated by FW from HW desc
  5632. * or generated by FW. But in HL monitor mode, the host would use
  5633. * the same structure with LL.
  5634. */
  5635. PREPACK struct hl_htt_rx_desc_base {
  5636. A_UINT32
  5637. seq_num:12,
  5638. encrypted:1,
  5639. chan_info_present:1,
  5640. resv0:2,
  5641. mcast_bcast:1,
  5642. fragment:1,
  5643. key_id_oct:8,
  5644. resv1:6;
  5645. A_UINT32
  5646. pn_31_0;
  5647. union {
  5648. struct {
  5649. A_UINT16 pn_47_32;
  5650. A_UINT16 pn_63_48;
  5651. } pn16;
  5652. A_UINT32 pn_63_32;
  5653. } u0;
  5654. A_UINT32
  5655. pn_95_64;
  5656. A_UINT32
  5657. pn_127_96;
  5658. } POSTPACK;
  5659. /*
  5660. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  5661. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  5662. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  5663. * Please see htt_chan_change_t for description of the fields.
  5664. */
  5665. PREPACK struct htt_chan_info_t
  5666. {
  5667. A_UINT32 primary_chan_center_freq_mhz: 16,
  5668. contig_chan1_center_freq_mhz: 16;
  5669. A_UINT32 contig_chan2_center_freq_mhz: 16,
  5670. phy_mode: 8,
  5671. reserved: 8;
  5672. } POSTPACK;
  5673. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  5674. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  5675. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  5676. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  5677. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  5678. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  5679. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  5680. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  5681. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  5682. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  5683. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  5684. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  5685. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  5686. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  5687. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  5688. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  5689. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  5690. /* Channel information */
  5691. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  5692. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  5693. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  5694. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  5695. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  5696. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  5697. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  5698. #define HTT_CHAN_INFO_PHY_MODE_S 16
  5699. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  5700. do { \
  5701. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  5702. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  5703. } while (0)
  5704. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  5705. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  5706. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  5707. do { \
  5708. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  5709. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  5710. } while (0)
  5711. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  5712. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  5713. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  5714. do { \
  5715. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  5716. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  5717. } while (0)
  5718. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  5719. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  5720. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  5721. do { \
  5722. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  5723. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  5724. } while (0)
  5725. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  5726. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  5727. /*
  5728. * @brief target -> host rx reorder flush message definition
  5729. *
  5730. * @details
  5731. * The following field definitions describe the format of the rx flush
  5732. * message sent from the target to the host.
  5733. * The message consists of a 4-octet header, followed by one or more
  5734. * 4-octet payload information elements.
  5735. *
  5736. * |31 24|23 8|7 0|
  5737. * |--------------------------------------------------------------|
  5738. * | TID | peer ID | msg type |
  5739. * |--------------------------------------------------------------|
  5740. * | seq num end | seq num start | MPDU status | reserved |
  5741. * |--------------------------------------------------------------|
  5742. * First DWORD:
  5743. * - MSG_TYPE
  5744. * Bits 7:0
  5745. * Purpose: identifies this as an rx flush message
  5746. * Value: 0x2
  5747. * - PEER_ID
  5748. * Bits 23:8 (only bits 18:8 actually used)
  5749. * Purpose: identify which peer's rx data is being flushed
  5750. * Value: (rx) peer ID
  5751. * - TID
  5752. * Bits 31:24 (only bits 27:24 actually used)
  5753. * Purpose: Specifies which traffic identifier's rx data is being flushed
  5754. * Value: traffic identifier
  5755. * Second DWORD:
  5756. * - MPDU_STATUS
  5757. * Bits 15:8
  5758. * Purpose:
  5759. * Indicate whether the flushed MPDUs should be discarded or processed.
  5760. * Value:
  5761. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  5762. * stages of rx processing
  5763. * other: discard the MPDUs
  5764. * It is anticipated that flush messages will always have
  5765. * MPDU status == 1, but the status flag is included for
  5766. * flexibility.
  5767. * - SEQ_NUM_START
  5768. * Bits 23:16
  5769. * Purpose:
  5770. * Indicate the start of a series of consecutive MPDUs being flushed.
  5771. * Not all MPDUs within this range are necessarily valid - the host
  5772. * must check each sequence number within this range to see if the
  5773. * corresponding MPDU is actually present.
  5774. * Value:
  5775. * The sequence number for the first MPDU in the sequence.
  5776. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  5777. * - SEQ_NUM_END
  5778. * Bits 30:24
  5779. * Purpose:
  5780. * Indicate the end of a series of consecutive MPDUs being flushed.
  5781. * Value:
  5782. * The sequence number one larger than the sequence number of the
  5783. * last MPDU being flushed.
  5784. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  5785. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  5786. * are to be released for further rx processing.
  5787. * Not all MPDUs within this range are necessarily valid - the host
  5788. * must check each sequence number within this range to see if the
  5789. * corresponding MPDU is actually present.
  5790. */
  5791. /* first DWORD */
  5792. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  5793. #define HTT_RX_FLUSH_PEER_ID_S 8
  5794. #define HTT_RX_FLUSH_TID_M 0xff000000
  5795. #define HTT_RX_FLUSH_TID_S 24
  5796. /* second DWORD */
  5797. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  5798. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  5799. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  5800. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  5801. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  5802. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  5803. #define HTT_RX_FLUSH_BYTES 8
  5804. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  5805. do { \
  5806. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  5807. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  5808. } while (0)
  5809. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  5810. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  5811. #define HTT_RX_FLUSH_TID_SET(word, value) \
  5812. do { \
  5813. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  5814. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  5815. } while (0)
  5816. #define HTT_RX_FLUSH_TID_GET(word) \
  5817. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  5818. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  5819. do { \
  5820. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  5821. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  5822. } while (0)
  5823. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  5824. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  5825. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  5826. do { \
  5827. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  5828. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  5829. } while (0)
  5830. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  5831. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  5832. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  5833. do { \
  5834. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  5835. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  5836. } while (0)
  5837. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  5838. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  5839. /*
  5840. * @brief target -> host rx pn check indication message
  5841. *
  5842. * @details
  5843. * The following field definitions describe the format of the Rx PN check
  5844. * indication message sent from the target to the host.
  5845. * The message consists of a 4-octet header, followed by the start and
  5846. * end sequence numbers to be released, followed by the PN IEs. Each PN
  5847. * IE is one octet containing the sequence number that failed the PN
  5848. * check.
  5849. *
  5850. * |31 24|23 8|7 0|
  5851. * |--------------------------------------------------------------|
  5852. * | TID | peer ID | msg type |
  5853. * |--------------------------------------------------------------|
  5854. * | Reserved | PN IE count | seq num end | seq num start|
  5855. * |--------------------------------------------------------------|
  5856. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  5857. * |--------------------------------------------------------------|
  5858. * First DWORD:
  5859. * - MSG_TYPE
  5860. * Bits 7:0
  5861. * Purpose: Identifies this as an rx pn check indication message
  5862. * Value: 0x2
  5863. * - PEER_ID
  5864. * Bits 23:8 (only bits 18:8 actually used)
  5865. * Purpose: identify which peer
  5866. * Value: (rx) peer ID
  5867. * - TID
  5868. * Bits 31:24 (only bits 27:24 actually used)
  5869. * Purpose: identify traffic identifier
  5870. * Value: traffic identifier
  5871. * Second DWORD:
  5872. * - SEQ_NUM_START
  5873. * Bits 7:0
  5874. * Purpose:
  5875. * Indicates the starting sequence number of the MPDU in this
  5876. * series of MPDUs that went though PN check.
  5877. * Value:
  5878. * The sequence number for the first MPDU in the sequence.
  5879. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  5880. * - SEQ_NUM_END
  5881. * Bits 15:8
  5882. * Purpose:
  5883. * Indicates the ending sequence number of the MPDU in this
  5884. * series of MPDUs that went though PN check.
  5885. * Value:
  5886. * The sequence number one larger then the sequence number of the last
  5887. * MPDU being flushed.
  5888. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  5889. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  5890. * for invalid PN numbers and are ready to be released for further processing.
  5891. * Not all MPDUs within this range are necessarily valid - the host
  5892. * must check each sequence number within this range to see if the
  5893. * corresponding MPDU is actually present.
  5894. * - PN_IE_COUNT
  5895. * Bits 23:16
  5896. * Purpose:
  5897. * Used to determine the variable number of PN information elements in this
  5898. * message
  5899. *
  5900. * PN information elements:
  5901. * - PN_IE_x-
  5902. * Purpose:
  5903. * Each PN information element contains the sequence number of the MPDU that
  5904. * has failed the target PN check.
  5905. * Value:
  5906. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  5907. * that failed the PN check.
  5908. */
  5909. /* first DWORD */
  5910. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  5911. #define HTT_RX_PN_IND_PEER_ID_S 8
  5912. #define HTT_RX_PN_IND_TID_M 0xff000000
  5913. #define HTT_RX_PN_IND_TID_S 24
  5914. /* second DWORD */
  5915. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  5916. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  5917. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  5918. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  5919. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  5920. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  5921. #define HTT_RX_PN_IND_BYTES 8
  5922. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  5923. do { \
  5924. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  5925. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  5926. } while (0)
  5927. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  5928. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  5929. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  5930. do { \
  5931. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  5932. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  5933. } while (0)
  5934. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  5935. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  5936. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  5937. do { \
  5938. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  5939. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  5940. } while (0)
  5941. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  5942. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  5943. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  5944. do { \
  5945. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  5946. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  5947. } while (0)
  5948. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  5949. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  5950. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  5951. do { \
  5952. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  5953. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  5954. } while (0)
  5955. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  5956. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  5957. /*
  5958. * @brief target -> host rx offload deliver message for LL system
  5959. *
  5960. * @details
  5961. * In a low latency system this message is sent whenever the offload
  5962. * manager flushes out the packets it has coalesced in its coalescing buffer.
  5963. * The DMA of the actual packets into host memory is done before sending out
  5964. * this message. This message indicates only how many MSDUs to reap. The
  5965. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  5966. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  5967. * DMA'd by the MAC directly into host memory these packets do not contain
  5968. * the MAC descriptors in the header portion of the packet. Instead they contain
  5969. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  5970. * message, the packets are delivered directly to the NW stack without going
  5971. * through the regular reorder buffering and PN checking path since it has
  5972. * already been done in target.
  5973. *
  5974. * |31 24|23 16|15 8|7 0|
  5975. * |-----------------------------------------------------------------------|
  5976. * | Total MSDU count | reserved | msg type |
  5977. * |-----------------------------------------------------------------------|
  5978. *
  5979. * @brief target -> host rx offload deliver message for HL system
  5980. *
  5981. * @details
  5982. * In a high latency system this message is sent whenever the offload manager
  5983. * flushes out the packets it has coalesced in its coalescing buffer. The
  5984. * actual packets are also carried along with this message. When the host
  5985. * receives this message, it is expected to deliver these packets to the NW
  5986. * stack directly instead of routing them through the reorder buffering and
  5987. * PN checking path since it has already been done in target.
  5988. *
  5989. * |31 24|23 16|15 8|7 0|
  5990. * |-----------------------------------------------------------------------|
  5991. * | Total MSDU count | reserved | msg type |
  5992. * |-----------------------------------------------------------------------|
  5993. * | peer ID | MSDU length |
  5994. * |-----------------------------------------------------------------------|
  5995. * | MSDU payload | FW Desc | tid | vdev ID |
  5996. * |-----------------------------------------------------------------------|
  5997. * | MSDU payload contd. |
  5998. * |-----------------------------------------------------------------------|
  5999. * | peer ID | MSDU length |
  6000. * |-----------------------------------------------------------------------|
  6001. * | MSDU payload | FW Desc | tid | vdev ID |
  6002. * |-----------------------------------------------------------------------|
  6003. * | MSDU payload contd. |
  6004. * |-----------------------------------------------------------------------|
  6005. *
  6006. */
  6007. /* first DWORD */
  6008. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6009. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6010. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6011. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6012. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6013. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6014. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6015. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6016. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6017. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6018. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6019. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6020. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6021. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6022. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6023. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6024. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6025. do { \
  6026. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6027. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6028. } while (0)
  6029. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6030. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6031. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6032. do { \
  6033. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6034. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6035. } while (0)
  6036. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6037. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6038. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6039. do { \
  6040. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6041. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6042. } while (0)
  6043. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6044. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6045. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6046. do { \
  6047. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6048. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6049. } while (0)
  6050. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6051. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6052. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6053. do { \
  6054. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6055. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6056. } while (0)
  6057. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6058. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6059. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6060. do { \
  6061. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6062. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6063. } while (0)
  6064. /**
  6065. * @brief target -> host rx peer map/unmap message definition
  6066. *
  6067. * @details
  6068. * The following diagram shows the format of the rx peer map message sent
  6069. * from the target to the host. This layout assumes the target operates
  6070. * as little-endian.
  6071. *
  6072. * |31 24|23 16|15 8|7 0|
  6073. * |-----------------------------------------------------------------------|
  6074. * | peer ID | VDEV ID | msg type |
  6075. * |-----------------------------------------------------------------------|
  6076. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6077. * |-----------------------------------------------------------------------|
  6078. * | reserved | MAC addr 5 | MAC addr 4 |
  6079. * |-----------------------------------------------------------------------|
  6080. *
  6081. *
  6082. * The following diagram shows the format of the rx peer unmap message sent
  6083. * from the target to the host.
  6084. *
  6085. * |31 24|23 16|15 8|7 0|
  6086. * |-----------------------------------------------------------------------|
  6087. * | peer ID | VDEV ID | msg type |
  6088. * |-----------------------------------------------------------------------|
  6089. *
  6090. * The following field definitions describe the format of the rx peer map
  6091. * and peer unmap messages sent from the target to the host.
  6092. * - MSG_TYPE
  6093. * Bits 7:0
  6094. * Purpose: identifies this as an rx peer map or peer unmap message
  6095. * Value: peer map -> 0x3, peer unmap -> 0x4
  6096. * - VDEV_ID
  6097. * Bits 15:8
  6098. * Purpose: Indicates which virtual device the peer is associated
  6099. * with.
  6100. * Value: vdev ID (used in the host to look up the vdev object)
  6101. * - PEER_ID
  6102. * Bits 31:16
  6103. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6104. * freeing (unmap)
  6105. * Value: (rx) peer ID
  6106. * - MAC_ADDR_L32 (peer map only)
  6107. * Bits 31:0
  6108. * Purpose: Identifies which peer node the peer ID is for.
  6109. * Value: lower 4 bytes of peer node's MAC address
  6110. * - MAC_ADDR_U16 (peer map only)
  6111. * Bits 15:0
  6112. * Purpose: Identifies which peer node the peer ID is for.
  6113. * Value: upper 2 bytes of peer node's MAC address
  6114. */
  6115. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6116. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6117. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6118. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6119. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6120. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6121. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6122. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6123. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6124. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6125. do { \
  6126. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6127. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6128. } while (0)
  6129. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6130. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6131. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6132. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6133. do { \
  6134. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6135. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6136. } while (0)
  6137. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6138. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6139. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6140. #define HTT_RX_PEER_MAP_BYTES 12
  6141. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6142. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6143. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6144. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6145. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6146. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6147. #define HTT_RX_PEER_UNMAP_BYTES 4
  6148. /**
  6149. * @brief target -> host message specifying security parameters
  6150. *
  6151. * @details
  6152. * The following diagram shows the format of the security specification
  6153. * message sent from the target to the host.
  6154. * This security specification message tells the host whether a PN check is
  6155. * necessary on rx data frames, and if so, how large the PN counter is.
  6156. * This message also tells the host about the security processing to apply
  6157. * to defragmented rx frames - specifically, whether a Message Integrity
  6158. * Check is required, and the Michael key to use.
  6159. *
  6160. * |31 24|23 16|15|14 8|7 0|
  6161. * |-----------------------------------------------------------------------|
  6162. * | peer ID | U| security type | msg type |
  6163. * |-----------------------------------------------------------------------|
  6164. * | Michael Key K0 |
  6165. * |-----------------------------------------------------------------------|
  6166. * | Michael Key K1 |
  6167. * |-----------------------------------------------------------------------|
  6168. * | WAPI RSC Low0 |
  6169. * |-----------------------------------------------------------------------|
  6170. * | WAPI RSC Low1 |
  6171. * |-----------------------------------------------------------------------|
  6172. * | WAPI RSC Hi0 |
  6173. * |-----------------------------------------------------------------------|
  6174. * | WAPI RSC Hi1 |
  6175. * |-----------------------------------------------------------------------|
  6176. *
  6177. * The following field definitions describe the format of the security
  6178. * indication message sent from the target to the host.
  6179. * - MSG_TYPE
  6180. * Bits 7:0
  6181. * Purpose: identifies this as a security specification message
  6182. * Value: 0xb
  6183. * - SEC_TYPE
  6184. * Bits 14:8
  6185. * Purpose: specifies which type of security applies to the peer
  6186. * Value: htt_sec_type enum value
  6187. * - UNICAST
  6188. * Bit 15
  6189. * Purpose: whether this security is applied to unicast or multicast data
  6190. * Value: 1 -> unicast, 0 -> multicast
  6191. * - PEER_ID
  6192. * Bits 31:16
  6193. * Purpose: The ID number for the peer the security specification is for
  6194. * Value: peer ID
  6195. * - MICHAEL_KEY_K0
  6196. * Bits 31:0
  6197. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  6198. * Value: Michael Key K0 (if security type is TKIP)
  6199. * - MICHAEL_KEY_K1
  6200. * Bits 31:0
  6201. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  6202. * Value: Michael Key K1 (if security type is TKIP)
  6203. * - WAPI_RSC_LOW0
  6204. * Bits 31:0
  6205. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  6206. * Value: WAPI RSC Low0 (if security type is WAPI)
  6207. * - WAPI_RSC_LOW1
  6208. * Bits 31:0
  6209. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  6210. * Value: WAPI RSC Low1 (if security type is WAPI)
  6211. * - WAPI_RSC_HI0
  6212. * Bits 31:0
  6213. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  6214. * Value: WAPI RSC Hi0 (if security type is WAPI)
  6215. * - WAPI_RSC_HI1
  6216. * Bits 31:0
  6217. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  6218. * Value: WAPI RSC Hi1 (if security type is WAPI)
  6219. */
  6220. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  6221. #define HTT_SEC_IND_SEC_TYPE_S 8
  6222. #define HTT_SEC_IND_UNICAST_M 0x00008000
  6223. #define HTT_SEC_IND_UNICAST_S 15
  6224. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  6225. #define HTT_SEC_IND_PEER_ID_S 16
  6226. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  6227. do { \
  6228. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  6229. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  6230. } while (0)
  6231. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  6232. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  6233. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  6234. do { \
  6235. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  6236. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  6237. } while (0)
  6238. #define HTT_SEC_IND_UNICAST_GET(word) \
  6239. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  6240. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  6241. do { \
  6242. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  6243. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  6244. } while (0)
  6245. #define HTT_SEC_IND_PEER_ID_GET(word) \
  6246. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  6247. #define HTT_SEC_IND_BYTES 28
  6248. /**
  6249. * @brief target -> host rx ADDBA / DELBA message definitions
  6250. *
  6251. * @details
  6252. * The following diagram shows the format of the rx ADDBA message sent
  6253. * from the target to the host:
  6254. *
  6255. * |31 20|19 16|15 8|7 0|
  6256. * |---------------------------------------------------------------------|
  6257. * | peer ID | TID | window size | msg type |
  6258. * |---------------------------------------------------------------------|
  6259. *
  6260. * The following diagram shows the format of the rx DELBA message sent
  6261. * from the target to the host:
  6262. *
  6263. * |31 20|19 16|15 8|7 0|
  6264. * |---------------------------------------------------------------------|
  6265. * | peer ID | TID | reserved | msg type |
  6266. * |---------------------------------------------------------------------|
  6267. *
  6268. * The following field definitions describe the format of the rx ADDBA
  6269. * and DELBA messages sent from the target to the host.
  6270. * - MSG_TYPE
  6271. * Bits 7:0
  6272. * Purpose: identifies this as an rx ADDBA or DELBA message
  6273. * Value: ADDBA -> 0x5, DELBA -> 0x6
  6274. * - WIN_SIZE
  6275. * Bits 15:8 (ADDBA only)
  6276. * Purpose: Specifies the length of the block ack window (max = 64).
  6277. * Value:
  6278. * block ack window length specified by the received ADDBA
  6279. * management message.
  6280. * - TID
  6281. * Bits 19:16
  6282. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  6283. * Value:
  6284. * TID specified by the received ADDBA or DELBA management message.
  6285. * - PEER_ID
  6286. * Bits 31:20
  6287. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  6288. * Value:
  6289. * ID (hash value) used by the host for fast, direct lookup of
  6290. * host SW peer info, including rx reorder states.
  6291. */
  6292. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  6293. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  6294. #define HTT_RX_ADDBA_TID_M 0xf0000
  6295. #define HTT_RX_ADDBA_TID_S 16
  6296. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  6297. #define HTT_RX_ADDBA_PEER_ID_S 20
  6298. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  6299. do { \
  6300. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  6301. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  6302. } while (0)
  6303. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  6304. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  6305. #define HTT_RX_ADDBA_TID_SET(word, value) \
  6306. do { \
  6307. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  6308. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  6309. } while (0)
  6310. #define HTT_RX_ADDBA_TID_GET(word) \
  6311. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  6312. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  6313. do { \
  6314. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  6315. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  6316. } while (0)
  6317. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  6318. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  6319. #define HTT_RX_ADDBA_BYTES 4
  6320. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  6321. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  6322. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  6323. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  6324. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  6325. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  6326. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  6327. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  6328. #define HTT_RX_DELBA_BYTES 4
  6329. /**
  6330. * @brief tx queue group information element definition
  6331. *
  6332. * @details
  6333. * The following diagram shows the format of the tx queue group
  6334. * information element, which can be included in target --> host
  6335. * messages to specify the number of tx "credits" (tx descriptors
  6336. * for LL, or tx buffers for HL) available to a particular group
  6337. * of host-side tx queues, and which host-side tx queues belong to
  6338. * the group.
  6339. *
  6340. * |31|30 24|23 16|15|14|13 0|
  6341. * |------------------------------------------------------------------------|
  6342. * | X| reserved | tx queue grp ID | A| S| credit count |
  6343. * |------------------------------------------------------------------------|
  6344. * | vdev ID mask | AC mask |
  6345. * |------------------------------------------------------------------------|
  6346. *
  6347. * The following definitions describe the fields within the tx queue group
  6348. * information element:
  6349. * - credit_count
  6350. * Bits 13:1
  6351. * Purpose: specify how many tx credits are available to the tx queue group
  6352. * Value: An absolute or relative, positive or negative credit value
  6353. * The 'A' bit specifies whether the value is absolute or relative.
  6354. * The 'S' bit specifies whether the value is positive or negative.
  6355. * A negative value can only be relative, not absolute.
  6356. * An absolute value replaces any prior credit value the host has for
  6357. * the tx queue group in question.
  6358. * A relative value is added to the prior credit value the host has for
  6359. * the tx queue group in question.
  6360. * - sign
  6361. * Bit 14
  6362. * Purpose: specify whether the credit count is positive or negative
  6363. * Value: 0 -> positive, 1 -> negative
  6364. * - absolute
  6365. * Bit 15
  6366. * Purpose: specify whether the credit count is absolute or relative
  6367. * Value: 0 -> relative, 1 -> absolute
  6368. * - txq_group_id
  6369. * Bits 23:16
  6370. * Purpose: indicate which tx queue group's credit and/or membership are
  6371. * being specified
  6372. * Value: 0 to max_tx_queue_groups-1
  6373. * - reserved
  6374. * Bits 30:16
  6375. * Value: 0x0
  6376. * - eXtension
  6377. * Bit 31
  6378. * Purpose: specify whether another tx queue group info element follows
  6379. * Value: 0 -> no more tx queue group information elements
  6380. * 1 -> another tx queue group information element immediately follows
  6381. * - ac_mask
  6382. * Bits 15:0
  6383. * Purpose: specify which Access Categories belong to the tx queue group
  6384. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  6385. * the tx queue group.
  6386. * The AC bit-mask values are obtained by left-shifting by the
  6387. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  6388. * - vdev_id_mask
  6389. * Bits 31:16
  6390. * Purpose: specify which vdev's tx queues belong to the tx queue group
  6391. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  6392. * belong to the tx queue group.
  6393. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  6394. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  6395. */
  6396. PREPACK struct htt_txq_group {
  6397. A_UINT32
  6398. credit_count: 14,
  6399. sign: 1,
  6400. absolute: 1,
  6401. tx_queue_group_id: 8,
  6402. reserved0: 7,
  6403. extension: 1;
  6404. A_UINT32
  6405. ac_mask: 16,
  6406. vdev_id_mask: 16;
  6407. } POSTPACK;
  6408. /* first word */
  6409. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  6410. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  6411. #define HTT_TXQ_GROUP_SIGN_S 14
  6412. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  6413. #define HTT_TXQ_GROUP_ABS_S 15
  6414. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  6415. #define HTT_TXQ_GROUP_ID_S 16
  6416. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  6417. #define HTT_TXQ_GROUP_EXT_S 31
  6418. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  6419. /* second word */
  6420. #define HTT_TXQ_GROUP_AC_MASK_S 0
  6421. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  6422. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  6423. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  6424. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  6425. do { \
  6426. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  6427. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  6428. } while (0)
  6429. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  6430. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  6431. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  6432. do { \
  6433. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  6434. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  6435. } while (0)
  6436. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  6437. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  6438. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  6439. do { \
  6440. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  6441. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  6442. } while (0)
  6443. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  6444. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  6445. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  6446. do { \
  6447. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  6448. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  6449. } while (0)
  6450. #define HTT_TXQ_GROUP_ID_GET(_info) \
  6451. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  6452. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  6453. do { \
  6454. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  6455. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  6456. } while (0)
  6457. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  6458. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  6459. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  6460. do { \
  6461. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  6462. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  6463. } while (0)
  6464. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  6465. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  6466. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  6467. do { \
  6468. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  6469. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  6470. } while (0)
  6471. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  6472. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  6473. /**
  6474. * @brief target -> host TX completion indication message definition
  6475. *
  6476. * @details
  6477. * The following diagram shows the format of the TX completion indication sent
  6478. * from the target to the host
  6479. *
  6480. * |31 25| 24|23 16| 15 |14 11|10 8|7 0|
  6481. * |-------------------------------------------------------------|
  6482. * header: | reserved |append| num | t_i| tid |status| msg_type |
  6483. * |-------------------------------------------------------------|
  6484. * payload: | MSDU1 ID | MSDU0 ID |
  6485. * |-------------------------------------------------------------|
  6486. * : MSDU3 ID : MSDU2 ID :
  6487. * |-------------------------------------------------------------|
  6488. * | struct htt_tx_compl_ind_append_retries |
  6489. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  6490. *
  6491. * The following field definitions describe the format of the TX completion
  6492. * indication sent from the target to the host
  6493. * Header fields:
  6494. * - msg_type
  6495. * Bits 7:0
  6496. * Purpose: identifies this as HTT TX completion indication
  6497. * Value: 0x7
  6498. * - status
  6499. * Bits 10:8
  6500. * Purpose: the TX completion status of payload fragmentations descriptors
  6501. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  6502. * - tid
  6503. * Bits 14:11
  6504. * Purpose: the tid associated with those fragmentation descriptors. It is
  6505. * valid or not, depending on the tid_invalid bit.
  6506. * Value: 0 to 15
  6507. * - tid_invalid
  6508. * Bits 15:15
  6509. * Purpose: this bit indicates whether the tid field is valid or not
  6510. * Value: 0 indicates valid; 1 indicates invalid
  6511. * - num
  6512. * Bits 23:16
  6513. * Purpose: the number of payload in this indication
  6514. * Value: 1 to 255
  6515. * - append
  6516. * Bits 24:24
  6517. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  6518. * the number of tx retries for one MSDU at the end of this message
  6519. * Value: 0 indicates no appending; 1 indicates appending
  6520. * Payload fields:
  6521. * - hmsdu_id
  6522. * Bits 15:0
  6523. * Purpose: this ID is used to track the Tx buffer in host
  6524. * Value: 0 to "size of host MSDU descriptor pool - 1"
  6525. */
  6526. #define HTT_TX_COMPL_IND_STATUS_S 8
  6527. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  6528. #define HTT_TX_COMPL_IND_TID_S 11
  6529. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  6530. #define HTT_TX_COMPL_IND_TID_INV_S 15
  6531. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  6532. #define HTT_TX_COMPL_IND_NUM_S 16
  6533. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  6534. #define HTT_TX_COMPL_IND_APPEND_S 24
  6535. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  6536. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  6537. do { \
  6538. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  6539. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  6540. } while (0)
  6541. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  6542. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  6543. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  6544. do { \
  6545. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  6546. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  6547. } while (0)
  6548. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  6549. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  6550. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  6551. do { \
  6552. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  6553. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  6554. } while (0)
  6555. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  6556. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  6557. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  6558. do { \
  6559. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  6560. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  6561. } while (0)
  6562. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  6563. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  6564. HTT_TX_COMPL_IND_TID_INV_S)
  6565. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  6566. do { \
  6567. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  6568. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  6569. } while (0)
  6570. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  6571. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  6572. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  6573. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  6574. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  6575. #define HTT_TX_COMPL_IND_STAT_OK 0
  6576. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  6577. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  6578. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  6579. /*
  6580. * The PEER_DEL tx completion status is used for HL cases
  6581. * where the peer the frame is for has been deleted.
  6582. * The host has already discarded its copy of the frame, but
  6583. * it still needs the tx completion to restore its credit.
  6584. */
  6585. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  6586. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  6587. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  6588. PREPACK struct htt_tx_compl_ind_base {
  6589. A_UINT32 hdr;
  6590. A_UINT16 payload[1/*or more*/];
  6591. } POSTPACK;
  6592. PREPACK struct htt_tx_compl_ind_append_retries {
  6593. A_UINT16 msdu_id;
  6594. A_UINT8 tx_retries;
  6595. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  6596. 0: this is the last append_retries struct */
  6597. } POSTPACK;
  6598. /**
  6599. * @brief target -> host rate-control update indication message
  6600. *
  6601. * @details
  6602. * The following diagram shows the format of the RC Update message
  6603. * sent from the target to the host, while processing the tx-completion
  6604. * of a transmitted PPDU.
  6605. *
  6606. * |31 24|23 16|15 8|7 0|
  6607. * |-------------------------------------------------------------|
  6608. * | peer ID | vdev ID | msg_type |
  6609. * |-------------------------------------------------------------|
  6610. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6611. * |-------------------------------------------------------------|
  6612. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  6613. * |-------------------------------------------------------------|
  6614. * | : |
  6615. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  6616. * | : |
  6617. * |-------------------------------------------------------------|
  6618. * | : |
  6619. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  6620. * | : |
  6621. * |-------------------------------------------------------------|
  6622. * : :
  6623. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  6624. *
  6625. */
  6626. typedef struct {
  6627. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  6628. A_UINT32 rate_code_flags;
  6629. A_UINT32 flags; /* Encodes information such as excessive
  6630. retransmission, aggregate, some info
  6631. from .11 frame control,
  6632. STBC, LDPC, (SGI and Tx Chain Mask
  6633. are encoded in ptx_rc->flags field),
  6634. AMPDU truncation (BT/time based etc.),
  6635. RTS/CTS attempt */
  6636. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  6637. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  6638. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  6639. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  6640. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  6641. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  6642. } HTT_RC_TX_DONE_PARAMS;
  6643. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  6644. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  6645. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  6646. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  6647. #define HTT_RC_UPDATE_VDEVID_S 8
  6648. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  6649. #define HTT_RC_UPDATE_PEERID_S 16
  6650. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  6651. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  6652. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  6653. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  6654. do { \
  6655. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  6656. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  6657. } while (0)
  6658. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  6659. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  6660. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  6661. do { \
  6662. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  6663. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  6664. } while (0)
  6665. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  6666. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  6667. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  6668. do { \
  6669. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  6670. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  6671. } while (0)
  6672. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  6673. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  6674. /**
  6675. * @brief target -> host rx fragment indication message definition
  6676. *
  6677. * @details
  6678. * The following field definitions describe the format of the rx fragment
  6679. * indication message sent from the target to the host.
  6680. * The rx fragment indication message shares the format of the
  6681. * rx indication message, but not all fields from the rx indication message
  6682. * are relevant to the rx fragment indication message.
  6683. *
  6684. *
  6685. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  6686. * |-----------+-------------------+---------------------+-------------|
  6687. * | peer ID | |FV| ext TID | msg type |
  6688. * |-------------------------------------------------------------------|
  6689. * | | flush | flush |
  6690. * | | end | start |
  6691. * | | seq num | seq num |
  6692. * |-------------------------------------------------------------------|
  6693. * | reserved | FW rx desc bytes |
  6694. * |-------------------------------------------------------------------|
  6695. * | | FW MSDU Rx |
  6696. * | | desc B0 |
  6697. * |-------------------------------------------------------------------|
  6698. * Header fields:
  6699. * - MSG_TYPE
  6700. * Bits 7:0
  6701. * Purpose: identifies this as an rx fragment indication message
  6702. * Value: 0xa
  6703. * - EXT_TID
  6704. * Bits 12:8
  6705. * Purpose: identify the traffic ID of the rx data, including
  6706. * special "extended" TID values for multicast, broadcast, and
  6707. * non-QoS data frames
  6708. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  6709. * - FLUSH_VALID (FV)
  6710. * Bit 13
  6711. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  6712. * is valid
  6713. * Value:
  6714. * 1 -> flush IE is valid and needs to be processed
  6715. * 0 -> flush IE is not valid and should be ignored
  6716. * - PEER_ID
  6717. * Bits 31:16
  6718. * Purpose: Identify, by ID, which peer sent the rx data
  6719. * Value: ID of the peer who sent the rx data
  6720. * - FLUSH_SEQ_NUM_START
  6721. * Bits 5:0
  6722. * Purpose: Indicate the start of a series of MPDUs to flush
  6723. * Not all MPDUs within this series are necessarily valid - the host
  6724. * must check each sequence number within this range to see if the
  6725. * corresponding MPDU is actually present.
  6726. * This field is only valid if the FV bit is set.
  6727. * Value:
  6728. * The sequence number for the first MPDUs to check to flush.
  6729. * The sequence number is masked by 0x3f.
  6730. * - FLUSH_SEQ_NUM_END
  6731. * Bits 11:6
  6732. * Purpose: Indicate the end of a series of MPDUs to flush
  6733. * Value:
  6734. * The sequence number one larger than the sequence number of the
  6735. * last MPDU to check to flush.
  6736. * The sequence number is masked by 0x3f.
  6737. * Not all MPDUs within this series are necessarily valid - the host
  6738. * must check each sequence number within this range to see if the
  6739. * corresponding MPDU is actually present.
  6740. * This field is only valid if the FV bit is set.
  6741. * Rx descriptor fields:
  6742. * - FW_RX_DESC_BYTES
  6743. * Bits 15:0
  6744. * Purpose: Indicate how many bytes in the Rx indication are used for
  6745. * FW Rx descriptors
  6746. * Value: 1
  6747. */
  6748. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  6749. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  6750. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  6751. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  6752. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  6753. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  6754. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  6755. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  6756. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  6757. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  6758. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  6759. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  6760. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  6761. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  6762. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  6763. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  6764. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  6765. #define HTT_RX_FRAG_IND_BYTES \
  6766. (4 /* msg hdr */ + \
  6767. 4 /* flush spec */ + \
  6768. 4 /* (unused) FW rx desc bytes spec */ + \
  6769. 4 /* FW rx desc */)
  6770. /**
  6771. * @brief target -> host test message definition
  6772. *
  6773. * @details
  6774. * The following field definitions describe the format of the test
  6775. * message sent from the target to the host.
  6776. * The message consists of a 4-octet header, followed by a variable
  6777. * number of 32-bit integer values, followed by a variable number
  6778. * of 8-bit character values.
  6779. *
  6780. * |31 16|15 8|7 0|
  6781. * |-----------------------------------------------------------|
  6782. * | num chars | num ints | msg type |
  6783. * |-----------------------------------------------------------|
  6784. * | int 0 |
  6785. * |-----------------------------------------------------------|
  6786. * | int 1 |
  6787. * |-----------------------------------------------------------|
  6788. * | ... |
  6789. * |-----------------------------------------------------------|
  6790. * | char 3 | char 2 | char 1 | char 0 |
  6791. * |-----------------------------------------------------------|
  6792. * | | | ... | char 4 |
  6793. * |-----------------------------------------------------------|
  6794. * - MSG_TYPE
  6795. * Bits 7:0
  6796. * Purpose: identifies this as a test message
  6797. * Value: HTT_MSG_TYPE_TEST
  6798. * - NUM_INTS
  6799. * Bits 15:8
  6800. * Purpose: indicate how many 32-bit integers follow the message header
  6801. * - NUM_CHARS
  6802. * Bits 31:16
  6803. * Purpose: indicate how many 8-bit charaters follow the series of integers
  6804. */
  6805. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  6806. #define HTT_RX_TEST_NUM_INTS_S 8
  6807. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  6808. #define HTT_RX_TEST_NUM_CHARS_S 16
  6809. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  6810. do { \
  6811. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  6812. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  6813. } while (0)
  6814. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  6815. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  6816. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  6817. do { \
  6818. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  6819. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  6820. } while (0)
  6821. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  6822. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  6823. /**
  6824. * @brief target -> host packet log message
  6825. *
  6826. * @details
  6827. * The following field definitions describe the format of the packet log
  6828. * message sent from the target to the host.
  6829. * The message consists of a 4-octet header,followed by a variable number
  6830. * of 32-bit character values.
  6831. *
  6832. * |31 24|23 16|15 8|7 0|
  6833. * |-----------------------------------------------------------|
  6834. * | | | | msg type |
  6835. * |-----------------------------------------------------------|
  6836. * | payload |
  6837. * |-----------------------------------------------------------|
  6838. * - MSG_TYPE
  6839. * Bits 7:0
  6840. * Purpose: identifies this as a test message
  6841. * Value: HTT_MSG_TYPE_PACKETLOG
  6842. */
  6843. PREPACK struct htt_pktlog_msg {
  6844. A_UINT32 header;
  6845. A_UINT32 payload[1/* or more */];
  6846. } POSTPACK;
  6847. /*
  6848. * Rx reorder statistics
  6849. * NB: all the fields must be defined in 4 octets size.
  6850. */
  6851. struct rx_reorder_stats {
  6852. /* Non QoS MPDUs received */
  6853. A_UINT32 deliver_non_qos;
  6854. /* MPDUs received in-order */
  6855. A_UINT32 deliver_in_order;
  6856. /* Flush due to reorder timer expired */
  6857. A_UINT32 deliver_flush_timeout;
  6858. /* Flush due to move out of window */
  6859. A_UINT32 deliver_flush_oow;
  6860. /* Flush due to DELBA */
  6861. A_UINT32 deliver_flush_delba;
  6862. /* MPDUs dropped due to FCS error */
  6863. A_UINT32 fcs_error;
  6864. /* MPDUs dropped due to monitor mode non-data packet */
  6865. A_UINT32 mgmt_ctrl;
  6866. /* Unicast-data MPDUs dropped due to invalid peer */
  6867. A_UINT32 invalid_peer;
  6868. /* MPDUs dropped due to duplication (non aggregation) */
  6869. A_UINT32 dup_non_aggr;
  6870. /* MPDUs dropped due to processed before */
  6871. A_UINT32 dup_past;
  6872. /* MPDUs dropped due to duplicate in reorder queue */
  6873. A_UINT32 dup_in_reorder;
  6874. /* Reorder timeout happened */
  6875. A_UINT32 reorder_timeout;
  6876. /* invalid bar ssn */
  6877. A_UINT32 invalid_bar_ssn;
  6878. /* reorder reset due to bar ssn */
  6879. A_UINT32 ssn_reset;
  6880. /* Flush due to delete peer */
  6881. A_UINT32 deliver_flush_delpeer;
  6882. /* Flush due to offload*/
  6883. A_UINT32 deliver_flush_offload;
  6884. /* Flush due to out of buffer*/
  6885. A_UINT32 deliver_flush_oob;
  6886. /* MPDUs dropped due to PN check fail */
  6887. A_UINT32 pn_fail;
  6888. /* MPDUs dropped due to unable to allocate memory */
  6889. A_UINT32 store_fail;
  6890. /* Number of times the tid pool alloc succeeded */
  6891. A_UINT32 tid_pool_alloc_succ;
  6892. /* Number of times the MPDU pool alloc succeeded */
  6893. A_UINT32 mpdu_pool_alloc_succ;
  6894. /* Number of times the MSDU pool alloc succeeded */
  6895. A_UINT32 msdu_pool_alloc_succ;
  6896. /* Number of times the tid pool alloc failed */
  6897. A_UINT32 tid_pool_alloc_fail;
  6898. /* Number of times the MPDU pool alloc failed */
  6899. A_UINT32 mpdu_pool_alloc_fail;
  6900. /* Number of times the MSDU pool alloc failed */
  6901. A_UINT32 msdu_pool_alloc_fail;
  6902. /* Number of times the tid pool freed */
  6903. A_UINT32 tid_pool_free;
  6904. /* Number of times the MPDU pool freed */
  6905. A_UINT32 mpdu_pool_free;
  6906. /* Number of times the MSDU pool freed */
  6907. A_UINT32 msdu_pool_free;
  6908. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  6909. A_UINT32 msdu_queued;
  6910. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  6911. A_UINT32 msdu_recycled;
  6912. /* Number of MPDUs with invalid peer but A2 found in AST */
  6913. A_UINT32 invalid_peer_a2_in_ast;
  6914. /* Number of MPDUs with invalid peer but A3 found in AST */
  6915. A_UINT32 invalid_peer_a3_in_ast;
  6916. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  6917. A_UINT32 invalid_peer_bmc_mpdus;
  6918. /* Number of MSDUs with err attention word */
  6919. A_UINT32 rxdesc_err_att;
  6920. /* Number of MSDUs with flag of peer_idx_invalid */
  6921. A_UINT32 rxdesc_err_peer_idx_inv;
  6922. /* Number of MSDUs with flag of peer_idx_timeout */
  6923. A_UINT32 rxdesc_err_peer_idx_to;
  6924. /* Number of MSDUs with flag of overflow */
  6925. A_UINT32 rxdesc_err_ov;
  6926. /* Number of MSDUs with flag of msdu_length_err */
  6927. A_UINT32 rxdesc_err_msdu_len;
  6928. /* Number of MSDUs with flag of mpdu_length_err */
  6929. A_UINT32 rxdesc_err_mpdu_len;
  6930. /* Number of MSDUs with flag of tkip_mic_err */
  6931. A_UINT32 rxdesc_err_tkip_mic;
  6932. /* Number of MSDUs with flag of decrypt_err */
  6933. A_UINT32 rxdesc_err_decrypt;
  6934. /* Number of MSDUs with flag of fcs_err */
  6935. A_UINT32 rxdesc_err_fcs;
  6936. /* Number of Unicast (bc_mc bit is not set in attention word)
  6937. * frames with invalid peer handler
  6938. */
  6939. A_UINT32 rxdesc_uc_msdus_inv_peer;
  6940. /* Number of unicast frame directly (direct bit is set in attention word)
  6941. * to DUT with invalid peer handler
  6942. */
  6943. A_UINT32 rxdesc_direct_msdus_inv_peer;
  6944. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  6945. * frames with invalid peer handler
  6946. */
  6947. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  6948. /* Number of MSDUs dropped due to no first MSDU flag */
  6949. A_UINT32 rxdesc_no_1st_msdu;
  6950. /* Number of MSDUs droped due to ring overflow */
  6951. A_UINT32 msdu_drop_ring_ov;
  6952. /* Number of MSDUs dropped due to FC mismatch */
  6953. A_UINT32 msdu_drop_fc_mismatch;
  6954. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  6955. A_UINT32 msdu_drop_mgmt_remote_ring;
  6956. /* Number of MSDUs dropped due to errors not reported in attention word */
  6957. A_UINT32 msdu_drop_misc;
  6958. /* Number of MSDUs go to offload before reorder */
  6959. A_UINT32 offload_msdu_wal;
  6960. /* Number of data frame dropped by offload after reorder */
  6961. A_UINT32 offload_msdu_reorder;
  6962. /* Number of MPDUs with sequence number in the past and within the BA window */
  6963. A_UINT32 dup_past_within_window;
  6964. /* Number of MPDUs with sequence number in the past and outside the BA window */
  6965. A_UINT32 dup_past_outside_window;
  6966. /* Number of MSDUs with decrypt/MIC error */
  6967. A_UINT32 rxdesc_err_decrypt_mic;
  6968. /* Number of data MSDUs received on both local and remote rings */
  6969. A_UINT32 data_msdus_on_both_rings;
  6970. };
  6971. /*
  6972. * Rx Remote buffer statistics
  6973. * NB: all the fields must be defined in 4 octets size.
  6974. */
  6975. struct rx_remote_buffer_mgmt_stats {
  6976. /* Total number of MSDUs reaped for Rx processing */
  6977. A_UINT32 remote_reaped;
  6978. /* MSDUs recycled within firmware */
  6979. A_UINT32 remote_recycled;
  6980. /* MSDUs stored by Data Rx */
  6981. A_UINT32 data_rx_msdus_stored;
  6982. /* Number of HTT indications from WAL Rx MSDU */
  6983. A_UINT32 wal_rx_ind;
  6984. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  6985. A_UINT32 wal_rx_ind_unconsumed;
  6986. /* Number of HTT indications from Data Rx MSDU */
  6987. A_UINT32 data_rx_ind;
  6988. /* Number of unconsumed HTT indications from Data Rx MSDU */
  6989. A_UINT32 data_rx_ind_unconsumed;
  6990. /* Number of HTT indications from ATHBUF */
  6991. A_UINT32 athbuf_rx_ind;
  6992. /* Number of remote buffers requested for refill */
  6993. A_UINT32 refill_buf_req;
  6994. /* Number of remote buffers filled by the host */
  6995. A_UINT32 refill_buf_rsp;
  6996. /* Number of times MAC hw_index = f/w write_index */
  6997. A_INT32 mac_no_bufs;
  6998. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  6999. A_INT32 fw_indices_equal;
  7000. /* Number of times f/w finds no buffers to post */
  7001. A_INT32 host_no_bufs;
  7002. };
  7003. /*
  7004. * TXBF MU/SU packets and NDPA statistics
  7005. * NB: all the fields must be defined in 4 octets size.
  7006. */
  7007. struct rx_txbf_musu_ndpa_pkts_stats {
  7008. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  7009. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  7010. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  7011. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  7012. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  7013. A_UINT32 reserved[3]; /* must be set to 0x0 */
  7014. };
  7015. /*
  7016. * htt_dbg_stats_status -
  7017. * present - The requested stats have been delivered in full.
  7018. * This indicates that either the stats information was contained
  7019. * in its entirety within this message, or else this message
  7020. * completes the delivery of the requested stats info that was
  7021. * partially delivered through earlier STATS_CONF messages.
  7022. * partial - The requested stats have been delivered in part.
  7023. * One or more subsequent STATS_CONF messages with the same
  7024. * cookie value will be sent to deliver the remainder of the
  7025. * information.
  7026. * error - The requested stats could not be delivered, for example due
  7027. * to a shortage of memory to construct a message holding the
  7028. * requested stats.
  7029. * invalid - The requested stat type is either not recognized, or the
  7030. * target is configured to not gather the stats type in question.
  7031. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7032. * series_done - This special value indicates that no further stats info
  7033. * elements are present within a series of stats info elems
  7034. * (within a stats upload confirmation message).
  7035. */
  7036. enum htt_dbg_stats_status {
  7037. HTT_DBG_STATS_STATUS_PRESENT = 0,
  7038. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  7039. HTT_DBG_STATS_STATUS_ERROR = 2,
  7040. HTT_DBG_STATS_STATUS_INVALID = 3,
  7041. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  7042. };
  7043. /**
  7044. * @brief target -> host statistics upload
  7045. *
  7046. * @details
  7047. * The following field definitions describe the format of the HTT target
  7048. * to host stats upload confirmation message.
  7049. * The message contains a cookie echoed from the HTT host->target stats
  7050. * upload request, which identifies which request the confirmation is
  7051. * for, and a series of tag-length-value stats information elements.
  7052. * The tag-length header for each stats info element also includes a
  7053. * status field, to indicate whether the request for the stat type in
  7054. * question was fully met, partially met, unable to be met, or invalid
  7055. * (if the stat type in question is disabled in the target).
  7056. * A special value of all 1's in this status field is used to indicate
  7057. * the end of the series of stats info elements.
  7058. *
  7059. *
  7060. * |31 16|15 8|7 5|4 0|
  7061. * |------------------------------------------------------------|
  7062. * | reserved | msg type |
  7063. * |------------------------------------------------------------|
  7064. * | cookie LSBs |
  7065. * |------------------------------------------------------------|
  7066. * | cookie MSBs |
  7067. * |------------------------------------------------------------|
  7068. * | stats entry length | reserved | S |stat type|
  7069. * |------------------------------------------------------------|
  7070. * | |
  7071. * | type-specific stats info |
  7072. * | |
  7073. * |------------------------------------------------------------|
  7074. * | stats entry length | reserved | S |stat type|
  7075. * |------------------------------------------------------------|
  7076. * | |
  7077. * | type-specific stats info |
  7078. * | |
  7079. * |------------------------------------------------------------|
  7080. * | n/a | reserved | 111 | n/a |
  7081. * |------------------------------------------------------------|
  7082. * Header fields:
  7083. * - MSG_TYPE
  7084. * Bits 7:0
  7085. * Purpose: identifies this is a statistics upload confirmation message
  7086. * Value: 0x9
  7087. * - COOKIE_LSBS
  7088. * Bits 31:0
  7089. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7090. * message with its preceding host->target stats request message.
  7091. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7092. * - COOKIE_MSBS
  7093. * Bits 31:0
  7094. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7095. * message with its preceding host->target stats request message.
  7096. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7097. *
  7098. * Stats Information Element tag-length header fields:
  7099. * - STAT_TYPE
  7100. * Bits 4:0
  7101. * Purpose: identifies the type of statistics info held in the
  7102. * following information element
  7103. * Value: htt_dbg_stats_type
  7104. * - STATUS
  7105. * Bits 7:5
  7106. * Purpose: indicate whether the requested stats are present
  7107. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  7108. * the completion of the stats entry series
  7109. * - LENGTH
  7110. * Bits 31:16
  7111. * Purpose: indicate the stats information size
  7112. * Value: This field specifies the number of bytes of stats information
  7113. * that follows the element tag-length header.
  7114. * It is expected but not required that this length is a multiple of
  7115. * 4 bytes. Even if the length is not an integer multiple of 4, the
  7116. * subsequent stats entry header will begin on a 4-byte aligned
  7117. * boundary.
  7118. */
  7119. #define HTT_T2H_STATS_COOKIE_SIZE 8
  7120. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  7121. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  7122. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  7123. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  7124. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  7125. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  7126. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  7127. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  7128. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  7129. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  7130. do { \
  7131. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  7132. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  7133. } while (0)
  7134. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  7135. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  7136. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  7137. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  7138. do { \
  7139. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  7140. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  7141. } while (0)
  7142. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  7143. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  7144. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  7145. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  7146. do { \
  7147. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  7148. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  7149. } while (0)
  7150. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  7151. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  7152. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  7153. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  7154. #define HTT_MAX_AGGR 64
  7155. #define HTT_HL_MAX_AGGR 18
  7156. /**
  7157. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  7158. *
  7159. * @details
  7160. * The following field definitions describe the format of the HTT host
  7161. * to target frag_desc/msdu_ext bank configuration message.
  7162. * The message contains the based address and the min and max id of the
  7163. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  7164. * MSDU_EXT/FRAG_DESC.
  7165. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  7166. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  7167. * the hardware does the mapping/translation.
  7168. *
  7169. * Total banks that can be configured is configured to 16.
  7170. *
  7171. * This should be called before any TX has be initiated by the HTT
  7172. *
  7173. * |31 16|15 8|7 5|4 0|
  7174. * |------------------------------------------------------------|
  7175. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  7176. * |------------------------------------------------------------|
  7177. * | BANK0_BASE_ADDRESS (bits 31:0) |
  7178. #if HTT_PADDR64
  7179. * | BANK0_BASE_ADDRESS (bits 63:32) |
  7180. #endif
  7181. * |------------------------------------------------------------|
  7182. * | ... |
  7183. * |------------------------------------------------------------|
  7184. * | BANK15_BASE_ADDRESS (bits 31:0) |
  7185. #if HTT_PADDR64
  7186. * | BANK15_BASE_ADDRESS (bits 63:32) |
  7187. #endif
  7188. * |------------------------------------------------------------|
  7189. * | BANK0_MAX_ID | BANK0_MIN_ID |
  7190. * |------------------------------------------------------------|
  7191. * | ... |
  7192. * |------------------------------------------------------------|
  7193. * | BANK15_MAX_ID | BANK15_MIN_ID |
  7194. * |------------------------------------------------------------|
  7195. * Header fields:
  7196. * - MSG_TYPE
  7197. * Bits 7:0
  7198. * Value: 0x6
  7199. * for systems with 64-bit format for bus addresses:
  7200. * - BANKx_BASE_ADDRESS_LO
  7201. * Bits 31:0
  7202. * Purpose: Provide a mechanism to specify the base address of the
  7203. * MSDU_EXT bank physical/bus address.
  7204. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  7205. * - BANKx_BASE_ADDRESS_HI
  7206. * Bits 31:0
  7207. * Purpose: Provide a mechanism to specify the base address of the
  7208. * MSDU_EXT bank physical/bus address.
  7209. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  7210. * for systems with 32-bit format for bus addresses:
  7211. * - BANKx_BASE_ADDRESS
  7212. * Bits 31:0
  7213. * Purpose: Provide a mechanism to specify the base address of the
  7214. * MSDU_EXT bank physical/bus address.
  7215. * Value: MSDU_EXT bank physical / bus address
  7216. * - BANKx_MIN_ID
  7217. * Bits 15:0
  7218. * Purpose: Provide a mechanism to specify the min index that needs to
  7219. * mapped.
  7220. * - BANKx_MAX_ID
  7221. * Bits 31:16
  7222. * Purpose: Provide a mechanism to specify the max index that needs to
  7223. * mapped.
  7224. *
  7225. */
  7226. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  7227. * safe value.
  7228. * @note MAX supported banks is 16.
  7229. */
  7230. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  7231. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  7232. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  7233. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  7234. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  7235. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  7236. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  7237. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  7238. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  7239. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  7240. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  7241. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  7242. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  7243. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  7244. do { \
  7245. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  7246. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  7247. } while (0)
  7248. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  7249. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  7250. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  7251. do { \
  7252. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  7253. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  7254. } while (0)
  7255. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  7256. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  7257. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  7258. do { \
  7259. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  7260. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  7261. } while (0)
  7262. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  7263. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  7264. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  7265. do { \
  7266. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  7267. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  7268. } while (0)
  7269. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  7270. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  7271. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  7272. do { \
  7273. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  7274. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  7275. } while (0)
  7276. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  7277. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  7278. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  7279. do { \
  7280. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  7281. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  7282. } while (0)
  7283. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  7284. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  7285. /*
  7286. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  7287. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  7288. * addresses are stored in a XXX-bit field.
  7289. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  7290. * htt_tx_frag_desc64_bank_cfg_t structs.
  7291. */
  7292. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  7293. _paddr_bits_, \
  7294. _paddr__bank_base_address_) \
  7295. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  7296. /** word 0 \
  7297. * msg_type: 8, \
  7298. * pdev_id: 2, \
  7299. * swap: 1, \
  7300. * reserved0: 5, \
  7301. * num_banks: 8, \
  7302. * desc_size: 8; \
  7303. */ \
  7304. A_UINT32 word0; \
  7305. /* \
  7306. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  7307. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  7308. * the second A_UINT32). \
  7309. */ \
  7310. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  7311. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  7312. } POSTPACK
  7313. /* define htt_tx_frag_desc32_bank_cfg_t */
  7314. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  7315. /* define htt_tx_frag_desc64_bank_cfg_t */
  7316. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  7317. /*
  7318. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  7319. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  7320. */
  7321. #if HTT_PADDR64
  7322. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  7323. #else
  7324. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  7325. #endif
  7326. /**
  7327. * @brief target -> host HTT TX Credit total count update message definition
  7328. *
  7329. *|31 16|15|14 9| 8 |7 0 |
  7330. *|---------------------+--+----------+-------+----------|
  7331. *|cur htt credit delta | Q| reserved | sign | msg type |
  7332. *|------------------------------------------------------|
  7333. *
  7334. * Header fields:
  7335. * - MSG_TYPE
  7336. * Bits 7:0
  7337. * Purpose: identifies this as a htt tx credit delta update message
  7338. * Value: 0xe
  7339. * - SIGN
  7340. * Bits 8
  7341. * identifies whether credit delta is positive or negative
  7342. * Value:
  7343. * - 0x0: credit delta is positive, rebalance in some buffers
  7344. * - 0x1: credit delta is negative, rebalance out some buffers
  7345. * - reserved
  7346. * Bits 14:9
  7347. * Value: 0x0
  7348. * - TXQ_GRP
  7349. * Bit 15
  7350. * Purpose: indicates whether any tx queue group information elements
  7351. * are appended to the tx credit update message
  7352. * Value: 0 -> no tx queue group information element is present
  7353. * 1 -> a tx queue group information element immediately follows
  7354. * - DELTA_COUNT
  7355. * Bits 31:16
  7356. * Purpose: Specify current htt credit delta absolute count
  7357. */
  7358. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  7359. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  7360. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  7361. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  7362. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  7363. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  7364. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  7365. do { \
  7366. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  7367. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  7368. } while (0)
  7369. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  7370. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  7371. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  7372. do { \
  7373. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  7374. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  7375. } while (0)
  7376. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  7377. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  7378. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  7379. do { \
  7380. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  7381. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  7382. } while (0)
  7383. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  7384. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  7385. #define HTT_TX_CREDIT_MSG_BYTES 4
  7386. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  7387. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  7388. /**
  7389. * @brief HTT WDI_IPA Operation Response Message
  7390. *
  7391. * @details
  7392. * HTT WDI_IPA Operation Response message is sent by target
  7393. * to host confirming suspend or resume operation.
  7394. * |31 24|23 16|15 8|7 0|
  7395. * |----------------+----------------+----------------+----------------|
  7396. * | op_code | Rsvd | msg_type |
  7397. * |-------------------------------------------------------------------|
  7398. * | Rsvd | Response len |
  7399. * |-------------------------------------------------------------------|
  7400. * | |
  7401. * | Response-type specific info |
  7402. * | |
  7403. * | |
  7404. * |-------------------------------------------------------------------|
  7405. * Header fields:
  7406. * - MSG_TYPE
  7407. * Bits 7:0
  7408. * Purpose: Identifies this as WDI_IPA Operation Response message
  7409. * value: = 0x13
  7410. * - OP_CODE
  7411. * Bits 31:16
  7412. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  7413. * value: = enum htt_wdi_ipa_op_code
  7414. * - RSP_LEN
  7415. * Bits 16:0
  7416. * Purpose: length for the response-type specific info
  7417. * value: = length in bytes for response-type specific info
  7418. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  7419. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  7420. */
  7421. PREPACK struct htt_wdi_ipa_op_response_t
  7422. {
  7423. /* DWORD 0: flags and meta-data */
  7424. A_UINT32
  7425. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  7426. reserved1: 8,
  7427. op_code: 16;
  7428. A_UINT32
  7429. rsp_len: 16,
  7430. reserved2: 16;
  7431. } POSTPACK;
  7432. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  7433. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  7434. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  7435. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  7436. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  7437. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  7438. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  7439. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  7440. do { \
  7441. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  7442. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  7443. } while (0)
  7444. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  7445. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  7446. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  7447. do { \
  7448. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  7449. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  7450. } while (0)
  7451. enum htt_phy_mode {
  7452. htt_phy_mode_11a = 0,
  7453. htt_phy_mode_11g = 1,
  7454. htt_phy_mode_11b = 2,
  7455. htt_phy_mode_11g_only = 3,
  7456. htt_phy_mode_11na_ht20 = 4,
  7457. htt_phy_mode_11ng_ht20 = 5,
  7458. htt_phy_mode_11na_ht40 = 6,
  7459. htt_phy_mode_11ng_ht40 = 7,
  7460. htt_phy_mode_11ac_vht20 = 8,
  7461. htt_phy_mode_11ac_vht40 = 9,
  7462. htt_phy_mode_11ac_vht80 = 10,
  7463. htt_phy_mode_11ac_vht20_2g = 11,
  7464. htt_phy_mode_11ac_vht40_2g = 12,
  7465. htt_phy_mode_11ac_vht80_2g = 13,
  7466. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  7467. htt_phy_mode_11ac_vht160 = 15,
  7468. htt_phy_mode_max,
  7469. };
  7470. /**
  7471. * @brief target -> host HTT channel change indication
  7472. * @details
  7473. * Specify when a channel change occurs.
  7474. * This allows the host to precisely determine which rx frames arrived
  7475. * on the old channel and which rx frames arrived on the new channel.
  7476. *
  7477. *|31 |7 0 |
  7478. *|-------------------------------------------+----------|
  7479. *| reserved | msg type |
  7480. *|------------------------------------------------------|
  7481. *| primary_chan_center_freq_mhz |
  7482. *|------------------------------------------------------|
  7483. *| contiguous_chan1_center_freq_mhz |
  7484. *|------------------------------------------------------|
  7485. *| contiguous_chan2_center_freq_mhz |
  7486. *|------------------------------------------------------|
  7487. *| phy_mode |
  7488. *|------------------------------------------------------|
  7489. *
  7490. * Header fields:
  7491. * - MSG_TYPE
  7492. * Bits 7:0
  7493. * Purpose: identifies this as a htt channel change indication message
  7494. * Value: 0x15
  7495. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  7496. * Bits 31:0
  7497. * Purpose: identify the (center of the) new 20 MHz primary channel
  7498. * Value: center frequency of the 20 MHz primary channel, in MHz units
  7499. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  7500. * Bits 31:0
  7501. * Purpose: identify the (center of the) contiguous frequency range
  7502. * comprising the new channel.
  7503. * For example, if the new channel is a 80 MHz channel extending
  7504. * 60 MHz beyond the primary channel, this field would be 30 larger
  7505. * than the primary channel center frequency field.
  7506. * Value: center frequency of the contiguous frequency range comprising
  7507. * the full channel in MHz units
  7508. * (80+80 channels also use the CONTIG_CHAN2 field)
  7509. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  7510. * Bits 31:0
  7511. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  7512. * within a VHT 80+80 channel.
  7513. * This field is only relevant for VHT 80+80 channels.
  7514. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  7515. * channel (arbitrary value for cases besides VHT 80+80)
  7516. * - PHY_MODE
  7517. * Bits 31:0
  7518. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  7519. * and band
  7520. * Value: htt_phy_mode enum value
  7521. */
  7522. PREPACK struct htt_chan_change_t
  7523. {
  7524. /* DWORD 0: flags and meta-data */
  7525. A_UINT32
  7526. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  7527. reserved1: 24;
  7528. A_UINT32 primary_chan_center_freq_mhz;
  7529. A_UINT32 contig_chan1_center_freq_mhz;
  7530. A_UINT32 contig_chan2_center_freq_mhz;
  7531. A_UINT32 phy_mode;
  7532. } POSTPACK;
  7533. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  7534. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  7535. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  7536. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  7537. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  7538. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  7539. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  7540. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  7541. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  7542. do { \
  7543. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  7544. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  7545. } while (0)
  7546. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  7547. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  7548. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  7549. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  7550. do { \
  7551. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  7552. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  7553. } while (0)
  7554. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  7555. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  7556. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  7557. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  7558. do { \
  7559. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  7560. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  7561. } while (0)
  7562. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  7563. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  7564. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  7565. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  7566. do { \
  7567. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  7568. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  7569. } while (0)
  7570. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  7571. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  7572. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  7573. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  7574. /**
  7575. * @brief rx offload packet error message
  7576. *
  7577. * @details
  7578. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  7579. * of target payload like mic err.
  7580. *
  7581. * |31 24|23 16|15 8|7 0|
  7582. * |----------------+----------------+----------------+----------------|
  7583. * | tid | vdev_id | msg_sub_type | msg_type |
  7584. * |-------------------------------------------------------------------|
  7585. * : (sub-type dependent content) :
  7586. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  7587. * Header fields:
  7588. * - msg_type
  7589. * Bits 7:0
  7590. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  7591. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  7592. * - msg_sub_type
  7593. * Bits 15:8
  7594. * Purpose: Identifies which type of rx error is reported by this message
  7595. * value: htt_rx_ofld_pkt_err_type
  7596. * - vdev_id
  7597. * Bits 23:16
  7598. * Purpose: Identifies which vdev received the erroneous rx frame
  7599. * value:
  7600. * - tid
  7601. * Bits 31:24
  7602. * Purpose: Identifies the traffic type of the rx frame
  7603. * value:
  7604. *
  7605. * - The payload fields used if the sub-type == MIC error are shown below.
  7606. * Note - MIC err is per MSDU, while PN is per MPDU.
  7607. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  7608. * with MIC err in A-MSDU case, so FW will send only one HTT message
  7609. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  7610. * instead of sending separate HTT messages for each wrong MSDU within
  7611. * the MPDU.
  7612. *
  7613. * |31 24|23 16|15 8|7 0|
  7614. * |----------------+----------------+----------------+----------------|
  7615. * | Rsvd | key_id | peer_id |
  7616. * |-------------------------------------------------------------------|
  7617. * | receiver MAC addr 31:0 |
  7618. * |-------------------------------------------------------------------|
  7619. * | Rsvd | receiver MAC addr 47:32 |
  7620. * |-------------------------------------------------------------------|
  7621. * | transmitter MAC addr 31:0 |
  7622. * |-------------------------------------------------------------------|
  7623. * | Rsvd | transmitter MAC addr 47:32 |
  7624. * |-------------------------------------------------------------------|
  7625. * | PN 31:0 |
  7626. * |-------------------------------------------------------------------|
  7627. * | Rsvd | PN 47:32 |
  7628. * |-------------------------------------------------------------------|
  7629. * - peer_id
  7630. * Bits 15:0
  7631. * Purpose: identifies which peer is frame is from
  7632. * value:
  7633. * - key_id
  7634. * Bits 23:16
  7635. * Purpose: identifies key_id of rx frame
  7636. * value:
  7637. * - RA_31_0 (receiver MAC addr 31:0)
  7638. * Bits 31:0
  7639. * Purpose: identifies by MAC address which vdev received the frame
  7640. * value: MAC address lower 4 bytes
  7641. * - RA_47_32 (receiver MAC addr 47:32)
  7642. * Bits 15:0
  7643. * Purpose: identifies by MAC address which vdev received the frame
  7644. * value: MAC address upper 2 bytes
  7645. * - TA_31_0 (transmitter MAC addr 31:0)
  7646. * Bits 31:0
  7647. * Purpose: identifies by MAC address which peer transmitted the frame
  7648. * value: MAC address lower 4 bytes
  7649. * - TA_47_32 (transmitter MAC addr 47:32)
  7650. * Bits 15:0
  7651. * Purpose: identifies by MAC address which peer transmitted the frame
  7652. * value: MAC address upper 2 bytes
  7653. * - PN_31_0
  7654. * Bits 31:0
  7655. * Purpose: Identifies pn of rx frame
  7656. * value: PN lower 4 bytes
  7657. * - PN_47_32
  7658. * Bits 15:0
  7659. * Purpose: Identifies pn of rx frame
  7660. * value:
  7661. * TKIP or CCMP: PN upper 2 bytes
  7662. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  7663. */
  7664. enum htt_rx_ofld_pkt_err_type {
  7665. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  7666. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  7667. };
  7668. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  7669. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  7670. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  7671. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  7672. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  7673. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  7674. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  7675. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  7676. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  7677. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  7678. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  7679. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  7680. do { \
  7681. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  7682. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  7683. } while (0)
  7684. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  7685. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  7686. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  7687. do { \
  7688. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  7689. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  7690. } while (0)
  7691. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  7692. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  7693. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  7694. do { \
  7695. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  7696. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  7697. } while (0)
  7698. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  7699. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  7700. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  7701. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  7702. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  7703. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  7704. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  7705. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  7706. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  7707. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  7708. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  7709. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  7710. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  7711. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  7712. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  7713. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  7714. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  7715. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  7716. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  7717. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  7718. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  7719. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  7720. do { \
  7721. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  7722. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  7723. } while (0)
  7724. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  7725. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  7726. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  7727. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  7728. do { \
  7729. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  7730. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  7731. } while (0)
  7732. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  7733. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  7734. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  7735. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  7736. do { \
  7737. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  7738. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  7739. } while (0)
  7740. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  7741. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  7742. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  7743. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  7744. do { \
  7745. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  7746. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  7747. } while (0)
  7748. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  7749. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  7750. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  7751. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  7752. do { \
  7753. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  7754. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  7755. } while (0)
  7756. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  7757. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  7758. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  7759. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  7760. do { \
  7761. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  7762. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  7763. } while (0)
  7764. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  7765. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  7766. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  7767. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  7768. do { \
  7769. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  7770. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  7771. } while (0)
  7772. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  7773. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  7774. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  7775. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  7776. do { \
  7777. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  7778. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  7779. } while (0)
  7780. /**
  7781. * @brief peer rate report message
  7782. *
  7783. * @details
  7784. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  7785. * justified rate of all the peers.
  7786. *
  7787. * |31 24|23 16|15 8|7 0|
  7788. * |----------------+----------------+----------------+----------------|
  7789. * | peer_count | | msg_type |
  7790. * |-------------------------------------------------------------------|
  7791. * : Payload (variant number of peer rate report) :
  7792. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  7793. * Header fields:
  7794. * - msg_type
  7795. * Bits 7:0
  7796. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  7797. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  7798. * - reserved
  7799. * Bits 15:8
  7800. * Purpose:
  7801. * value:
  7802. * - peer_count
  7803. * Bits 31:16
  7804. * Purpose: Specify how many peer rate report elements are present in the payload.
  7805. * value:
  7806. *
  7807. * Payload:
  7808. * There are variant number of peer rate report follow the first 32 bits.
  7809. * The peer rate report is defined as follows.
  7810. *
  7811. * |31 20|19 16|15 0|
  7812. * |-----------------------+---------+---------------------------------|-
  7813. * | reserved | phy | peer_id | \
  7814. * |-------------------------------------------------------------------| -> report #0
  7815. * | rate | /
  7816. * |-----------------------+---------+---------------------------------|-
  7817. * | reserved | phy | peer_id | \
  7818. * |-------------------------------------------------------------------| -> report #1
  7819. * | rate | /
  7820. * |-----------------------+---------+---------------------------------|-
  7821. * | reserved | phy | peer_id | \
  7822. * |-------------------------------------------------------------------| -> report #2
  7823. * | rate | /
  7824. * |-------------------------------------------------------------------|-
  7825. * : :
  7826. * : :
  7827. * : :
  7828. * :-------------------------------------------------------------------:
  7829. *
  7830. * - peer_id
  7831. * Bits 15:0
  7832. * Purpose: identify the peer
  7833. * value:
  7834. * - phy
  7835. * Bits 19:16
  7836. * Purpose: identify which phy is in use
  7837. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  7838. * Please see enum htt_peer_report_phy_type for detail.
  7839. * - reserved
  7840. * Bits 31:20
  7841. * Purpose:
  7842. * value:
  7843. * - rate
  7844. * Bits 31:0
  7845. * Purpose: represent the justified rate of the peer specified by peer_id
  7846. * value:
  7847. */
  7848. enum htt_peer_rate_report_phy_type {
  7849. HTT_PEER_RATE_REPORT_11B = 0,
  7850. HTT_PEER_RATE_REPORT_11A_G,
  7851. HTT_PEER_RATE_REPORT_11N,
  7852. HTT_PEER_RATE_REPORT_11AC,
  7853. };
  7854. #define HTT_PEER_RATE_REPORT_SIZE 8
  7855. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  7856. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  7857. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  7858. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  7859. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  7860. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  7861. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  7862. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  7863. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  7864. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  7865. do { \
  7866. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  7867. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  7868. } while (0)
  7869. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  7870. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  7871. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  7872. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  7873. do { \
  7874. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  7875. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  7876. } while (0)
  7877. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  7878. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  7879. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  7880. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  7881. do { \
  7882. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  7883. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  7884. } while (0)
  7885. /**
  7886. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  7887. *
  7888. * @details
  7889. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  7890. * a flow of descriptors.
  7891. *
  7892. * This message is in TLV format and indicates the parameters to be setup a
  7893. * flow in the host. Each entry indicates that a particular flow ID is ready to
  7894. * receive descriptors from a specified pool.
  7895. *
  7896. * The message would appear as follows:
  7897. *
  7898. * |31 24|23 16|15 8|7 0|
  7899. * |----------------+----------------+----------------+----------------|
  7900. * header | reserved | num_flows | msg_type |
  7901. * |-------------------------------------------------------------------|
  7902. * | |
  7903. * : payload :
  7904. * | |
  7905. * |-------------------------------------------------------------------|
  7906. *
  7907. * The header field is one DWORD long and is interpreted as follows:
  7908. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  7909. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  7910. * this message
  7911. * b'16-31 - reserved: These bits are reserved for future use
  7912. *
  7913. * Payload:
  7914. * The payload would contain multiple objects of the following structure. Each
  7915. * object represents a flow.
  7916. *
  7917. * |31 24|23 16|15 8|7 0|
  7918. * |----------------+----------------+----------------+----------------|
  7919. * header | reserved | num_flows | msg_type |
  7920. * |-------------------------------------------------------------------|
  7921. * payload0| flow_type |
  7922. * |-------------------------------------------------------------------|
  7923. * | flow_id |
  7924. * |-------------------------------------------------------------------|
  7925. * | reserved0 | flow_pool_id |
  7926. * |-------------------------------------------------------------------|
  7927. * | reserved1 | flow_pool_size |
  7928. * |-------------------------------------------------------------------|
  7929. * | reserved2 |
  7930. * |-------------------------------------------------------------------|
  7931. * payload1| flow_type |
  7932. * |-------------------------------------------------------------------|
  7933. * | flow_id |
  7934. * |-------------------------------------------------------------------|
  7935. * | reserved0 | flow_pool_id |
  7936. * |-------------------------------------------------------------------|
  7937. * | reserved1 | flow_pool_size |
  7938. * |-------------------------------------------------------------------|
  7939. * | reserved2 |
  7940. * |-------------------------------------------------------------------|
  7941. * | . |
  7942. * | . |
  7943. * | . |
  7944. * |-------------------------------------------------------------------|
  7945. *
  7946. * Each payload is 5 DWORDS long and is interpreted as follows:
  7947. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  7948. * this flow is associated. It can be VDEV, peer,
  7949. * or tid (AC). Based on enum htt_flow_type.
  7950. *
  7951. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  7952. * object. For flow_type vdev it is set to the
  7953. * vdevid, for peer it is peerid and for tid, it is
  7954. * tid_num.
  7955. *
  7956. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  7957. * in the host for this flow
  7958. * b'16:31 - reserved0: This field in reserved for the future. In case
  7959. * we have a hierarchical implementation (HCM) of
  7960. * pools, it can be used to indicate the ID of the
  7961. * parent-pool.
  7962. *
  7963. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  7964. * Descriptors for this flow will be
  7965. * allocated from this pool in the host.
  7966. * b'16:31 - reserved1: This field in reserved for the future. In case
  7967. * we have a hierarchical implementation of pools,
  7968. * it can be used to indicate the max number of
  7969. * descriptors in the pool. The b'0:15 can be used
  7970. * to indicate min number of descriptors in the
  7971. * HCM scheme.
  7972. *
  7973. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  7974. * we have a hierarchical implementation of pools,
  7975. * b'0:15 can be used to indicate the
  7976. * priority-based borrowing (PBB) threshold of
  7977. * the flow's pool. The b'16:31 are still left
  7978. * reserved.
  7979. */
  7980. enum htt_flow_type {
  7981. FLOW_TYPE_VDEV = 0,
  7982. /* Insert new flow types above this line */
  7983. };
  7984. PREPACK struct htt_flow_pool_map_payload_t {
  7985. A_UINT32 flow_type;
  7986. A_UINT32 flow_id;
  7987. A_UINT32 flow_pool_id:16,
  7988. reserved0:16;
  7989. A_UINT32 flow_pool_size:16,
  7990. reserved1:16;
  7991. A_UINT32 reserved2;
  7992. } POSTPACK;
  7993. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  7994. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  7995. (sizeof(struct htt_flow_pool_map_payload_t))
  7996. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  7997. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  7998. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  7999. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  8000. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  8001. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  8002. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  8003. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  8004. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  8005. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  8006. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  8007. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  8008. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  8009. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  8010. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  8011. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  8012. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  8013. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  8014. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  8015. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  8016. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  8017. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  8018. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  8019. do { \
  8020. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  8021. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  8022. } while (0)
  8023. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  8024. do { \
  8025. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  8026. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  8027. } while (0)
  8028. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  8029. do { \
  8030. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  8031. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  8032. } while (0)
  8033. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  8034. do { \
  8035. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  8036. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  8037. } while (0)
  8038. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  8039. do { \
  8040. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  8041. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  8042. } while (0)
  8043. /**
  8044. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  8045. *
  8046. * @details
  8047. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  8048. * down a flow of descriptors.
  8049. * This message indicates that for the flow (whose ID is provided) is wanting
  8050. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  8051. * pool of descriptors from where descriptors are being allocated for this
  8052. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  8053. * be unmapped by the host.
  8054. *
  8055. * The message would appear as follows:
  8056. *
  8057. * |31 24|23 16|15 8|7 0|
  8058. * |----------------+----------------+----------------+----------------|
  8059. * | reserved0 | msg_type |
  8060. * |-------------------------------------------------------------------|
  8061. * | flow_type |
  8062. * |-------------------------------------------------------------------|
  8063. * | flow_id |
  8064. * |-------------------------------------------------------------------|
  8065. * | reserved1 | flow_pool_id |
  8066. * |-------------------------------------------------------------------|
  8067. *
  8068. * The message is interpreted as follows:
  8069. * dword0 - b'0:7 - msg_type: This will be set to
  8070. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  8071. * b'8:31 - reserved0: Reserved for future use
  8072. *
  8073. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  8074. * this flow is associated. It can be VDEV, peer,
  8075. * or tid (AC). Based on enum htt_flow_type.
  8076. *
  8077. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8078. * object. For flow_type vdev it is set to the
  8079. * vdevid, for peer it is peerid and for tid, it is
  8080. * tid_num.
  8081. *
  8082. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  8083. * used in the host for this flow
  8084. * b'16:31 - reserved0: This field in reserved for the future.
  8085. *
  8086. */
  8087. PREPACK struct htt_flow_pool_unmap_t {
  8088. A_UINT32 msg_type:8,
  8089. reserved0:24;
  8090. A_UINT32 flow_type;
  8091. A_UINT32 flow_id;
  8092. A_UINT32 flow_pool_id:16,
  8093. reserved1:16;
  8094. } POSTPACK;
  8095. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  8096. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  8097. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  8098. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  8099. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  8100. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  8101. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  8102. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  8103. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  8104. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  8105. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  8106. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  8107. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  8108. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  8109. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  8110. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  8111. do { \
  8112. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  8113. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  8114. } while (0)
  8115. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  8116. do { \
  8117. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  8118. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  8119. } while (0)
  8120. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  8121. do { \
  8122. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  8123. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  8124. } while (0)
  8125. /**
  8126. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  8127. *
  8128. * @details
  8129. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  8130. * SRNG ring setup is done
  8131. *
  8132. * This message indicates whether the last setup operation is successful.
  8133. * It will be sent to host when host set respose_required bit in
  8134. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  8135. * The message would appear as follows:
  8136. *
  8137. * |31 24|23 16|15 8|7 0|
  8138. * |--------------- +----------------+----------------+----------------|
  8139. * | setup_status | ring_id | pdev_id | msg_type |
  8140. * |-------------------------------------------------------------------|
  8141. *
  8142. * The message is interpreted as follows:
  8143. * dword0 - b'0:7 - msg_type: This will be set to
  8144. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  8145. * b'8:15 - pdev_id:
  8146. * 0 (for rings at SOC/UMAC level),
  8147. * 1/2/3 mac id (for rings at LMAC level)
  8148. * b'16:23 - ring_id: Identify the ring which is set up
  8149. * More details can be got from enum htt_srng_ring_id
  8150. * b'24:31 - setup_status: Indicate status of setup operation
  8151. * Refer to htt_ring_setup_status
  8152. */
  8153. PREPACK struct htt_sring_setup_done_t {
  8154. A_UINT32 msg_type: 8,
  8155. pdev_id: 8,
  8156. ring_id: 8,
  8157. setup_status: 8;
  8158. } POSTPACK;
  8159. enum htt_ring_setup_status {
  8160. htt_ring_setup_status_ok = 0,
  8161. htt_ring_setup_status_error,
  8162. };
  8163. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  8164. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  8165. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  8166. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  8167. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  8168. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  8169. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  8170. do { \
  8171. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  8172. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  8173. } while (0)
  8174. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  8175. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  8176. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  8177. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  8178. HTT_SRING_SETUP_DONE_RING_ID_S)
  8179. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  8180. do { \
  8181. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  8182. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  8183. } while (0)
  8184. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  8185. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  8186. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  8187. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  8188. HTT_SRING_SETUP_DONE_STATUS_S)
  8189. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  8190. do { \
  8191. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  8192. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  8193. } while (0)
  8194. /**
  8195. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  8196. *
  8197. * @details
  8198. * HTT TX map flow entry with tqm flow pointer
  8199. * Sent from firmware to host to add tqm flow pointer in corresponding
  8200. * flow search entry. Flow metadata is replayed back to host as part of this
  8201. * struct to enable host to find the specific flow search entry
  8202. *
  8203. * The message would appear as follows:
  8204. *
  8205. * |31 28|27 18|17 14|13 8|7 0|
  8206. * |-------+------------------------------------------+----------------|
  8207. * | rsvd0 | fse_hsh_idx | msg_type |
  8208. * |-------------------------------------------------------------------|
  8209. * | rsvd1 | tid | peer_id |
  8210. * |-------------------------------------------------------------------|
  8211. * | tqm_flow_pntr_lo |
  8212. * |-------------------------------------------------------------------|
  8213. * | tqm_flow_pntr_hi |
  8214. * |-------------------------------------------------------------------|
  8215. * | fse_meta_data |
  8216. * |-------------------------------------------------------------------|
  8217. *
  8218. * The message is interpreted as follows:
  8219. *
  8220. * dword0 - b'0:7 - msg_type: This will be set to
  8221. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  8222. *
  8223. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  8224. * for this flow entry
  8225. *
  8226. * dword0 - b'28:31 - rsvd0: Reserved for future use
  8227. *
  8228. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  8229. *
  8230. * dword1 - b'14:17 - tid
  8231. *
  8232. * dword1 - b'18:31 - rsvd1: Reserved for future use
  8233. *
  8234. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  8235. *
  8236. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  8237. *
  8238. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  8239. * given by host
  8240. */
  8241. PREPACK struct htt_tx_map_flow_info {
  8242. A_UINT32
  8243. msg_type: 8,
  8244. fse_hsh_idx: 20,
  8245. rsvd0: 4;
  8246. A_UINT32
  8247. peer_id: 14,
  8248. tid: 4,
  8249. rsvd1: 14;
  8250. A_UINT32 tqm_flow_pntr_lo;
  8251. A_UINT32 tqm_flow_pntr_hi;
  8252. struct htt_tx_flow_metadata fse_meta_data;
  8253. } POSTPACK;
  8254. /* DWORD 0 */
  8255. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  8256. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  8257. /* DWORD 1 */
  8258. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  8259. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  8260. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  8261. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  8262. /* DWORD 0 */
  8263. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  8264. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  8265. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  8266. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  8267. do { \
  8268. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  8269. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  8270. } while (0)
  8271. /* DWORD 1 */
  8272. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  8273. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  8274. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  8275. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  8276. do { \
  8277. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  8278. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  8279. } while (0)
  8280. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  8281. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  8282. HTT_TX_MAP_FLOW_INFO_TID_S)
  8283. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  8284. do { \
  8285. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  8286. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  8287. } while (0)
  8288. #endif