htt.h 420 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470
  1. /*
  2. * Copyright (c) 2011-2017 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. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  143. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  144. * sharing stats
  145. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  146. * 3.34 Add HW_PEER_ID field to PEER_MAP
  147. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  148. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  149. * not yet in use)
  150. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  151. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  152. * 3.38 Add holes_no_filled field to rx_reorder_stats
  153. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  154. * 3.40 Add optional timestamps in the HTT tx completion
  155. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  156. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  157. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  158. * 3.44 Add htt_tx_wbm_completion_v2
  159. */
  160. #define HTT_CURRENT_VERSION_MAJOR 3
  161. #define HTT_CURRENT_VERSION_MINOR 44
  162. #define HTT_NUM_TX_FRAG_DESC 1024
  163. #define HTT_WIFI_IP_VERSION(x, y) ((x) == (y))
  164. #define HTT_CHECK_SET_VAL(field, val) \
  165. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  166. /* macros to assist in sign-extending fields from HTT messages */
  167. #define HTT_SIGN_BIT_MASK(field) \
  168. ((field ## _M + (1 << field ## _S)) >> 1)
  169. #define HTT_SIGN_BIT(_val, field) \
  170. (_val & HTT_SIGN_BIT_MASK(field))
  171. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  172. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  173. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  174. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  175. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  176. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  177. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  178. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  179. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  180. /*
  181. * TEMPORARY:
  182. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  183. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  184. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  185. * updated.
  186. */
  187. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  188. /*
  189. * TEMPORARY:
  190. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  191. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  192. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  193. * updated.
  194. */
  195. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  196. /* HTT Access Category values */
  197. enum HTT_AC_WMM {
  198. /* WMM Access Categories */
  199. HTT_AC_WMM_BE = 0x0,
  200. HTT_AC_WMM_BK = 0x1,
  201. HTT_AC_WMM_VI = 0x2,
  202. HTT_AC_WMM_VO = 0x3,
  203. /* extension Access Categories */
  204. HTT_AC_EXT_NON_QOS = 0x4,
  205. HTT_AC_EXT_UCAST_MGMT = 0x5,
  206. HTT_AC_EXT_MCAST_DATA = 0x6,
  207. HTT_AC_EXT_MCAST_MGMT = 0x7,
  208. };
  209. enum HTT_AC_WMM_MASK {
  210. /* WMM Access Categories */
  211. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  212. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  213. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  214. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  215. /* extension Access Categories */
  216. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  217. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  218. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  219. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  220. };
  221. #define HTT_AC_MASK_WMM \
  222. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  223. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  224. #define HTT_AC_MASK_EXT \
  225. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  226. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  227. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  228. /*
  229. * htt_dbg_stats_type -
  230. * bit positions for each stats type within a stats type bitmask
  231. * The bitmask contains 24 bits.
  232. */
  233. enum htt_dbg_stats_type {
  234. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  235. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  236. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  237. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  238. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  239. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  240. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  241. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  242. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  243. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  244. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  245. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  246. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  247. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  248. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  249. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  250. /* bits 16-23 currently reserved */
  251. /* keep this last */
  252. HTT_DBG_NUM_STATS
  253. };
  254. /*=== HTT option selection TLVs ===
  255. * Certain HTT messages have alternatives or options.
  256. * For such cases, the host and target need to agree on which option to use.
  257. * Option specification TLVs can be appended to the VERSION_REQ and
  258. * VERSION_CONF messages to select options other than the default.
  259. * These TLVs are entirely optional - if they are not provided, there is a
  260. * well-defined default for each option. If they are provided, they can be
  261. * provided in any order. Each TLV can be present or absent independent of
  262. * the presence / absence of other TLVs.
  263. *
  264. * The HTT option selection TLVs use the following format:
  265. * |31 16|15 8|7 0|
  266. * |---------------------------------+----------------+----------------|
  267. * | value (payload) | length | tag |
  268. * |-------------------------------------------------------------------|
  269. * The value portion need not be only 2 bytes; it can be extended by any
  270. * integer number of 4-byte units. The total length of the TLV, including
  271. * the tag and length fields, must be a multiple of 4 bytes. The length
  272. * field specifies the total TLV size in 4-byte units. Thus, the typical
  273. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  274. * field, would store 0x1 in its length field, to show that the TLV occupies
  275. * a single 4-byte unit.
  276. */
  277. /*--- TLV header format - applies to all HTT option TLVs ---*/
  278. enum HTT_OPTION_TLV_TAGS {
  279. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  280. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  281. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  282. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  283. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  284. };
  285. PREPACK struct htt_option_tlv_header_t {
  286. A_UINT8 tag;
  287. A_UINT8 length;
  288. } POSTPACK;
  289. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  290. #define HTT_OPTION_TLV_TAG_S 0
  291. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  292. #define HTT_OPTION_TLV_LENGTH_S 8
  293. /*
  294. * value0 - 16 bit value field stored in word0
  295. * The TLV's value field may be longer than 2 bytes, in which case
  296. * the remainder of the value is stored in word1, word2, etc.
  297. */
  298. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  299. #define HTT_OPTION_TLV_VALUE0_S 16
  300. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  301. do { \
  302. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  303. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  304. } while (0)
  305. #define HTT_OPTION_TLV_TAG_GET(word) \
  306. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  307. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  308. do { \
  309. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  310. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  311. } while (0)
  312. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  313. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  314. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  315. do { \
  316. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  317. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  318. } while (0)
  319. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  320. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  321. /*--- format of specific HTT option TLVs ---*/
  322. /*
  323. * HTT option TLV for specifying LL bus address size
  324. * Some chips require bus addresses used by the target to access buffers
  325. * within the host's memory to be 32 bits; others require bus addresses
  326. * used by the target to access buffers within the host's memory to be
  327. * 64 bits.
  328. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  329. * a suffix to the VERSION_CONF message to specify which bus address format
  330. * the target requires.
  331. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  332. * default to providing bus addresses to the target in 32-bit format.
  333. */
  334. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  335. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  336. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  337. };
  338. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  339. struct htt_option_tlv_header_t hdr;
  340. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  341. } POSTPACK;
  342. /*
  343. * HTT option TLV for specifying whether HL systems should indicate
  344. * over-the-air tx completion for individual frames, or should instead
  345. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  346. * requests an OTA tx completion for a particular tx frame.
  347. * This option does not apply to LL systems, where the TX_COMPL_IND
  348. * is mandatory.
  349. * This option is primarily intended for HL systems in which the tx frame
  350. * downloads over the host --> target bus are as slow as or slower than
  351. * the transmissions over the WLAN PHY. For cases where the bus is faster
  352. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  353. * and consquently will send one TX_COMPL_IND message that covers several
  354. * tx frames. For cases where the WLAN PHY is faster than the bus,
  355. * the target will end up transmitting very short A-MPDUs, and consequently
  356. * sending many TX_COMPL_IND messages, which each cover a very small number
  357. * of tx frames.
  358. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  359. * a suffix to the VERSION_REQ message to request whether the host desires to
  360. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  361. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  362. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  363. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  364. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  365. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  366. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  367. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  368. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  369. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  370. * TLV.
  371. */
  372. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  373. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  374. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  375. };
  376. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  377. struct htt_option_tlv_header_t hdr;
  378. A_UINT16 hl_suppress_tx_compl_ind;/*HL_SUPPRESS_TX_COMPL_IND enum*/
  379. } POSTPACK;
  380. /*
  381. * HTT option TLV for specifying how many tx queue groups the target
  382. * may establish.
  383. * This TLV specifies the maximum value the target may send in the
  384. * txq_group_id field of any TXQ_GROUP information elements sent by
  385. * the target to the host. This allows the host to pre-allocate an
  386. * appropriate number of tx queue group structs.
  387. *
  388. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  389. * a suffix to the VERSION_REQ message to specify whether the host supports
  390. * tx queue groups at all, and if so if there is any limit on the number of
  391. * tx queue groups that the host supports.
  392. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  393. * a suffix to the VERSION_CONF message. If the host has specified in the
  394. * VER_REQ message a limit on the number of tx queue groups the host can
  395. * supprt, the target shall limit its specification of the maximum tx groups
  396. * to be no larger than this host-specified limit.
  397. *
  398. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  399. * shall preallocate 4 tx queue group structs, and the target shall not
  400. * specify a txq_group_id larger than 3.
  401. */
  402. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  403. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  404. /*
  405. * values 1 through N specify the max number of tx queue groups
  406. * the sender supports
  407. */
  408. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  409. };
  410. /* TEMPORARY backwards-compatibility alias for a typo fix -
  411. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  412. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  413. * to support the old name (with the typo) until all references to the
  414. * old name are replaced with the new name.
  415. */
  416. #define htt_option_tlv_mac_tx_queue_groups_t \
  417. htt_option_tlv_max_tx_queue_groups_t
  418. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  419. struct htt_option_tlv_header_t hdr;
  420. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  421. } POSTPACK;
  422. /*
  423. * HTT option TLV for specifying whether the target supports an extended
  424. * version of the HTT tx descriptor. If the target provides this TLV
  425. * and specifies in the TLV that the target supports an extended version
  426. * of the HTT tx descriptor, the target must check the "extension" bit in
  427. * the HTT tx descriptor, and if the extension bit is set, to expect a
  428. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  429. * descriptor. Furthermore, the target must provide room for the HTT
  430. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  431. * This option is intended for systems where the host needs to explicitly
  432. * control the transmission parameters such as tx power for individual
  433. * tx frames.
  434. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  435. * as a suffix to the VERSION_CONF message to explicitly specify whether
  436. * the target supports the HTT tx MSDU extension descriptor.
  437. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  438. * by the host as lack of target support for the HTT tx MSDU extension
  439. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  440. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  441. * the HTT tx MSDU extension descriptor.
  442. * The host is not required to provide the HTT tx MSDU extension descriptor
  443. * just because the target supports it; the target must check the
  444. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  445. * extension descriptor is present.
  446. */
  447. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  448. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  449. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  450. };
  451. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  452. struct htt_option_tlv_header_t hdr;
  453. A_UINT16 tx_msdu_desc_ext_support;/*SUPPORT_TX_MSDU_DESC_EXT enum*/
  454. } POSTPACK;
  455. /*=== host -> target messages ===============================================*/
  456. enum htt_h2t_msg_type {
  457. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  458. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  459. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  460. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  461. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  462. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  463. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  464. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  465. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  466. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  467. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /*per vdev amsdu subfrm limit*/
  468. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  469. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  470. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  471. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  472. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  473. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  474. /* keep this last */
  475. HTT_H2T_NUM_MSGS
  476. };
  477. /*
  478. * HTT host to target message type -
  479. * stored in bits 7:0 of the first word of the message
  480. */
  481. #define HTT_H2T_MSG_TYPE_M 0xff
  482. #define HTT_H2T_MSG_TYPE_S 0
  483. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  484. do { \
  485. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  486. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  487. } while (0)
  488. #define HTT_H2T_MSG_TYPE_GET(word) \
  489. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  490. /**
  491. * @brief host -> target version number request message definition
  492. *
  493. * |31 24|23 16|15 8|7 0|
  494. * |----------------+----------------+----------------+----------------|
  495. * | reserved | msg type |
  496. * |-------------------------------------------------------------------|
  497. * : option request TLV (optional) |
  498. * :...................................................................:
  499. *
  500. * The VER_REQ message may consist of a single 4-byte word, or may be
  501. * extended with TLVs that specify which HTT options the host is requesting
  502. * from the target.
  503. * The following option TLVs may be appended to the VER_REQ message:
  504. * - HL_SUPPRESS_TX_COMPL_IND
  505. * - HL_MAX_TX_QUEUE_GROUPS
  506. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  507. * may be appended to the VER_REQ message (but only one TLV of each type).
  508. *
  509. * Header fields:
  510. * - MSG_TYPE
  511. * Bits 7:0
  512. * Purpose: identifies this as a version number request message
  513. * Value: 0x0
  514. */
  515. #define HTT_VER_REQ_BYTES 4
  516. /* TBDXXX: figure out a reasonable number */
  517. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  518. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  519. /**
  520. * @brief HTT tx MSDU descriptor
  521. *
  522. * @details
  523. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  524. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  525. * the target firmware needs for the FW's tx processing, particularly
  526. * for creating the HW msdu descriptor.
  527. * The same HTT tx descriptor is used for HL and LL systems, though
  528. * a few fields within the tx descriptor are used only by LL or
  529. * only by HL.
  530. * The HTT tx descriptor is defined in two manners: by a struct with
  531. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  532. * definitions.
  533. * The target should use the struct def, for simplicitly and clarity,
  534. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  535. * neutral. Specifically, the host shall use the get/set macros built
  536. * around the mask + shift defs.
  537. */
  538. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  539. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  540. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  541. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  542. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  543. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  544. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  545. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  546. #define HTT_TX_VDEV_ID_WORD 0
  547. #define HTT_TX_VDEV_ID_MASK 0x3f
  548. #define HTT_TX_VDEV_ID_SHIFT 16
  549. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  550. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  551. #define HTT_TX_MSDU_LEN_DWORD 1
  552. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  553. /*
  554. * HTT_VAR_PADDR macros
  555. * Allow physical / bus addresses to be either a single 32-bit value,
  556. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  557. */
  558. /*
  559. * Note that in this macro A_UINT32 has been converted to
  560. * uint32_t only to address checkpath errors caused by declaring
  561. * var_name as A_UINT32.
  562. */
  563. #define HTT_VAR_PADDR32(var_name) uint32_t (var_name)
  564. #define HTT_VAR_PADDR64_LE(var_name) \
  565. struct { \
  566. /* little-endian: lo precedes hi */ \
  567. A_UINT32 lo; \
  568. A_UINT32 hi; \
  569. } var_name
  570. /*
  571. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  572. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  573. * addresses are stored in a XXX-bit field.
  574. * This macro is used to define both htt_tx_msdu_desc32_t and
  575. * htt_tx_msdu_desc64_t structs.
  576. */
  577. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  578. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  579. { \
  580. /* DWORD 0: flags and meta-data */ \
  581. A_UINT32 \
  582. msg_type:8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  583. \
  584. /* pkt_subtype - \
  585. * Detailed specification of the tx frame contents, extending the \
  586. * general specification provided by pkt_type. \
  587. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  588. *pkt_type | pkt_subtype \
  589. *============================================================== \
  590. *802.3 | bit 0:3 - Reserved \
  591. * | bit 4: 0x0 - Copy-Engine Classification Results \
  592. * | not appended to the HTT message \
  593. * | 0x1 - Copy-Engine Classification Results \
  594. * | appended to the HTT message in the \
  595. * | format: \
  596. * | [HTT tx desc, frame header, \
  597. * | CE classification results] \
  598. * | The CE classification results begin \
  599. * | at the next 4-byte boundary after \
  600. * | the frame header. \
  601. *------------+------------------------------------------------- \
  602. *Eth2 | bit 0:3 - Reserved \
  603. * | bit 4: 0x0 - Copy-Engine Classification Results \
  604. * | not appended to the HTT message \
  605. * | 0x1 - Copy-Engine Classification Results \
  606. * | appended to the HTT message. \
  607. * | See the above specification of the \
  608. * | CE classification results location. \
  609. *------------+------------------------------------------------- \
  610. *native WiFi | bit 0:3 - Reserved \
  611. * | bit 4: 0x0 - Copy-Engine Classification Results \
  612. * | not appended to the HTT message \
  613. * | 0x1 - Copy-Engine Classification Results \
  614. * | appended to the HTT message. \
  615. * | See the above specification of the \
  616. * | CE classification results location. \
  617. *------------+------------------------------------------------- \
  618. *mgmt | 0x0 - 802.11 MAC header absent \
  619. * | 0x1 - 802.11 MAC header present \
  620. *------------+------------------------------------------------- \
  621. *raw | bit 0: 0x0 - 802.11 MAC header absent \
  622. * | 0x1 - 802.11 MAC header present \
  623. * | bit 1: 0x0 - allow aggregation \
  624. * | 0x1 - don't allow aggregation \
  625. * | bit 2: 0x0 - perform encryption \
  626. * | 0x1 - don't perform encryption \
  627. * | bit 3: 0x0 - perform tx classification / queuing \
  628. * | 0x1 - don't perform tx classification; \
  629. * | insert the frame into the "misc" \
  630. * | tx queue \
  631. * | bit 4: 0x0 - Copy-Engine Classification Results \
  632. * | not appended to the HTT message \
  633. * | 0x1 - Copy-Engine Classification Results \
  634. * | appended to the HTT message. \
  635. * | See the above specification of the \
  636. * | CE classification results location. \
  637. */ \
  638. pkt_subtype:5, \
  639. \
  640. /* pkt_type - \
  641. * General specification of the tx frame contents. \
  642. * The htt_pkt_type enum should be used to specify \
  643. * and check the value of this field. \
  644. */ \
  645. pkt_type:3, \
  646. \
  647. /* vdev_id - \
  648. * ID for the vdev that is sending this tx frame. \
  649. * For certain non-standard packet types, e.g. pkt_type == raw \
  650. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  651. * This field is used primarily for determining where to queue \
  652. * broadcast and multicast frames. \
  653. */ \
  654. vdev_id:6, \
  655. /* ext_tid - \
  656. * The extended traffic ID. \
  657. * If the TID is unknown, the extended TID is set to \
  658. * HTT_TX_EXT_TID_INVALID. \
  659. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  660. * value of the QoS TID. \
  661. * If the tx frame is non-QoS data, then the extended TID is set to \
  662. * HTT_TX_EXT_TID_NON_QOS. \
  663. * If the tx frame is multicast or broadcast, then the extended TID \
  664. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  665. */ \
  666. ext_tid:5, \
  667. \
  668. /* postponed - \
  669. * This flag indicates whether the tx frame has been downloaded to \
  670. * the target before but discarded by the target, and now is being \
  671. * downloaded again; or if this is a new frame that is being \
  672. * downloaded for the first time. \
  673. * This flag allows the target to determine the correct order for \
  674. * transmitting new vs. old frames. \
  675. * value: 0 -> new frame, 1 -> re-send of a previously
  676. * sent frame \
  677. * This flag only applies to HL systems, since in LL systems, \
  678. * the tx flow control is handled entirely within the target. \
  679. */ \
  680. postponed:1, \
  681. \
  682. /* extension - \
  683. * This flag indicates whether a HTT tx MSDU extension descriptor\
  684. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor.\
  685. * \
  686. * 0x0 - no extension MSDU descriptor is present \
  687. * 0x1 - an extension MSDU descriptor immediately follows the \
  688. * regular MSDU descriptor \
  689. */ \
  690. extension:1, \
  691. \
  692. /* cksum_offload - \
  693. * This flag indicates whether checksum offload is enabled or not \
  694. * for this frame. Target FW use this flag to turn on HW checksumming \
  695. * 0x0 - No checksum offload \
  696. * 0x1 - L3 header checksum only \
  697. * 0x2 - L4 checksum only \
  698. * 0x3 - L3 header checksum + L4 checksum \
  699. */ \
  700. cksum_offload:2, \
  701. \
  702. /* tx_comp_req - \
  703. * This flag indicates whether Tx Completion \
  704. * from fw is required or not. \
  705. * This flag is only relevant if tx completion is not \
  706. * universally enabled. \
  707. * For all LL systems, tx completion is mandatory, \
  708. * so this flag will be irrelevant. \
  709. * For HL systems tx completion is optional, but HL systems in which \
  710. * the bus throughput exceeds the WLAN throughput will \
  711. * probably want to always use tx completion, and thus \
  712. * would not check this flag. \
  713. * This flag is required when tx completions are not used universally, \
  714. * but are still required for certain tx frames for which \
  715. * an OTA delivery acknowledgment is needed by the host. \
  716. * In practice, this would be for HL systems in which the \
  717. * bus throughput is less than the WLAN throughput. \
  718. * \
  719. * 0x0 - Tx Completion Indication from Fw not required \
  720. * 0x1 - Tx Completion Indication from Fw is required \
  721. */ \
  722. tx_compl_req:1; \
  723. \
  724. \
  725. /* DWORD 1: MSDU length and ID */ \
  726. A_UINT32 \
  727. len:16, /* MSDU length, in bytes */ \
  728. id:16; /* MSDU ID used to identify the MSDU to the host, \
  729. * and this id is used to calculate fragmentation \
  730. * descriptor pointer inside the target based on \
  731. * the base address, configured inside the target. \
  732. */ \
  733. \
  734. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  735. /* frags_desc_ptr - \
  736. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  737. * where the tx frame's fragments reside in memory. \
  738. * This field only applies to LL systems, since in HL systems the \
  739. * (degenerate single-fragment) fragmentation descriptor is created \
  740. * within the target. \
  741. */ \
  742. _paddr__frags_desc_ptr_; \
  743. \
  744. /* DWORD 3 (or 4): peerid, chanfreq */ \
  745. /* \
  746. * Peer ID : Target can use this value to know which peer-id packet \
  747. * destined to. \
  748. * It's intended to be specified by host in case of NAWDS. \
  749. */ \
  750. A_UINT16 peerid; \
  751. \
  752. /* \
  753. * Channel frequency: This identifies the desired channel \
  754. * frequency (in mhz) for tx frames. This is used by FW to help \
  755. * determine when it is safe to transmit or drop frames for \
  756. * off-channel operation. \
  757. * The default value of zero indicates to FW that the \
  758. * corresponding VDEV's home channel (if there is one) is \
  759. * the desired channel frequency. \
  760. */ \
  761. A_UINT16 chanfreq; \
  762. \
  763. /* Reason reserved is commented is increasing the htt
  764. * structure size leads to some wierd issues.
  765. * A_UINT32 reserved_dword3_bits0_31; \
  766. */ \
  767. } POSTPACK
  768. /* define a htt_tx_msdu_desc32_t type */
  769. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  770. /* define a htt_tx_msdu_desc64_t type */
  771. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  772. /*
  773. * Make htt_tx_msdu_desc_t be an alias for either
  774. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  775. */
  776. #if HTT_PADDR64
  777. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  778. #else
  779. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  780. #endif
  781. /* decriptor information for Management frame*/
  782. /*
  783. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  784. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  785. */
  786. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  787. extern A_UINT32 mgmt_hdr_len;
  788. PREPACK struct htt_mgmt_tx_desc_t {
  789. A_UINT32 msg_type;
  790. #if HTT_PADDR64
  791. A_UINT64 frag_paddr; /* DMAble address of the data */
  792. #else
  793. A_UINT32 frag_paddr; /* DMAble address of the data */
  794. #endif
  795. A_UINT32 desc_id; /* returned to host during completion
  796. * to free the meory*/
  797. A_UINT32 len; /* Fragment length */
  798. A_UINT32 vdev_id; /* virtual device ID */
  799. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  800. } POSTPACK;
  801. PREPACK struct htt_mgmt_tx_compl_ind {
  802. A_UINT32 desc_id;
  803. A_UINT32 status;
  804. } POSTPACK;
  805. /*
  806. * This SDU header size comes from the summation of the following:
  807. * 1. Max of:
  808. * a. Native WiFi header, for native WiFi frames: 24 bytes
  809. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  810. * b. 802.11 header, for raw frames: 36 bytes
  811. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  812. * QoS header, HT header)
  813. * c. 802.3 header, for ethernet frames: 14 bytes
  814. * (destination address, source address, ethertype / length)
  815. * 2. Max of:
  816. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  817. * b. IPv6 header, up through the Traffic Class: 2 bytes
  818. * 3. 802.1Q VLAN header: 4 bytes
  819. * 4. LLC/SNAP header: 8 bytes
  820. */
  821. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  822. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  823. #define HTT_TX_HDR_SIZE_ETHERNET 14
  824. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  825. A_COMPILE_TIME_ASSERT(htt_encap_hdr_size_max_check_nwifi,
  826. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >=
  827. HTT_TX_HDR_SIZE_NATIVE_WIFI);
  828. A_COMPILE_TIME_ASSERT(htt_encap_hdr_size_max_check_enet,
  829. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >=
  830. HTT_TX_HDR_SIZE_ETHERNET);
  831. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  832. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  833. #define HTT_TX_HDR_SIZE_802_1Q 4
  834. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  835. #define HTT_COMMON_TX_FRM_HDR_LEN \
  836. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  837. HTT_TX_HDR_SIZE_802_1Q + \
  838. HTT_TX_HDR_SIZE_LLC_SNAP)
  839. #define HTT_HL_TX_FRM_HDR_LEN \
  840. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  841. #define HTT_LL_TX_FRM_HDR_LEN \
  842. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  843. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  844. /* dword 0 */
  845. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  846. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  847. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  848. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  849. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  850. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  851. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  852. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  853. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  854. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  855. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  856. #define HTT_TX_DESC_PKT_TYPE_S 13
  857. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  858. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  859. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  860. #define HTT_TX_DESC_VDEV_ID_S 16
  861. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  862. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  863. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  864. #define HTT_TX_DESC_EXT_TID_S 22
  865. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  866. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  867. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  868. #define HTT_TX_DESC_POSTPONED_S 27
  869. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  870. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  871. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  872. #define HTT_TX_DESC_EXTENSION_S 28
  873. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  874. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  875. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  876. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  877. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  878. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  879. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  880. #define HTT_TX_DESC_TX_COMP_S 31
  881. /* dword 1 */
  882. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  883. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  884. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  885. #define HTT_TX_DESC_FRM_LEN_S 0
  886. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  887. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  888. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  889. #define HTT_TX_DESC_FRM_ID_S 16
  890. /* dword 2 */
  891. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  892. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  893. /* for systems using 64-bit format for bus addresses */
  894. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  895. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  896. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  897. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  898. /* for systems using 32-bit format for bus addresses */
  899. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  900. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  901. /* dword 3 */
  902. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  903. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  904. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  905. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  906. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  907. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  908. #if HTT_PADDR64
  909. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  910. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  911. #else
  912. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  913. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  914. #endif
  915. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  916. #define HTT_TX_DESC_PEER_ID_S 0
  917. /*
  918. * TEMPORARY:
  919. * The original definitions for the PEER_ID fields contained typos
  920. * (with _DESC_PADDR appended to this PEER_ID field name).
  921. * Retain deprecated original names for PEER_ID fields until all code that
  922. * refers to them has been updated.
  923. */
  924. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  925. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  926. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  927. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  928. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  929. HTT_TX_DESC_PEER_ID_M
  930. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  931. HTT_TX_DESC_PEER_ID_S
  932. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  933. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  934. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  935. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  936. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  937. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  938. #if HTT_PADDR64
  939. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  940. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  941. #else
  942. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  943. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  944. #endif
  945. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  946. #define HTT_TX_DESC_CHAN_FREQ_S 16
  947. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  948. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  949. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  950. do { \
  951. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  952. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  953. } while (0)
  954. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  955. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  956. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  957. do { \
  958. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  959. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  960. } while (0)
  961. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  962. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  963. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  964. do { \
  965. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  966. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  967. } while (0)
  968. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  969. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  970. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  971. do { \
  972. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  973. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  974. } while (0)
  975. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  976. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  977. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  978. do { \
  979. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  980. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  981. } while (0)
  982. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  983. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  984. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  985. do { \
  986. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  987. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  988. } while (0)
  989. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  990. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  991. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  992. do { \
  993. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  994. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  995. } while (0)
  996. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  997. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  998. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  999. do { \
  1000. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1001. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1002. } while (0)
  1003. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1004. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1005. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1006. do { \
  1007. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1008. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1009. } while (0)
  1010. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1011. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1012. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1013. do { \
  1014. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1015. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1016. } while (0)
  1017. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1018. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1019. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1020. do { \
  1021. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1022. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1023. } while (0)
  1024. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1025. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1026. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1027. do { \
  1028. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1029. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1030. } while (0)
  1031. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1032. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1033. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1034. do { \
  1035. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1036. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1037. } while (0)
  1038. /* enums used in the HTT tx MSDU extension descriptor */
  1039. enum {
  1040. htt_tx_guard_interval_regular = 0,
  1041. htt_tx_guard_interval_short = 1,
  1042. };
  1043. enum {
  1044. htt_tx_preamble_type_ofdm = 0,
  1045. htt_tx_preamble_type_cck = 1,
  1046. htt_tx_preamble_type_ht = 2,
  1047. htt_tx_preamble_type_vht = 3,
  1048. };
  1049. enum {
  1050. htt_tx_bandwidth_5MHz = 0,
  1051. htt_tx_bandwidth_10MHz = 1,
  1052. htt_tx_bandwidth_20MHz = 2,
  1053. htt_tx_bandwidth_40MHz = 3,
  1054. htt_tx_bandwidth_80MHz = 4,
  1055. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1056. };
  1057. /**
  1058. * @brief HTT tx MSDU extension descriptor
  1059. * @details
  1060. * If the target supports HTT tx MSDU extension descriptors, the host has
  1061. * the option of appending the following struct following the regular
  1062. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1063. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1064. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1065. * tx specs for each frame.
  1066. */
  1067. PREPACK struct htt_tx_msdu_desc_ext_t {
  1068. /* DWORD 0: flags */
  1069. A_UINT32 valid_pwr:1,/* bit 0:if set, tx pwr spec is valid */
  1070. valid_mcs_mask:1,/* bit 1:if set, tx MCS mask spec is valid */
  1071. valid_nss_mask:1,/* bit 2:if set, tx Nss mask spec is valid */
  1072. valid_guard_interval:1,/* bit 3:if set, tx guard intv spec is valid */
  1073. valid_preamble_type_mask:1,/* 4:if set, tx preamble mask is valid */
  1074. valid_chainmask:1,/* bit 5:if set, tx chainmask spec is valid */
  1075. valid_retries:1,/* bit 6:if set, tx retries spec is valid */
  1076. valid_bandwidth:1,/* bit 7:if set, tx bandwidth spec is valid */
  1077. valid_expire_tsf:1,/* bit 8:if set, tx expire TSF spec is valid */
  1078. is_dsrc:1, /* bit 9:if set, MSDU is a DSRC frame */
  1079. reserved0_31_7:22; /* bits 31:10 - unused, set to 0x0 */
  1080. /* DWORD 1:tx power, tx rate, tx BW */
  1081. A_UINT32
  1082. /* pwr -
  1083. * Specify what power the tx frame needs to be transmitted at.
  1084. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1085. * The value needs to be appropriately sign-extended when extracting
  1086. * the value from the message and storing it in a variable that is
  1087. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1088. * automatically handles this sign-extension.)
  1089. * If the transmission uses multiple tx chains, this power spec is
  1090. * the total transmit power, assuming incoherent combination of
  1091. * per-chain power to produce the total power.
  1092. */
  1093. pwr:8,
  1094. /* mcs_mask -
  1095. * Specify the allowable values for MCS index (modulation and coding)
  1096. * to use for transmitting the frame.
  1097. *
  1098. * For HT / VHT preamble types, this mask directly corresponds to
  1099. * the HT or VHT MCS indices that are allowed. For each bit N set
  1100. * within the mask, MCS index N is allowed for transmitting the frame.
  1101. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1102. * rates versus OFDM rates, so the host has the option of specifying
  1103. * that the target must transmit the frame with CCK or OFDM rates
  1104. * (not HT or VHT), but leaving the decision to the target whether
  1105. * to use CCK or OFDM.
  1106. *
  1107. * For CCK and OFDM, the bits within this mask are interpreted as
  1108. * follows:
  1109. * bit 0 -> CCK 1 Mbps rate is allowed
  1110. * bit 1 -> CCK 2 Mbps rate is allowed
  1111. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1112. * bit 3 -> CCK 11 Mbps rate is allowed
  1113. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1114. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1115. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1116. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1117. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1118. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1119. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1120. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1121. *
  1122. * The MCS index specification needs to be compatible with the
  1123. * bandwidth mask specification. For example, a MCS index == 9
  1124. * specification is inconsistent with a preamble type == VHT,
  1125. * Nss == 1, and channel bandwidth == 20 MHz.
  1126. *
  1127. * Furthermore, the host has only a limited ability to specify to
  1128. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1129. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1130. */
  1131. mcs_mask:12,
  1132. /* nss_mask -
  1133. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1134. * Each bit in this mask corresponds to a Nss value:
  1135. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1136. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1137. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1138. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1139. * The values in the Nss mask must be suitable for the recipient, e.g.
  1140. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1141. * recipient which only supports 2x2 MIMO.
  1142. */
  1143. nss_mask:4,
  1144. /* guard_interval -
  1145. * Specify a htt_tx_guard_interval enum value to indicate whether
  1146. * the transmission should use a regular guard interval or a
  1147. * short guard interval.
  1148. */
  1149. guard_interval:1,
  1150. /* preamble_type_mask -
  1151. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1152. * may choose from for transmitting this frame.
  1153. * The bits in this mask correspond to the values in the
  1154. * htt_tx_preamble_type enum. For example, to allow the target
  1155. * to transmit the frame as either CCK or OFDM, this field would
  1156. * be set to
  1157. * (1 << htt_tx_preamble_type_ofdm) |
  1158. * (1 << htt_tx_preamble_type_cck)
  1159. */
  1160. preamble_type_mask:4,
  1161. reserved1_31_29:3; /* unused, set to 0x0 */
  1162. /* DWORD 2: tx chain mask, tx retries */
  1163. A_UINT32
  1164. /* chain_mask - specify which chains to transmit from */
  1165. chain_mask:4,
  1166. /* retry_limit -
  1167. * Specify the maximum number of transmissions, including the
  1168. * initial transmission, to attempt before giving up if no ack
  1169. * is received.
  1170. * If the tx rate is specified, then all retries shall use the
  1171. * same rate as the initial transmission.
  1172. * If no tx rate is specified, the target can choose whether to
  1173. * retain the original rate during the retransmissions, or to
  1174. * fall back to a more robust rate.
  1175. */
  1176. retry_limit:4,
  1177. /* bandwidth_mask -
  1178. * Specify what channel widths may be used for the transmission.
  1179. * A value of zero indicates "don't care" - the target may choose
  1180. * the transmission bandwidth.
  1181. * The bits within this mask correspond to the htt_tx_bandwidth
  1182. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1183. * The bandwidth_mask must be consistent with the
  1184. * preamble_type_mask * and mcs_mask specs, if they are
  1185. * provided. For example,
  1186. * 80 MHz and 160 MHz can only be enabled in the mask
  1187. * if preamble_type == VHT.
  1188. */
  1189. bandwidth_mask:6,
  1190. reserved2_31_14:18; /* unused, set to 0x0 */
  1191. /* DWORD 3: tx expiry time (TSF) LSBs */
  1192. A_UINT32 expire_tsf_lo;
  1193. /* DWORD 4: tx expiry time (TSF) MSBs */
  1194. A_UINT32 expire_tsf_hi;
  1195. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1196. } POSTPACK;
  1197. /* DWORD 0 */
  1198. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1199. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1200. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1201. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1202. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1203. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1204. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1205. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1206. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1207. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1208. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1209. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1210. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1211. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1213. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1214. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1216. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1217. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1218. /* DWORD 1 */
  1219. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1220. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1221. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1222. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1223. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1224. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1225. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1226. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1227. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1228. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1229. /* DWORD 2 */
  1230. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1231. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1232. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1233. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1234. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1235. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1236. /* DWORD 0 */
  1237. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1238. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1239. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1240. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1241. do { \
  1242. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1243. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1244. } while (0)
  1245. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1246. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1247. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1248. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1249. do { \
  1250. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1251. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1252. } while (0)
  1253. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1254. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1255. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1256. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1257. do { \
  1258. HTT_CHECK_SET_VAL( \
  1259. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1260. ((_var) |= ((_val) \
  1261. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1262. } while (0)
  1263. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1264. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >>\
  1265. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1266. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1267. do { \
  1268. HTT_CHECK_SET_VAL( \
  1269. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1270. ((_var) |= ((_val) \
  1271. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1272. } while (0)
  1273. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1274. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1275. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1276. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1277. do { \
  1278. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1279. ((_var) |= ((_val) << \
  1280. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1281. } while (0)
  1282. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1283. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1284. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1285. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1286. do { \
  1287. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1288. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1289. } while (0)
  1290. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1291. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1292. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1293. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1294. do { \
  1295. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1296. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1297. } while (0)
  1298. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1299. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1300. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1301. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1302. do { \
  1303. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1304. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1305. } while (0)
  1306. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1307. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1308. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1309. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1310. do { \
  1311. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1312. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1313. } while (0)
  1314. /* DWORD 1 */
  1315. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1316. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1317. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1318. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1319. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1320. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1321. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1322. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1323. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1324. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1325. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1326. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1327. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1328. do { \
  1329. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1330. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1331. } while (0)
  1332. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1333. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1334. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1335. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1336. do { \
  1337. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1338. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1339. } while (0)
  1340. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1341. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1342. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1343. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1344. do { \
  1345. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1346. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1347. } while (0)
  1348. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1349. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1350. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1351. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1352. do { \
  1353. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK,\
  1354. _val); \
  1355. ((_var) |= ((_val) << \
  1356. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1357. } while (0)
  1358. /* DWORD 2 */
  1359. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1360. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1361. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1362. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1363. do { \
  1364. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1365. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1366. } while (0)
  1367. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1368. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1369. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1370. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1371. do { \
  1372. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1373. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1374. } while (0)
  1375. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1376. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1377. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1378. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1379. do { \
  1380. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1381. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1382. } while (0)
  1383. typedef enum {
  1384. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1385. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1386. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1387. } htt_11ax_ltf_subtype_t;
  1388. typedef enum {
  1389. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1390. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1391. HTT_TX_MSDU_EXT2_DESC_PREAM_HT,
  1392. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1393. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1394. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1395. } htt_tx_ext2_preamble_type_t;
  1396. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1397. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1398. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1399. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1400. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1401. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1402. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1403. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1404. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1405. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1406. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1407. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1408. /**
  1409. * @brief HTT tx MSDU extension descriptor v2
  1410. * @details
  1411. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1412. * is received as tcl_exit_base->host_meta_info in firmware.
  1413. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1414. * are already part of tcl_exit_base.
  1415. */
  1416. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1417. /* DWORD 0: flags */
  1418. A_UINT32
  1419. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1420. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1421. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1422. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1423. valid_retries : 1, /* if set, tx retries spec is valid */
  1424. /* if set, tx dyn_bw and bw_mask are valid */
  1425. valid_bw_info : 1,
  1426. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1427. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1428. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1429. valid_key_flags : 1, /* if set, key flags is valid */
  1430. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1431. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1432. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1433. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1434. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1435. * 1 = ENCRYPT,
  1436. * 2 ~ 3 - Reserved
  1437. */
  1438. /* retry_limit -
  1439. * Specify the maximum number of transmissions, including the
  1440. * initial transmission, to attempt before giving up if no ack
  1441. * is received.
  1442. * If the tx rate is specified, then all retries shall use the
  1443. * same rate as the initial transmission.
  1444. * If no tx rate is specified, the target can choose whether to
  1445. * retain the original rate during the retransmissions, or to
  1446. * fall back to a more robust rate.
  1447. */
  1448. retry_limit : 4,
  1449. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1450. * Valid only for 11ax preamble types HE_SU
  1451. * and HE_EXT_SU
  1452. */
  1453. /* Takes enum values of htt_11ax_ltf_subtype_t
  1454. * Valid only for 11ax preamble types HE_SU
  1455. * and HE_EXT_SU
  1456. */
  1457. ltf_subtype_11ax : 2,
  1458. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1459. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1460. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1461. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1462. */
  1463. reserved0_31 : 1;
  1464. /* DWORD 1: tx power, tx rate */
  1465. A_UINT32
  1466. /* unit of the power field is 0.5 dbm
  1467. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1468. * signed value ranging from -64dbm to 63.5 dbm
  1469. */
  1470. power : 8,
  1471. /* mcs bit mask of 0 ~ 11
  1472. * Setting more than one MCS isn't currently
  1473. * supported by the target (but is supported
  1474. * in the interface in case in the future
  1475. * the target supports specifications of
  1476. * a limited set of MCS values.
  1477. */
  1478. mcs_mask : 12,
  1479. /* Nss bit mask 0 ~ 7
  1480. * Setting more than one Nss isn't currently
  1481. * supported by the target (but is supported
  1482. * in the interface in case in the future
  1483. * the target supports specifications of
  1484. * a limited set of Nss values.
  1485. */
  1486. nss_mask : 8,
  1487. /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1488. pream_type : 3,
  1489. /*
  1490. * When set these custom values will be used for all packets,
  1491. * until the next update via this ext header. This is to make
  1492. * sure not all packets need to include this header.
  1493. */
  1494. update_peer_cache : 1;
  1495. /* DWORD 2: tx chain mask, tx retries */
  1496. A_UINT32
  1497. /* chain_mask - specify which chains to transmit from */
  1498. chain_mask : 8,
  1499. /* Key Index and related flags - used in mesh mode
  1500. * TODO: Update Enum values for key_flags
  1501. */
  1502. key_flags : 8,
  1503. /*
  1504. * Channel frequency: This identifies the desired channel
  1505. * frequency (in MHz) for tx frames. This is used by FW to help
  1506. * determine when it is safe to transmit or drop frames for
  1507. * off-channel operation.
  1508. * The default value of zero indicates to FW that the corresponding
  1509. * VDEV's home channel (if there is one) is the desired channel
  1510. * frequency.
  1511. */
  1512. chanfreq : 16;
  1513. /* DWORD 3: tx expiry time (TSF) LSBs */
  1514. A_UINT32 expire_tsf_lo;
  1515. /* DWORD 4: tx expiry time (TSF) MSBs */
  1516. A_UINT32 expire_tsf_hi;
  1517. /*
  1518. * DWORD 5: reserved
  1519. * This structure can be expanded further up to 60 bytes
  1520. * by adding further DWORDs as needed.
  1521. */
  1522. A_UINT32 rsvd0;
  1523. } POSTPACK;
  1524. /* DWORD 0 */
  1525. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1526. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1527. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1528. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1529. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1530. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1531. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1532. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1533. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1534. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1535. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1536. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1537. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1538. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1539. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1540. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1541. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1542. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1543. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1544. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1545. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1546. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1547. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1548. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1549. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1550. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1551. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1552. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1553. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1554. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1555. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1556. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1557. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1558. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1559. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1560. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1561. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1562. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1563. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1564. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1565. /* DWORD 1 */
  1566. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1567. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1568. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1569. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1570. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1571. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1572. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1573. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1574. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1575. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1576. /* DWORD 2 */
  1577. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1578. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1579. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1580. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1581. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1582. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1583. /* DWORD 0 */
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1585. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1586. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1587. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1588. do { \
  1589. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1590. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S));\
  1591. } while (0)
  1592. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1593. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1594. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1595. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1596. do { \
  1597. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK,\
  1598. _val); \
  1599. ((_var) |= \
  1600. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1601. } while (0)
  1602. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1603. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1604. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1605. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1606. do { \
  1607. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK,\
  1608. _val); \
  1609. ((_var) |= \
  1610. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1611. } while (0)
  1612. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1613. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1614. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1615. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1616. do { \
  1617. HTT_CHECK_SET_VAL( \
  1618. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1619. ((_var) |= ((_val) \
  1620. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1621. } while (0)
  1622. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1623. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1624. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1625. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1626. do { \
  1627. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES,\
  1628. _val); \
  1629. ((_var) |= ((_val) << \
  1630. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1631. } while (0)
  1632. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1633. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1634. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1635. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1636. do { \
  1637. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO,\
  1638. _val); \
  1639. ((_var) |= \
  1640. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1641. } while (0)
  1642. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1643. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >>\
  1644. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1645. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1646. do { \
  1647. HTT_CHECK_SET_VAL( \
  1648. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1649. ((_var) |= ((_val) \
  1650. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1651. } while (0)
  1652. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1653. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1654. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1655. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1656. do { \
  1657. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK,\
  1658. _val); \
  1659. ((_var) |= \
  1660. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1661. } while (0)
  1662. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1663. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1664. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1665. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1666. do { \
  1667. HTT_CHECK_SET_VAL( \
  1668. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1669. ((_var) |= \
  1670. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1671. } while (0)
  1672. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1673. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1674. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1675. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1676. do { \
  1677. HTT_CHECK_SET_VAL( \
  1678. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1679. ((_var) |= \
  1680. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1681. } while (0)
  1682. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1683. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1684. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1685. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1686. do { \
  1687. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME,\
  1688. _val); \
  1689. ((_var) |= ((_val) << \
  1690. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1691. } while (0)
  1692. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1693. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1694. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1695. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1696. do { \
  1697. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ,\
  1698. _val); \
  1699. ((_var) |= ((_val) << \
  1700. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S));\
  1701. } while (0)
  1702. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1703. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1704. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1705. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1706. do { \
  1707. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val);\
  1708. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S));\
  1709. } while (0)
  1710. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1711. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1712. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1713. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1714. do { \
  1715. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val);\
  1716. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S));\
  1717. } while (0)
  1718. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1719. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1720. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1721. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1722. do { \
  1723. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val);\
  1724. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S));\
  1725. } while (0)
  1726. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1727. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1728. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1729. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1730. do { \
  1731. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val);\
  1732. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S));\
  1733. } while (0)
  1734. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1735. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1736. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1737. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1738. do { \
  1739. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val);\
  1740. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S));\
  1741. } while (0)
  1742. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1743. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1744. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1745. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1746. do { \
  1747. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX,\
  1748. _val); \
  1749. ((_var) |= ((_val) << \
  1750. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1751. } while (0)
  1752. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1753. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1754. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1755. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1756. do { \
  1757. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1758. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S));\
  1759. } while (0)
  1760. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1761. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1762. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1763. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1764. do { \
  1765. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val);\
  1766. ((_var) |= ((_val) << \
  1767. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1768. } while (0)
  1769. /* DWORD 1 */
  1770. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1771. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1772. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1773. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1774. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1775. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1776. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1777. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1778. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1779. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1780. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1781. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1782. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1783. do { \
  1784. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val);\
  1785. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S));\
  1786. } while (0)
  1787. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1788. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1789. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1790. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1791. do { \
  1792. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val);\
  1793. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S));\
  1794. } while (0)
  1795. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1796. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1797. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1798. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1799. do { \
  1800. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val);\
  1801. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S));\
  1802. } while (0)
  1803. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1804. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1805. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1806. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1807. do { \
  1808. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1809. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1810. } while (0)
  1811. /* DWORD 2 */
  1812. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1813. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1814. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1815. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1816. do { \
  1817. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val);\
  1818. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S));\
  1819. } while (0)
  1820. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1821. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1822. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1823. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1824. do { \
  1825. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val);\
  1826. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S));\
  1827. } while (0)
  1828. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1829. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1830. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1831. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1832. do { \
  1833. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val);\
  1834. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S));\
  1835. } while (0)
  1836. typedef enum {
  1837. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1838. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1839. } htt_tcl_metadata_type;
  1840. /**
  1841. * @brief HTT TCL command number format
  1842. * @details
  1843. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1844. * available to firmware as tcl_exit_base->tcl_status_number.
  1845. * For regular / multicast packets host will send vdev and mac id and for
  1846. * NAWDS packets, host will send peer id.
  1847. * A_UINT32 is used to avoid endianness conversion problems.
  1848. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1849. */
  1850. typedef struct {
  1851. A_UINT32
  1852. type: 1, /* vdev_id based or peer_id based */
  1853. rsvd: 31;
  1854. } htt_tx_tcl_vdev_or_peer_t;
  1855. typedef struct {
  1856. A_UINT32
  1857. type: 1, /* vdev_id based or peer_id based */
  1858. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1859. vdev_id: 8,
  1860. pdev_id: 2,
  1861. host_inspected:1,
  1862. rsvd: 19;
  1863. } htt_tx_tcl_vdev_metadata;
  1864. typedef struct {
  1865. A_UINT32
  1866. type: 1, /* vdev_id based or peer_id based */
  1867. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1868. peer_id: 14,
  1869. rsvd: 16;
  1870. } htt_tx_tcl_peer_metadata;
  1871. PREPACK struct htt_tx_tcl_metadata {
  1872. union {
  1873. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1874. htt_tx_tcl_vdev_metadata vdev_meta;
  1875. htt_tx_tcl_peer_metadata peer_meta;
  1876. };
  1877. } POSTPACK;
  1878. /* DWORD 0 */
  1879. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1880. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1881. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1882. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1883. /* VDEV metadata */
  1884. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1885. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1886. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1887. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1888. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1889. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1890. /* PEER metadata */
  1891. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1892. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1893. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1894. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1895. HTT_TX_TCL_METADATA_TYPE_S)
  1896. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1897. do { \
  1898. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val);\
  1899. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S));\
  1900. } while (0)
  1901. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1902. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1903. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1904. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1905. do { \
  1906. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val);\
  1907. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S));\
  1908. } while (0)
  1909. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1910. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1911. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1912. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1913. do { \
  1914. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val);\
  1915. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S));\
  1916. } while (0)
  1917. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1918. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1919. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1920. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1921. do { \
  1922. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val);\
  1923. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S));\
  1924. } while (0)
  1925. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1926. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1927. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1928. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1929. do { \
  1930. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED,\
  1931. _val); \
  1932. ((_var) |= ((_val) <<\
  1933. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1934. } while (0)
  1935. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1936. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1937. HTT_TX_TCL_METADATA_PEER_ID_S)
  1938. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1939. do { \
  1940. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val);\
  1941. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S));\
  1942. } while (0)
  1943. typedef enum {
  1944. HTT_TX_FW2WBM_TX_STATUS_OK,
  1945. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1946. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1947. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1948. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1949. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  1950. HTT_TX_FW2WBM_TX_STATUS_MAX
  1951. } htt_tx_fw2wbm_tx_status_t;
  1952. typedef enum {
  1953. /* deprecated */
  1954. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1955. /* current */
  1956. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP =
  1957. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1958. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1959. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1960. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1961. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1962. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1963. } htt_tx_fw2wbm_reinject_reason_t;
  1964. /**
  1965. * @brief HTT TX WBM Completion from firmware to host
  1966. * @details
  1967. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1968. * DWORD 3 and 4 for software based completions (Exception frames and
  1969. * TQM bypass frames)
  1970. * For software based completions, wbm_release_ring->release_source_module will
  1971. * be set to release_source_fw
  1972. */
  1973. PREPACK struct htt_tx_wbm_completion {
  1974. A_UINT32
  1975. sch_cmd_id: 24,
  1976. /* If set, this packet was queued via exception path */
  1977. exception_frame: 1,
  1978. rsvd0_31_25: 7;
  1979. A_UINT32
  1980. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1981. * reception of an ACK or BA, this field indicates
  1982. * the RSSI of the received ACK or BA frame.
  1983. * When the frame is removed as result of a direct
  1984. * remove command from the SW, this field is set
  1985. * to 0x0 (which is never a valid value when real
  1986. * RSSI is available).
  1987. * Units: dB w.r.t noise floor
  1988. */
  1989. /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1990. tx_status: 4,
  1991. /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1992. reinject_reason: 4,
  1993. rsvd1_31_16: 16;
  1994. } POSTPACK;
  1995. /* DWORD 0 */
  1996. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1997. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1998. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1999. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2000. /* DWORD 1 */
  2001. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2002. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2003. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2004. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2005. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2006. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2007. /* DWORD 0 */
  2008. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2009. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2010. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2011. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2012. do { \
  2013. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val);\
  2014. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S));\
  2015. } while (0)
  2016. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2017. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2018. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2019. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2020. do { \
  2021. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val);\
  2022. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S));\
  2023. } while (0)
  2024. /* DWORD 1 */
  2025. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2026. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2027. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2028. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2029. do { \
  2030. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val);\
  2031. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S));\
  2032. } while (0)
  2033. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2034. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2035. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2036. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2037. do { \
  2038. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val);\
  2039. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S));\
  2040. } while (0)
  2041. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2042. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2043. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2044. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2045. do { \
  2046. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val);\
  2047. ((_var) |= ((_val) << \
  2048. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2049. } while (0)
  2050. /**
  2051. * @brief HTT TX WBM Completion from firmware to host
  2052. * @details
  2053. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2054. * (WBM) offload HW.
  2055. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2056. * For software based completions, release_source_module will
  2057. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2058. * struct wbm_release_ring and then switch to this after looking at
  2059. * release_source_module.
  2060. */
  2061. PREPACK struct htt_tx_wbm_completion_v2 {
  2062. /* Refer to struct wbm_release_ring */
  2063. A_UINT32 used_by_hw0;
  2064. /* Refer to struct wbm_release_ring */
  2065. A_UINT32 used_by_hw1;
  2066. A_UINT32
  2067. /* Refer to struct wbm_release_ring */
  2068. used_by_hw2: 9,
  2069. /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2070. tx_status: 4,
  2071. /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2072. reinject_reason: 4,
  2073. exception_frame: 1,
  2074. /* For future use */
  2075. rsvd0: 14;
  2076. /*
  2077. * data0,1 and 2 changes based on tx_status type
  2078. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2079. * or HTT_TX_FW2WBM_TX_STATUS_TTL,
  2080. * struct htt_tx_wbm_transmit_status will be used.
  2081. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2082. * struct htt_tx_wbm_reinject_status will be used.
  2083. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2084. * struct htt_tx_wbm_mec_addr_notify will be used.
  2085. */
  2086. A_UINT32
  2087. data0: 32;
  2088. A_UINT32
  2089. data1: 32;
  2090. A_UINT32
  2091. data2: 32;
  2092. /* Refer to struct wbm_release_ring */
  2093. A_UINT32
  2094. used_by_hw3;
  2095. } POSTPACK;
  2096. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2097. /* DWORD 3 */
  2098. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2099. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2100. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2101. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2102. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2103. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2104. /* DWORD 3 */
  2105. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2106. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2107. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2108. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2109. do { \
  2110. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2111. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2112. } while (0)
  2113. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2114. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2115. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2116. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2117. do { \
  2118. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2119. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2120. } while (0)
  2121. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2122. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2123. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2124. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2125. do { \
  2126. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2127. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2128. } while (0)
  2129. /**
  2130. * @brief HTT TX WBM transmit status from firmware to host
  2131. * @details
  2132. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2133. * (WBM) offload HW.
  2134. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2135. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2136. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2137. */
  2138. PREPACK struct htt_tx_wbm_transmit_status {
  2139. A_UINT32
  2140. sch_cmd_id: 24,
  2141. /* If this frame is removed as the result of the
  2142. * reception of an ACK or BA, this field indicates
  2143. * the RSSI of the received ACK or BA frame.
  2144. * When the frame is removed as result of a direct
  2145. * remove command from the SW, this field is set
  2146. * to 0x0 (which is never a valid value when real
  2147. * RSSI is available).
  2148. * Units: dB w.r.t noise floor
  2149. */
  2150. ack_frame_rssi: 8;
  2151. A_UINT32
  2152. reserved0: 32;
  2153. A_UINT32
  2154. reserved1: 32;
  2155. } POSTPACK;
  2156. /* DWORD 4 */
  2157. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2158. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2159. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2160. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2161. /* DWORD 4 */
  2162. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2163. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2164. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2165. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2166. do { \
  2167. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2168. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2169. } while (0)
  2170. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2171. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2172. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2173. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2174. do { \
  2175. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2176. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2177. } while (0)
  2178. /**
  2179. * @brief HTT TX WBM reinject status from firmware to host
  2180. * @details
  2181. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2182. * (WBM) offload HW.
  2183. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2184. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2185. */
  2186. PREPACK struct htt_tx_wbm_reinject_status {
  2187. A_UINT32
  2188. reserved0: 32;
  2189. A_UINT32
  2190. reserved1: 32;
  2191. A_UINT32
  2192. reserved2: 32;
  2193. } POSTPACK;
  2194. /**
  2195. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2196. * @details
  2197. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2198. * (WBM) offload HW.
  2199. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2200. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2201. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2202. * STA side.
  2203. */
  2204. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2205. A_UINT32
  2206. mec_sa_addr_31_0;
  2207. A_UINT32
  2208. mec_sa_addr_47_32: 16,
  2209. sa_ast_index: 16;
  2210. A_UINT32
  2211. vdev_id: 8,
  2212. reserved0: 24;
  2213. } POSTPACK;
  2214. /* DWORD 4 - mec_sa_addr_31_0 */
  2215. /* DWORD 5 */
  2216. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2217. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2218. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2219. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2220. /* DWORD 6 */
  2221. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2222. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2223. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2224. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2225. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2226. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2227. do { \
  2228. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2229. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2230. } while (0)
  2231. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2232. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2233. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2234. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2235. do { \
  2236. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2237. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2238. } while (0)
  2239. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2240. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2241. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2242. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2243. do { \
  2244. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2245. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2246. } while (0)
  2247. typedef enum {
  2248. TX_FLOW_PRIORITY_BE,
  2249. TX_FLOW_PRIORITY_HIGH,
  2250. TX_FLOW_PRIORITY_LOW,
  2251. } htt_tx_flow_priority_t;
  2252. typedef enum {
  2253. TX_FLOW_LATENCY_SENSITIVE,
  2254. TX_FLOW_LATENCY_INSENSITIVE,
  2255. } htt_tx_flow_latency_t;
  2256. typedef enum {
  2257. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2258. TX_FLOW_INTERACTIVE_TRAFFIC,
  2259. TX_FLOW_PERIODIC_TRAFFIC,
  2260. TX_FLOW_BURSTY_TRAFFIC,
  2261. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2262. } htt_tx_flow_traffic_pattern_t;
  2263. /**
  2264. * @brief HTT TX Flow search metadata format
  2265. * @details
  2266. * Host will set this metadata in flow table's flow search entry along with
  2267. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2268. * firmware and TQM ring if the flow search entry wins.
  2269. * This metadata is available to firmware in that first MSDU's
  2270. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2271. * to one of the available flows for specific tid and returns the tqm flow
  2272. * pointer as part of htt_tx_map_flow_info message.
  2273. */
  2274. PREPACK struct htt_tx_flow_metadata {
  2275. A_UINT32
  2276. rsvd0_1_0: 2,
  2277. tid: 4,
  2278. /* Takes enum values of htt_tx_flow_priority_t */
  2279. priority: 3,
  2280. /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2281. traffic_pattern: 3,
  2282. /* If set, tid field in this struct is the final tid.
  2283. * Else choose final tid based on latency, priority.
  2284. */
  2285. tid_override: 1,
  2286. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2287. /* Takes enum values of htt_tx_flow_latency_t */
  2288. latency_sensitive: 2,
  2289. /* Used by host to map flow metadata with flow entry */
  2290. host_flow_identifier: 16;
  2291. } POSTPACK;
  2292. /* DWORD 0 */
  2293. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2294. #define HTT_TX_FLOW_METADATA_TID_S 2
  2295. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2296. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2297. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2298. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2299. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2300. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2301. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2302. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2303. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2304. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2305. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2306. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2307. /* DWORD 0 */
  2308. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2309. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2310. HTT_TX_FLOW_METADATA_TID_S)
  2311. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2312. do { \
  2313. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2314. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2315. } while (0)
  2316. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2317. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2318. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2319. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2320. do { \
  2321. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2322. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S));\
  2323. } while (0)
  2324. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2325. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2326. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2327. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2328. do { \
  2329. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val);\
  2330. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S));\
  2331. } while (0)
  2332. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2333. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2334. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2335. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2336. do { \
  2337. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val);\
  2338. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S));\
  2339. } while (0)
  2340. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2341. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2342. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2343. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2344. do { \
  2345. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val);\
  2346. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S));\
  2347. } while (0)
  2348. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2349. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2350. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2351. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2352. do { \
  2353. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2354. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S));\
  2355. } while (0)
  2356. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2357. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2358. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2359. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2360. do { \
  2361. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val);\
  2362. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S));\
  2363. } while (0)
  2364. /**
  2365. * @brief for HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and
  2366. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2367. *
  2368. * @details
  2369. * HTT wds entry from source port learning
  2370. * Host will learn wds entries from rx and send this message to firmware
  2371. * to enable firmware to configure/delete AST entries for wds clients.
  2372. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2373. * and when SA's entry is deleted, firmware removes this AST entry
  2374. *
  2375. * The message would appear as follows:
  2376. *
  2377. * |31 30|29 |17 16|15 8|7 0|
  2378. * |----------------+----------------+----------------+----------------|
  2379. * | rsvd0 |PDVID| vdev_id | msg_type |
  2380. * |-------------------------------------------------------------------|
  2381. * | sa_addr_31_0 |
  2382. * |-------------------------------------------------------------------|
  2383. * | | ta_peer_id | sa_addr_47_32 |
  2384. * |-------------------------------------------------------------------|
  2385. * Where PDVID = pdev_id
  2386. *
  2387. * The message is interpreted as follows:
  2388. *
  2389. * dword0 - b'0:7 - msg_type: This will be set to
  2390. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2391. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2392. *
  2393. * dword0 - b'8:15 - vdev_id
  2394. *
  2395. * dword0 - b'16:17 - pdev_id
  2396. *
  2397. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2398. *
  2399. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2400. *
  2401. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2402. *
  2403. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2404. */
  2405. PREPACK struct htt_wds_entry {
  2406. A_UINT32
  2407. msg_type: 8,
  2408. vdev_id: 8,
  2409. pdev_id: 2,
  2410. rsvd0: 14;
  2411. A_UINT32 sa_addr_31_0;
  2412. A_UINT32
  2413. sa_addr_47_32: 16,
  2414. ta_peer_id: 14,
  2415. rsvd2: 2;
  2416. } POSTPACK;
  2417. /* DWORD 0 */
  2418. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2419. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2420. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2421. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2422. /* DWORD 2 */
  2423. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2424. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2425. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2426. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2427. /* DWORD 0 */
  2428. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2429. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2430. HTT_WDS_ENTRY_VDEV_ID_S)
  2431. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2432. do { \
  2433. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2434. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2435. } while (0)
  2436. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2437. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2438. HTT_WDS_ENTRY_PDEV_ID_S)
  2439. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2440. do { \
  2441. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2442. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2443. } while (0)
  2444. /* DWORD 2 */
  2445. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2446. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2447. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2448. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2449. do { \
  2450. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2451. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2452. } while (0)
  2453. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2454. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2455. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2456. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2457. do { \
  2458. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2459. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2460. } while (0)
  2461. /**
  2462. * @brief MAC DMA rx ring setup specification
  2463. * @details
  2464. * To allow for dynamic rx ring reconfiguration and to avoid race
  2465. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2466. * it uses. Instead, it sends this message to the target, indicating how
  2467. * the rx ring used by the host should be set up and maintained.
  2468. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2469. * specifications.
  2470. *
  2471. * |31 16|15 8|7 0|
  2472. * |---------------------------------------------------------------|
  2473. * header: | reserved | num rings | msg type |
  2474. * |---------------------------------------------------------------|
  2475. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2476. #if HTT_PADDR64
  2477. * | FW_IDX shadow register physical address (bits 63:32) |
  2478. #endif
  2479. * |---------------------------------------------------------------|
  2480. * | rx ring base physical address (bits 31:0) |
  2481. #if HTT_PADDR64
  2482. * | rx ring base physical address (bits 63:32) |
  2483. #endif
  2484. * |---------------------------------------------------------------|
  2485. * | rx ring buffer size | rx ring length |
  2486. * |---------------------------------------------------------------|
  2487. * | FW_IDX initial value | enabled flags |
  2488. * |---------------------------------------------------------------|
  2489. * | MSDU payload offset | 802.11 header offset |
  2490. * |---------------------------------------------------------------|
  2491. * | PPDU end offset | PPDU start offset |
  2492. * |---------------------------------------------------------------|
  2493. * | MPDU end offset | MPDU start offset |
  2494. * |---------------------------------------------------------------|
  2495. * | MSDU end offset | MSDU start offset |
  2496. * |---------------------------------------------------------------|
  2497. * | frag info offset | rx attention offset |
  2498. * |---------------------------------------------------------------|
  2499. * payload 2, if present, has the same format as payload 1
  2500. * Header fields:
  2501. * - MSG_TYPE
  2502. * Bits 7:0
  2503. * Purpose: identifies this as an rx ring configuration message
  2504. * Value: 0x2
  2505. * - NUM_RINGS
  2506. * Bits 15:8
  2507. * Purpose: indicates whether the host is setting up one rx ring or two
  2508. * Value: 1 or 2
  2509. * Payload:
  2510. * for systems using 64-bit format for bus addresses:
  2511. * - IDX_SHADOW_REG_PADDR_LO
  2512. * Bits 31:0
  2513. * Value: lower 4 bytes of physical address of the host's
  2514. * FW_IDX shadow register
  2515. * - IDX_SHADOW_REG_PADDR_HI
  2516. * Bits 31:0
  2517. * Value: upper 4 bytes of physical address of the host's
  2518. * FW_IDX shadow register
  2519. * - RING_BASE_PADDR_LO
  2520. * Bits 31:0
  2521. * Value: lower 4 bytes of physical address of the host's rx ring
  2522. * - RING_BASE_PADDR_HI
  2523. * Bits 31:0
  2524. * Value: uppper 4 bytes of physical address of the host's rx ring
  2525. * for systems using 32-bit format for bus addresses:
  2526. * - IDX_SHADOW_REG_PADDR
  2527. * Bits 31:0
  2528. * Value: physical address of the host's FW_IDX shadow register
  2529. * - RING_BASE_PADDR
  2530. * Bits 31:0
  2531. * Value: physical address of the host's rx ring
  2532. * - RING_LEN
  2533. * Bits 15:0
  2534. * Value: number of elements in the rx ring
  2535. * - RING_BUF_SZ
  2536. * Bits 31:16
  2537. * Value: size of the buffers referenced by the rx ring, in byte units
  2538. * - ENABLED_FLAGS
  2539. * Bits 15:0
  2540. * Value: 1-bit flags to show whether different rx fields are enabled
  2541. * bit 0: 802.11 header enabled (1) or disabled (0)
  2542. * bit 1: MSDU payload enabled (1) or disabled (0)
  2543. * bit 2: PPDU start enabled (1) or disabled (0)
  2544. * bit 3: PPDU end enabled (1) or disabled (0)
  2545. * bit 4: MPDU start enabled (1) or disabled (0)
  2546. * bit 5: MPDU end enabled (1) or disabled (0)
  2547. * bit 6: MSDU start enabled (1) or disabled (0)
  2548. * bit 7: MSDU end enabled (1) or disabled (0)
  2549. * bit 8: rx attention enabled (1) or disabled (0)
  2550. * bit 9: frag info enabled (1) or disabled (0)
  2551. * bit 10: unicast rx enabled (1) or disabled (0)
  2552. * bit 11: multicast rx enabled (1) or disabled (0)
  2553. * bit 12: ctrl rx enabled (1) or disabled (0)
  2554. * bit 13: mgmt rx enabled (1) or disabled (0)
  2555. * bit 14: null rx enabled (1) or disabled (0)
  2556. * bit 15: phy data rx enabled (1) or disabled (0)
  2557. * - IDX_INIT_VAL
  2558. * Bits 31:16
  2559. * Purpose: Specify the initial value for the FW_IDX.
  2560. * Value: the number of buffers initially present in the host's rx ring
  2561. * - OFFSET_802_11_HDR
  2562. * Bits 15:0
  2563. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2564. * - OFFSET_MSDU_PAYLOAD
  2565. * Bits 31:16
  2566. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2567. * - OFFSET_PPDU_START
  2568. * Bits 15:0
  2569. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2570. * - OFFSET_PPDU_END
  2571. * Bits 31:16
  2572. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2573. * - OFFSET_MPDU_START
  2574. * Bits 15:0
  2575. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2576. * - OFFSET_MPDU_END
  2577. * Bits 31:16
  2578. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2579. * - OFFSET_MSDU_START
  2580. * Bits 15:0
  2581. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2582. * - OFFSET_MSDU_END
  2583. * Bits 31:16
  2584. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2585. * - OFFSET_RX_ATTN
  2586. * Bits 15:0
  2587. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2588. * - OFFSET_FRAG_INFO
  2589. * Bits 31:16
  2590. * Value: offset in QUAD-bytes of frag info table
  2591. */
  2592. /* header fields */
  2593. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2594. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2595. /* payload fields */
  2596. /* for systems using a 64-bit format for bus addresses */
  2597. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2598. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2599. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2600. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2601. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2602. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2603. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2604. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2605. /* for systems using a 32-bit format for bus addresses */
  2606. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2607. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2608. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2609. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2610. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2611. #define HTT_RX_RING_CFG_LEN_S 0
  2612. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2613. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2614. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2615. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2616. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2617. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2618. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2619. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2620. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2621. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2622. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2623. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2624. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2625. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2626. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2627. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2628. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2629. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2630. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2631. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2632. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2633. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2634. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2635. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2636. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2637. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2638. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2639. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2640. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2641. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2642. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2643. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2644. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2645. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2646. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2647. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2648. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2649. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2650. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2651. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2652. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2653. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2654. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2655. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2656. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2657. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2658. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2659. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2660. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2661. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2662. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2663. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2664. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2665. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2666. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2667. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2668. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2669. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2670. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2671. #if HTT_PADDR64
  2672. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2673. #else
  2674. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2675. #endif
  2676. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2677. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2678. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2679. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2680. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2681. do { \
  2682. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2683. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2684. } while (0)
  2685. /* degenerate case for 32-bit fields */
  2686. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2687. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2688. ((_var) = (_val))
  2689. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2690. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2691. ((_var) = (_val))
  2692. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2693. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2694. ((_var) = (_val))
  2695. /* degenerate case for 32-bit fields */
  2696. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2697. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) ((_var) = (_val))
  2698. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2699. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) ((_var) = (_val))
  2700. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2701. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) ((_var) = (_val))
  2702. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2703. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2704. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2705. do { \
  2706. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2707. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2708. } while (0)
  2709. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2710. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2711. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2712. do { \
  2713. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2714. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2715. } while (0)
  2716. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2717. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2718. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2719. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2720. do { \
  2721. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2722. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2723. } while (0)
  2724. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2725. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2726. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2727. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2728. do { \
  2729. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2730. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2731. } while (0)
  2732. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2733. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2734. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2735. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2736. do { \
  2737. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2738. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2739. } while (0)
  2740. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2741. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2742. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2743. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2744. do { \
  2745. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2746. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2747. } while (0)
  2748. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2749. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2750. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2751. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2752. do { \
  2753. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2754. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2755. } while (0)
  2756. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2757. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2758. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2759. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2760. do { \
  2761. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2762. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2763. } while (0)
  2764. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2765. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2766. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2767. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2768. do { \
  2769. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2770. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2771. } while (0)
  2772. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2773. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2774. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2775. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2776. do { \
  2777. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2778. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2779. } while (0)
  2780. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2781. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2782. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2783. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2784. do { \
  2785. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2786. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2787. } while (0)
  2788. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2789. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2790. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2791. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2792. do { \
  2793. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2794. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2795. } while (0)
  2796. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2797. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2798. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2799. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2800. do { \
  2801. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2802. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2803. } while (0)
  2804. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2805. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2806. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2807. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2808. do { \
  2809. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2810. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2811. } while (0)
  2812. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2813. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2814. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2815. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2816. do { \
  2817. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2818. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2819. } while (0)
  2820. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2821. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2822. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2823. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2824. do { \
  2825. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2826. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2827. } while (0)
  2828. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2829. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2830. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2831. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2832. do { \
  2833. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2834. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2835. } while (0)
  2836. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2837. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2838. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2839. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2840. do { \
  2841. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2842. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2843. } while (0)
  2844. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2845. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2846. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2847. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2848. do { \
  2849. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2850. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2851. } while (0)
  2852. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2853. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2854. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2855. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2856. do { \
  2857. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2858. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2859. } while (0)
  2860. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2861. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2862. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2863. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2864. do { \
  2865. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2866. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2867. } while (0)
  2868. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2869. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2870. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2871. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2872. do { \
  2873. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2874. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2875. } while (0)
  2876. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2877. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2878. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2879. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2880. do { \
  2881. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2882. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2883. } while (0)
  2884. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2885. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2886. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2887. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2888. do { \
  2889. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2890. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2891. } while (0)
  2892. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2893. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2894. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2895. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2896. do { \
  2897. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2898. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2899. } while (0)
  2900. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2901. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2902. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2903. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2904. do { \
  2905. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2906. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2907. } while (0)
  2908. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2909. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2910. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2911. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2912. do { \
  2913. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2914. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2915. } while (0)
  2916. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2917. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2918. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2919. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2920. do { \
  2921. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2922. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2923. } while (0)
  2924. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2925. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2926. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2927. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2928. do { \
  2929. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2930. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2931. } while (0)
  2932. /**
  2933. * @brief host -> target FW statistics retrieve
  2934. *
  2935. * @details
  2936. * The following field definitions describe the format of the HTT host
  2937. * to target FW stats retrieve message. The message specifies the type of
  2938. * stats host wants to retrieve.
  2939. *
  2940. * |31 24|23 16|15 8|7 0|
  2941. * |-----------------------------------------------------------|
  2942. * | stats types request bitmask | msg type |
  2943. * |-----------------------------------------------------------|
  2944. * | stats types reset bitmask | reserved |
  2945. * |-----------------------------------------------------------|
  2946. * | stats type | config value |
  2947. * |-----------------------------------------------------------|
  2948. * | cookie LSBs |
  2949. * |-----------------------------------------------------------|
  2950. * | cookie MSBs |
  2951. * |-----------------------------------------------------------|
  2952. * Header fields:
  2953. * - MSG_TYPE
  2954. * Bits 7:0
  2955. * Purpose: identifies this is a stats upload request message
  2956. * Value: 0x3
  2957. * - UPLOAD_TYPES
  2958. * Bits 31:8
  2959. * Purpose: identifies which types of FW statistics to upload
  2960. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2961. * - RESET_TYPES
  2962. * Bits 31:8
  2963. * Purpose: identifies which types of FW statistics to reset
  2964. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2965. * - CFG_VAL
  2966. * Bits 23:0
  2967. * Purpose: give an opaque configuration value to the specified stats type
  2968. * Value: stats-type specific configuration value
  2969. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  2970. * bits 7:0 - how many per-MPDU byte counts to include in a record
  2971. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  2972. * bits 23:16 - how many per-MSDU byte counts to include in a record
  2973. * - CFG_STAT_TYPE
  2974. * Bits 31:24
  2975. * Purpose: specify which stats type (if any) the config value applies to
  2976. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  2977. * a valid configuration specification
  2978. * - COOKIE_LSBS
  2979. * Bits 31:0
  2980. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2981. * message with its preceding host->target stats request message.
  2982. * Value: LSBs of the opaque cookie specified by the host-side requestor
  2983. * - COOKIE_MSBS
  2984. * Bits 31:0
  2985. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2986. * message with its preceding host->target stats request message.
  2987. * Value: MSBs of the opaque cookie specified by the host-side requestor
  2988. */
  2989. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  2990. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  2991. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  2992. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  2993. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  2994. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  2995. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  2996. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  2997. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  2998. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  2999. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3000. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3001. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3002. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3003. do { \
  3004. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3005. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3006. } while (0)
  3007. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3008. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3009. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3010. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3011. do { \
  3012. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3013. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3014. } while (0)
  3015. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3016. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3017. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3018. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3019. do { \
  3020. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3021. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3022. } while (0)
  3023. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3024. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3025. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3026. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3027. do { \
  3028. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3029. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3030. } while (0)
  3031. /**
  3032. * @brief host -> target HTT out-of-band sync request
  3033. *
  3034. * @details
  3035. * The HTT SYNC tells the target to suspend processing of subsequent
  3036. * HTT host-to-target messages until some other target agent locally
  3037. * informs the target HTT FW that the current sync counter is equal to
  3038. * or greater than (in a modulo sense) the sync counter specified in
  3039. * the SYNC message.
  3040. * This allows other host-target components to synchronize their operation
  3041. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3042. * security key has been downloaded to and activated by the target.
  3043. * In the absence of any explicit synchronization counter value
  3044. * specification, the target HTT FW will use zero as the default current
  3045. * sync value.
  3046. *
  3047. * |31 24|23 16|15 8|7 0|
  3048. * |-----------------------------------------------------------|
  3049. * | reserved | sync count | msg type |
  3050. * |-----------------------------------------------------------|
  3051. * Header fields:
  3052. * - MSG_TYPE
  3053. * Bits 7:0
  3054. * Purpose: identifies this as a sync message
  3055. * Value: 0x4
  3056. * - SYNC_COUNT
  3057. * Bits 15:8
  3058. * Purpose: specifies what sync value the HTT FW will wait for from
  3059. * an out-of-band specification to resume its operation
  3060. * Value: in-band sync counter value to compare against the out-of-band
  3061. * counter spec.
  3062. * The HTT target FW will suspend its host->target message processing
  3063. * as long as
  3064. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3065. */
  3066. #define HTT_H2T_SYNC_MSG_SZ 4
  3067. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3068. #define HTT_H2T_SYNC_COUNT_S 8
  3069. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3070. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3071. HTT_H2T_SYNC_COUNT_S)
  3072. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3073. do { \
  3074. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3075. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3076. } while (0)
  3077. /**
  3078. * @brief HTT aggregation configuration
  3079. */
  3080. #define HTT_AGGR_CFG_MSG_SZ 4
  3081. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3082. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3083. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3084. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3085. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3086. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3087. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3088. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3089. do { \
  3090. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3091. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3092. } while (0)
  3093. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3094. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3095. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3096. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3097. do { \
  3098. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3099. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3100. } while (0)
  3101. /**
  3102. * @brief host -> target HTT configure max amsdu info per vdev
  3103. *
  3104. * @details
  3105. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3106. *
  3107. * |31 21|20 16|15 8|7 0|
  3108. * |-----------------------------------------------------------|
  3109. * | reserved | vdev id | max amsdu | msg type |
  3110. * |-----------------------------------------------------------|
  3111. * Header fields:
  3112. * - MSG_TYPE
  3113. * Bits 7:0
  3114. * Purpose: identifies this as a aggr cfg ex message
  3115. * Value: 0xa
  3116. * - MAX_NUM_AMSDU_SUBFRM
  3117. * Bits 15:8
  3118. * Purpose: max MSDUs per A-MSDU
  3119. * - VDEV_ID
  3120. * Bits 20:16
  3121. * Purpose: ID of the vdev to which this limit is applied
  3122. */
  3123. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3124. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3125. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3126. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3127. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3128. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3129. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3130. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3131. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3132. do { \
  3133. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3134. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3135. } while (0)
  3136. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3137. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3138. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3139. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3140. do { \
  3141. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3142. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3143. } while (0)
  3144. /**
  3145. * @brief HTT WDI_IPA Config Message
  3146. *
  3147. * @details
  3148. * The HTT WDI_IPA config message is created/sent by host at driver
  3149. * init time. It contains information about data structures used on
  3150. * WDI_IPA TX and RX path.
  3151. * TX CE ring is used for pushing packet metadata from IPA uC
  3152. * to WLAN FW
  3153. * TX Completion ring is used for generating TX completions from
  3154. * WLAN FW to IPA uC
  3155. * RX Indication ring is used for indicating RX packets from FW
  3156. * to IPA uC
  3157. * RX Ring2 is used as either completion ring or as second
  3158. * indication ring. when Ring2 is used as completion ring, IPA uC
  3159. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3160. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3161. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3162. * indicated in RX Indication ring. Please see WDI_IPA specification
  3163. * for more details.
  3164. * |31 24|23 16|15 8|7 0|
  3165. * |----------------+----------------+----------------+----------------|
  3166. * | tx pkt pool size | Rsvd | msg_type |
  3167. * |-------------------------------------------------------------------|
  3168. * | tx comp ring base (bits 31:0) |
  3169. #if HTT_PADDR64
  3170. * | tx comp ring base (bits 63:32) |
  3171. #endif
  3172. * |-------------------------------------------------------------------|
  3173. * | tx comp ring size |
  3174. * |-------------------------------------------------------------------|
  3175. * | tx comp WR_IDX physical address (bits 31:0) |
  3176. #if HTT_PADDR64
  3177. * | tx comp WR_IDX physical address (bits 63:32) |
  3178. #endif
  3179. * |-------------------------------------------------------------------|
  3180. * | tx CE WR_IDX physical address (bits 31:0) |
  3181. #if HTT_PADDR64
  3182. * | tx CE WR_IDX physical address (bits 63:32) |
  3183. #endif
  3184. * |-------------------------------------------------------------------|
  3185. * | rx indication ring base (bits 31:0) |
  3186. #if HTT_PADDR64
  3187. * | rx indication ring base (bits 63:32) |
  3188. #endif
  3189. * |-------------------------------------------------------------------|
  3190. * | rx indication ring size |
  3191. * |-------------------------------------------------------------------|
  3192. * | rx ind RD_IDX physical address (bits 31:0) |
  3193. #if HTT_PADDR64
  3194. * | rx ind RD_IDX physical address (bits 63:32) |
  3195. #endif
  3196. * |-------------------------------------------------------------------|
  3197. * | rx ind WR_IDX physical address (bits 31:0) |
  3198. #if HTT_PADDR64
  3199. * | rx ind WR_IDX physical address (bits 63:32) |
  3200. #endif
  3201. * |-------------------------------------------------------------------|
  3202. * |-------------------------------------------------------------------|
  3203. * | rx ring2 base (bits 31:0) |
  3204. #if HTT_PADDR64
  3205. * | rx ring2 base (bits 63:32) |
  3206. #endif
  3207. * |-------------------------------------------------------------------|
  3208. * | rx ring2 size |
  3209. * |-------------------------------------------------------------------|
  3210. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3211. #if HTT_PADDR64
  3212. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3213. #endif
  3214. * |-------------------------------------------------------------------|
  3215. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3216. #if HTT_PADDR64
  3217. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3218. #endif
  3219. * |-------------------------------------------------------------------|
  3220. *
  3221. * Header fields:
  3222. * Header fields:
  3223. * - MSG_TYPE
  3224. * Bits 7:0
  3225. * Purpose: Identifies this as WDI_IPA config message
  3226. * value: = 0x8
  3227. * - TX_PKT_POOL_SIZE
  3228. * Bits 15:0
  3229. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3230. * WDI_IPA TX path
  3231. * For systems using 32-bit format for bus addresses:
  3232. * - TX_COMP_RING_BASE_ADDR
  3233. * Bits 31:0
  3234. * Purpose: TX Completion Ring base address in DDR
  3235. * - TX_COMP_RING_SIZE
  3236. * Bits 31:0
  3237. * Purpose: TX Completion Ring size (must be power of 2)
  3238. * - TX_COMP_WR_IDX_ADDR
  3239. * Bits 31:0
  3240. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3241. * updates the Write Index for WDI_IPA TX completion ring
  3242. * - TX_CE_WR_IDX_ADDR
  3243. * Bits 31:0
  3244. * Purpose: DDR address where IPA uC
  3245. * updates the WR Index for TX CE ring
  3246. * (needed for fusion platforms)
  3247. * - RX_IND_RING_BASE_ADDR
  3248. * Bits 31:0
  3249. * Purpose: RX Indication Ring base address in DDR
  3250. * - RX_IND_RING_SIZE
  3251. * Bits 31:0
  3252. * Purpose: RX Indication Ring size
  3253. * - RX_IND_RD_IDX_ADDR
  3254. * Bits 31:0
  3255. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3256. * RX indication ring
  3257. * - RX_IND_WR_IDX_ADDR
  3258. * Bits 31:0
  3259. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3260. * updates the Write Index for WDI_IPA RX indication ring
  3261. * - RX_RING2_BASE_ADDR
  3262. * Bits 31:0
  3263. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3264. * - RX_RING2_SIZE
  3265. * Bits 31:0
  3266. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3267. * - RX_RING2_RD_IDX_ADDR
  3268. * Bits 31:0
  3269. * Purpose: If Second RX ring is Indication ring, DDR address where
  3270. * IPA uC updates the Read Index for Ring2.
  3271. * If Second RX ring is completion ring, this is NOT used
  3272. * - RX_RING2_WR_IDX_ADDR
  3273. * Bits 31:0
  3274. * Purpose: If Second RX ring is Indication ring, DDR address where
  3275. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3276. * If second RX ring is completion ring, DDR address where
  3277. * IPA uC updates the Write Index for Ring 2.
  3278. * For systems using 64-bit format for bus addresses:
  3279. * - TX_COMP_RING_BASE_ADDR_LO
  3280. * Bits 31:0
  3281. * Purpose: Lower 4 bytes of TX Completion Ring base physical
  3282. * address in DDR
  3283. * - TX_COMP_RING_BASE_ADDR_HI
  3284. * Bits 31:0
  3285. * Purpose: Higher 4 bytes of TX Completion Ring base physical
  3286. * address in DDR
  3287. * - TX_COMP_RING_SIZE
  3288. * Bits 31:0
  3289. * Purpose: TX Completion Ring size (must be power of 2)
  3290. * - TX_COMP_WR_IDX_ADDR_LO
  3291. * Bits 31:0
  3292. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3293. * Lower 4 bytes of DDR address where WIFI FW
  3294. * updates the Write Index for WDI_IPA TX completion ring
  3295. * - TX_COMP_WR_IDX_ADDR_HI
  3296. * Bits 31:0
  3297. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3298. * Higher 4 bytes of DDR address where WIFI FW
  3299. * updates the Write Index for WDI_IPA TX completion ring
  3300. * - TX_CE_WR_IDX_ADDR_LO
  3301. * Bits 31:0
  3302. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3303. * updates the WR Index for TX CE ring
  3304. * (needed for fusion platforms)
  3305. * - TX_CE_WR_IDX_ADDR_HI
  3306. * Bits 31:0
  3307. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3308. * updates the WR Index for TX CE ring
  3309. * (needed for fusion platforms)
  3310. * - RX_IND_RING_BASE_ADDR_LO
  3311. * Bits 31:0
  3312. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3313. * - RX_IND_RING_BASE_ADDR_HI
  3314. * Bits 31:0
  3315. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3316. * - RX_IND_RING_SIZE
  3317. * Bits 31:0
  3318. * Purpose: RX Indication Ring size
  3319. * - RX_IND_RD_IDX_ADDR_LO
  3320. * Bits 31:0
  3321. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the
  3322. * Read Index for WDI_IPA RX indication ring
  3323. * - RX_IND_RD_IDX_ADDR_HI
  3324. * Bits 31:0
  3325. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the
  3326. * Read Index for WDI_IPA RX indication ring
  3327. * - RX_IND_WR_IDX_ADDR_LO
  3328. * Bits 31:0
  3329. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3330. * Lower 4 bytes of DDR address where WIFI FW
  3331. * updates the Write Index for WDI_IPA RX indication ring
  3332. * - RX_IND_WR_IDX_ADDR_HI
  3333. * Bits 31:0
  3334. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3335. * Higher 4 bytes of DDR address where WIFI FW
  3336. * updates the Write Index for WDI_IPA RX indication ring
  3337. * - RX_RING2_BASE_ADDR_LO
  3338. * Bits 31:0
  3339. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)
  3340. * base address in DDR
  3341. * - RX_RING2_BASE_ADDR_HI
  3342. * Bits 31:0
  3343. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)
  3344. * base address in DDR
  3345. * - RX_RING2_SIZE
  3346. * Bits 31:0
  3347. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3348. * - RX_RING2_RD_IDX_ADDR_LO
  3349. * Bits 31:0
  3350. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3351. * DDR address where IPA uC updates the Read Index for Ring2.
  3352. * If Second RX ring is completion ring, this is NOT used
  3353. * - RX_RING2_RD_IDX_ADDR_HI
  3354. * Bits 31:0
  3355. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3356. * DDR address where IPA uC updates the Read Index for Ring2.
  3357. * If Second RX ring is completion ring, this is NOT used
  3358. * - RX_RING2_WR_IDX_ADDR_LO
  3359. * Bits 31:0
  3360. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3361. * DDR address where WIFI FW updates the Write Index
  3362. * for WDI_IPA RX ring2
  3363. * If second RX ring is completion ring, lower 4 bytes of
  3364. * DDR address where IPA uC updates the Write Index for Ring 2.
  3365. * - RX_RING2_WR_IDX_ADDR_HI
  3366. * Bits 31:0
  3367. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3368. * DDR address where WIFI FW updates the Write Index
  3369. * for WDI_IPA RX ring2
  3370. * If second RX ring is completion ring, higher 4 bytes of
  3371. * DDR address where IPA uC updates the Write Index for Ring 2.
  3372. */
  3373. #if HTT_PADDR64
  3374. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3375. #else
  3376. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3377. #endif
  3378. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3379. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3380. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3381. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3382. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3383. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3384. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3385. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3386. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3387. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3388. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3389. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3390. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3391. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3392. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3393. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3394. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3395. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3396. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3397. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3398. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3399. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3400. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3401. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3402. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3403. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3404. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3405. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3406. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3407. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3408. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3409. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3410. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3411. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3412. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3413. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3414. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3415. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3416. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3417. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3418. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3419. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3420. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3421. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3422. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3423. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3424. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3425. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3426. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3427. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3428. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3429. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3430. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3431. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3432. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3433. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3434. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3435. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3436. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3437. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3438. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3439. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3440. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3441. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> \
  3442. HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3443. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3444. do { \
  3445. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3446. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3447. } while (0)
  3448. /* for systems using 32-bit format for bus addr */
  3449. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3450. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> \
  3451. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3452. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3453. do { \
  3454. HTT_CHECK_SET_VAL( \
  3455. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val);\
  3456. ((_var) |= \
  3457. ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3458. } while (0)
  3459. /* for systems using 64-bit format for bus addr */
  3460. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3461. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> \
  3462. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3463. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3464. do { \
  3465. HTT_CHECK_SET_VAL( \
  3466. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val);\
  3467. ((_var) |= \
  3468. ((_val) << \
  3469. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3470. } while (0)
  3471. /* for systems using 64-bit format for bus addr */
  3472. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3473. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> \
  3474. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3475. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3476. do { \
  3477. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3478. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3479. } while (0)
  3480. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3481. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> \
  3482. HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3483. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3484. do { \
  3485. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3486. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3487. } while (0)
  3488. /* for systems using 32-bit format for bus addr */
  3489. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3490. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> \
  3491. HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3492. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3493. do { \
  3494. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3495. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3496. } while (0)
  3497. /* for systems using 64-bit format for bus addr */
  3498. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3499. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> \
  3500. HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3501. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3502. do { \
  3503. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3504. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3505. } while (0)
  3506. /* for systems using 64-bit format for bus addr */
  3507. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3508. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> \
  3509. HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3510. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3511. do { \
  3512. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3513. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3514. } while (0)
  3515. /* for systems using 32-bit format for bus addr */
  3516. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3517. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> \
  3518. HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3519. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3520. do { \
  3521. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3522. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3523. } while (0)
  3524. /* for systems using 64-bit format for bus addr */
  3525. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3526. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >>\
  3527. HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3528. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3529. do { \
  3530. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3531. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3532. } while (0)
  3533. /* for systems using 64-bit format for bus addr */
  3534. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3535. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> \
  3536. HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3537. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3538. do { \
  3539. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3540. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3541. } while (0)
  3542. /* for systems using 32-bit format for bus addr */
  3543. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3544. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> \
  3545. HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3546. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3547. do { \
  3548. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3549. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3550. } while (0)
  3551. /* for systems using 64-bit format for bus addr */
  3552. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3553. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> \
  3554. HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3555. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3556. do { \
  3557. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3558. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3559. } while (0)
  3560. /* for systems using 64-bit format for bus addr */
  3561. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3562. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> \
  3563. HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3564. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3565. do { \
  3566. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3567. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3568. } while (0)
  3569. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3570. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> \
  3571. HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3572. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3573. do { \
  3574. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3575. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3576. } while (0)
  3577. /* for systems using 32-bit format for bus addr */
  3578. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3579. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> \
  3580. HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3581. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3582. do { \
  3583. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3584. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3585. } while (0)
  3586. /* for systems using 64-bit format for bus addr */
  3587. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3588. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> \
  3589. HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3590. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3591. do { \
  3592. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3593. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3594. } while (0)
  3595. /* for systems using 64-bit format for bus addr */
  3596. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3597. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> \
  3598. HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3599. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3600. do { \
  3601. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3602. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3603. } while (0)
  3604. /* for systems using 32-bit format for bus addr */
  3605. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3606. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> \
  3607. HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3608. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3609. do { \
  3610. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3611. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3612. } while (0)
  3613. /* for systems using 64-bit format for bus addr */
  3614. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3615. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> \
  3616. HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3617. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3618. do { \
  3619. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3620. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3621. } while (0)
  3622. /* for systems using 64-bit format for bus addr */
  3623. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3624. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> \
  3625. HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3626. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3627. do { \
  3628. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3629. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3630. } while (0)
  3631. /* for systems using 32-bit format for bus addr */
  3632. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3633. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> \
  3634. HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3635. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3636. do { \
  3637. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3638. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3639. } while (0)
  3640. /* for systems using 64-bit format for bus addr */
  3641. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3642. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> \
  3643. HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3644. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3645. do { \
  3646. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3647. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3648. } while (0)
  3649. /* for systems using 64-bit format for bus addr */
  3650. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3651. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> \
  3652. HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3653. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3654. do { \
  3655. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3656. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3657. } while (0)
  3658. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3659. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> \
  3660. HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3661. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3662. do { \
  3663. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3664. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3665. } while (0)
  3666. /* for systems using 32-bit format for bus addr */
  3667. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3668. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> \
  3669. HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3670. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3671. do { \
  3672. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3673. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3674. } while (0)
  3675. /* for systems using 64-bit format for bus addr */
  3676. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3677. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> \
  3678. HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3679. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3680. do { \
  3681. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3682. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3683. } while (0)
  3684. /* for systems using 64-bit format for bus addr */
  3685. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3686. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> \
  3687. HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3688. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3689. do { \
  3690. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3691. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3692. } while (0)
  3693. /* for systems using 32-bit format for bus addr */
  3694. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3695. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> \
  3696. HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3697. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3698. do { \
  3699. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3700. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3701. } while (0)
  3702. /* for systems using 64-bit format for bus addr */
  3703. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3704. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> \
  3705. HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3706. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3707. do { \
  3708. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3709. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3710. } while (0)
  3711. /* for systems using 64-bit format for bus addr */
  3712. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3713. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> \
  3714. HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3715. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3716. do { \
  3717. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3718. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3719. } while (0)
  3720. /*
  3721. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3722. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3723. * addresses are stored in a XXX-bit field.
  3724. * This macro is used to define both htt_wdi_ipa_config32_t and
  3725. * htt_wdi_ipa_config64_t structs.
  3726. */
  3727. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3728. _paddr__tx_comp_ring_base_addr_, \
  3729. _paddr__tx_comp_wr_idx_addr_, \
  3730. _paddr__tx_ce_wr_idx_addr_, \
  3731. _paddr__rx_ind_ring_base_addr_, \
  3732. _paddr__rx_ind_rd_idx_addr_, \
  3733. _paddr__rx_ind_wr_idx_addr_, \
  3734. _paddr__rx_ring2_base_addr_,\
  3735. _paddr__rx_ring2_rd_idx_addr_,\
  3736. _paddr__rx_ring2_wr_idx_addr_) \
  3737. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3738. { \
  3739. /* DWORD 0: flags and meta-data */ \
  3740. A_UINT32 \
  3741. msg_type:8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3742. reserved:8, \
  3743. tx_pkt_pool_size:16;\
  3744. /* DWORD 1 */\
  3745. _paddr__tx_comp_ring_base_addr_;\
  3746. /* DWORD 2 (or 3)*/\
  3747. A_UINT32 tx_comp_ring_size;\
  3748. /* DWORD 3 (or 4)*/\
  3749. _paddr__tx_comp_wr_idx_addr_;\
  3750. /* DWORD 4 (or 6)*/\
  3751. _paddr__tx_ce_wr_idx_addr_;\
  3752. /* DWORD 5 (or 8)*/\
  3753. _paddr__rx_ind_ring_base_addr_;\
  3754. /* DWORD 6 (or 10)*/\
  3755. A_UINT32 rx_ind_ring_size;\
  3756. /* DWORD 7 (or 11)*/\
  3757. _paddr__rx_ind_rd_idx_addr_;\
  3758. /* DWORD 8 (or 13)*/\
  3759. _paddr__rx_ind_wr_idx_addr_;\
  3760. /* DWORD 9 (or 15)*/\
  3761. _paddr__rx_ring2_base_addr_;\
  3762. /* DWORD 10 (or 17) */\
  3763. A_UINT32 rx_ring2_size;\
  3764. /* DWORD 11 (or 18) */\
  3765. _paddr__rx_ring2_rd_idx_addr_;\
  3766. /* DWORD 12 (or 20) */\
  3767. _paddr__rx_ring2_wr_idx_addr_;\
  3768. } POSTPACK
  3769. /* define a htt_wdi_ipa_config32_t type */
  3770. TEMPLATE_HTT_WDI_IPA_CONFIG_T(32, HTT_VAR_PADDR32(tx_comp_ring_base_addr),
  3771. HTT_VAR_PADDR32(tx_comp_wr_idx_addr),
  3772. HTT_VAR_PADDR32(tx_ce_wr_idx_addr),
  3773. HTT_VAR_PADDR32(rx_ind_ring_base_addr),
  3774. HTT_VAR_PADDR32(rx_ind_rd_idx_addr),
  3775. HTT_VAR_PADDR32(rx_ind_wr_idx_addr),
  3776. HTT_VAR_PADDR32(rx_ring2_base_addr),
  3777. HTT_VAR_PADDR32(rx_ring2_rd_idx_addr),
  3778. HTT_VAR_PADDR32(rx_ring2_wr_idx_addr));
  3779. /* define a htt_wdi_ipa_config64_t type */
  3780. TEMPLATE_HTT_WDI_IPA_CONFIG_T(64, HTT_VAR_PADDR64_LE(tx_comp_ring_base_addr),
  3781. HTT_VAR_PADDR64_LE(tx_comp_wr_idx_addr),
  3782. HTT_VAR_PADDR64_LE(tx_ce_wr_idx_addr),
  3783. HTT_VAR_PADDR64_LE(rx_ind_ring_base_addr),
  3784. HTT_VAR_PADDR64_LE(rx_ind_rd_idx_addr),
  3785. HTT_VAR_PADDR64_LE(rx_ind_wr_idx_addr),
  3786. HTT_VAR_PADDR64_LE(rx_ring2_base_addr),
  3787. HTT_VAR_PADDR64_LE(rx_ring2_rd_idx_addr),
  3788. HTT_VAR_PADDR64_LE(rx_ring2_wr_idx_addr));
  3789. #if HTT_PADDR64
  3790. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3791. #else
  3792. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3793. #endif
  3794. enum htt_wdi_ipa_op_code {
  3795. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3796. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3797. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3798. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3799. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3800. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3801. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3802. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3803. /* keep this last */
  3804. HTT_WDI_IPA_OPCODE_MAX
  3805. };
  3806. /**
  3807. * @brief HTT WDI_IPA Operation Request Message
  3808. *
  3809. * @details
  3810. * HTT WDI_IPA Operation Request message is sent by host
  3811. * to either suspend or resume WDI_IPA TX or RX path.
  3812. * |31 24|23 16|15 8|7 0|
  3813. * |----------------+----------------+----------------+----------------|
  3814. * | op_code | Rsvd | msg_type |
  3815. * |-------------------------------------------------------------------|
  3816. *
  3817. * Header fields:
  3818. * - MSG_TYPE
  3819. * Bits 7:0
  3820. * Purpose: Identifies this as WDI_IPA Operation Request message
  3821. * value: = 0x9
  3822. * - OP_CODE
  3823. * Bits 31:16
  3824. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3825. * value: = enum htt_wdi_ipa_op_code
  3826. */
  3827. PREPACK struct htt_wdi_ipa_op_request_t {
  3828. /* DWORD 0: flags and meta-data */
  3829. A_UINT32
  3830. msg_type:8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ */
  3831. reserved:8,
  3832. op_code:16;
  3833. } POSTPACK;
  3834. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3835. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3836. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3837. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3838. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> \
  3839. HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3840. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3841. do { \
  3842. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3843. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3844. } while (0)
  3845. /**
  3846. * @brief WLAN_WDI_IPA_GET_SHARING_STATS_REQ
  3847. * |31 24|23 16|15 8|7 0|
  3848. * |----------------+----------------+----------------+----------------|
  3849. * | reserved | reset_stats |
  3850. * |-------------------------------------------------------------------|
  3851. * Header fields:
  3852. * - RESET_STATS
  3853. * Bits 7:0
  3854. * Purpose: when 1, FW clears sharing stats
  3855. * - RESERVED
  3856. * Bits 31:8
  3857. * Purpose: reserved bits
  3858. */
  3859. PREPACK struct htt_wdi_ipa_get_sharing_stats_t {
  3860. A_UINT32
  3861. reset_stats:8, /* reset stat countis after response */
  3862. reserved:24;
  3863. } POSTPACK;
  3864. #define HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_SZ \
  3865. (sizeof(struct htt_wdi_ipa_get_sharing_stats_t))
  3866. #define HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_M 0x000000ff
  3867. #define HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_S 0
  3868. #define HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_GET(_var) \
  3869. (((_var) & HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_M) >>\
  3870. HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_S)
  3871. #define HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_SET(_var, _val)\
  3872. do { \
  3873. HTT_CHECK_SET_VAL( \
  3874. HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS,\
  3875. _val); \
  3876. ((_var) |= ((_val) << \
  3877. HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_S)); \
  3878. } while (0)
  3879. /**
  3880. * @brief WLAN_WDI_IPA_SET_QUOTA_REQ
  3881. *
  3882. * |31 24|23 16|15 8|7 0|
  3883. * |----------------+----------------+----------------+----------------|
  3884. * | reserved | set_quota |
  3885. * |-------------------------------------------------------------------|
  3886. * | quota_lo |
  3887. * |-------------------------------------------------------------------|
  3888. * | quota_hi |
  3889. * |-------------------------------------------------------------------|
  3890. * Header fields:
  3891. * - set_quota
  3892. * Bits 7:0
  3893. * Purpose: when 1, FW configures quota and starts quota monitoring.
  3894. * when 0, FW stops.
  3895. * - RESERVED
  3896. * Bits 31:8
  3897. * Purpose: reserved bits
  3898. * - quota_lo
  3899. * Bits 31:0
  3900. * Purpose: bytes of quota to be set, low 32-bit.
  3901. * It is accumulated number of bytes from when quota is configured.
  3902. * - quota_hi
  3903. * Bits 31:0
  3904. * Purpose: bytes of quota to be set, high 32-bit
  3905. */
  3906. PREPACK struct htt_wdi_ipa_set_quota_t {
  3907. A_UINT32
  3908. set_quota:8, /* enable quota monitoring */
  3909. reserved:24;
  3910. A_UINT32 quota_lo; /* quota limit in bytes */
  3911. A_UINT32 quota_hi;
  3912. } POSTPACK;
  3913. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_SZ \
  3914. (sizeof(struct htt_wdi_ipa_set_quota_t))
  3915. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_M 0x000000ff
  3916. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_S 0
  3917. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_GET(_var) \
  3918. (((_var) & HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_M) >> \
  3919. HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_S)
  3920. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_SET(_var, _val) \
  3921. do { \
  3922. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA,\
  3923. _val); \
  3924. ((_var) |= ((_val) << \
  3925. HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_S)); \
  3926. } while (0)
  3927. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_M 0xffffffff
  3928. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_S 0
  3929. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_GET(_var) \
  3930. (((_var) & HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_M) >> \
  3931. HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_S)
  3932. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_SET(_var, _val) \
  3933. do { \
  3934. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO,\
  3935. _val); \
  3936. ((_var) |= ((_val) << \
  3937. HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_S)); \
  3938. } while (0)
  3939. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_M 0xffffffff
  3940. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_S 0
  3941. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_GET(_var) \
  3942. (((_var) & HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_M) >> \
  3943. HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_S)
  3944. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_SET(_var, _val) \
  3945. do { \
  3946. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI,\
  3947. _val); \
  3948. ((_var) |= ((_val) << \
  3949. HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_S)); \
  3950. } while (0)
  3951. /*
  3952. * @brief host -> target HTT_SRING_SETUP message
  3953. *
  3954. * @details
  3955. * After target is booted up, Host can send SRING setup message for
  3956. * each host facing LMAC SRING. Target setups up HW registers based
  3957. * on setup message and confirms back to Host if response_required is set.
  3958. * Host should wait for confirmation message before sending new SRING
  3959. * setup message
  3960. *
  3961. * The message would appear as follows:
  3962. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3963. * |--------------- +-----------------+----------------+------------------|
  3964. * | ring_type | ring_id | pdev_id | msg_type |
  3965. * |----------------------------------------------------------------------|
  3966. * | ring_base_addr_lo |
  3967. * |----------------------------------------------------------------------|
  3968. * | ring_base_addr_hi |
  3969. * |----------------------------------------------------------------------|
  3970. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3971. * |----------------------------------------------------------------------|
  3972. * | ring_head_offset32_remote_addr_lo |
  3973. * |----------------------------------------------------------------------|
  3974. * | ring_head_offset32_remote_addr_hi |
  3975. * |----------------------------------------------------------------------|
  3976. * | ring_tail_offset32_remote_addr_lo |
  3977. * |----------------------------------------------------------------------|
  3978. * | ring_tail_offset32_remote_addr_hi |
  3979. * |----------------------------------------------------------------------|
  3980. * | ring_msi_addr_lo |
  3981. * |----------------------------------------------------------------------|
  3982. * | ring_msi_addr_hi |
  3983. * |----------------------------------------------------------------------|
  3984. * | ring_msi_data |
  3985. * |----------------------------------------------------------------------|
  3986. * | intr_timer_th |IM| intr_batch_counter_th |
  3987. * |----------------------------------------------------------------------|
  3988. * | reserved |RR|PTCF| intr_low_threshold |
  3989. * |----------------------------------------------------------------------|
  3990. * Where
  3991. * IM = sw_intr_mode
  3992. * RR = response_required
  3993. * PTCF = prefetch_timer_cfg
  3994. *
  3995. * The message is interpreted as follows:
  3996. * dword0 - b'0:7 - msg_type: This will be set to
  3997. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3998. * b'8:15 - pdev_id:
  3999. * 0 (for rings at SOC/UMAC level),
  4000. * 1/2/3 mac id (for rings at LMAC level)
  4001. * b'16:23 - ring_id: identify which ring is to setup,
  4002. * more details can be got from enum htt_srng_ring_id
  4003. * b'24:31 - ring_type: identify type of host rings,
  4004. * more details can be got from enum htt_srng_ring_type
  4005. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4006. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4007. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4008. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4009. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4010. * SW_TO_HW_RING.
  4011. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4012. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4013. * Lower 32 bits of memory address of the remote variable
  4014. * storing the 4-byte word offset that identifies the head
  4015. * element within the ring.
  4016. * (The head offset variable has type A_UINT32.)
  4017. * Valid for HW_TO_SW and SW_TO_SW rings.
  4018. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4019. * Upper 32 bits of memory address of the remote variable
  4020. * storing the 4-byte word offset that identifies the head
  4021. * element within the ring.
  4022. * (The head offset variable has type A_UINT32.)
  4023. * Valid for HW_TO_SW and SW_TO_SW rings.
  4024. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4025. * Lower 32 bits of memory address of the remote variable
  4026. * storing the 4-byte word offset that identifies the tail
  4027. * element within the ring.
  4028. * (The tail offset variable has type A_UINT32.)
  4029. * Valid for HW_TO_SW and SW_TO_SW rings.
  4030. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4031. * Upper 32 bits of memory address of the remote variable
  4032. * storing the 4-byte word offset that identifies the tail
  4033. * element within the ring.
  4034. * (The tail offset variable has type A_UINT32.)
  4035. * Valid for HW_TO_SW and SW_TO_SW rings.
  4036. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4037. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4038. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4039. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4040. * dword10 - b'0:31 - ring_msi_data: MSI data
  4041. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4042. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4043. * dword11 - b'0:14 - intr_batch_counter_th:
  4044. * batch counter threshold is in units of 4-byte words.
  4045. * HW internally maintains and increments batch count.
  4046. * (see SRING spec for detail description).
  4047. * When batch count reaches threshold value, an interrupt
  4048. * is generated by HW.
  4049. * b'15 - sw_intr_mode:
  4050. * This configuration shall be static.
  4051. * Only programmed at power up.
  4052. * 0: generate pulse style sw interrupts
  4053. * 1: generate level style sw interrupts
  4054. * b'16:31 - intr_timer_th:
  4055. * The timer init value when timer is idle or is
  4056. * initialized to start downcounting.
  4057. * In 8us units (to cover a range of 0 to 524 ms)
  4058. * dword12 - b'0:15 - intr_low_threshold:
  4059. * Used only by Consumer ring to generate ring_sw_int_p.
  4060. * Ring entries low threshold water mark, that is used
  4061. * in combination with the interrupt timer as well as
  4062. * the the clearing of the level interrupt.
  4063. * b'16:18 - prefetch_timer_cfg:
  4064. * Used only by Consumer ring to set timer mode to
  4065. * support Application prefetch handling.
  4066. * The external tail offset/pointer will be updated
  4067. * at following intervals:
  4068. * 3'b000: (Prefetch feature disabled; used only for debug)
  4069. * 3'b001: 1 usec
  4070. * 3'b010: 4 usec
  4071. * 3'b011: 8 usec (default)
  4072. * 3'b100: 16 usec
  4073. * Others: Reserverd
  4074. * b'19 - response_required:
  4075. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4076. * b'20:31 - reserved: reserved for future use
  4077. */
  4078. PREPACK struct htt_sring_setup_t {
  4079. A_UINT32 msg_type: 8,
  4080. pdev_id: 8,
  4081. ring_id: 8,
  4082. ring_type: 8;
  4083. A_UINT32 ring_base_addr_lo;
  4084. A_UINT32 ring_base_addr_hi;
  4085. A_UINT32 ring_size: 16,
  4086. ring_entry_size: 8,
  4087. ring_misc_cfg_flag: 8;
  4088. A_UINT32 ring_head_offset32_remote_addr_lo;
  4089. A_UINT32 ring_head_offset32_remote_addr_hi;
  4090. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4091. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4092. A_UINT32 ring_msi_addr_lo;
  4093. A_UINT32 ring_msi_addr_hi;
  4094. A_UINT32 ring_msi_data;
  4095. A_UINT32 intr_batch_counter_th: 15,
  4096. sw_intr_mode: 1,
  4097. intr_timer_th: 16;
  4098. A_UINT32 intr_low_threshold: 16,
  4099. prefetch_timer_cfg: 3,
  4100. response_required: 1,
  4101. reserved1: 12;
  4102. } POSTPACK;
  4103. enum htt_srng_ring_type {
  4104. HTT_HW_TO_SW_RING = 0,
  4105. HTT_SW_TO_HW_RING,
  4106. HTT_SW_TO_SW_RING,
  4107. /* Insert new ring types above this line */
  4108. };
  4109. enum htt_srng_ring_id {
  4110. /* Used by FW to feed remote buffers and update remote packets */
  4111. HTT_RXDMA_HOST_BUF_RING = 0,
  4112. /*
  4113. * For getting all PPDU/MPDU/MSDU status deescriptors on host for
  4114. * monitor VAP or packet log purposes
  4115. */
  4116. HTT_RXDMA_MONITOR_STATUS_RING,
  4117. /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4118. HTT_RXDMA_MONITOR_BUF_RING,
  4119. /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4120. HTT_RXDMA_MONITOR_DESC_RING,
  4121. /* Per MPDU indication to host for monitor traffic upload */
  4122. HTT_RXDMA_MONITOR_DEST_RING,
  4123. /* (mobile only) used by host to provide remote RX buffers */
  4124. HTT_HOST1_TO_FW_RXBUF_RING,
  4125. /* (mobile only) second ring used by host to provide remote RX buffers*/
  4126. HTT_HOST2_TO_FW_RXBUF_RING,
  4127. /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4128. HTT_RXDMA_NON_MONITOR_DEST_RING,
  4129. /*
  4130. * Add Other SRING which can't be directly configured by host software
  4131. * above this line
  4132. */
  4133. };
  4134. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4135. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4136. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4137. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4138. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4139. HTT_SRING_SETUP_PDEV_ID_S)
  4140. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4141. do { \
  4142. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4143. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4144. } while (0)
  4145. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4146. #define HTT_SRING_SETUP_RING_ID_S 16
  4147. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4148. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4149. HTT_SRING_SETUP_RING_ID_S)
  4150. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4151. do { \
  4152. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4153. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4154. } while (0)
  4155. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4156. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4157. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4158. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4159. HTT_SRING_SETUP_RING_TYPE_S)
  4160. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4161. do { \
  4162. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4163. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4164. } while (0)
  4165. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4166. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4167. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4168. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4169. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4170. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4171. do { \
  4172. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val);\
  4173. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S));\
  4174. } while (0)
  4175. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4176. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4177. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4178. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4179. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4180. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4181. do { \
  4182. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val);\
  4183. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S));\
  4184. } while (0)
  4185. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4186. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4187. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4188. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4189. HTT_SRING_SETUP_RING_SIZE_S)
  4190. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4191. do { \
  4192. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4193. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4194. } while (0)
  4195. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4196. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4197. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4198. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4199. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4200. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4201. do { \
  4202. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4203. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4204. } while (0)
  4205. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4206. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4207. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var)\
  4208. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4209. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4210. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4211. do { \
  4212. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4213. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4214. } while (0)
  4215. /* This control bit is applicable to only Producer, which updates Ring ID field
  4216. * of each descriptor before pushing into the ring.
  4217. * 0: updates ring_id(default)
  4218. * 1: ring_id updating disabled
  4219. */
  4220. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4221. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4222. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4223. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4224. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4225. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4226. do { \
  4227. HTT_CHECK_SET_VAL( \
  4228. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val);\
  4229. ((_var) |= ((_val) << \
  4230. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4231. } while (0)
  4232. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4233. * of each descriptor before pushing into the ring.
  4234. * 0: updates Loopcnt(default)
  4235. * 1: Loopcnt updating disabled
  4236. */
  4237. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4238. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4239. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4240. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4241. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4242. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4243. do { \
  4244. HTT_CHECK_SET_VAL( \
  4245. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4246. ((_var) |= ((_val) << \
  4247. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4248. } while (0)
  4249. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4250. * into security_id port of GXI/AXI.
  4251. */
  4252. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4253. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4254. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4255. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4256. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4257. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4258. do { \
  4259. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY,\
  4260. _val); \
  4261. ((_var) |= ((_val) << \
  4262. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S));\
  4263. } while (0)
  4264. /* During MSI write operation, SRNG drives value of this register bit into
  4265. * swap bit of GXI/AXI.
  4266. */
  4267. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4268. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4269. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4270. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4271. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4272. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4273. do { \
  4274. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP,\
  4275. _val); \
  4276. ((_var) |= ((_val) << \
  4277. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4278. } while (0)
  4279. /* During Pointer write operation, SRNG drives value of this register bit into
  4280. * swap bit of GXI/AXI.
  4281. */
  4282. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4283. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4284. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4285. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4286. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4287. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4288. do { \
  4289. HTT_CHECK_SET_VAL( \
  4290. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4291. ((_var) |= ((_val) << \
  4292. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4293. } while (0)
  4294. /* During any data or TLV write operation, SRNG drives value of this register
  4295. * bit into swap bit of GXI/AXI.
  4296. */
  4297. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4298. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4299. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4300. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4301. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4302. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4303. do { \
  4304. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP,\
  4305. _val); \
  4306. ((_var) |= ((_val) << \
  4307. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S));\
  4308. } while (0)
  4309. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4310. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4311. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4312. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4313. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4314. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4315. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4316. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4317. do { \
  4318. HTT_CHECK_SET_VAL( \
  4319. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4320. ((_var) |= ((_val) << \
  4321. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4322. } while (0)
  4323. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4324. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4325. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4326. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >>\
  4327. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4328. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val)\
  4329. do { \
  4330. HTT_CHECK_SET_VAL( \
  4331. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val);\
  4332. ((_var) |= ((_val) << \
  4333. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4334. } while (0)
  4335. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4336. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4337. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4338. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4339. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4340. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4341. do { \
  4342. HTT_CHECK_SET_VAL( \
  4343. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4344. ((_var) |= ((_val) << \
  4345. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S));\
  4346. } while (0)
  4347. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4348. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4349. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4350. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4351. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4352. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4353. do { \
  4354. HTT_CHECK_SET_VAL( \
  4355. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4356. ((_var) |= ((_val) << \
  4357. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4358. } while (0)
  4359. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4360. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4361. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4362. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4363. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4364. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4365. do { \
  4366. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4367. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4368. } while (0)
  4369. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4370. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4371. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4372. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4373. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4374. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4375. do { \
  4376. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4377. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4378. } while (0)
  4379. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4380. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4381. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4382. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4383. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4384. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4385. do { \
  4386. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4387. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4388. } while (0)
  4389. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4390. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4391. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4392. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4393. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4394. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4395. do { \
  4396. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4397. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4398. } while (0)
  4399. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4400. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4401. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4402. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4403. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4404. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4405. do { \
  4406. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4407. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4408. } while (0)
  4409. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4410. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4411. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4412. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4413. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4414. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4415. do { \
  4416. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4417. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4418. } while (0)
  4419. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4420. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4421. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4422. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4423. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4424. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4425. do { \
  4426. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4427. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4428. } while (0)
  4429. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4430. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4431. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4432. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4433. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4434. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4435. do { \
  4436. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4437. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4438. } while (0)
  4439. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4440. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4441. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4442. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4443. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4444. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4445. do { \
  4446. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4447. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4448. } while (0)
  4449. /**
  4450. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4451. *
  4452. * @details
  4453. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4454. * configure RXDMA rings.
  4455. * The configuration is per ring based and includes both packet subtypes
  4456. * and PPDU/MPDU TLVs.
  4457. *
  4458. * The message would appear as follows:
  4459. *
  4460. * |31 26|25|24|23 16|15 8|7 0|
  4461. * |-----------------+----------------+----------------+---------------|
  4462. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  4463. * |-------------------------------------------------------------------|
  4464. * | rsvd2 | ring_buffer_size |
  4465. * |-------------------------------------------------------------------|
  4466. * | packet_type_enable_flags_0 |
  4467. * |-------------------------------------------------------------------|
  4468. * | packet_type_enable_flags_1 |
  4469. * |-------------------------------------------------------------------|
  4470. * | packet_type_enable_flags_2 |
  4471. * |-------------------------------------------------------------------|
  4472. * | packet_type_enable_flags_3 |
  4473. * |-------------------------------------------------------------------|
  4474. * | tlv_filter_in_flags |
  4475. * |-------------------------------------------------------------------|
  4476. * Where:
  4477. * PS = pkt_swap
  4478. * SS = status_swap
  4479. * The message is interpreted as follows:
  4480. * dword0 - b'0:7 - msg_type: This will be set to
  4481. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4482. * b'8:15 - pdev_id:
  4483. * 0 (for rings at SOC/UMAC level),
  4484. * 1/2/3 mac id (for rings at LMAC level)
  4485. * b'16:23 - ring_id : Identify the ring to configure.
  4486. * More details can be got from enum htt_srng_ring_id
  4487. * b'24 - status_swap: 1 is to swap status TLV
  4488. * b'25 - pkt_swap: 1 is to swap packet TLV
  4489. * b'26:31 - rsvd1: reserved for future use
  4490. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4491. * in byte units.
  4492. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4493. * - b'16:31 - rsvd2: Reserved for future use
  4494. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4495. * Enable MGMT packet from 0b0000 to 0b1001
  4496. * bits from low to high: FP, MD, MO - 3 bits
  4497. * FP: Filter_Pass
  4498. * MD: Monitor_Direct
  4499. * MO: Monitor_Other
  4500. * 10 mgmt subtypes * 3 bits -> 30 bits
  4501. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4502. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4503. * Enable MGMT packet from 0b1010 to 0b1111
  4504. * bits from low to high: FP, MD, MO - 3 bits
  4505. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4506. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4507. * Enable CTRL packet from 0b0000 to 0b1001
  4508. * bits from low to high: FP, MD, MO - 3 bits
  4509. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4510. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4511. * Enable CTRL packet from 0b1010 to 0b1111,
  4512. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4513. * bits from low to high: FP, MD, MO - 3 bits
  4514. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4515. * dword6 - b'0:31 - tlv_filter_in_flags:
  4516. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4517. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4518. */
  4519. PREPACK struct htt_rx_ring_selection_cfg_t {
  4520. A_UINT32 msg_type: 8,
  4521. pdev_id: 8,
  4522. ring_id: 8,
  4523. status_swap: 1,
  4524. pkt_swap: 1,
  4525. rsvd1: 6;
  4526. A_UINT32 ring_buffer_size: 16,
  4527. rsvd2: 16;
  4528. A_UINT32 packet_type_enable_flags_0;
  4529. A_UINT32 packet_type_enable_flags_1;
  4530. A_UINT32 packet_type_enable_flags_2;
  4531. A_UINT32 packet_type_enable_flags_3;
  4532. A_UINT32 tlv_filter_in_flags;
  4533. } POSTPACK;
  4534. #define HTT_RX_RING_SELECTION_CFG_SZ \
  4535. (sizeof(struct htt_rx_ring_selection_cfg_t))
  4536. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4537. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4538. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4539. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4540. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4541. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4542. do { \
  4543. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4544. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4545. } while (0)
  4546. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4547. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4548. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4549. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4550. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4551. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4552. do { \
  4553. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4554. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4555. } while (0)
  4556. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4557. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4558. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4559. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4560. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4561. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4562. do { \
  4563. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP,\
  4564. _val); \
  4565. ((_var) |= ((_val) << \
  4566. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4567. } while (0)
  4568. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4569. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4570. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4571. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4572. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4573. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4574. do { \
  4575. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP,\
  4576. _val); \
  4577. ((_var) |= ((_val) << \
  4578. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4579. } while (0)
  4580. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4581. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4582. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4583. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4584. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4585. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4586. do { \
  4587. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE,\
  4588. _val); \
  4589. ((_var) |= ((_val) << \
  4590. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4591. } while (0)
  4592. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4595. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4596. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4598. do { \
  4599. HTT_CHECK_SET_VAL( \
  4600. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, \
  4601. _val); \
  4602. ((_var) |= ((_val) << \
  4603. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4604. } while (0)
  4605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4608. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4609. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4611. do { \
  4612. HTT_CHECK_SET_VAL( \
  4613. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val);\
  4614. ((_var) |= ((_val) << \
  4615. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4616. } while (0)
  4617. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4620. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4621. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4623. do { \
  4624. HTT_CHECK_SET_VAL( \
  4625. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val);\
  4626. ((_var) |= ((_val) << \
  4627. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4628. } while (0)
  4629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4632. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4633. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4635. do { \
  4636. HTT_CHECK_SET_VAL( \
  4637. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val);\
  4638. ((_var) |= ((_val) << \
  4639. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4640. } while (0)
  4641. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4642. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4643. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4644. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4645. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4646. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4647. do { \
  4648. HTT_CHECK_SET_VAL( \
  4649. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4650. ((_var) |= ((_val) << \
  4651. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4652. } while (0)
  4653. /*
  4654. * Subtype based MGMT frames enable bits.
  4655. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4656. */
  4657. /* association request */
  4658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M \
  4659. 0x00000001
  4660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M \
  4662. 0x00000002
  4663. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4664. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M \
  4665. 0x00000004
  4666. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4667. /* association response */
  4668. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M \
  4669. 0x00000008
  4670. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4671. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M \
  4672. 0x00000010
  4673. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4674. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M \
  4675. 0x00000020
  4676. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4677. /* Reassociation request */
  4678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M \
  4679. 0x00000040
  4680. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4681. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M \
  4682. 0x00000080
  4683. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4684. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M \
  4685. 0x00000100
  4686. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4687. /* Reassociation response */
  4688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M \
  4689. 0x00000200
  4690. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4691. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M \
  4692. 0x00000400
  4693. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M \
  4695. 0x00000800
  4696. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4697. /* Probe request */
  4698. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M \
  4699. 0x00001000
  4700. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4701. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M \
  4702. 0x00002000
  4703. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4704. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M \
  4705. 0x00004000
  4706. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4707. /* Probe response */
  4708. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M \
  4709. 0x00008000
  4710. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4711. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M \
  4712. 0x00010000
  4713. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4714. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M \
  4715. 0x00020000
  4716. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4717. /* Timing Advertisement */
  4718. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M \
  4719. 0x00040000
  4720. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4721. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M \
  4722. 0x00080000
  4723. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4724. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M \
  4725. 0x00100000
  4726. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4727. /* Reserved */
  4728. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M \
  4729. 0x00200000
  4730. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4731. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M \
  4732. 0x00400000
  4733. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4734. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M \
  4735. 0x00800000
  4736. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4737. /* Beacon */
  4738. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M \
  4739. 0x01000001
  4740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4741. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M \
  4742. 0x02000001
  4743. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M \
  4745. 0x00000001
  4746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4747. /* ATIM */
  4748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M \
  4749. 0x00000001
  4750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M \
  4752. 0x00000001
  4753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M \
  4755. 0x00000001
  4756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4757. /* Disassociation */
  4758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M \
  4759. 0x00000001
  4760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M \
  4762. 0x00000002
  4763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M \
  4765. 0x00000004
  4766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4767. /* Authentication */
  4768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M \
  4769. 0x00000008
  4770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M \
  4772. 0x00000010
  4773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M \
  4775. 0x00000020
  4776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4777. /* Deauthentication */
  4778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M \
  4779. 0x00000040
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M \
  4782. 0x00000080
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M \
  4785. 0x00000100
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4787. /* Action */
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M \
  4789. 0x00000200
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M \
  4792. 0x00000400
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M \
  4795. 0x00000800
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4797. /* Action No Ack */
  4798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M \
  4799. 0x00001000
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M \
  4802. 0x00002000
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M \
  4805. 0x00004000
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4807. /* Reserved */
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M \
  4809. 0x00008000
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M \
  4812. 0x00010000
  4813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M \
  4815. 0x00020000
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4817. /*
  4818. * Subtype based CTRL frames enable bits.
  4819. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4820. */
  4821. /* Reserved */
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M \
  4823. 0x00000001
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M \
  4826. 0x00000002
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M \
  4829. 0x00000004
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4831. /* Reserved */
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M \
  4833. 0x00000008
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M \
  4836. 0x00000010
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M \
  4839. 0x00000020
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4841. /* Reserved */
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M \
  4843. 0x00000040
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M \
  4846. 0x00000080
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M \
  4849. 0x00000100
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4851. /* Reserved */
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M \
  4853. 0x00000200
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M \
  4856. 0x00000400
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M \
  4859. 0x00000800
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4861. /* Reserved */
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M \
  4863. 0x00001000
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M \
  4866. 0x00002000
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M \
  4869. 0x00004000
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4871. /* Reserved */
  4872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M \
  4873. 0x00008000
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M \
  4876. 0x00010000
  4877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M \
  4879. 0x00020000
  4880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4881. /* Reserved */
  4882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M \
  4883. 0x00040000
  4884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M \
  4886. 0x00080000
  4887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M \
  4889. 0x00100000
  4890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4891. /* Control Wrapper */
  4892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M \
  4893. 0x00200000
  4894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M \
  4896. 0x00400000
  4897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M \
  4899. 0x00800000
  4900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4901. /* Block Ack Request */
  4902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M \
  4903. 0x01000001
  4904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M \
  4906. 0x02000001
  4907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M \
  4909. 0x00000001
  4910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4911. /* Block Ack*/
  4912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M \
  4913. 0x00000001
  4914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M \
  4916. 0x00000001
  4917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M \
  4919. 0x00000001
  4920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4921. /* PS-POLL */
  4922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M \
  4923. 0x00000001
  4924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M \
  4926. 0x00000002
  4927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M \
  4929. 0x00000004
  4930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4931. /* RTS */
  4932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M \
  4933. 0x00000008
  4934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M \
  4936. 0x00000010
  4937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M \
  4939. 0x00000020
  4940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4941. /* CTS */
  4942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M \
  4943. 0x00000040
  4944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M \
  4946. 0x00000080
  4947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M \
  4949. 0x00000100
  4950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4951. /* ACK */
  4952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M \
  4953. 0x00000200
  4954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M \
  4956. 0x00000400
  4957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M \
  4959. 0x00000800
  4960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4961. /* CF-END */
  4962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M \
  4963. 0x00001000
  4964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M \
  4966. 0x00002000
  4967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M \
  4969. 0x00004000
  4970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4971. /* CF-END + CF-ACK */
  4972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M \
  4973. 0x00008000
  4974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M \
  4976. 0x00010000
  4977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M \
  4979. 0x00020000
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4981. /* Multicast data */
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M \
  4983. 0x00040000
  4984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M \
  4986. 0x00080000
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M \
  4989. 0x00100000
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4991. /* Unicast data */
  4992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M \
  4993. 0x00200000
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M \
  4996. 0x00400000
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M \
  4999. 0x00800000
  5000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5001. /* NULL data */
  5002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M \
  5003. 0x01000000
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M \
  5006. 0x02000000
  5007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M \
  5009. 0x04000000
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5012. do { \
  5013. HTT_CHECK_SET_VAL(httsym, value); \
  5014. (word) |= (value) << httsym##_S; \
  5015. } while (0)
  5016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5017. (((word) & httsym##_M) >> httsym##_S)
  5018. #define htt_rx_ring_pkt_enable_subtype_set( \
  5019. word, flag, mode, type, subtype, val) \
  5020. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, \
  5021. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype,\
  5022. val)
  5023. #define htt_rx_ring_pkt_enable_subtype_get( \
  5024. word, flag, mode, type, subtype) \
  5025. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word,\
  5026. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5027. /* Definition to filter in TLVs */
  5028. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5029. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5030. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5031. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5032. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5033. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5034. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5035. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5036. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5037. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5038. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M \
  5039. 0x00000020
  5040. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5041. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5042. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5043. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5044. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5045. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5046. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5047. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5048. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5049. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M \
  5050. 0x00000400
  5051. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5052. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5053. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5054. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M \
  5055. 0x00001000
  5056. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S\
  5057. 12
  5058. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5059. do { \
  5060. HTT_CHECK_SET_VAL(httsym, enable); \
  5061. (word) |= (enable) << httsym##_S; \
  5062. } while (0)
  5063. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5064. (((word) & httsym##_M) >> httsym##_S)
  5065. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5066. HTT_RX_RING_TLV_ENABLE_SET( \
  5067. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5068. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5069. HTT_RX_RING_TLV_ENABLE_GET(word, \
  5070. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5071. /**
  5072. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  5073. * host --> target Receive Flow Steering configuration message definition.
  5074. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5075. * The reason for this is we want RFS to be configured and ready before MAC
  5076. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5077. *
  5078. * |31 24|23 16|15 9|8|7 0|
  5079. * |----------------+----------------+----------------+----------------|
  5080. * | reserved |E| msg type |
  5081. * |-------------------------------------------------------------------|
  5082. * Where E = RFS enable flag
  5083. *
  5084. * The RFS_CONFIG message consists of a single 4-byte word.
  5085. *
  5086. * Header fields:
  5087. * - MSG_TYPE
  5088. * Bits 7:0
  5089. * Purpose: identifies this as a RFS config msg
  5090. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5091. * - RFS_CONFIG
  5092. * Bit 8
  5093. * Purpose: Tells target whether to enable (1) or disable (0)
  5094. * flow steering feature when sending rx indication messages to host
  5095. */
  5096. #define HTT_RFS_CFG_REQ_BYTES 4
  5097. #define HTT_H2T_RFS_CONFIG_M 0x100
  5098. #define HTT_H2T_RFS_CONFIG_S 8
  5099. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5100. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5101. HTT_H2T_RFS_CONFIG_S)
  5102. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5103. do { \
  5104. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5105. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5106. } while (0)
  5107. /**
  5108. * @brief host -> target FW extended statistics retrieve
  5109. *
  5110. * @details
  5111. * The following field definitions describe the format of the HTT host
  5112. * to target FW extended stats retrieve message.
  5113. * The message specifies the type of stats the host wants to retrieve.
  5114. *
  5115. * |31 24|23 16|15 8|7 0|
  5116. * |-----------------------------------------------------------|
  5117. * | reserved | stats type | pdev_mask | msg type |
  5118. * |-----------------------------------------------------------|
  5119. * | config param [0] |
  5120. * |-----------------------------------------------------------|
  5121. * | config param [1] |
  5122. * |-----------------------------------------------------------|
  5123. * | config param [2] |
  5124. * |-----------------------------------------------------------|
  5125. * | config param [3] |
  5126. * |-----------------------------------------------------------|
  5127. * | reserved |
  5128. * |-----------------------------------------------------------|
  5129. * | cookie LSBs |
  5130. * |-----------------------------------------------------------|
  5131. * | cookie MSBs |
  5132. * |-----------------------------------------------------------|
  5133. * Header fields:
  5134. * - MSG_TYPE
  5135. * Bits 7:0
  5136. * Purpose: identifies this is a extended stats upload request message
  5137. * Value: 0x10
  5138. * - PDEV_MASK
  5139. * Bits 8:15
  5140. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5141. * Value: This is a overloaded field, refer to usage and interpretation of
  5142. * PDEV in interface document.
  5143. * Bit 8 : Reserved for SOC stats
  5144. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5145. * Indicates MACID_MASK in DBS
  5146. * - STATS_TYPE
  5147. * Bits 23:16
  5148. * Purpose: identifies which FW statistics to upload
  5149. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5150. * - Reserved
  5151. * Bits 31:24
  5152. * - CONFIG_PARAM [0]
  5153. * Bits 31:0
  5154. * Purpose: give an opaque configuration value to the specified stats type
  5155. * Value: stats-type specific configuration value
  5156. * Refer to htt_stats.h for interpretation for each stats sub_type
  5157. * - CONFIG_PARAM [1]
  5158. * Bits 31:0
  5159. * Purpose: give an opaque configuration value to the specified stats type
  5160. * Value: stats-type specific configuration value
  5161. * Refer to htt_stats.h for interpretation for each stats sub_type
  5162. * - CONFIG_PARAM [2]
  5163. * Bits 31:0
  5164. * Purpose: give an opaque configuration value to the specified stats type
  5165. * Value: stats-type specific configuration value
  5166. * Refer to htt_stats.h for interpretation for each stats sub_type
  5167. * - CONFIG_PARAM [3]
  5168. * Bits 31:0
  5169. * Purpose: give an opaque configuration value to the specified stats type
  5170. * Value: stats-type specific configuration value
  5171. * Refer to htt_stats.h for interpretation for each stats sub_type
  5172. * - Reserved [31:0] for future use.
  5173. * - COOKIE_LSBS
  5174. * Bits 31:0
  5175. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5176. * message with its preceding host->target stats request message.
  5177. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5178. * - COOKIE_MSBS
  5179. * Bits 31:0
  5180. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5181. * message with its preceding host->target stats request message.
  5182. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5183. */
  5184. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5185. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5186. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5187. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5188. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5189. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5190. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5191. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5192. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5193. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5194. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5195. do { \
  5196. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5197. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S));\
  5198. } while (0)
  5199. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5200. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5201. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5202. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5203. do { \
  5204. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val);\
  5205. ((_var) |= ((_val) << \
  5206. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5207. } while (0)
  5208. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5209. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5210. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5211. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5212. do { \
  5213. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, \
  5214. _val); \
  5215. ((_var) |= ((_val) << \
  5216. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5217. } while (0)
  5218. /**
  5219. * @brief host -> target FW PPDU_STATS request message
  5220. *
  5221. * @details
  5222. * The following field definitions describe the format of the HTT host
  5223. * to target FW for PPDU_STATS_CFG msg.
  5224. * The message allows the host to configure the PPDU_STATS_IND messages
  5225. * produced by the target.
  5226. *
  5227. * |31 24|23 16|15 8|7 0|
  5228. * |-----------------------------------------------------------|
  5229. * | REQ bit mask | pdev_mask | msg type |
  5230. * |-----------------------------------------------------------|
  5231. * Header fields:
  5232. * - MSG_TYPE
  5233. * Bits 7:0
  5234. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5235. * Value: 0x11
  5236. * - PDEV_MASK
  5237. * Bits 8:15
  5238. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5239. * Value: This is a overloaded field, refer to usage and interpretation of
  5240. * PDEV in interface document.
  5241. * Bit 8 : Reserved for SOC stats
  5242. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5243. * Indicates MACID_MASK in DBS
  5244. * - REQ_TLV_BIT_MASK
  5245. * Bits 16:31
  5246. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5247. * needs to be included in the target's PPDU_STATS_IND messages.
  5248. * Value: refer htt_ppdu_stats_tlv_tag_t
  5249. *
  5250. */
  5251. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5252. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5253. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5254. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5255. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5256. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5257. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5258. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5259. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5260. do { \
  5261. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5262. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5263. } while (0)
  5264. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5265. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5266. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5267. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5268. do { \
  5269. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5270. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5271. } while (0)
  5272. /*=== target -> host messages ===============================================*/
  5273. enum htt_t2h_msg_type {
  5274. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  5275. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  5276. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  5277. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  5278. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  5279. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  5280. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  5281. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  5282. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  5283. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  5284. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  5285. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  5286. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc,/* no longer used */
  5287. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  5288. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  5289. /* only used for HL, add HTT MSG for HTT CREDIT update */
  5290. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  5291. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  5292. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  5293. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  5294. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  5295. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  5296. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  5297. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  5298. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  5299. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  5300. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  5301. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  5302. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  5303. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  5304. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  5305. HTT_T2H_MSG_TYPE_TEST,
  5306. /* keep this last */
  5307. HTT_T2H_NUM_MSGS
  5308. };
  5309. /*
  5310. * HTT target to host message type -
  5311. * stored in bits 7:0 of the first word of the message
  5312. */
  5313. #define HTT_T2H_MSG_TYPE_M 0xff
  5314. #define HTT_T2H_MSG_TYPE_S 0
  5315. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  5316. do { \
  5317. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  5318. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  5319. } while (0)
  5320. #define HTT_T2H_MSG_TYPE_GET(word) \
  5321. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5322. /**
  5323. * @brief target -> host version number confirmation message definition
  5324. *
  5325. * |31 24|23 16|15 8|7 0|
  5326. * |----------------+----------------+----------------+----------------|
  5327. * | reserved | major number | minor number | msg type |
  5328. * |-------------------------------------------------------------------|
  5329. * : option request TLV (optional) |
  5330. * :...................................................................:
  5331. *
  5332. * The VER_CONF message may consist of a single 4-byte word, or may be
  5333. * extended with TLVs that specify HTT options selected by the target.
  5334. * The following option TLVs may be appended to the VER_CONF message:
  5335. * - LL_BUS_ADDR_SIZE
  5336. * - HL_SUPPRESS_TX_COMPL_IND
  5337. * - MAX_TX_QUEUE_GROUPS
  5338. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5339. * may be appended to the VER_CONF message (but only one TLV of each type).
  5340. *
  5341. * Header fields:
  5342. * - MSG_TYPE
  5343. * Bits 7:0
  5344. * Purpose: identifies this as a version number confirmation message
  5345. * Value: 0x0
  5346. * - VER_MINOR
  5347. * Bits 15:8
  5348. * Purpose: Specify the minor number of the HTT message library version
  5349. * in use by the target firmware.
  5350. * The minor number specifies the specific revision within a range
  5351. * of fundamentally compatible HTT message definition revisions.
  5352. * Compatible revisions involve adding new messages or perhaps
  5353. * adding new fields to existing messages, in a backwards-compatible
  5354. * manner.
  5355. * Incompatible revisions involve changing the message type values,
  5356. * or redefining existing messages.
  5357. * Value: minor number
  5358. * - VER_MAJOR
  5359. * Bits 15:8
  5360. * Purpose: Specify the major number of the HTT message library version
  5361. * in use by the target firmware.
  5362. * The major number specifies the family of minor revisions that are
  5363. * fundamentally compatible with each other, but not with prior or
  5364. * later families.
  5365. * Value: major number
  5366. */
  5367. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5368. #define HTT_VER_CONF_MINOR_S 8
  5369. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5370. #define HTT_VER_CONF_MAJOR_S 16
  5371. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5372. do { \
  5373. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5374. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5375. } while (0)
  5376. #define HTT_VER_CONF_MINOR_GET(word) \
  5377. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5378. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5379. do { \
  5380. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5381. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5382. } while (0)
  5383. #define HTT_VER_CONF_MAJOR_GET(word) \
  5384. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5385. #define HTT_VER_CONF_BYTES 4
  5386. /**
  5387. * @brief - target -> host HTT Rx In order indication message
  5388. *
  5389. * @details
  5390. *
  5391. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5392. * |----------------+-------------------+---------------------+---------------|
  5393. * | peer ID | P| F| O| ext TID | msg type |
  5394. * |--------------------------------------------------------------------------|
  5395. * | MSDU count | Reserved | vdev id |
  5396. * |--------------------------------------------------------------------------|
  5397. * | MSDU 0 bus address (bits 31:0) |
  5398. #if HTT_PADDR64
  5399. * | MSDU 0 bus address (bits 63:32) |
  5400. #endif
  5401. * |--------------------------------------------------------------------------|
  5402. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5403. * |--------------------------------------------------------------------------|
  5404. * | MSDU 1 bus address (bits 31:0) |
  5405. #if HTT_PADDR64
  5406. * | MSDU 1 bus address (bits 63:32) |
  5407. #endif
  5408. * |--------------------------------------------------------------------------|
  5409. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5410. * |--------------------------------------------------------------------------|
  5411. */
  5412. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5413. *
  5414. * @details
  5415. * bits
  5416. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5417. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5418. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5419. * | | frag | | | | fail |chksum fail|
  5420. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5421. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5422. */
  5423. struct htt_rx_in_ord_paddr_ind_hdr_t {
  5424. A_UINT32 /* word 0 */
  5425. msg_type:8,
  5426. ext_tid:5,
  5427. offload:1,
  5428. frag:1,
  5429. /*
  5430. * Tell host whether to store MSDUs referenced in this message
  5431. * in pktlog
  5432. */
  5433. pktlog:1,
  5434. peer_id:16;
  5435. A_UINT32 /* word 1 */
  5436. vap_id:8,
  5437. reserved_1:8,
  5438. msdu_cnt:16;
  5439. };
  5440. struct htt_rx_in_ord_paddr_ind_msdu32_t {
  5441. A_UINT32 dma_addr;
  5442. A_UINT32
  5443. length:16,
  5444. fw_desc:8,
  5445. msdu_info:8;
  5446. };
  5447. struct htt_rx_in_ord_paddr_ind_msdu64_t {
  5448. A_UINT32 dma_addr_lo;
  5449. A_UINT32 dma_addr_hi;
  5450. A_UINT32
  5451. length:16,
  5452. fw_desc:8,
  5453. msdu_info:8;
  5454. };
  5455. #if HTT_PADDR64
  5456. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5457. #else
  5458. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5459. #endif
  5460. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES \
  5461. (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5462. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS \
  5463. (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5464. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET \
  5465. HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5466. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET \
  5467. HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5468. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 \
  5469. (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5470. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 \
  5471. (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5472. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 \
  5473. (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5474. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 \
  5475. (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5476. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES \
  5477. (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5478. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS \
  5479. (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5480. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5481. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5482. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5483. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5484. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5485. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5486. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5487. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5488. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5489. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5490. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5491. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5492. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5493. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5494. /* for systems using 64-bit format for bus addresses */
  5495. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5496. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5497. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5498. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5499. /* for systems using 32-bit format for bus addresses */
  5500. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5501. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5502. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5503. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5504. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5505. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5506. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5507. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5508. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5509. do { \
  5510. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5511. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5512. } while (0)
  5513. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5514. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> \
  5515. HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5516. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5517. do { \
  5518. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5519. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5520. } while (0)
  5521. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5522. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> \
  5523. HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5524. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5525. do { \
  5526. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5527. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5528. } while (0)
  5529. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5530. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> \
  5531. HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5532. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5533. do { \
  5534. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5535. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5536. } while (0)
  5537. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5538. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> \
  5539. HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5540. /* for systems using 64-bit format for bus addresses */
  5541. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5542. do { \
  5543. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5544. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5545. } while (0)
  5546. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5547. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> \
  5548. HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5549. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5550. do { \
  5551. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5552. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5553. } while (0)
  5554. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5555. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> \
  5556. HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5557. /* for systems using 32-bit format for bus addresses */
  5558. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5559. do { \
  5560. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5561. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5562. } while (0)
  5563. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5564. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> \
  5565. HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5566. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5567. do { \
  5568. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value);\
  5569. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5570. } while (0)
  5571. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5572. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> \
  5573. HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5574. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5575. do { \
  5576. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5577. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5578. } while (0)
  5579. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5580. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> \
  5581. HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5582. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5583. do { \
  5584. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value);\
  5585. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S;\
  5586. } while (0)
  5587. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5588. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> \
  5589. HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5590. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5591. do { \
  5592. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value);\
  5593. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5594. } while (0)
  5595. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5596. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> \
  5597. HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5598. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5599. do { \
  5600. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5601. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5602. } while (0)
  5603. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5604. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> \
  5605. HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5606. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5607. do { \
  5608. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5609. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5610. } while (0)
  5611. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5612. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> \
  5613. HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5614. /* definitions used within target -> host rx indication message */
  5615. PREPACK struct htt_rx_ind_hdr_prefix_t {
  5616. A_UINT32 /* word 0 */
  5617. msg_type:8,
  5618. ext_tid:5,
  5619. release_valid:1,
  5620. flush_valid:1,
  5621. reserved0:1,
  5622. peer_id:16;
  5623. A_UINT32 /* word 1 */
  5624. flush_start_seq_num:6,
  5625. flush_end_seq_num:6,
  5626. release_start_seq_num:6,
  5627. release_end_seq_num:6,
  5628. num_mpdu_ranges:8;
  5629. } POSTPACK;
  5630. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5631. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5632. #define HTT_TGT_RSSI_INVALID 0x80
  5633. PREPACK struct htt_rx_ppdu_desc_t {
  5634. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5635. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5636. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5637. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5638. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5639. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5640. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5641. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5642. A_UINT32 /* word 0 */
  5643. rssi_cmb:8,
  5644. timestamp_submicrosec:8,
  5645. phy_err_code:8,
  5646. phy_err:1,
  5647. legacy_rate:4,
  5648. legacy_rate_sel:1,
  5649. end_valid:1,
  5650. start_valid:1;
  5651. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5652. union {
  5653. A_UINT32 /* word 1 */
  5654. rssi0_pri20:8,
  5655. rssi0_ext20:8,
  5656. rssi0_ext40:8,
  5657. rssi0_ext80:8;
  5658. A_UINT32 rssi0; /* access all 20/40/80 per-b/w RSSIs together */
  5659. } u0;
  5660. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5661. union {
  5662. A_UINT32 /* word 2 */
  5663. rssi1_pri20:8,
  5664. rssi1_ext20:8,
  5665. rssi1_ext40:8,
  5666. rssi1_ext80:8;
  5667. A_UINT32 rssi1; /* access all 20/40/80 per-b/w RSSIs together */
  5668. } u1;
  5669. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5670. union {
  5671. A_UINT32 /* word 3 */
  5672. rssi2_pri20:8,
  5673. rssi2_ext20:8,
  5674. rssi2_ext40:8,
  5675. rssi2_ext80:8;
  5676. A_UINT32 rssi2; /* access all 20/40/80 per-b/w RSSIs together */
  5677. } u2;
  5678. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5679. union {
  5680. A_UINT32 /* word 4 */
  5681. rssi3_pri20:8,
  5682. rssi3_ext20:8,
  5683. rssi3_ext40:8,
  5684. rssi3_ext80:8;
  5685. A_UINT32 rssi3; /* access all 20/40/80 per-b/w RSSIs together */
  5686. } u3;
  5687. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5688. A_UINT32 tsf32; /* word 5 */
  5689. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5690. A_UINT32 timestamp_microsec; /* word 6 */
  5691. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5692. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5693. A_UINT32 /* word 7 */
  5694. vht_sig_a1:24,
  5695. preamble_type:8;
  5696. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5697. A_UINT32 /* word 8 */
  5698. vht_sig_a2:24,
  5699. reserved0:8;
  5700. } POSTPACK;
  5701. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5702. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5703. PREPACK struct htt_rx_ind_hdr_suffix_t {
  5704. A_UINT32 /* word 0 */
  5705. fw_rx_desc_bytes:16,
  5706. reserved0:16;
  5707. } POSTPACK;
  5708. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5709. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5710. PREPACK struct htt_rx_ind_hdr_t {
  5711. struct htt_rx_ind_hdr_prefix_t prefix;
  5712. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5713. struct htt_rx_ind_hdr_suffix_t suffix;
  5714. } POSTPACK;
  5715. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5716. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5717. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5718. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5719. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5720. /*
  5721. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5722. * the offset into the HTT rx indication message at which the
  5723. * FW rx PPDU descriptor resides
  5724. */
  5725. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5726. /*
  5727. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5728. * the offset into the HTT rx indication message at which the
  5729. * header suffix (FW rx MSDU byte count) resides
  5730. */
  5731. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5732. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5733. /*
  5734. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5735. * the offset into the HTT rx indication message at which the per-MSDU
  5736. * information starts
  5737. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5738. * per-MSDU information portion of the message. The per-MSDU info itself
  5739. * starts at byte 12.
  5740. */
  5741. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5742. /**
  5743. * @brief target -> host rx indication message definition
  5744. *
  5745. * @details
  5746. * The following field definitions describe the format of the rx indication
  5747. * message sent from the target to the host.
  5748. * The message consists of three major sections:
  5749. * 1. a fixed-length header
  5750. * 2. a variable-length list of firmware rx MSDU descriptors
  5751. * 3. one or more 4-octet MPDU range information elements
  5752. * The fixed length header itself has two sub-sections
  5753. * 1. the message meta-information, including identification of the
  5754. * sender and type of the received data, and a 4-octet flush/release IE
  5755. * 2. the firmware rx PPDU descriptor
  5756. *
  5757. * The format of the message is depicted below.
  5758. * in this depiction, the following abbreviations are used for information
  5759. * elements within the message:
  5760. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5761. * elements associated with the PPDU start are valid.
  5762. * Specifically, the following fields are valid only if SV is set:
  5763. * RSSI (all variants), L, legacy rate, preamble type, service,
  5764. * VHT-SIG-A
  5765. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5766. * elements associated with the PPDU end are valid.
  5767. * Specifically, the following fields are valid only if EV is set:
  5768. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5769. * - L - Legacy rate selector - if legacy rates are used, this flag
  5770. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5771. * (L == 0) PHY.
  5772. * - P - PHY error flag - boolean indication of whether the rx frame had
  5773. * a PHY error
  5774. *
  5775. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5776. * |----------------+-------------------+---------------------+---------------|
  5777. * | peer ID | |RV|FV| ext TID | msg type |
  5778. * |--------------------------------------------------------------------------|
  5779. * | num | release | release | flush | flush |
  5780. * | MPDU | end | start | end | start |
  5781. * | ranges | seq num | seq num | seq num | seq num |
  5782. * |==========================================================================|
  5783. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5784. * |V|V| | rate | | | timestamp | RSSI |
  5785. * |--------------------------------------------------------------------------|
  5786. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5787. * |--------------------------------------------------------------------------|
  5788. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5789. * |--------------------------------------------------------------------------|
  5790. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5791. * |--------------------------------------------------------------------------|
  5792. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5793. * |--------------------------------------------------------------------------|
  5794. * | TSF LSBs |
  5795. * |--------------------------------------------------------------------------|
  5796. * | microsec timestamp |
  5797. * |--------------------------------------------------------------------------|
  5798. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5799. * |--------------------------------------------------------------------------|
  5800. * | service | HT-SIG / VHT-SIG-A2 |
  5801. * |==========================================================================|
  5802. * | reserved | FW rx desc bytes |
  5803. * |--------------------------------------------------------------------------|
  5804. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5805. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5806. * |--------------------------------------------------------------------------|
  5807. * : : :
  5808. * |--------------------------------------------------------------------------|
  5809. * | alignment | MSDU Rx |
  5810. * | padding | desc Bn |
  5811. * |--------------------------------------------------------------------------|
  5812. * | reserved | MPDU range status | MPDU count |
  5813. * |--------------------------------------------------------------------------|
  5814. * : reserved : MPDU range status : MPDU count :
  5815. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5816. *
  5817. * Header fields:
  5818. * - MSG_TYPE
  5819. * Bits 7:0
  5820. * Purpose: identifies this as an rx indication message
  5821. * Value: 0x1
  5822. * - EXT_TID
  5823. * Bits 12:8
  5824. * Purpose: identify the traffic ID of the rx data, including
  5825. * special "extended" TID values for multicast, broadcast, and
  5826. * non-QoS data frames
  5827. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5828. * - FLUSH_VALID (FV)
  5829. * Bit 13
  5830. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5831. * is valid
  5832. * Value:
  5833. * 1 -> flush IE is valid and needs to be processed
  5834. * 0 -> flush IE is not valid and should be ignored
  5835. * - REL_VALID (RV)
  5836. * Bit 13
  5837. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5838. * is valid
  5839. * Value:
  5840. * 1 -> release IE is valid and needs to be processed
  5841. * 0 -> release IE is not valid and should be ignored
  5842. * - PEER_ID
  5843. * Bits 31:16
  5844. * Purpose: Identify, by ID, which peer sent the rx data
  5845. * Value: ID of the peer who sent the rx data
  5846. * - FLUSH_SEQ_NUM_START
  5847. * Bits 5:0
  5848. * Purpose: Indicate the start of a series of MPDUs to flush
  5849. * Not all MPDUs within this series are necessarily valid - the host
  5850. * must check each sequence number within this range to see if the
  5851. * corresponding MPDU is actually present.
  5852. * This field is only valid if the FV bit is set.
  5853. * Value:
  5854. * The sequence number for the first MPDUs to check to flush.
  5855. * The sequence number is masked by 0x3f.
  5856. * - FLUSH_SEQ_NUM_END
  5857. * Bits 11:6
  5858. * Purpose: Indicate the end of a series of MPDUs to flush
  5859. * Value:
  5860. * The sequence number one larger than the sequence number of the
  5861. * last MPDU to check to flush.
  5862. * The sequence number is masked by 0x3f.
  5863. * Not all MPDUs within this series are necessarily valid - the host
  5864. * must check each sequence number within this range to see if the
  5865. * corresponding MPDU is actually present.
  5866. * This field is only valid if the FV bit is set.
  5867. * - REL_SEQ_NUM_START
  5868. * Bits 17:12
  5869. * Purpose: Indicate the start of a series of MPDUs to release.
  5870. * All MPDUs within this series are present and valid - the host
  5871. * need not check each sequence number within this range to see if
  5872. * the corresponding MPDU is actually present.
  5873. * This field is only valid if the RV bit is set.
  5874. * Value:
  5875. * The sequence number for the first MPDUs to check to release.
  5876. * The sequence number is masked by 0x3f.
  5877. * - REL_SEQ_NUM_END
  5878. * Bits 23:18
  5879. * Purpose: Indicate the end of a series of MPDUs to release.
  5880. * Value:
  5881. * The sequence number one larger than the sequence number of the
  5882. * last MPDU to check to release.
  5883. * The sequence number is masked by 0x3f.
  5884. * All MPDUs within this series are present and valid - the host
  5885. * need not check each sequence number within this range to see if
  5886. * the corresponding MPDU is actually present.
  5887. * This field is only valid if the RV bit is set.
  5888. * - NUM_MPDU_RANGES
  5889. * Bits 31:24
  5890. * Purpose: Indicate how many ranges of MPDUs are present.
  5891. * Each MPDU range consists of a series of contiguous MPDUs within the
  5892. * rx frame sequence which all have the same MPDU status.
  5893. * Value: 1-63 (typically a small number, like 1-3)
  5894. *
  5895. * Rx PPDU descriptor fields:
  5896. * - RSSI_CMB
  5897. * Bits 7:0
  5898. * Purpose: Combined RSSI from all active rx chains, across the active
  5899. * bandwidth.
  5900. * Value: RSSI dB units w.r.t. noise floor
  5901. * - TIMESTAMP_SUBMICROSEC
  5902. * Bits 15:8
  5903. * Purpose: high-resolution timestamp
  5904. * Value:
  5905. * Sub-microsecond time of PPDU reception.
  5906. * This timestamp ranges from [0,MAC clock MHz).
  5907. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5908. * to form a high-resolution, large range rx timestamp.
  5909. * - PHY_ERR_CODE
  5910. * Bits 23:16
  5911. * Purpose:
  5912. * If the rx frame processing resulted in a PHY error, indicate what
  5913. * type of rx PHY error occurred.
  5914. * Value:
  5915. * This field is valid if the "P" (PHY_ERR) flag is set.
  5916. * TBD: document/specify the values for this field
  5917. * - PHY_ERR
  5918. * Bit 24
  5919. * Purpose: indicate whether the rx PPDU had a PHY error
  5920. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5921. * - LEGACY_RATE
  5922. * Bits 28:25
  5923. * Purpose:
  5924. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5925. * specify which rate was used.
  5926. * Value:
  5927. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5928. * flag.
  5929. * If LEGACY_RATE_SEL is 0:
  5930. * 0x8: OFDM 48 Mbps
  5931. * 0x9: OFDM 24 Mbps
  5932. * 0xA: OFDM 12 Mbps
  5933. * 0xB: OFDM 6 Mbps
  5934. * 0xC: OFDM 54 Mbps
  5935. * 0xD: OFDM 36 Mbps
  5936. * 0xE: OFDM 18 Mbps
  5937. * 0xF: OFDM 9 Mbps
  5938. * If LEGACY_RATE_SEL is 1:
  5939. * 0x8: CCK 11 Mbps long preamble
  5940. * 0x9: CCK 5.5 Mbps long preamble
  5941. * 0xA: CCK 2 Mbps long preamble
  5942. * 0xB: CCK 1 Mbps long preamble
  5943. * 0xC: CCK 11 Mbps short preamble
  5944. * 0xD: CCK 5.5 Mbps short preamble
  5945. * 0xE: CCK 2 Mbps short preamble
  5946. * - LEGACY_RATE_SEL
  5947. * Bit 29
  5948. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5949. * Value:
  5950. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5951. * used a legacy rate.
  5952. * 0 -> OFDM, 1 -> CCK
  5953. * - END_VALID
  5954. * Bit 30
  5955. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5956. * the start of the PPDU are valid. Specifically, the following
  5957. * fields are only valid if END_VALID is set:
  5958. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5959. * TIMESTAMP_SUBMICROSEC
  5960. * Value:
  5961. * 0 -> rx PPDU desc end fields are not valid
  5962. * 1 -> rx PPDU desc end fields are valid
  5963. * - START_VALID
  5964. * Bit 31
  5965. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5966. * the end of the PPDU are valid. Specifically, the following
  5967. * fields are only valid if START_VALID is set:
  5968. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5969. * VHT-SIG-A
  5970. * Value:
  5971. * 0 -> rx PPDU desc start fields are not valid
  5972. * 1 -> rx PPDU desc start fields are valid
  5973. * - RSSI0_PRI20
  5974. * Bits 7:0
  5975. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5976. * Value: RSSI dB units w.r.t. noise floor
  5977. *
  5978. * - RSSI0_EXT20
  5979. * Bits 7:0
  5980. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5981. * (if the rx bandwidth was >= 40 MHz)
  5982. * Value: RSSI dB units w.r.t. noise floor
  5983. * - RSSI0_EXT40
  5984. * Bits 7:0
  5985. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5986. * (if the rx bandwidth was >= 80 MHz)
  5987. * Value: RSSI dB units w.r.t. noise floor
  5988. * - RSSI0_EXT80
  5989. * Bits 7:0
  5990. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5991. * (if the rx bandwidth was >= 160 MHz)
  5992. * Value: RSSI dB units w.r.t. noise floor
  5993. *
  5994. * - RSSI1_PRI20
  5995. * Bits 7:0
  5996. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5997. * Value: RSSI dB units w.r.t. noise floor
  5998. * - RSSI1_EXT20
  5999. * Bits 7:0
  6000. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  6001. * (if the rx bandwidth was >= 40 MHz)
  6002. * Value: RSSI dB units w.r.t. noise floor
  6003. * - RSSI1_EXT40
  6004. * Bits 7:0
  6005. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  6006. * (if the rx bandwidth was >= 80 MHz)
  6007. * Value: RSSI dB units w.r.t. noise floor
  6008. * - RSSI1_EXT80
  6009. * Bits 7:0
  6010. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  6011. * (if the rx bandwidth was >= 160 MHz)
  6012. * Value: RSSI dB units w.r.t. noise floor
  6013. *
  6014. * - RSSI2_PRI20
  6015. * Bits 7:0
  6016. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  6017. * Value: RSSI dB units w.r.t. noise floor
  6018. * - RSSI2_EXT20
  6019. * Bits 7:0
  6020. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  6021. * (if the rx bandwidth was >= 40 MHz)
  6022. * Value: RSSI dB units w.r.t. noise floor
  6023. * - RSSI2_EXT40
  6024. * Bits 7:0
  6025. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  6026. * (if the rx bandwidth was >= 80 MHz)
  6027. * Value: RSSI dB units w.r.t. noise floor
  6028. * - RSSI2_EXT80
  6029. * Bits 7:0
  6030. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  6031. * (if the rx bandwidth was >= 160 MHz)
  6032. * Value: RSSI dB units w.r.t. noise floor
  6033. *
  6034. * - RSSI3_PRI20
  6035. * Bits 7:0
  6036. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  6037. * Value: RSSI dB units w.r.t. noise floor
  6038. * - RSSI3_EXT20
  6039. * Bits 7:0
  6040. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  6041. * (if the rx bandwidth was >= 40 MHz)
  6042. * Value: RSSI dB units w.r.t. noise floor
  6043. * - RSSI3_EXT40
  6044. * Bits 7:0
  6045. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  6046. * (if the rx bandwidth was >= 80 MHz)
  6047. * Value: RSSI dB units w.r.t. noise floor
  6048. * - RSSI3_EXT80
  6049. * Bits 7:0
  6050. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  6051. * (if the rx bandwidth was >= 160 MHz)
  6052. * Value: RSSI dB units w.r.t. noise floor
  6053. *
  6054. * - TSF32
  6055. * Bits 31:0
  6056. * Purpose: specify the time the rx PPDU was received, in TSF units
  6057. * Value: 32 LSBs of the TSF
  6058. * - TIMESTAMP_MICROSEC
  6059. * Bits 31:0
  6060. * Purpose: specify the time the rx PPDU was received, in microsecond units
  6061. * Value: PPDU rx time, in microseconds
  6062. * - VHT_SIG_A1
  6063. * Bits 23:0
  6064. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  6065. * from the rx PPDU
  6066. * Value:
  6067. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  6068. * VHT-SIG-A1 data.
  6069. * If PREAMBLE_TYPE specifies HT, then this field contains the
  6070. * first 24 bits of the HT-SIG data.
  6071. * Otherwise, this field is invalid.
  6072. * Refer to the the 802.11 protocol for the definition of the
  6073. * HT-SIG and VHT-SIG-A1 fields
  6074. * - VHT_SIG_A2
  6075. * Bits 23:0
  6076. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  6077. * from the rx PPDU
  6078. * Value:
  6079. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  6080. * VHT-SIG-A2 data.
  6081. * If PREAMBLE_TYPE specifies HT, then this field contains the
  6082. * last 24 bits of the HT-SIG data.
  6083. * Otherwise, this field is invalid.
  6084. * Refer to the the 802.11 protocol for the definition of the
  6085. * HT-SIG and VHT-SIG-A2 fields
  6086. * - PREAMBLE_TYPE
  6087. * Bits 31:24
  6088. * Purpose: indicate the PHY format of the received burst
  6089. * Value:
  6090. * 0x4: Legacy (OFDM/CCK)
  6091. * 0x8: HT
  6092. * 0x9: HT with TxBF
  6093. * 0xC: VHT
  6094. * 0xD: VHT with TxBF
  6095. * - SERVICE
  6096. * Bits 31:24
  6097. * Purpose: TBD
  6098. * Value: TBD
  6099. *
  6100. * Rx MSDU descriptor fields:
  6101. * - FW_RX_DESC_BYTES
  6102. * Bits 15:0
  6103. * Purpose: Indicate how many bytes in the Rx indication are used for
  6104. * FW Rx descriptors
  6105. *
  6106. * Payload fields:
  6107. * - MPDU_COUNT
  6108. * Bits 7:0
  6109. * Purpose: Indicate how many sequential MPDUs share the same status.
  6110. * All MPDUs within the indicated list are from the same RA-TA-TID.
  6111. * - MPDU_STATUS
  6112. * Bits 15:8
  6113. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  6114. * received successfully.
  6115. * Value:
  6116. * 0x1: success
  6117. * 0x2: FCS error
  6118. * 0x3: duplicate error
  6119. * 0x4: replay error
  6120. * 0x5: invalid peer
  6121. */
  6122. /* header fields */
  6123. #define HTT_RX_IND_EXT_TID_M 0x1f00
  6124. #define HTT_RX_IND_EXT_TID_S 8
  6125. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  6126. #define HTT_RX_IND_FLUSH_VALID_S 13
  6127. #define HTT_RX_IND_REL_VALID_M 0x4000
  6128. #define HTT_RX_IND_REL_VALID_S 14
  6129. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  6130. #define HTT_RX_IND_PEER_ID_S 16
  6131. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  6132. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  6133. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  6134. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  6135. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  6136. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  6137. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  6138. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  6139. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  6140. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  6141. /* rx PPDU descriptor fields */
  6142. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  6143. #define HTT_RX_IND_RSSI_CMB_S 0
  6144. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  6145. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  6146. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  6147. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  6148. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  6149. #define HTT_RX_IND_PHY_ERR_S 24
  6150. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  6151. #define HTT_RX_IND_LEGACY_RATE_S 25
  6152. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  6153. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  6154. #define HTT_RX_IND_END_VALID_M 0x40000000
  6155. #define HTT_RX_IND_END_VALID_S 30
  6156. #define HTT_RX_IND_START_VALID_M 0x80000000
  6157. #define HTT_RX_IND_START_VALID_S 31
  6158. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  6159. #define HTT_RX_IND_RSSI_PRI20_S 0
  6160. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  6161. #define HTT_RX_IND_RSSI_EXT20_S 8
  6162. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  6163. #define HTT_RX_IND_RSSI_EXT40_S 16
  6164. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  6165. #define HTT_RX_IND_RSSI_EXT80_S 24
  6166. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  6167. #define HTT_RX_IND_VHT_SIG_A1_S 0
  6168. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  6169. #define HTT_RX_IND_VHT_SIG_A2_S 0
  6170. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  6171. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  6172. #define HTT_RX_IND_SERVICE_M 0xff000000
  6173. #define HTT_RX_IND_SERVICE_S 24
  6174. /* rx MSDU descriptor fields */
  6175. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  6176. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  6177. /* payload fields */
  6178. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  6179. #define HTT_RX_IND_MPDU_COUNT_S 0
  6180. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  6181. #define HTT_RX_IND_MPDU_STATUS_S 8
  6182. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  6183. do { \
  6184. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  6185. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  6186. } while (0)
  6187. #define HTT_RX_IND_EXT_TID_GET(word) \
  6188. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  6189. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  6190. do { \
  6191. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  6192. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  6193. } while (0)
  6194. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  6195. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  6196. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  6197. do { \
  6198. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  6199. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  6200. } while (0)
  6201. #define HTT_RX_IND_REL_VALID_GET(word) \
  6202. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  6203. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  6204. do { \
  6205. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  6206. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  6207. } while (0)
  6208. #define HTT_RX_IND_PEER_ID_GET(word) \
  6209. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  6210. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  6211. do { \
  6212. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  6213. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  6214. } while (0)
  6215. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  6216. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> \
  6217. HTT_RX_IND_FW_RX_DESC_BYTES_S)
  6218. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  6219. do { \
  6220. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  6221. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  6222. } while (0)
  6223. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  6224. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  6225. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  6226. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  6227. do { \
  6228. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  6229. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  6230. } while (0)
  6231. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  6232. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  6233. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  6234. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  6235. do { \
  6236. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  6237. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  6238. } while (0)
  6239. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  6240. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  6241. HTT_RX_IND_REL_SEQ_NUM_START_S)
  6242. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  6243. do { \
  6244. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  6245. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  6246. } while (0)
  6247. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  6248. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  6249. HTT_RX_IND_REL_SEQ_NUM_END_S)
  6250. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  6251. do { \
  6252. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  6253. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  6254. } while (0)
  6255. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  6256. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  6257. HTT_RX_IND_NUM_MPDU_RANGES_S)
  6258. /* FW rx PPDU descriptor fields */
  6259. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  6260. do { \
  6261. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  6262. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  6263. } while (0)
  6264. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  6265. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  6266. HTT_RX_IND_RSSI_CMB_S)
  6267. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  6268. do { \
  6269. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  6270. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  6271. } while (0)
  6272. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  6273. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  6274. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  6275. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  6276. do { \
  6277. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  6278. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  6279. } while (0)
  6280. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  6281. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  6282. HTT_RX_IND_PHY_ERR_CODE_S)
  6283. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  6284. do { \
  6285. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  6286. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  6287. } while (0)
  6288. #define HTT_RX_IND_PHY_ERR_GET(word) \
  6289. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  6290. HTT_RX_IND_PHY_ERR_S)
  6291. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  6292. do { \
  6293. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  6294. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  6295. } while (0)
  6296. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  6297. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  6298. HTT_RX_IND_LEGACY_RATE_S)
  6299. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  6300. do { \
  6301. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  6302. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  6303. } while (0)
  6304. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  6305. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  6306. HTT_RX_IND_LEGACY_RATE_SEL_S)
  6307. #define HTT_RX_IND_END_VALID_SET(word, value) \
  6308. do { \
  6309. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  6310. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  6311. } while (0)
  6312. #define HTT_RX_IND_END_VALID_GET(word) \
  6313. (((word) & HTT_RX_IND_END_VALID_M) >> \
  6314. HTT_RX_IND_END_VALID_S)
  6315. #define HTT_RX_IND_START_VALID_SET(word, value) \
  6316. do { \
  6317. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  6318. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  6319. } while (0)
  6320. #define HTT_RX_IND_START_VALID_GET(word) \
  6321. (((word) & HTT_RX_IND_START_VALID_M) >> \
  6322. HTT_RX_IND_START_VALID_S)
  6323. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  6324. do { \
  6325. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  6326. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  6327. } while (0)
  6328. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  6329. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  6330. HTT_RX_IND_RSSI_PRI20_S)
  6331. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  6332. do { \
  6333. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  6334. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  6335. } while (0)
  6336. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  6337. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  6338. HTT_RX_IND_RSSI_EXT20_S)
  6339. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  6340. do { \
  6341. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6342. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6343. } while (0)
  6344. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6345. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6346. HTT_RX_IND_RSSI_EXT40_S)
  6347. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6348. do { \
  6349. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6350. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6351. } while (0)
  6352. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6353. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6354. HTT_RX_IND_RSSI_EXT80_S)
  6355. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6356. do { \
  6357. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6358. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6359. } while (0)
  6360. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6361. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6362. HTT_RX_IND_VHT_SIG_A1_S)
  6363. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6364. do { \
  6365. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6366. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6367. } while (0)
  6368. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6369. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6370. HTT_RX_IND_VHT_SIG_A2_S)
  6371. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6372. do { \
  6373. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6374. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6375. } while (0)
  6376. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6377. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6378. HTT_RX_IND_PREAMBLE_TYPE_S)
  6379. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6380. do { \
  6381. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6382. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6383. } while (0)
  6384. #define HTT_RX_IND_SERVICE_GET(word) \
  6385. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6386. HTT_RX_IND_SERVICE_S)
  6387. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6388. do { \
  6389. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6390. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6391. } while (0)
  6392. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6393. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6394. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6395. do { \
  6396. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6397. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6398. } while (0)
  6399. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6400. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6401. #define HTT_RX_IND_HL_BYTES \
  6402. (HTT_RX_IND_HDR_BYTES + \
  6403. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  6404. 4 /* single MPDU range information element */)
  6405. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6406. /* Could we use one macro entry? */
  6407. #define HTT_WORD_SET(word, field, value) \
  6408. do { \
  6409. HTT_CHECK_SET_VAL(field, value); \
  6410. (word) |= ((value) << field ## _S); \
  6411. } while (0)
  6412. #define HTT_WORD_GET(word, field) \
  6413. (((word) & field ## _M) >> field ## _S)
  6414. PREPACK struct hl_htt_rx_ind_base {
  6415. /*
  6416. * align with LL case rx indication message,but
  6417. * reduced to 5 words
  6418. */
  6419. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32];
  6420. } POSTPACK;
  6421. /*
  6422. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6423. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6424. * HL host needed info. The field is just after the msdu fw rx desc.
  6425. */
  6426. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6427. (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6428. struct htt_rx_ind_hl_rx_desc_t {
  6429. A_UINT8 ver;
  6430. A_UINT8 len;
  6431. struct {
  6432. A_UINT8
  6433. first_msdu:1,
  6434. last_msdu:1,
  6435. c3_failed:1,
  6436. c4_failed:1,
  6437. ipv6:1,
  6438. tcp:1,
  6439. udp:1,
  6440. reserved:1;
  6441. } flags;
  6442. };
  6443. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6444. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6445. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6446. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6447. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6448. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6449. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6450. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6451. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6452. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6453. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6454. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6455. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6456. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6457. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or ipv4 */
  6458. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6459. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6460. /* This structure is used in HL, the basic descriptor information
  6461. * used by host. the structure is translated by FW from HW desc
  6462. * or generated by FW. But in HL monitor mode, the host would use
  6463. * the same structure with LL.
  6464. */
  6465. PREPACK struct hl_htt_rx_desc_base {
  6466. A_UINT32
  6467. seq_num:12,
  6468. encrypted:1,
  6469. chan_info_present:1,
  6470. resv0:2,
  6471. mcast_bcast:1,
  6472. fragment:1,
  6473. key_id_oct:8,
  6474. resv1:6;
  6475. A_UINT32 pn_31_0;
  6476. union {
  6477. struct {
  6478. A_UINT16 pn_47_32;
  6479. A_UINT16 pn_63_48;
  6480. } pn16;
  6481. A_UINT32 pn_63_32;
  6482. } u0;
  6483. A_UINT32 pn_95_64;
  6484. A_UINT32 pn_127_96;
  6485. } POSTPACK;
  6486. /*
  6487. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6488. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6489. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6490. * Please see htt_chan_change_t for description of the fields.
  6491. */
  6492. PREPACK struct htt_chan_info_t
  6493. {
  6494. A_UINT32
  6495. primary_chan_center_freq_mhz:16,
  6496. contig_chan1_center_freq_mhz:16;
  6497. A_UINT32
  6498. contig_chan2_center_freq_mhz:16,
  6499. phy_mode:8,
  6500. reserved:8;
  6501. } POSTPACK;
  6502. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6503. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6504. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6505. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6506. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6507. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6508. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6509. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6510. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6511. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6512. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6513. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6514. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6515. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6516. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6517. #define HTT_HL_RX_DESC_PN_OFFSET \
  6518. offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6519. #define HTT_HL_RX_DESC_PN_WORD_OFFSET \
  6520. (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6521. /* Channel information */
  6522. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6523. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6524. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6525. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6526. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6527. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6528. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6529. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6530. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6531. do { \
  6532. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6533. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6534. } while (0)
  6535. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6536. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) \
  6537. >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6538. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6539. do { \
  6540. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6541. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6542. } while (0)
  6543. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6544. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) \
  6545. >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6546. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6547. do { \
  6548. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6549. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6550. } while (0)
  6551. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6552. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) \
  6553. >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6554. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6555. do { \
  6556. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6557. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6558. } while (0)
  6559. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6560. (((word) & HTT_CHAN_INFO_PHY_MODE_M) \
  6561. >> HTT_CHAN_INFO_PHY_MODE_S)
  6562. /*
  6563. * @brief target -> host rx reorder flush message definition
  6564. *
  6565. * @details
  6566. * The following field definitions describe the format of the rx flush
  6567. * message sent from the target to the host.
  6568. * The message consists of a 4-octet header, followed by one or more
  6569. * 4-octet payload information elements.
  6570. *
  6571. * |31 24|23 8|7 0|
  6572. * |--------------------------------------------------------------|
  6573. * | TID | peer ID | msg type |
  6574. * |--------------------------------------------------------------|
  6575. * | seq num end | seq num start | MPDU status | reserved |
  6576. * |--------------------------------------------------------------|
  6577. * First DWORD:
  6578. * - MSG_TYPE
  6579. * Bits 7:0
  6580. * Purpose: identifies this as an rx flush message
  6581. * Value: 0x2
  6582. * - PEER_ID
  6583. * Bits 23:8 (only bits 18:8 actually used)
  6584. * Purpose: identify which peer's rx data is being flushed
  6585. * Value: (rx) peer ID
  6586. * - TID
  6587. * Bits 31:24 (only bits 27:24 actually used)
  6588. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6589. * Value: traffic identifier
  6590. * Second DWORD:
  6591. * - MPDU_STATUS
  6592. * Bits 15:8
  6593. * Purpose:
  6594. * Indicate whether the flushed MPDUs should be discarded or processed.
  6595. * Value:
  6596. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6597. * stages of rx processing
  6598. * other: discard the MPDUs
  6599. * It is anticipated that flush messages will always have
  6600. * MPDU status == 1, but the status flag is included for
  6601. * flexibility.
  6602. * - SEQ_NUM_START
  6603. * Bits 23:16
  6604. * Purpose:
  6605. * Indicate the start of a series of consecutive MPDUs being flushed.
  6606. * Not all MPDUs within this range are necessarily valid - the host
  6607. * must check each sequence number within this range to see if the
  6608. * corresponding MPDU is actually present.
  6609. * Value:
  6610. * The sequence number for the first MPDU in the sequence.
  6611. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6612. * - SEQ_NUM_END
  6613. * Bits 30:24
  6614. * Purpose:
  6615. * Indicate the end of a series of consecutive MPDUs being flushed.
  6616. * Value:
  6617. * The sequence number one larger than the sequence number of the
  6618. * last MPDU being flushed.
  6619. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6620. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6621. * are to be released for further rx processing.
  6622. * Not all MPDUs within this range are necessarily valid - the host
  6623. * must check each sequence number within this range to see if the
  6624. * corresponding MPDU is actually present.
  6625. */
  6626. /* first DWORD */
  6627. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6628. #define HTT_RX_FLUSH_PEER_ID_S 8
  6629. #define HTT_RX_FLUSH_TID_M 0xff000000
  6630. #define HTT_RX_FLUSH_TID_S 24
  6631. /* second DWORD */
  6632. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6633. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6634. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6635. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6636. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6637. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6638. #define HTT_RX_FLUSH_BYTES 8
  6639. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6640. do { \
  6641. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6642. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6643. } while (0)
  6644. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6645. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6646. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6647. do { \
  6648. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6649. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6650. } while (0)
  6651. #define HTT_RX_FLUSH_TID_GET(word) \
  6652. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6653. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6654. do { \
  6655. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6656. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6657. } while (0)
  6658. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6659. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6660. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6661. do { \
  6662. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6663. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6664. } while (0)
  6665. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6666. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> \
  6667. HTT_RX_FLUSH_SEQ_NUM_START_S)
  6668. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6669. do { \
  6670. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6671. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6672. } while (0)
  6673. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6674. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6675. /*
  6676. * @brief target -> host rx pn check indication message
  6677. *
  6678. * @details
  6679. * The following field definitions describe the format of the Rx PN check
  6680. * indication message sent from the target to the host.
  6681. * The message consists of a 4-octet header, followed by the start and
  6682. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6683. * IE is one octet containing the sequence number that failed the PN
  6684. * check.
  6685. *
  6686. * |31 24|23 8|7 0|
  6687. * |--------------------------------------------------------------|
  6688. * | TID | peer ID | msg type |
  6689. * |--------------------------------------------------------------|
  6690. * | Reserved | PN IE count | seq num end | seq num start|
  6691. * |--------------------------------------------------------------|
  6692. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6693. * |--------------------------------------------------------------|
  6694. * First DWORD:
  6695. * - MSG_TYPE
  6696. * Bits 7:0
  6697. * Purpose: Identifies this as an rx pn check indication message
  6698. * Value: 0x2
  6699. * - PEER_ID
  6700. * Bits 23:8 (only bits 18:8 actually used)
  6701. * Purpose: identify which peer
  6702. * Value: (rx) peer ID
  6703. * - TID
  6704. * Bits 31:24 (only bits 27:24 actually used)
  6705. * Purpose: identify traffic identifier
  6706. * Value: traffic identifier
  6707. * Second DWORD:
  6708. * - SEQ_NUM_START
  6709. * Bits 7:0
  6710. * Purpose:
  6711. * Indicates the starting sequence number of the MPDU in this
  6712. * series of MPDUs that went though PN check.
  6713. * Value:
  6714. * The sequence number for the first MPDU in the sequence.
  6715. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6716. * - SEQ_NUM_END
  6717. * Bits 15:8
  6718. * Purpose:
  6719. * Indicates the ending sequence number of the MPDU in this
  6720. * series of MPDUs that went though PN check.
  6721. * Value:
  6722. * The sequence number one larger then the sequence number of the last
  6723. * MPDU being flushed.
  6724. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6725. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1]
  6726. * have been checked for invalid PN numbers and are ready
  6727. * to be released for further processing.
  6728. * Not all MPDUs within this range are necessarily valid - the host
  6729. * must check each sequence number within this range to see if the
  6730. * corresponding MPDU is actually present.
  6731. * - PN_IE_COUNT
  6732. * Bits 23:16
  6733. * Purpose:
  6734. * Used to determine the variable number of PN information
  6735. * elements in this message
  6736. *
  6737. * PN information elements:
  6738. * - PN_IE_x-
  6739. * Purpose:
  6740. * Each PN information element contains the sequence number
  6741. * of the MPDU that has failed the target PN check.
  6742. * Value:
  6743. * Contains the 6 LSBs of the 802.11 sequence number
  6744. * corresponding to the MPDU that failed the PN check.
  6745. */
  6746. /* first DWORD */
  6747. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6748. #define HTT_RX_PN_IND_PEER_ID_S 8
  6749. #define HTT_RX_PN_IND_TID_M 0xff000000
  6750. #define HTT_RX_PN_IND_TID_S 24
  6751. /* second DWORD */
  6752. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6753. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6754. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6755. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6756. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6757. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6758. #define HTT_RX_PN_IND_BYTES 8
  6759. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6760. do { \
  6761. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6762. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6763. } while (0)
  6764. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6765. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6766. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6767. do { \
  6768. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6769. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6770. } while (0)
  6771. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6772. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6773. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6774. do { \
  6775. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6776. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6777. } while (0)
  6778. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6779. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> \
  6780. HTT_RX_PN_IND_SEQ_NUM_START_S)
  6781. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6782. do { \
  6783. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6784. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6785. } while (0)
  6786. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6787. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6788. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6789. do { \
  6790. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6791. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6792. } while (0)
  6793. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6794. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6795. /*
  6796. * @brief target -> host rx offload deliver message for LL system
  6797. *
  6798. * @details
  6799. * In a low latency system this message is sent whenever the offload
  6800. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6801. * The DMA of the actual packets into host memory is done before sending out
  6802. * this message. This message indicates only how many MSDUs to reap. The
  6803. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6804. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6805. * DMA'd by the MAC directly into host memory these packets do not contain
  6806. * the MAC descriptors in the header portion of the packet. Instead they contain
  6807. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6808. * message, the packets are delivered directly to the NW stack without going
  6809. * through the regular reorder buffering and PN checking path since it has
  6810. * already been done in target.
  6811. *
  6812. * |31 24|23 16|15 8|7 0|
  6813. * |-----------------------------------------------------------------------|
  6814. * | Total MSDU count | reserved | msg type |
  6815. * |-----------------------------------------------------------------------|
  6816. *
  6817. * @brief target -> host rx offload deliver message for HL system
  6818. *
  6819. * @details
  6820. * In a high latency system this message is sent whenever the offload manager
  6821. * flushes out the packets it has coalesced in its coalescing buffer. The
  6822. * actual packets are also carried along with this message. When the host
  6823. * receives this message, it is expected to deliver these packets to the NW
  6824. * stack directly instead of routing them through the reorder buffering and
  6825. * PN checking path since it has already been done in target.
  6826. *
  6827. * |31 24|23 16|15 8|7 0|
  6828. * |-----------------------------------------------------------------------|
  6829. * | Total MSDU count | reserved | msg type |
  6830. * |-----------------------------------------------------------------------|
  6831. * | peer ID | MSDU length |
  6832. * |-----------------------------------------------------------------------|
  6833. * | MSDU payload | FW Desc | tid | vdev ID |
  6834. * |-----------------------------------------------------------------------|
  6835. * | MSDU payload contd. |
  6836. * |-----------------------------------------------------------------------|
  6837. * | peer ID | MSDU length |
  6838. * |-----------------------------------------------------------------------|
  6839. * | MSDU payload | FW Desc | tid | vdev ID |
  6840. * |-----------------------------------------------------------------------|
  6841. * | MSDU payload contd. |
  6842. * |-----------------------------------------------------------------------|
  6843. *
  6844. */
  6845. /* first DWORD */
  6846. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6847. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6848. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6849. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6850. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6851. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6852. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6853. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6854. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6855. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6856. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6857. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6858. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6859. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6860. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6861. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> \
  6862. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6863. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6864. do { \
  6865. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6866. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6867. } while (0) \
  6868. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6869. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> \
  6870. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6871. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6872. do { \
  6873. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6874. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6875. } while (0) \
  6876. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6877. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> \
  6878. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6879. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6880. do { \
  6881. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6882. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6883. } while (0) \
  6884. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6885. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> \
  6886. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6887. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6888. do { \
  6889. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6890. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6891. } while (0) \
  6892. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6893. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> \
  6894. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6895. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6896. do { \
  6897. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6898. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6899. } while (0) \
  6900. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6901. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> \
  6902. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6903. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6904. do { \
  6905. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6906. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6907. } while (0) \
  6908. /**
  6909. * @brief target -> host rx peer map/unmap message definition
  6910. *
  6911. * @details
  6912. * The following diagram shows the format of the rx peer map message sent
  6913. * from the target to the host. This layout assumes the target operates
  6914. * as little-endian.
  6915. *
  6916. * This message always contains a SW peer ID. The main purpose of the
  6917. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6918. * with, so that the host can use that peer ID to determine which peer
  6919. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6920. * other purposes, such as identifying during tx completions which peer
  6921. * the tx frames in question were transmitted to.
  6922. *
  6923. * In certain generations of chips, the peer map message also contains
  6924. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6925. * to identify which peer the frame needs to be forwarded to (i.e. the
  6926. * peer assocated with the Destination MAC Address within the packet),
  6927. * and particularly which vdev needs to transmit the frame (for cases
  6928. * of inter-vdev rx --> tx forwarding).
  6929. * This DA-based peer ID that is provided for certain rx frames
  6930. * (the rx frames that need to be re-transmitted as tx frames)
  6931. * is the ID that the HW uses for referring to the peer in question,
  6932. * rather than the peer ID that the SW+FW use to refer to the peer.
  6933. *
  6934. *
  6935. * |31 24|23 16|15 8|7 0|
  6936. * |-----------------------------------------------------------------------|
  6937. * | SW peer ID | VDEV ID | msg type |
  6938. * |-----------------------------------------------------------------------|
  6939. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6940. * |-----------------------------------------------------------------------|
  6941. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6942. * |-----------------------------------------------------------------------|
  6943. *
  6944. *
  6945. * The following diagram shows the format of the rx peer unmap message sent
  6946. * from the target to the host.
  6947. *
  6948. * |31 24|23 16|15 8|7 0|
  6949. * |-----------------------------------------------------------------------|
  6950. * | SW peer ID | VDEV ID | msg type |
  6951. * |-----------------------------------------------------------------------|
  6952. *
  6953. * The following field definitions describe the format of the rx peer map
  6954. * and peer unmap messages sent from the target to the host.
  6955. * - MSG_TYPE
  6956. * Bits 7:0
  6957. * Purpose: identifies this as an rx peer map or peer unmap message
  6958. * Value: peer map -> 0x3, peer unmap -> 0x4
  6959. * - VDEV_ID
  6960. * Bits 15:8
  6961. * Purpose: Indicates which virtual device the peer is associated
  6962. * with.
  6963. * Value: vdev ID (used in the host to look up the vdev object)
  6964. * - PEER_ID (a.k.a. SW_PEER_ID)
  6965. * Bits 31:16
  6966. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6967. * freeing (unmap)
  6968. * Value: (rx) peer ID
  6969. * - MAC_ADDR_L32 (peer map only)
  6970. * Bits 31:0
  6971. * Purpose: Identifies which peer node the peer ID is for.
  6972. * Value: lower 4 bytes of peer node's MAC address
  6973. * - MAC_ADDR_U16 (peer map only)
  6974. * Bits 15:0
  6975. * Purpose: Identifies which peer node the peer ID is for.
  6976. * Value: upper 2 bytes of peer node's MAC address
  6977. * - HW_PEER_ID
  6978. * Bits 31:16
  6979. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6980. * address, so for rx frames marked for rx --> tx forwarding, the
  6981. * host can determine from the HW peer ID provided as meta-data with
  6982. * the rx frame which peer the frame is supposed to be forwarded to.
  6983. * Value: ID used by the MAC HW to identify the peer
  6984. */
  6985. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6986. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6987. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6988. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6989. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6990. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6991. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6992. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6993. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6994. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6995. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6996. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6997. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6998. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6999. do { \
  7000. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  7001. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  7002. } while (0)
  7003. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  7004. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  7005. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  7006. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  7007. do { \
  7008. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  7009. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  7010. } while (0)
  7011. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  7012. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  7013. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  7014. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  7015. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  7016. do { \
  7017. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  7018. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  7019. } while (0)
  7020. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  7021. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> \
  7022. HTT_RX_PEER_MAP_HW_PEER_ID_S)
  7023. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  7024. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  7025. #define HTT_RX_PEER_MAP_BYTES 12
  7026. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  7027. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  7028. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  7029. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  7030. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  7031. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  7032. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  7033. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  7034. #define HTT_RX_PEER_UNMAP_BYTES 4
  7035. /**
  7036. * @brief target -> host message specifying security parameters
  7037. *
  7038. * @details
  7039. * The following diagram shows the format of the security specification
  7040. * message sent from the target to the host.
  7041. * This security specification message tells the host whether a PN check is
  7042. * necessary on rx data frames, and if so, how large the PN counter is.
  7043. * This message also tells the host about the security processing to apply
  7044. * to defragmented rx frames - specifically, whether a Message Integrity
  7045. * Check is required, and the Michael key to use.
  7046. *
  7047. * |31 24|23 16|15|14 8|7 0|
  7048. * |-----------------------------------------------------------------------|
  7049. * | peer ID | U| security type | msg type |
  7050. * |-----------------------------------------------------------------------|
  7051. * | Michael Key K0 |
  7052. * |-----------------------------------------------------------------------|
  7053. * | Michael Key K1 |
  7054. * |-----------------------------------------------------------------------|
  7055. * | WAPI RSC Low0 |
  7056. * |-----------------------------------------------------------------------|
  7057. * | WAPI RSC Low1 |
  7058. * |-----------------------------------------------------------------------|
  7059. * | WAPI RSC Hi0 |
  7060. * |-----------------------------------------------------------------------|
  7061. * | WAPI RSC Hi1 |
  7062. * |-----------------------------------------------------------------------|
  7063. *
  7064. * The following field definitions describe the format of the security
  7065. * indication message sent from the target to the host.
  7066. * - MSG_TYPE
  7067. * Bits 7:0
  7068. * Purpose: identifies this as a security specification message
  7069. * Value: 0xb
  7070. * - SEC_TYPE
  7071. * Bits 14:8
  7072. * Purpose: specifies which type of security applies to the peer
  7073. * Value: htt_sec_type enum value
  7074. * - UNICAST
  7075. * Bit 15
  7076. * Purpose: whether this security is applied to unicast or multicast data
  7077. * Value: 1 -> unicast, 0 -> multicast
  7078. * - PEER_ID
  7079. * Bits 31:16
  7080. * Purpose: The ID number for the peer the security specification is for
  7081. * Value: peer ID
  7082. * - MICHAEL_KEY_K0
  7083. * Bits 31:0
  7084. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  7085. * Value: Michael Key K0 (if security type is TKIP)
  7086. * - MICHAEL_KEY_K1
  7087. * Bits 31:0
  7088. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  7089. * Value: Michael Key K1 (if security type is TKIP)
  7090. * - WAPI_RSC_LOW0
  7091. * Bits 31:0
  7092. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  7093. * Value: WAPI RSC Low0 (if security type is WAPI)
  7094. * - WAPI_RSC_LOW1
  7095. * Bits 31:0
  7096. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  7097. * Value: WAPI RSC Low1 (if security type is WAPI)
  7098. * - WAPI_RSC_HI0
  7099. * Bits 31:0
  7100. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  7101. * Value: WAPI RSC Hi0 (if security type is WAPI)
  7102. * - WAPI_RSC_HI1
  7103. * Bits 31:0
  7104. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  7105. * Value: WAPI RSC Hi1 (if security type is WAPI)
  7106. */
  7107. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  7108. #define HTT_SEC_IND_SEC_TYPE_S 8
  7109. #define HTT_SEC_IND_UNICAST_M 0x00008000
  7110. #define HTT_SEC_IND_UNICAST_S 15
  7111. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  7112. #define HTT_SEC_IND_PEER_ID_S 16
  7113. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  7114. do { \
  7115. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  7116. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  7117. } while (0)
  7118. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  7119. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  7120. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  7121. do { \
  7122. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  7123. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  7124. } while (0)
  7125. #define HTT_SEC_IND_UNICAST_GET(word) \
  7126. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  7127. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  7128. do { \
  7129. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  7130. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  7131. } while (0)
  7132. #define HTT_SEC_IND_PEER_ID_GET(word) \
  7133. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  7134. #define HTT_SEC_IND_BYTES 28
  7135. /**
  7136. * @brief target -> host rx ADDBA / DELBA message definitions
  7137. *
  7138. * @details
  7139. * The following diagram shows the format of the rx ADDBA message sent
  7140. * from the target to the host:
  7141. *
  7142. * |31 20|19 16|15 8|7 0|
  7143. * |---------------------------------------------------------------------|
  7144. * | peer ID | TID | window size | msg type |
  7145. * |---------------------------------------------------------------------|
  7146. *
  7147. * The following diagram shows the format of the rx DELBA message sent
  7148. * from the target to the host:
  7149. *
  7150. * |31 20|19 16|15 8|7 0|
  7151. * |---------------------------------------------------------------------|
  7152. * | peer ID | TID | reserved | msg type |
  7153. * |---------------------------------------------------------------------|
  7154. *
  7155. * The following field definitions describe the format of the rx ADDBA
  7156. * and DELBA messages sent from the target to the host.
  7157. * - MSG_TYPE
  7158. * Bits 7:0
  7159. * Purpose: identifies this as an rx ADDBA or DELBA message
  7160. * Value: ADDBA -> 0x5, DELBA -> 0x6
  7161. * - WIN_SIZE
  7162. * Bits 15:8 (ADDBA only)
  7163. * Purpose: Specifies the length of the block ack window (max = 64).
  7164. * Value:
  7165. * block ack window length specified by the received ADDBA
  7166. * management message.
  7167. * - TID
  7168. * Bits 19:16
  7169. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  7170. * Value:
  7171. * TID specified by the received ADDBA or DELBA management message.
  7172. * - PEER_ID
  7173. * Bits 31:20
  7174. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  7175. * Value:
  7176. * ID (hash value) used by the host for fast, direct lookup of
  7177. * host SW peer info, including rx reorder states.
  7178. */
  7179. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7180. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7181. #define HTT_RX_ADDBA_TID_M 0xf0000
  7182. #define HTT_RX_ADDBA_TID_S 16
  7183. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7184. #define HTT_RX_ADDBA_PEER_ID_S 20
  7185. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7186. do { \
  7187. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7188. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7189. } while (0)
  7190. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7191. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7192. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7193. do { \
  7194. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7195. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7196. } while (0)
  7197. #define HTT_RX_ADDBA_TID_GET(word) \
  7198. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7199. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7200. do { \
  7201. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7202. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7203. } while (0)
  7204. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7205. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7206. #define HTT_RX_ADDBA_BYTES 4
  7207. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7208. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7209. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7210. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7211. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7212. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7213. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7214. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7215. #define HTT_RX_DELBA_BYTES 4
  7216. /**
  7217. * @brief tx queue group information element definition
  7218. *
  7219. * @details
  7220. * The following diagram shows the format of the tx queue group
  7221. * information element, which can be included in target --> host
  7222. * messages to specify the number of tx "credits" (tx descriptors
  7223. * for LL, or tx buffers for HL) available to a particular group
  7224. * of host-side tx queues, and which host-side tx queues belong to
  7225. * the group.
  7226. *
  7227. * |31|30 24|23 16|15|14|13 0|
  7228. * |------------------------------------------------------------------------|
  7229. * | X| reserved | tx queue grp ID | A| S| credit count |
  7230. * |------------------------------------------------------------------------|
  7231. * | vdev ID mask | AC mask |
  7232. * |------------------------------------------------------------------------|
  7233. *
  7234. * The following definitions describe the fields within the tx queue group
  7235. * information element:
  7236. * - credit_count
  7237. * Bits 13:1
  7238. * Purpose: specify how many tx credits are available to the tx queue group
  7239. * Value: An absolute or relative, positive or negative credit value
  7240. * The 'A' bit specifies whether the value is absolute or relative.
  7241. * The 'S' bit specifies whether the value is positive or negative.
  7242. * A negative value can only be relative, not absolute.
  7243. * An absolute value replaces any prior credit value the host has for
  7244. * the tx queue group in question.
  7245. * A relative value is added to the prior credit value the host has for
  7246. * the tx queue group in question.
  7247. * - sign
  7248. * Bit 14
  7249. * Purpose: specify whether the credit count is positive or negative
  7250. * Value: 0 -> positive, 1 -> negative
  7251. * - absolute
  7252. * Bit 15
  7253. * Purpose: specify whether the credit count is absolute or relative
  7254. * Value: 0 -> relative, 1 -> absolute
  7255. * - txq_group_id
  7256. * Bits 23:16
  7257. * Purpose: indicate which tx queue group's credit and/or membership are
  7258. * being specified
  7259. * Value: 0 to max_tx_queue_groups-1
  7260. * - reserved
  7261. * Bits 30:16
  7262. * Value: 0x0
  7263. * - eXtension
  7264. * Bit 31
  7265. * Purpose: specify whether another tx queue group info element follows
  7266. * Value: 0 -> no more tx queue group information elements
  7267. * 1 -> another tx queue group information element immediately follows
  7268. * - ac_mask
  7269. * Bits 15:0
  7270. * Purpose: specify which Access Categories belong to the tx queue group
  7271. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7272. * the tx queue group.
  7273. * The AC bit-mask values are obtained by left-shifting by the
  7274. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7275. * - vdev_id_mask
  7276. * Bits 31:16
  7277. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7278. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7279. * belong to the tx queue group.
  7280. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7281. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7282. */
  7283. PREPACK struct htt_txq_group {
  7284. A_UINT32
  7285. credit_count:14,
  7286. sign:1,
  7287. absolute:1,
  7288. tx_queue_group_id:8,
  7289. reserved0:7,
  7290. extension:1;
  7291. A_UINT32
  7292. ac_mask:16,
  7293. vdev_id_mask:16;
  7294. } POSTPACK;
  7295. /* first word */
  7296. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7297. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7298. #define HTT_TXQ_GROUP_SIGN_S 14
  7299. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7300. #define HTT_TXQ_GROUP_ABS_S 15
  7301. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7302. #define HTT_TXQ_GROUP_ID_S 16
  7303. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7304. #define HTT_TXQ_GROUP_EXT_S 31
  7305. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7306. /* second word */
  7307. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7308. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7309. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7310. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7311. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7312. do { \
  7313. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7314. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7315. } while (0)
  7316. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7317. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> \
  7318. HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7319. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7320. do { \
  7321. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7322. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7323. } while (0)
  7324. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7325. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7326. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7327. do { \
  7328. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7329. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7330. } while (0)
  7331. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7332. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7333. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7334. do { \
  7335. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7336. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7337. } while (0)
  7338. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7339. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7340. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7341. do { \
  7342. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7343. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7344. } while (0)
  7345. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7346. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7347. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7348. do { \
  7349. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7350. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7351. } while (0)
  7352. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7353. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7354. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7355. do { \
  7356. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7357. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7358. } while (0)
  7359. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7360. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> \
  7361. HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7362. /**
  7363. * @brief target -> host TX completion indication message definition
  7364. *
  7365. * @details
  7366. * The following diagram shows the format of the TX completion indication sent
  7367. * from the target to the host
  7368. *
  7369. * |31 27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7370. * |------------------------------------------------------------|
  7371. * header: | rsvd |TP|A1|A0| num | t_i| tid |status| msg_type |
  7372. * |------------------------------------------------------------|
  7373. * payload: | MSDU1 ID | MSDU0 ID |
  7374. * |------------------------------------------------------------|
  7375. * : MSDU3 ID : MSDU2 ID :
  7376. * |------------------------------------------------------------|
  7377. * | struct htt_tx_compl_ind_append_retries |
  7378. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7379. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7380. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7381. *
  7382. * Where:
  7383. * A0 = append (a.k.a. append0)
  7384. * A1 = append1
  7385. * TP = MSDU tx power presence
  7386. *
  7387. * The following field definitions describe the format of the TX completion
  7388. * indication sent from the target to the host
  7389. * Header fields:
  7390. * - msg_type
  7391. * Bits 7:0
  7392. * Purpose: identifies this as HTT TX completion indication
  7393. * Value: 0x7
  7394. * - status
  7395. * Bits 10:8
  7396. * Purpose: the TX completion status of payload fragmentations descriptors
  7397. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7398. * - tid
  7399. * Bits 14:11
  7400. * Purpose: the tid associated with those fragmentation descriptors. It is
  7401. * valid or not, depending on the tid_invalid bit.
  7402. * Value: 0 to 15
  7403. * - tid_invalid
  7404. * Bits 15:15
  7405. * Purpose: this bit indicates whether the tid field is valid or not
  7406. * Value: 0 indicates valid; 1 indicates invalid
  7407. * - num
  7408. * Bits 23:16
  7409. * Purpose: the number of payload in this indication
  7410. * Value: 1 to 255
  7411. * - append (a.k.a. append0)
  7412. * Bits 24:24
  7413. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7414. * the number of tx retries for one MSDU at the end of this message
  7415. * - append1
  7416. * Bits 25:25
  7417. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7418. * contains the timestamp info for each TX msdu id in payload.
  7419. * The order of the timestamps matches the order of the MSDU IDs.
  7420. * Note that a big-endian host needs to account for the reordering
  7421. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7422. * conversion) when determining which tx timestamp corresponds to
  7423. * which MSDU ID.
  7424. * Value: 0 indicates no appending; 1 indicates appending
  7425. * Payload fields:
  7426. * - hmsdu_id
  7427. * Bits 15:0
  7428. * Purpose: this ID is used to track the Tx buffer in host
  7429. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7430. */
  7431. #define HTT_TX_COMPL_IND_STATUS_S 8
  7432. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7433. #define HTT_TX_COMPL_IND_TID_S 11
  7434. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7435. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7436. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7437. #define HTT_TX_COMPL_IND_NUM_S 16
  7438. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7439. #define HTT_TX_COMPL_IND_APPEND_S 24
  7440. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7441. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7442. do { \
  7443. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7444. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7445. } while (0)
  7446. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7447. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7448. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7449. do { \
  7450. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7451. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7452. } while (0)
  7453. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7454. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7455. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7456. do { \
  7457. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7458. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7459. } while (0)
  7460. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7461. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7462. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7463. do { \
  7464. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7465. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7466. } while (0)
  7467. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7468. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7469. HTT_TX_COMPL_IND_TID_INV_S)
  7470. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7471. do { \
  7472. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7473. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7474. } while (0)
  7475. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7476. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7477. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  7478. do { \
  7479. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  7480. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  7481. } while (0)
  7482. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  7483. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  7484. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  7485. do { \
  7486. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  7487. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  7488. } while (0)
  7489. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  7490. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  7491. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  7492. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7493. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7494. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7495. #define HTT_TX_COMPL_IND_STAT_OK 0
  7496. /* DISCARD:
  7497. * current meaning:
  7498. * MSDUs were queued for transmission but filtered by HW or SW
  7499. * without any over the air attempts
  7500. * legacy meaning (HL Rome):
  7501. * MSDUs were discarded by the target FW without any over the air
  7502. * attempts due to lack of space
  7503. */
  7504. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7505. /* NO_ACK:
  7506. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7507. */
  7508. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7509. /* POSTPONE:
  7510. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7511. * be downloaded again later (in the appropriate order), when they are
  7512. * deliverable.
  7513. */
  7514. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7515. /*
  7516. * The PEER_DEL tx completion status is used for HL cases
  7517. * where the peer the frame is for has been deleted.
  7518. * The host has already discarded its copy of the frame, but
  7519. * it still needs the tx completion to restore its credit.
  7520. */
  7521. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7522. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7523. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7524. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7525. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7526. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7527. PREPACK struct htt_tx_compl_ind_base {
  7528. A_UINT32 hdr;
  7529. A_UINT16 payload[1 /*or more */];
  7530. } POSTPACK;
  7531. PREPACK struct htt_tx_compl_ind_append_retries {
  7532. A_UINT16 msdu_id;
  7533. A_UINT8 tx_retries;
  7534. A_UINT8 flag;/* Bit 0, 1: another append_retries struct is appended
  7535. 0: this is the last append_retries struct */
  7536. } POSTPACK;
  7537. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  7538. A_UINT32 timestamp[1/*or more*/];
  7539. } POSTPACK;
  7540. /**
  7541. * @brief target -> host rate-control update indication message
  7542. *
  7543. * @details
  7544. * The following diagram shows the format of the RC Update message
  7545. * sent from the target to the host, while processing the tx-completion
  7546. * of a transmitted PPDU.
  7547. *
  7548. * |31 24|23 16|15 8|7 0|
  7549. * |-------------------------------------------------------------|
  7550. * | peer ID | vdev ID | msg_type |
  7551. * |-------------------------------------------------------------|
  7552. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7553. * |-------------------------------------------------------------|
  7554. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7555. * |-------------------------------------------------------------|
  7556. * | : |
  7557. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7558. * | : |
  7559. * |-------------------------------------------------------------|
  7560. * | : |
  7561. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7562. * | : |
  7563. * |-------------------------------------------------------------|
  7564. * : :
  7565. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7566. *
  7567. */
  7568. typedef struct {
  7569. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7570. A_UINT32 rate_code_flags;
  7571. A_UINT32 flags; /* Encodes information such as excessive
  7572. retransmission, aggregate, some info
  7573. from .11 frame control,
  7574. STBC, LDPC, (SGI and Tx Chain Mask
  7575. are encoded in ptx_rc->flags field),
  7576. AMPDU truncation (BT/time based etc.),
  7577. RTS/CTS attempt */
  7578. A_UINT32 num_enqued;/* # of MPDUs (for non-AMPDU 1) for this rate */
  7579. A_UINT32 num_retries;/* Total # of transmission attempt for this rate */
  7580. A_UINT32 num_failed;/* # of failed MPDUs in A-MPDU, 0 otherwise */
  7581. A_UINT32 ack_rssi;/* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7582. A_UINT32 time_stamp; /* ACK timestamp (helps determine age) */
  7583. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7584. } HTT_RC_TX_DONE_PARAMS;
  7585. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS))/* bytes */
  7586. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7587. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7588. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7589. #define HTT_RC_UPDATE_VDEVID_S 8
  7590. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7591. #define HTT_RC_UPDATE_PEERID_S 16
  7592. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7593. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7594. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7595. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7596. do { \
  7597. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7598. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7599. } while (0)
  7600. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7601. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7602. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7603. do { \
  7604. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7605. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7606. } while (0)
  7607. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7608. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7609. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7610. do { \
  7611. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7612. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7613. } while (0)
  7614. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7615. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7616. /**
  7617. * @brief target -> host rx fragment indication message definition
  7618. *
  7619. * @details
  7620. * The following field definitions describe the format of the rx fragment
  7621. * indication message sent from the target to the host.
  7622. * The rx fragment indication message shares the format of the
  7623. * rx indication message, but not all fields from the rx indication message
  7624. * are relevant to the rx fragment indication message.
  7625. *
  7626. *
  7627. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7628. * |-----------+-------------------+---------------------+-------------|
  7629. * | peer ID | |FV| ext TID | msg type |
  7630. * |-------------------------------------------------------------------|
  7631. * | | flush | flush |
  7632. * | | end | start |
  7633. * | | seq num | seq num |
  7634. * |-------------------------------------------------------------------|
  7635. * | reserved | FW rx desc bytes |
  7636. * |-------------------------------------------------------------------|
  7637. * | | FW MSDU Rx |
  7638. * | | desc B0 |
  7639. * |-------------------------------------------------------------------|
  7640. * Header fields:
  7641. * - MSG_TYPE
  7642. * Bits 7:0
  7643. * Purpose: identifies this as an rx fragment indication message
  7644. * Value: 0xa
  7645. * - EXT_TID
  7646. * Bits 12:8
  7647. * Purpose: identify the traffic ID of the rx data, including
  7648. * special "extended" TID values for multicast, broadcast, and
  7649. * non-QoS data frames
  7650. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7651. * - FLUSH_VALID (FV)
  7652. * Bit 13
  7653. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7654. * is valid
  7655. * Value:
  7656. * 1 -> flush IE is valid and needs to be processed
  7657. * 0 -> flush IE is not valid and should be ignored
  7658. * - PEER_ID
  7659. * Bits 31:16
  7660. * Purpose: Identify, by ID, which peer sent the rx data
  7661. * Value: ID of the peer who sent the rx data
  7662. * - FLUSH_SEQ_NUM_START
  7663. * Bits 5:0
  7664. * Purpose: Indicate the start of a series of MPDUs to flush
  7665. * Not all MPDUs within this series are necessarily valid - the host
  7666. * must check each sequence number within this range to see if the
  7667. * corresponding MPDU is actually present.
  7668. * This field is only valid if the FV bit is set.
  7669. * Value:
  7670. * The sequence number for the first MPDUs to check to flush.
  7671. * The sequence number is masked by 0x3f.
  7672. * - FLUSH_SEQ_NUM_END
  7673. * Bits 11:6
  7674. * Purpose: Indicate the end of a series of MPDUs to flush
  7675. * Value:
  7676. * The sequence number one larger than the sequence number of the
  7677. * last MPDU to check to flush.
  7678. * The sequence number is masked by 0x3f.
  7679. * Not all MPDUs within this series are necessarily valid - the host
  7680. * must check each sequence number within this range to see if the
  7681. * corresponding MPDU is actually present.
  7682. * This field is only valid if the FV bit is set.
  7683. * Rx descriptor fields:
  7684. * - FW_RX_DESC_BYTES
  7685. * Bits 15:0
  7686. * Purpose: Indicate how many bytes in the Rx indication are used for
  7687. * FW Rx descriptors
  7688. * Value: 1
  7689. */
  7690. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7691. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7692. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7693. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7694. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7695. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7696. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7697. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7698. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7699. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7700. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7701. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7702. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7703. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7704. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7705. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7706. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7707. #define HTT_RX_FRAG_IND_BYTES \
  7708. (4 /* msg hdr */ + \
  7709. 4 /* flush spec */ + \
  7710. 4 /* (unused) FW rx desc bytes spec */ + \
  7711. 4 /* FW rx desc */)
  7712. /**
  7713. * @brief target -> host test message definition
  7714. *
  7715. * @details
  7716. * The following field definitions describe the format of the test
  7717. * message sent from the target to the host.
  7718. * The message consists of a 4-octet header, followed by a variable
  7719. * number of 32-bit integer values, followed by a variable number
  7720. * of 8-bit character values.
  7721. *
  7722. * |31 16|15 8|7 0|
  7723. * |-----------------------------------------------------------|
  7724. * | num chars | num ints | msg type |
  7725. * |-----------------------------------------------------------|
  7726. * | int 0 |
  7727. * |-----------------------------------------------------------|
  7728. * | int 1 |
  7729. * |-----------------------------------------------------------|
  7730. * | ... |
  7731. * |-----------------------------------------------------------|
  7732. * | char 3 | char 2 | char 1 | char 0 |
  7733. * |-----------------------------------------------------------|
  7734. * | | | ... | char 4 |
  7735. * |-----------------------------------------------------------|
  7736. * - MSG_TYPE
  7737. * Bits 7:0
  7738. * Purpose: identifies this as a test message
  7739. * Value: HTT_MSG_TYPE_TEST
  7740. * - NUM_INTS
  7741. * Bits 15:8
  7742. * Purpose: indicate how many 32-bit integers follow the message header
  7743. * - NUM_CHARS
  7744. * Bits 31:16
  7745. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7746. */
  7747. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7748. #define HTT_RX_TEST_NUM_INTS_S 8
  7749. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7750. #define HTT_RX_TEST_NUM_CHARS_S 16
  7751. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7752. do { \
  7753. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7754. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7755. } while (0)
  7756. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7757. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7758. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7759. do { \
  7760. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7761. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7762. } while (0)
  7763. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7764. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7765. /**
  7766. * @brief target -> host packet log message
  7767. *
  7768. * @details
  7769. * The following field definitions describe the format of the packet log
  7770. * message sent from the target to the host.
  7771. * The message consists of a 4-octet header,followed by a variable number
  7772. * of 32-bit character values.
  7773. *
  7774. * |31 24|23 16|15 8|7 0|
  7775. * |-----------------------------------------------------------|
  7776. * | | | | msg type |
  7777. * |-----------------------------------------------------------|
  7778. * | payload |
  7779. * |-----------------------------------------------------------|
  7780. * - MSG_TYPE
  7781. * Bits 7:0
  7782. * Purpose: identifies this as a test message
  7783. * Value: HTT_MSG_TYPE_PACKETLOG
  7784. */
  7785. PREPACK struct htt_pktlog_msg {
  7786. A_UINT32 header;
  7787. A_UINT32 payload[1 /* or more */];
  7788. } POSTPACK;
  7789. /*
  7790. * Rx reorder statistics
  7791. * NB: all the fields must be defined in 4 octets size.
  7792. */
  7793. struct rx_reorder_stats {
  7794. /* Non QoS MPDUs received */
  7795. A_UINT32 deliver_non_qos;
  7796. /* MPDUs received in-order */
  7797. A_UINT32 deliver_in_order;
  7798. /* Flush due to reorder timer expired */
  7799. A_UINT32 deliver_flush_timeout;
  7800. /* Flush due to move out of window */
  7801. A_UINT32 deliver_flush_oow;
  7802. /* Flush due to DELBA */
  7803. A_UINT32 deliver_flush_delba;
  7804. /* MPDUs dropped due to FCS error */
  7805. A_UINT32 fcs_error;
  7806. /* MPDUs dropped due to monitor mode non-data packet */
  7807. A_UINT32 mgmt_ctrl;
  7808. /* Unicast-data MPDUs dropped due to invalid peer */
  7809. A_UINT32 invalid_peer;
  7810. /* MPDUs dropped due to duplication (non aggregation) */
  7811. A_UINT32 dup_non_aggr;
  7812. /* MPDUs dropped due to processed before */
  7813. A_UINT32 dup_past;
  7814. /* MPDUs dropped due to duplicate in reorder queue */
  7815. A_UINT32 dup_in_reorder;
  7816. /* Reorder timeout happened */
  7817. A_UINT32 reorder_timeout;
  7818. /* invalid bar ssn */
  7819. A_UINT32 invalid_bar_ssn;
  7820. /* reorder reset due to bar ssn */
  7821. A_UINT32 ssn_reset;
  7822. /* Flush due to delete peer */
  7823. A_UINT32 deliver_flush_delpeer;
  7824. /* Flush due to offload */
  7825. A_UINT32 deliver_flush_offload;
  7826. /* Flush due to out of buffer */
  7827. A_UINT32 deliver_flush_oob;
  7828. /* MPDUs dropped due to PN check fail */
  7829. A_UINT32 pn_fail;
  7830. /* MPDUs dropped due to unable to allocate memory */
  7831. A_UINT32 store_fail;
  7832. /* Number of times the tid pool alloc succeeded */
  7833. A_UINT32 tid_pool_alloc_succ;
  7834. /* Number of times the MPDU pool alloc succeeded */
  7835. A_UINT32 mpdu_pool_alloc_succ;
  7836. /* Number of times the MSDU pool alloc succeeded */
  7837. A_UINT32 msdu_pool_alloc_succ;
  7838. /* Number of times the tid pool alloc failed */
  7839. A_UINT32 tid_pool_alloc_fail;
  7840. /* Number of times the MPDU pool alloc failed */
  7841. A_UINT32 mpdu_pool_alloc_fail;
  7842. /* Number of times the MSDU pool alloc failed */
  7843. A_UINT32 msdu_pool_alloc_fail;
  7844. /* Number of times the tid pool freed */
  7845. A_UINT32 tid_pool_free;
  7846. /* Number of times the MPDU pool freed */
  7847. A_UINT32 mpdu_pool_free;
  7848. /* Number of times the MSDU pool freed */
  7849. A_UINT32 msdu_pool_free;
  7850. /* number of MSDUs undelivered to HTT and queued
  7851. * to Data Rx MSDU free list */
  7852. A_UINT32 msdu_queued;
  7853. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  7854. A_UINT32 msdu_recycled;
  7855. /* Number of MPDUs with invalid peer but A2 found in AST */
  7856. A_UINT32 invalid_peer_a2_in_ast;
  7857. /* Number of MPDUs with invalid peer but A3 found in AST */
  7858. A_UINT32 invalid_peer_a3_in_ast;
  7859. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  7860. A_UINT32 invalid_peer_bmc_mpdus;
  7861. /* Number of MSDUs with err attention word */
  7862. A_UINT32 rxdesc_err_att;
  7863. /* Number of MSDUs with flag of peer_idx_invalid */
  7864. A_UINT32 rxdesc_err_peer_idx_inv;
  7865. /* Number of MSDUs with flag of peer_idx_timeout */
  7866. A_UINT32 rxdesc_err_peer_idx_to;
  7867. /* Number of MSDUs with flag of overflow */
  7868. A_UINT32 rxdesc_err_ov;
  7869. /* Number of MSDUs with flag of msdu_length_err */
  7870. A_UINT32 rxdesc_err_msdu_len;
  7871. /* Number of MSDUs with flag of mpdu_length_err */
  7872. A_UINT32 rxdesc_err_mpdu_len;
  7873. /* Number of MSDUs with flag of tkip_mic_err */
  7874. A_UINT32 rxdesc_err_tkip_mic;
  7875. /* Number of MSDUs with flag of decrypt_err */
  7876. A_UINT32 rxdesc_err_decrypt;
  7877. /* Number of MSDUs with flag of fcs_err */
  7878. A_UINT32 rxdesc_err_fcs;
  7879. /* Number of Unicast (bc_mc bit is not set in attention word)
  7880. * frames with invalid peer handler
  7881. */
  7882. A_UINT32 rxdesc_uc_msdus_inv_peer;
  7883. /* Number of unicast frame directly (direct bit is set in attention word)
  7884. * to DUT with invalid peer handler
  7885. */
  7886. A_UINT32 rxdesc_direct_msdus_inv_peer;
  7887. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  7888. * frames with invalid peer handler
  7889. */
  7890. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  7891. /* Number of MSDUs dropped due to no first MSDU flag */
  7892. A_UINT32 rxdesc_no_1st_msdu;
  7893. /* Number of MSDUs droped due to ring overflow */
  7894. A_UINT32 msdu_drop_ring_ov;
  7895. /* Number of MSDUs dropped due to FC mismatch */
  7896. A_UINT32 msdu_drop_fc_mismatch;
  7897. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  7898. A_UINT32 msdu_drop_mgmt_remote_ring;
  7899. /* Number of MSDUs dropped due to errors not reported in attention word */
  7900. A_UINT32 msdu_drop_misc;
  7901. /* Number of MSDUs go to offload before reorder */
  7902. A_UINT32 offload_msdu_wal;
  7903. /* Number of data frame dropped by offload after reorder */
  7904. A_UINT32 offload_msdu_reorder;
  7905. /* Number of MPDUs with sequence number in the past and within
  7906. the BA window */
  7907. A_UINT32 dup_past_within_window;
  7908. /* Number of MPDUs with sequence number in the past and
  7909. * outside the BA window */
  7910. A_UINT32 dup_past_outside_window;
  7911. /* Number of MSDUs with decrypt/MIC error */
  7912. A_UINT32 rxdesc_err_decrypt_mic;
  7913. /* Number of data MSDUs received on both local and remote rings */
  7914. A_UINT32 data_msdus_on_both_rings;
  7915. /* MPDUs never filled */
  7916. A_UINT32 holes_not_filled;
  7917. };
  7918. /*
  7919. * Rx Remote buffer statistics
  7920. * NB: all the fields must be defined in 4 octets size.
  7921. */
  7922. struct rx_remote_buffer_mgmt_stats {
  7923. /* Total number of MSDUs reaped for Rx processing */
  7924. A_UINT32 remote_reaped;
  7925. /* MSDUs recycled within firmware */
  7926. A_UINT32 remote_recycled;
  7927. /* MSDUs stored by Data Rx */
  7928. A_UINT32 data_rx_msdus_stored;
  7929. /* Number of HTT indications from WAL Rx MSDU */
  7930. A_UINT32 wal_rx_ind;
  7931. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  7932. A_UINT32 wal_rx_ind_unconsumed;
  7933. /* Number of HTT indications from Data Rx MSDU */
  7934. A_UINT32 data_rx_ind;
  7935. /* Number of unconsumed HTT indications from Data Rx MSDU */
  7936. A_UINT32 data_rx_ind_unconsumed;
  7937. /* Number of HTT indications from ATHBUF */
  7938. A_UINT32 athbuf_rx_ind;
  7939. /* Number of remote buffers requested for refill */
  7940. A_UINT32 refill_buf_req;
  7941. /* Number of remote buffers filled by the host */
  7942. A_UINT32 refill_buf_rsp;
  7943. /* Number of times MAC hw_index = f/w write_index */
  7944. A_INT32 mac_no_bufs;
  7945. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  7946. A_INT32 fw_indices_equal;
  7947. /* Number of times f/w finds no buffers to post */
  7948. A_INT32 host_no_bufs;
  7949. };
  7950. /*
  7951. * TXBF MU/SU packets and NDPA statistics
  7952. * NB: all the fields must be defined in 4 octets size.
  7953. */
  7954. struct rx_txbf_musu_ndpa_pkts_stats {
  7955. /* number of TXBF MU packets received */
  7956. A_UINT32 number_mu_pkts;
  7957. /* number of TXBF SU packets received */
  7958. A_UINT32 number_su_pkts;
  7959. /* number of TXBF directed NDPA */
  7960. A_UINT32 txbf_directed_ndpa_count;
  7961. /* number of TXBF retried NDPA */
  7962. A_UINT32 txbf_ndpa_retry_count;
  7963. /* total number of TXBF NDPA */
  7964. A_UINT32 txbf_total_ndpa_count;
  7965. /* must be set to 0x0 */
  7966. A_UINT32 reserved[3];
  7967. };
  7968. /*
  7969. * htt_dbg_stats_status -
  7970. * present - The requested stats have been delivered in full.
  7971. * This indicates that either the stats information was contained
  7972. * in its entirety within this message, or else this message
  7973. * completes the delivery of the requested stats info that was
  7974. * partially delivered through earlier STATS_CONF messages.
  7975. * partial - The requested stats have been delivered in part.
  7976. * One or more subsequent STATS_CONF messages with the same
  7977. * cookie value will be sent to deliver the remainder of the
  7978. * information.
  7979. * error - The requested stats could not be delivered, for example due
  7980. * to a shortage of memory to construct a message holding the
  7981. * requested stats.
  7982. * invalid - The requested stat type is either not recognized, or the
  7983. * target is configured to not gather the stats type in question.
  7984. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7985. * series_done - This special value indicates that no further stats info
  7986. * elements are present within a series of stats info elems
  7987. * (within a stats upload confirmation message).
  7988. */
  7989. enum htt_dbg_stats_status {
  7990. HTT_DBG_STATS_STATUS_PRESENT = 0,
  7991. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  7992. HTT_DBG_STATS_STATUS_ERROR = 2,
  7993. HTT_DBG_STATS_STATUS_INVALID = 3,
  7994. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  7995. };
  7996. /**
  7997. * @brief target -> host statistics upload
  7998. *
  7999. * @details
  8000. * The following field definitions describe the format of the HTT target
  8001. * to host stats upload confirmation message.
  8002. * The message contains a cookie echoed from the HTT host->target stats
  8003. * upload request, which identifies which request the confirmation is
  8004. * for, and a series of tag-length-value stats information elements.
  8005. * The tag-length header for each stats info element also includes a
  8006. * status field, to indicate whether the request for the stat type in
  8007. * question was fully met, partially met, unable to be met, or invalid
  8008. * (if the stat type in question is disabled in the target).
  8009. * A special value of all 1's in this status field is used to indicate
  8010. * the end of the series of stats info elements.
  8011. *
  8012. *
  8013. * |31 16|15 8|7 5|4 0|
  8014. * |------------------------------------------------------------|
  8015. * | reserved | msg type |
  8016. * |------------------------------------------------------------|
  8017. * | cookie LSBs |
  8018. * |------------------------------------------------------------|
  8019. * | cookie MSBs |
  8020. * |------------------------------------------------------------|
  8021. * | stats entry length | reserved | S |stat type|
  8022. * |------------------------------------------------------------|
  8023. * | |
  8024. * | type-specific stats info |
  8025. * | |
  8026. * |------------------------------------------------------------|
  8027. * | stats entry length | reserved | S |stat type|
  8028. * |------------------------------------------------------------|
  8029. * | |
  8030. * | type-specific stats info |
  8031. * | |
  8032. * |------------------------------------------------------------|
  8033. * | n/a | reserved | 111 | n/a |
  8034. * |------------------------------------------------------------|
  8035. * Header fields:
  8036. * - MSG_TYPE
  8037. * Bits 7:0
  8038. * Purpose: identifies this is a statistics upload confirmation message
  8039. * Value: 0x9
  8040. * - COOKIE_LSBS
  8041. * Bits 31:0
  8042. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8043. * message with its preceding host->target stats request message.
  8044. * Value: LSBs of the opaque cookie specified by the host-side requestor
  8045. * - COOKIE_MSBS
  8046. * Bits 31:0
  8047. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8048. * message with its preceding host->target stats request message.
  8049. * Value: MSBs of the opaque cookie specified by the host-side requestor
  8050. *
  8051. * Stats Information Element tag-length header fields:
  8052. * - STAT_TYPE
  8053. * Bits 4:0
  8054. * Purpose: identifies the type of statistics info held in the
  8055. * following information element
  8056. * Value: htt_dbg_stats_type
  8057. * - STATUS
  8058. * Bits 7:5
  8059. * Purpose: indicate whether the requested stats are present
  8060. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  8061. * the completion of the stats entry series
  8062. * - LENGTH
  8063. * Bits 31:16
  8064. * Purpose: indicate the stats information size
  8065. * Value: This field specifies the number of bytes of stats information
  8066. * that follows the element tag-length header.
  8067. * It is expected but not required that this length is a multiple of
  8068. * 4 bytes. Even if the length is not an integer multiple of 4, the
  8069. * subsequent stats entry header will begin on a 4-byte aligned
  8070. * boundary.
  8071. */
  8072. #define HTT_T2H_STATS_COOKIE_SIZE 8
  8073. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  8074. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  8075. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  8076. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  8077. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  8078. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  8079. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  8080. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  8081. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  8082. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  8083. do { \
  8084. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  8085. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  8086. } while (0)
  8087. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  8088. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  8089. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  8090. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  8091. do { \
  8092. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  8093. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  8094. } while (0)
  8095. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  8096. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  8097. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  8098. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  8099. do { \
  8100. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  8101. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  8102. } while (0)
  8103. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  8104. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  8105. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  8106. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  8107. #define HTT_MAX_AGGR 64
  8108. #define HTT_HL_MAX_AGGR 18
  8109. /**
  8110. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  8111. *
  8112. * @details
  8113. * The following field definitions describe the format of the HTT host
  8114. * to target frag_desc/msdu_ext bank configuration message.
  8115. * The message contains the based address and the min and max id of the
  8116. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  8117. * MSDU_EXT/FRAG_DESC.
  8118. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  8119. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  8120. * the hardware does the mapping/translation.
  8121. *
  8122. * Total banks that can be configured is configured to 16.
  8123. *
  8124. * This should be called before any TX has be initiated by the HTT
  8125. *
  8126. * |31 16|15 8|7 5|4 0|
  8127. * |------------------------------------------------------------|
  8128. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  8129. * |------------------------------------------------------------|
  8130. * | BANK0_BASE_ADDRESS (bits 31:0) |
  8131. #if HTT_PADDR64
  8132. * | BANK0_BASE_ADDRESS (bits 63:32) |
  8133. #endif
  8134. * |------------------------------------------------------------|
  8135. * | ... |
  8136. * |------------------------------------------------------------|
  8137. * | BANK15_BASE_ADDRESS (bits 31:0) |
  8138. #if HTT_PADDR64
  8139. * | BANK15_BASE_ADDRESS (bits 63:32) |
  8140. #endif
  8141. * |------------------------------------------------------------|
  8142. * | BANK0_MAX_ID | BANK0_MIN_ID |
  8143. * |------------------------------------------------------------|
  8144. * | ... |
  8145. * |------------------------------------------------------------|
  8146. * | BANK15_MAX_ID | BANK15_MIN_ID |
  8147. * |------------------------------------------------------------|
  8148. * Header fields:
  8149. * - MSG_TYPE
  8150. * Bits 7:0
  8151. * Value: 0x6
  8152. * for systems with 64-bit format for bus addresses:
  8153. * - BANKx_BASE_ADDRESS_LO
  8154. * Bits 31:0
  8155. * Purpose: Provide a mechanism to specify the base address of the
  8156. * MSDU_EXT bank physical/bus address.
  8157. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8158. * - BANKx_BASE_ADDRESS_HI
  8159. * Bits 31:0
  8160. * Purpose: Provide a mechanism to specify the base address of the
  8161. * MSDU_EXT bank physical/bus address.
  8162. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8163. * for systems with 32-bit format for bus addresses:
  8164. * - BANKx_BASE_ADDRESS
  8165. * Bits 31:0
  8166. * Purpose: Provide a mechanism to specify the base address of the
  8167. * MSDU_EXT bank physical/bus address.
  8168. * Value: MSDU_EXT bank physical / bus address
  8169. * - BANKx_MIN_ID
  8170. * Bits 15:0
  8171. * Purpose: Provide a mechanism to specify the min index that needs to
  8172. * mapped.
  8173. * - BANKx_MAX_ID
  8174. * Bits 31:16
  8175. * Purpose: Provide a mechanism to specify the max index that needs to
  8176. * mapped.
  8177. *
  8178. */
  8179. /** @todo Compress the fields to fit MAX HTT Message size, until then
  8180. * configure to a safe value.
  8181. * @note MAX supported banks is 16.
  8182. */
  8183. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8184. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8185. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8186. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8187. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8188. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8189. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8190. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8191. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8192. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8193. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8194. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8195. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8196. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8197. do { \
  8198. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8199. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8200. } while (0)
  8201. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8202. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> \
  8203. HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8204. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8205. do { \
  8206. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value);\
  8207. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S);\
  8208. } while (0)
  8209. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8210. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> \
  8211. HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8212. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8213. do { \
  8214. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8215. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8216. } while (0)
  8217. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8218. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> \
  8219. HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8220. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8221. do { \
  8222. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8223. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8224. } while (0)
  8225. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8226. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> \
  8227. HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8228. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8229. do { \
  8230. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8231. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8232. } while (0)
  8233. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8234. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> \
  8235. HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8236. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8237. do { \
  8238. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8239. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8240. } while (0)
  8241. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8242. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> \
  8243. HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  8244. /*
  8245. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  8246. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  8247. * addresses are stored in a XXX-bit field.
  8248. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  8249. * htt_tx_frag_desc64_bank_cfg_t structs.
  8250. */
  8251. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  8252. _paddr_bits_, \
  8253. _paddr__bank_base_address_) \
  8254. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  8255. /** word 0 \
  8256. * msg_type: 8, \
  8257. * pdev_id: 2, \
  8258. * swap: 1, \
  8259. * reserved0: 5, \
  8260. * num_banks: 8, \
  8261. * desc_size: 8; \
  8262. */ \
  8263. A_UINT32 word0; \
  8264. /* \
  8265. * If bank_base_address is 64 bits, the upper / lower
  8266. * halves are stored \
  8267. * in little-endian order (bytes 0-3 in the first A_UINT32,
  8268. * bytes 4-7 in the second A_UINT32). \
  8269. */ \
  8270. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8271. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8272. } POSTPACK
  8273. /* define htt_tx_frag_desc32_bank_cfg_t */
  8274. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  8275. /* define htt_tx_frag_desc64_bank_cfg_t */
  8276. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  8277. /*
  8278. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  8279. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  8280. */
  8281. #if HTT_PADDR64
  8282. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  8283. #else
  8284. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  8285. #endif
  8286. /**
  8287. * @brief target -> host HTT TX Credit total count update message definition
  8288. *
  8289. *|31 16|15|14 9| 8 |7 0 |
  8290. *|---------------------+--+----------+-------+----------|
  8291. *|cur htt credit delta | Q| reserved | sign | msg type |
  8292. *|------------------------------------------------------|
  8293. *
  8294. * Header fields:
  8295. * - MSG_TYPE
  8296. * Bits 7:0
  8297. * Purpose: identifies this as a htt tx credit delta update message
  8298. * Value: 0xe
  8299. * - SIGN
  8300. * Bits 8
  8301. * identifies whether credit delta is positive or negative
  8302. * Value:
  8303. * - 0x0: credit delta is positive, rebalance in some buffers
  8304. * - 0x1: credit delta is negative, rebalance out some buffers
  8305. * - reserved
  8306. * Bits 14:9
  8307. * Value: 0x0
  8308. * - TXQ_GRP
  8309. * Bit 15
  8310. * Purpose: indicates whether any tx queue group information elements
  8311. * are appended to the tx credit update message
  8312. * Value: 0 -> no tx queue group information element is present
  8313. * 1 -> a tx queue group information element immediately follows
  8314. * - DELTA_COUNT
  8315. * Bits 31:16
  8316. * Purpose: Specify current htt credit delta absolute count
  8317. */
  8318. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8319. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8320. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8321. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8322. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8323. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8324. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8325. do { \
  8326. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8327. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8328. } while (0)
  8329. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8330. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8331. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8332. do { \
  8333. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8334. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8335. } while (0)
  8336. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8337. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8338. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8339. do { \
  8340. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8341. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8342. } while (0)
  8343. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8344. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8345. #define HTT_TX_CREDIT_MSG_BYTES 4
  8346. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8347. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8348. /**
  8349. * @brief HTT WDI_IPA Operation Response Message
  8350. *
  8351. * @details
  8352. * HTT WDI_IPA Operation Response message is sent by target
  8353. * to host confirming suspend or resume operation.
  8354. * |31 24|23 16|15 8|7 0|
  8355. * |----------------+----------------+----------------+----------------|
  8356. * | op_code | Rsvd | msg_type |
  8357. * |-------------------------------------------------------------------|
  8358. * | Rsvd | Response len |
  8359. * |-------------------------------------------------------------------|
  8360. * | |
  8361. * | Response-type specific info |
  8362. * | |
  8363. * | |
  8364. * |-------------------------------------------------------------------|
  8365. * Header fields:
  8366. * - MSG_TYPE
  8367. * Bits 7:0
  8368. * Purpose: Identifies this as WDI_IPA Operation Response message
  8369. * value: = 0x13
  8370. * - OP_CODE
  8371. * Bits 31:16
  8372. * Purpose: Identifies the operation target is responding to
  8373. * (e.g. TX suspend)
  8374. * value: = enum htt_wdi_ipa_op_code
  8375. * - RSP_LEN
  8376. * Bits 16:0
  8377. * Purpose: length for the response-type specific info
  8378. * value: = length in bytes for response-type specific info
  8379. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8380. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8381. */
  8382. PREPACK struct htt_wdi_ipa_op_response_t {
  8383. /* DWORD 0: flags and meta-data */
  8384. A_UINT32
  8385. msg_type:8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8386. reserved1:8,
  8387. op_code:16;
  8388. A_UINT32
  8389. rsp_len:16,
  8390. reserved2:16;
  8391. } POSTPACK;
  8392. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8393. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8394. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8395. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8396. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8397. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8398. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> \
  8399. HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8400. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8401. do { \
  8402. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8403. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8404. } while (0)
  8405. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8406. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> \
  8407. HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8408. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8409. do { \
  8410. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8411. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8412. } while (0)
  8413. enum htt_phy_mode {
  8414. htt_phy_mode_11a = 0,
  8415. htt_phy_mode_11g = 1,
  8416. htt_phy_mode_11b = 2,
  8417. htt_phy_mode_11g_only = 3,
  8418. htt_phy_mode_11na_ht20 = 4,
  8419. htt_phy_mode_11ng_ht20 = 5,
  8420. htt_phy_mode_11na_ht40 = 6,
  8421. htt_phy_mode_11ng_ht40 = 7,
  8422. htt_phy_mode_11ac_vht20 = 8,
  8423. htt_phy_mode_11ac_vht40 = 9,
  8424. htt_phy_mode_11ac_vht80 = 10,
  8425. htt_phy_mode_11ac_vht20_2g = 11,
  8426. htt_phy_mode_11ac_vht40_2g = 12,
  8427. htt_phy_mode_11ac_vht80_2g = 13,
  8428. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8429. htt_phy_mode_11ac_vht160 = 15,
  8430. htt_phy_mode_max,
  8431. };
  8432. /**
  8433. * @brief target -> host HTT channel change indication
  8434. * @details
  8435. * Specify when a channel change occurs.
  8436. * This allows the host to precisely determine which rx frames arrived
  8437. * on the old channel and which rx frames arrived on the new channel.
  8438. *
  8439. *|31 |7 0 |
  8440. *|-------------------------------------------+----------|
  8441. *| reserved | msg type |
  8442. *|------------------------------------------------------|
  8443. *| primary_chan_center_freq_mhz |
  8444. *|------------------------------------------------------|
  8445. *| contiguous_chan1_center_freq_mhz |
  8446. *|------------------------------------------------------|
  8447. *| contiguous_chan2_center_freq_mhz |
  8448. *|------------------------------------------------------|
  8449. *| phy_mode |
  8450. *|------------------------------------------------------|
  8451. *
  8452. * Header fields:
  8453. * - MSG_TYPE
  8454. * Bits 7:0
  8455. * Purpose: identifies this as a htt channel change indication message
  8456. * Value: 0x15
  8457. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8458. * Bits 31:0
  8459. * Purpose: identify the (center of the) new 20 MHz primary channel
  8460. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8461. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8462. * Bits 31:0
  8463. * Purpose: identify the (center of the) contiguous frequency range
  8464. * comprising the new channel.
  8465. * For example, if the new channel is a 80 MHz channel extending
  8466. * 60 MHz beyond the primary channel, this field would be 30 larger
  8467. * than the primary channel center frequency field.
  8468. * Value: center frequency of the contiguous frequency range comprising
  8469. * the full channel in MHz units
  8470. * (80+80 channels also use the CONTIG_CHAN2 field)
  8471. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8472. * Bits 31:0
  8473. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8474. * within a VHT 80+80 channel.
  8475. * This field is only relevant for VHT 80+80 channels.
  8476. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8477. * channel (arbitrary value for cases besides VHT 80+80)
  8478. * - PHY_MODE
  8479. * Bits 31:0
  8480. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8481. * and band
  8482. * Value: htt_phy_mode enum value
  8483. */
  8484. PREPACK struct htt_chan_change_t {
  8485. /* DWORD 0: flags and meta-data */
  8486. A_UINT32 msg_type:8, /* HTT_T2H_MSG_TYPE_CHAN_CHANGE */
  8487. reserved1:24;
  8488. A_UINT32 primary_chan_center_freq_mhz;
  8489. A_UINT32 contig_chan1_center_freq_mhz;
  8490. A_UINT32 contig_chan2_center_freq_mhz;
  8491. A_UINT32 phy_mode;
  8492. } POSTPACK;
  8493. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8494. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8495. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8496. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8497. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8498. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8499. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8500. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8501. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8502. do { \
  8503. HTT_CHECK_SET_VAL( \
  8504. HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value); \
  8505. (word) |= (value) << \
  8506. HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8507. } while (0)
  8508. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8509. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8510. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8511. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8512. do { \
  8513. HTT_CHECK_SET_VAL( \
  8514. HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value); \
  8515. (word) |= (value) << \
  8516. HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8517. } while (0)
  8518. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8519. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8520. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8521. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8522. do { \
  8523. HTT_CHECK_SET_VAL( \
  8524. HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value); \
  8525. (word) |= (value) << \
  8526. HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8527. } while (0)
  8528. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8529. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8530. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8531. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8532. do { \
  8533. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value); \
  8534. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8535. } while (0)
  8536. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8537. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8538. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8539. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8540. /**
  8541. * @brief rx offload packet error message
  8542. *
  8543. * @details
  8544. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8545. * of target payload like mic err.
  8546. *
  8547. * |31 24|23 16|15 8|7 0|
  8548. * |----------------+----------------+----------------+----------------|
  8549. * | tid | vdev_id | msg_sub_type | msg_type |
  8550. * |-------------------------------------------------------------------|
  8551. * : (sub-type dependent content) :
  8552. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8553. * Header fields:
  8554. * - msg_type
  8555. * Bits 7:0
  8556. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8557. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8558. * - msg_sub_type
  8559. * Bits 15:8
  8560. * Purpose: Identifies which type of rx error is reported by this message
  8561. * value: htt_rx_ofld_pkt_err_type
  8562. * - vdev_id
  8563. * Bits 23:16
  8564. * Purpose: Identifies which vdev received the erroneous rx frame
  8565. * value:
  8566. * - tid
  8567. * Bits 31:24
  8568. * Purpose: Identifies the traffic type of the rx frame
  8569. * value:
  8570. *
  8571. * - The payload fields used if the sub-type == MIC error are shown below.
  8572. * Note - MIC err is per MSDU, while PN is per MPDU.
  8573. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8574. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8575. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8576. * instead of sending separate HTT messages for each wrong MSDU within
  8577. * the MPDU.
  8578. *
  8579. * |31 24|23 16|15 8|7 0|
  8580. * |----------------+----------------+----------------+----------------|
  8581. * | Rsvd | key_id | peer_id |
  8582. * |-------------------------------------------------------------------|
  8583. * | receiver MAC addr 31:0 |
  8584. * |-------------------------------------------------------------------|
  8585. * | Rsvd | receiver MAC addr 47:32 |
  8586. * |-------------------------------------------------------------------|
  8587. * | transmitter MAC addr 31:0 |
  8588. * |-------------------------------------------------------------------|
  8589. * | Rsvd | transmitter MAC addr 47:32 |
  8590. * |-------------------------------------------------------------------|
  8591. * | PN 31:0 |
  8592. * |-------------------------------------------------------------------|
  8593. * | Rsvd | PN 47:32 |
  8594. * |-------------------------------------------------------------------|
  8595. * - peer_id
  8596. * Bits 15:0
  8597. * Purpose: identifies which peer is frame is from
  8598. * value:
  8599. * - key_id
  8600. * Bits 23:16
  8601. * Purpose: identifies key_id of rx frame
  8602. * value:
  8603. * - RA_31_0 (receiver MAC addr 31:0)
  8604. * Bits 31:0
  8605. * Purpose: identifies by MAC address which vdev received the frame
  8606. * value: MAC address lower 4 bytes
  8607. * - RA_47_32 (receiver MAC addr 47:32)
  8608. * Bits 15:0
  8609. * Purpose: identifies by MAC address which vdev received the frame
  8610. * value: MAC address upper 2 bytes
  8611. * - TA_31_0 (transmitter MAC addr 31:0)
  8612. * Bits 31:0
  8613. * Purpose: identifies by MAC address which peer transmitted the frame
  8614. * value: MAC address lower 4 bytes
  8615. * - TA_47_32 (transmitter MAC addr 47:32)
  8616. * Bits 15:0
  8617. * Purpose: identifies by MAC address which peer transmitted the frame
  8618. * value: MAC address upper 2 bytes
  8619. * - PN_31_0
  8620. * Bits 31:0
  8621. * Purpose: Identifies pn of rx frame
  8622. * value: PN lower 4 bytes
  8623. * - PN_47_32
  8624. * Bits 15:0
  8625. * Purpose: Identifies pn of rx frame
  8626. * value:
  8627. * TKIP or CCMP: PN upper 2 bytes
  8628. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8629. */
  8630. enum htt_rx_ofld_pkt_err_type {
  8631. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8632. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8633. };
  8634. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8635. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8636. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8637. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8638. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8639. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8640. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8641. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8642. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8643. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8644. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8645. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8646. do { \
  8647. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8648. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8649. } while (0)
  8650. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8651. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> \
  8652. HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8653. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8654. do { \
  8655. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8656. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8657. } while (0)
  8658. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8659. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8660. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8661. do { \
  8662. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8663. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8664. } while (0)
  8665. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8666. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8667. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8668. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8669. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8670. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8671. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8672. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8673. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8674. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8675. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8676. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8677. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8678. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8679. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8680. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8681. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8682. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8683. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8684. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8685. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8686. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8687. do { \
  8688. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8689. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8690. } while (0)
  8691. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8692. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8693. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8694. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8695. do { \
  8696. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8697. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8698. } while (0)
  8699. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8700. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8701. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8702. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8703. do { \
  8704. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8705. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8706. } while (0)
  8707. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8708. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8709. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8710. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8711. do { \
  8712. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8713. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8714. } while (0)
  8715. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8716. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8717. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8718. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8719. do { \
  8720. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8721. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8722. } while (0)
  8723. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8724. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8725. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8726. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8727. do { \
  8728. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8729. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8730. } while (0)
  8731. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8732. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8733. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8734. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8735. do { \
  8736. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8737. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8738. } while (0)
  8739. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8740. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8741. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8742. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8743. do { \
  8744. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8745. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8746. } while (0)
  8747. /**
  8748. * @brief peer rate report message
  8749. *
  8750. * @details
  8751. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8752. * justified rate of all the peers.
  8753. *
  8754. * |31 24|23 16|15 8|7 0|
  8755. * |----------------+----------------+----------------+----------------|
  8756. * | peer_count | | msg_type |
  8757. * |-------------------------------------------------------------------|
  8758. * : Payload (variant number of peer rate report) :
  8759. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8760. * Header fields:
  8761. * - msg_type
  8762. * Bits 7:0
  8763. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8764. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8765. * - reserved
  8766. * Bits 15:8
  8767. * Purpose:
  8768. * value:
  8769. * - peer_count
  8770. * Bits 31:16
  8771. * Purpose: Specify how many peer rate report elements are present in the payload.
  8772. * value:
  8773. *
  8774. * Payload:
  8775. * There are variant number of peer rate report follow the first 32 bits.
  8776. * The peer rate report is defined as follows.
  8777. *
  8778. * |31 20|19 16|15 0|
  8779. * |-----------------------+---------+---------------------------------|-
  8780. * | reserved | phy | peer_id | \
  8781. * |-------------------------------------------------------------------| -> report #0
  8782. * | rate | /
  8783. * |-----------------------+---------+---------------------------------|-
  8784. * | reserved | phy | peer_id | \
  8785. * |-------------------------------------------------------------------| -> report #1
  8786. * | rate | /
  8787. * |-----------------------+---------+---------------------------------|-
  8788. * | reserved | phy | peer_id | \
  8789. * |-------------------------------------------------------------------| -> report #2
  8790. * | rate | /
  8791. * |-------------------------------------------------------------------|-
  8792. * : :
  8793. * : :
  8794. * : :
  8795. * :-------------------------------------------------------------------:
  8796. *
  8797. * - peer_id
  8798. * Bits 15:0
  8799. * Purpose: identify the peer
  8800. * value:
  8801. * - phy
  8802. * Bits 19:16
  8803. * Purpose: identify which phy is in use
  8804. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8805. * Please see enum htt_peer_report_phy_type for detail.
  8806. * - reserved
  8807. * Bits 31:20
  8808. * Purpose:
  8809. * value:
  8810. * - rate
  8811. * Bits 31:0
  8812. * Purpose: represent the justified rate of the peer specified by peer_id
  8813. * value:
  8814. */
  8815. enum htt_peer_rate_report_phy_type {
  8816. HTT_PEER_RATE_REPORT_11B = 0,
  8817. HTT_PEER_RATE_REPORT_11A_G,
  8818. HTT_PEER_RATE_REPORT_11N,
  8819. HTT_PEER_RATE_REPORT_11AC,
  8820. };
  8821. #define HTT_PEER_RATE_REPORT_SIZE 8
  8822. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8823. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8824. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8825. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8826. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8827. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8828. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8829. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8830. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8831. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8832. do { \
  8833. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8834. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8835. } while (0)
  8836. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8837. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8838. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8839. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8840. do { \
  8841. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8842. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8843. } while (0)
  8844. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8845. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8846. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8847. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8848. do { \
  8849. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8850. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8851. } while (0)
  8852. /**
  8853. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8854. *
  8855. * @details
  8856. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  8857. * a flow of descriptors.
  8858. *
  8859. * This message is in TLV format and indicates the parameters to be setup a
  8860. * flow in the host. Each entry indicates that a particular flow ID is ready to
  8861. * receive descriptors from a specified pool.
  8862. *
  8863. * The message would appear as follows:
  8864. *
  8865. * |31 24|23 16|15 8|7 0|
  8866. * |----------------+----------------+----------------+----------------|
  8867. * header | reserved | num_flows | msg_type |
  8868. * |-------------------------------------------------------------------|
  8869. * | |
  8870. * : payload :
  8871. * | |
  8872. * |-------------------------------------------------------------------|
  8873. *
  8874. * The header field is one DWORD long and is interpreted as follows:
  8875. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  8876. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  8877. * this message
  8878. * b'16-31 - reserved: These bits are reserved for future use
  8879. *
  8880. * Payload:
  8881. * The payload would contain multiple objects of the following structure. Each
  8882. * object represents a flow.
  8883. *
  8884. * |31 24|23 16|15 8|7 0|
  8885. * |----------------+----------------+----------------+----------------|
  8886. * header | reserved | num_flows | msg_type |
  8887. * |-------------------------------------------------------------------|
  8888. * payload0| flow_type |
  8889. * |-------------------------------------------------------------------|
  8890. * | flow_id |
  8891. * |-------------------------------------------------------------------|
  8892. * | reserved0 | flow_pool_id |
  8893. * |-------------------------------------------------------------------|
  8894. * | reserved1 | flow_pool_size |
  8895. * |-------------------------------------------------------------------|
  8896. * | reserved2 |
  8897. * |-------------------------------------------------------------------|
  8898. * payload1| flow_type |
  8899. * |-------------------------------------------------------------------|
  8900. * | flow_id |
  8901. * |-------------------------------------------------------------------|
  8902. * | reserved0 | flow_pool_id |
  8903. * |-------------------------------------------------------------------|
  8904. * | reserved1 | flow_pool_size |
  8905. * |-------------------------------------------------------------------|
  8906. * | reserved2 |
  8907. * |-------------------------------------------------------------------|
  8908. * | . |
  8909. * | . |
  8910. * | . |
  8911. * |-------------------------------------------------------------------|
  8912. *
  8913. * Each payload is 5 DWORDS long and is interpreted as follows:
  8914. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  8915. * this flow is associated. It can be VDEV, peer,
  8916. * or tid (AC). Based on enum htt_flow_type.
  8917. *
  8918. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8919. * object. For flow_type vdev it is set to the
  8920. * vdevid, for peer it is peerid and for tid, it is
  8921. * tid_num.
  8922. *
  8923. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  8924. * in the host for this flow
  8925. * b'16:31 - reserved0: This field in reserved for the future. In case
  8926. * we have a hierarchical implementation (HCM) of
  8927. * pools, it can be used to indicate the ID of the
  8928. * parent-pool.
  8929. *
  8930. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  8931. * Descriptors for this flow will be
  8932. * allocated from this pool in the host.
  8933. * b'16:31 - reserved1: This field in reserved for the future. In case
  8934. * we have a hierarchical implementation of pools,
  8935. * it can be used to indicate the max number of
  8936. * descriptors in the pool. The b'0:15 can be used
  8937. * to indicate min number of descriptors in the
  8938. * HCM scheme.
  8939. *
  8940. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  8941. * we have a hierarchical implementation of pools,
  8942. * b'0:15 can be used to indicate the
  8943. * priority-based borrowing (PBB) threshold of
  8944. * the flow's pool. The b'16:31 are still left
  8945. * reserved.
  8946. */
  8947. enum htt_flow_type {
  8948. FLOW_TYPE_VDEV = 0,
  8949. /* Insert new flow types above this line */
  8950. };
  8951. PREPACK struct htt_flow_pool_map_payload_t {
  8952. A_UINT32 flow_type;
  8953. A_UINT32 flow_id;
  8954. A_UINT32 flow_pool_id:16,
  8955. reserved0:16;
  8956. A_UINT32 flow_pool_size:16,
  8957. reserved1:16;
  8958. A_UINT32 reserved2;
  8959. } POSTPACK;
  8960. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  8961. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  8962. (sizeof(struct htt_flow_pool_map_payload_t))
  8963. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  8964. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  8965. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  8966. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  8967. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  8968. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  8969. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  8970. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  8971. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  8972. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  8973. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  8974. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  8975. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  8976. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  8977. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  8978. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  8979. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  8980. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  8981. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  8982. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  8983. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  8984. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  8985. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  8986. do { \
  8987. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  8988. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  8989. } while (0)
  8990. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  8991. do { \
  8992. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  8993. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  8994. } while (0)
  8995. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  8996. do { \
  8997. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  8998. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  8999. } while (0)
  9000. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  9001. do { \
  9002. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  9003. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  9004. } while (0)
  9005. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  9006. do { \
  9007. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  9008. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  9009. } while (0)
  9010. /**
  9011. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  9012. *
  9013. * @details
  9014. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  9015. * down a flow of descriptors.
  9016. * This message indicates that for the flow (whose ID is provided) is wanting
  9017. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  9018. * pool of descriptors from where descriptors are being allocated for this
  9019. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  9020. * be unmapped by the host.
  9021. *
  9022. * The message would appear as follows:
  9023. *
  9024. * |31 24|23 16|15 8|7 0|
  9025. * |----------------+----------------+----------------+----------------|
  9026. * | reserved0 | msg_type |
  9027. * |-------------------------------------------------------------------|
  9028. * | flow_type |
  9029. * |-------------------------------------------------------------------|
  9030. * | flow_id |
  9031. * |-------------------------------------------------------------------|
  9032. * | reserved1 | flow_pool_id |
  9033. * |-------------------------------------------------------------------|
  9034. *
  9035. * The message is interpreted as follows:
  9036. * dword0 - b'0:7 - msg_type: This will be set to
  9037. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  9038. * b'8:31 - reserved0: Reserved for future use
  9039. *
  9040. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  9041. * this flow is associated. It can be VDEV, peer,
  9042. * or tid (AC). Based on enum htt_flow_type.
  9043. *
  9044. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9045. * object. For flow_type vdev it is set to the
  9046. * vdevid, for peer it is peerid and for tid, it is
  9047. * tid_num.
  9048. *
  9049. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  9050. * used in the host for this flow
  9051. * b'16:31 - reserved0: This field in reserved for the future.
  9052. *
  9053. */
  9054. PREPACK struct htt_flow_pool_unmap_t {
  9055. A_UINT32 msg_type:8,
  9056. reserved0:24;
  9057. A_UINT32 flow_type;
  9058. A_UINT32 flow_id;
  9059. A_UINT32 flow_pool_id:16,
  9060. reserved1:16;
  9061. } POSTPACK;
  9062. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  9063. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  9064. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  9065. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  9066. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  9067. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  9068. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  9069. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  9070. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  9071. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  9072. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  9073. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  9074. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  9075. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  9076. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  9077. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  9078. do { \
  9079. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  9080. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  9081. } while (0)
  9082. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  9083. do { \
  9084. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  9085. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  9086. } while (0)
  9087. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  9088. do { \
  9089. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  9090. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  9091. } while (0)
  9092. /**
  9093. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  9094. *
  9095. * @details
  9096. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  9097. * SRNG ring setup is done
  9098. *
  9099. * This message indicates whether the last setup operation is successful.
  9100. * It will be sent to host when host set respose_required bit in
  9101. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  9102. * The message would appear as follows:
  9103. *
  9104. * |31 24|23 16|15 8|7 0|
  9105. * |--------------- +----------------+----------------+----------------|
  9106. * | setup_status | ring_id | pdev_id | msg_type |
  9107. * |-------------------------------------------------------------------|
  9108. *
  9109. * The message is interpreted as follows:
  9110. * dword0 - b'0:7 - msg_type: This will be set to
  9111. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  9112. * b'8:15 - pdev_id:
  9113. * 0 (for rings at SOC/UMAC level),
  9114. * 1/2/3 mac id (for rings at LMAC level)
  9115. * b'16:23 - ring_id: Identify the ring which is set up
  9116. * More details can be got from enum htt_srng_ring_id
  9117. * b'24:31 - setup_status: Indicate status of setup operation
  9118. * Refer to htt_ring_setup_status
  9119. */
  9120. PREPACK struct htt_sring_setup_done_t {
  9121. A_UINT32 msg_type: 8,
  9122. pdev_id: 8,
  9123. ring_id: 8,
  9124. setup_status: 8;
  9125. } POSTPACK;
  9126. enum htt_ring_setup_status {
  9127. htt_ring_setup_status_ok = 0,
  9128. htt_ring_setup_status_error,
  9129. };
  9130. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  9131. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  9132. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  9133. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  9134. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  9135. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  9136. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  9137. do { \
  9138. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  9139. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  9140. } while (0)
  9141. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  9142. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  9143. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  9144. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  9145. HTT_SRING_SETUP_DONE_RING_ID_S)
  9146. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  9147. do { \
  9148. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  9149. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  9150. } while (0)
  9151. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  9152. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  9153. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  9154. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  9155. HTT_SRING_SETUP_DONE_STATUS_S)
  9156. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  9157. do { \
  9158. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  9159. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  9160. } while (0)
  9161. /**
  9162. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9163. *
  9164. * @details
  9165. * HTT TX map flow entry with tqm flow pointer
  9166. * Sent from firmware to host to add tqm flow pointer in corresponding
  9167. * flow search entry. Flow metadata is replayed back to host as part of this
  9168. * struct to enable host to find the specific flow search entry
  9169. *
  9170. * The message would appear as follows:
  9171. *
  9172. * |31 28|27 18|17 14|13 8|7 0|
  9173. * |-------+------------------------------------------+----------------|
  9174. * | rsvd0 | fse_hsh_idx | msg_type |
  9175. * |-------------------------------------------------------------------|
  9176. * | rsvd1 | tid | peer_id |
  9177. * |-------------------------------------------------------------------|
  9178. * | tqm_flow_pntr_lo |
  9179. * |-------------------------------------------------------------------|
  9180. * | tqm_flow_pntr_hi |
  9181. * |-------------------------------------------------------------------|
  9182. * | fse_meta_data |
  9183. * |-------------------------------------------------------------------|
  9184. *
  9185. * The message is interpreted as follows:
  9186. *
  9187. * dword0 - b'0:7 - msg_type: This will be set to
  9188. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9189. *
  9190. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9191. * for this flow entry
  9192. *
  9193. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9194. *
  9195. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9196. *
  9197. * dword1 - b'14:17 - tid
  9198. *
  9199. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9200. *
  9201. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9202. *
  9203. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9204. *
  9205. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9206. * given by host
  9207. */
  9208. PREPACK struct htt_tx_map_flow_info {
  9209. A_UINT32
  9210. msg_type: 8,
  9211. fse_hsh_idx: 20,
  9212. rsvd0: 4;
  9213. A_UINT32
  9214. peer_id: 14,
  9215. tid: 4,
  9216. rsvd1: 14;
  9217. A_UINT32 tqm_flow_pntr_lo;
  9218. A_UINT32 tqm_flow_pntr_hi;
  9219. struct htt_tx_flow_metadata fse_meta_data;
  9220. } POSTPACK;
  9221. /* DWORD 0 */
  9222. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9223. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9224. /* DWORD 1 */
  9225. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9226. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9227. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9228. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9229. /* DWORD 0 */
  9230. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9231. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9232. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9233. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9234. do { \
  9235. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9236. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9237. } while (0)
  9238. /* DWORD 1 */
  9239. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9240. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9241. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9242. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9243. do { \
  9244. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9245. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9246. } while (0)
  9247. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9248. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9249. HTT_TX_MAP_FLOW_INFO_TID_S)
  9250. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9251. do { \
  9252. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  9253. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  9254. } while (0)
  9255. /*
  9256. * htt_dbg_ext_stats_status -
  9257. * present - The requested stats have been delivered in full.
  9258. * This indicates that either the stats information was contained
  9259. * in its entirety within this message, or else this message
  9260. * completes the delivery of the requested stats info that was
  9261. * partially delivered through earlier STATS_CONF messages.
  9262. * partial - The requested stats have been delivered in part.
  9263. * One or more subsequent STATS_CONF messages with the same
  9264. * cookie value will be sent to deliver the remainder of the
  9265. * information.
  9266. * error - The requested stats could not be delivered, for example due
  9267. * to a shortage of memory to construct a message holding the
  9268. * requested stats.
  9269. * invalid - The requested stat type is either not recognized, or the
  9270. * target is configured to not gather the stats type in question.
  9271. */
  9272. enum htt_dbg_ext_stats_status {
  9273. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  9274. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  9275. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  9276. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  9277. };
  9278. /**
  9279. * @brief target -> host ppdu stats upload
  9280. *
  9281. * @details
  9282. * The following field definitions describe the format of the HTT target
  9283. * to host ppdu stats indication message.
  9284. *
  9285. *
  9286. * |31 16|15 10|9 8|7 0 |
  9287. * |----------------------------------------------------------------------|
  9288. * | payload_size | rsvd bits |mac_id | msg type |
  9289. * |----------------------------------------------------------------------|
  9290. * | ppdu_id |
  9291. * |----------------------------------------------------------------------|
  9292. * | Timestamp in us |
  9293. * |----------------------------------------------------------------------|
  9294. * | reserved |
  9295. * |----------------------------------------------------------------------|
  9296. * | type-specific stats info |
  9297. * | (see htt_ppdu_stats.h) |
  9298. * |----------------------------------------------------------------------|
  9299. * Header fields:
  9300. * - MSG_TYPE
  9301. * Bits 7:0
  9302. * Purpose: Identifies this is a PPDU STATS indication
  9303. * message.
  9304. * Value: 0x1d
  9305. * - mac_id
  9306. * Bits 2
  9307. * Purpose: mac_id of this ppdu_id
  9308. * Value: 0-3
  9309. * - payload_size
  9310. * Bits 31:16
  9311. * Purpose: total tlv size
  9312. * Value: payload_size in bytes
  9313. */
  9314. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  9315. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  9316. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  9317. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  9318. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  9319. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  9320. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  9321. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  9322. do { \
  9323. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  9324. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  9325. } while (0)
  9326. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  9327. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  9328. HTT_T2H_PPDU_STATS_MAC_ID_S)
  9329. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  9330. do { \
  9331. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  9332. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  9333. } while (0)
  9334. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  9335. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  9336. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  9337. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  9338. do { \
  9339. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  9340. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  9341. } while (0)
  9342. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  9343. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  9344. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  9345. /**
  9346. * @brief target -> host extended statistics upload
  9347. *
  9348. * @details
  9349. * The following field definitions describe the format of the HTT target
  9350. * to host stats upload confirmation message.
  9351. * The message contains a cookie echoed from the HTT host->target stats
  9352. * upload request, which identifies which request the confirmation is
  9353. * for, and a single stats can span over multiple HTT stats indication
  9354. * due to the HTT message size limitation so every HTT ext stats indication
  9355. * will have tag-length-value stats information elements.
  9356. * The tag-length header for each HTT stats IND message also includes a
  9357. * status field, to indicate whether the request for the stat type in
  9358. * question was fully met, partially met, unable to be met, or invalid
  9359. * (if the stat type in question is disabled in the target).
  9360. * A Done bit 1's indicate the end of the of stats info elements.
  9361. *
  9362. *
  9363. * |31 16|15 12|11|10 8|7 5|4 0|
  9364. * |--------------------------------------------------------------|
  9365. * | reserved | msg type |
  9366. * |--------------------------------------------------------------|
  9367. * | cookie LSBs |
  9368. * |--------------------------------------------------------------|
  9369. * | cookie MSBs |
  9370. * |--------------------------------------------------------------|
  9371. * | stats entry length | rsvd | D| S | stat type |
  9372. * |--------------------------------------------------------------|
  9373. * | type-specific stats info |
  9374. * | (see htt_stats.h) |
  9375. * |--------------------------------------------------------------|
  9376. * Header fields:
  9377. * - MSG_TYPE
  9378. * Bits 7:0
  9379. * Purpose: Identifies this is a extended statistics upload confirmation
  9380. * message.
  9381. * Value: 0x1c
  9382. * - COOKIE_LSBS
  9383. * Bits 31:0
  9384. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9385. * message with its preceding host->target stats request message.
  9386. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9387. * - COOKIE_MSBS
  9388. * Bits 31:0
  9389. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9390. * message with its preceding host->target stats request message.
  9391. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9392. *
  9393. * Stats Information Element tag-length header fields:
  9394. * - STAT_TYPE
  9395. * Bits 7:0
  9396. * Purpose: identifies the type of statistics info held in the
  9397. * following information element
  9398. * Value: htt_dbg_ext_stats_type
  9399. * - STATUS
  9400. * Bits 10:8
  9401. * Purpose: indicate whether the requested stats are present
  9402. * Value: htt_dbg_ext_stats_status
  9403. * - DONE
  9404. * Bits 11
  9405. * Purpose:
  9406. * Indicates the completion of the stats entry, this will be the last
  9407. * stats conf HTT segment for the requested stats type.
  9408. * Value:
  9409. * 0 -> the stats retrieval is ongoing
  9410. * 1 -> the stats retrieval is complete
  9411. * - LENGTH
  9412. * Bits 31:16
  9413. * Purpose: indicate the stats information size
  9414. * Value: This field specifies the number of bytes of stats information
  9415. * that follows the element tag-length header.
  9416. * It is expected but not required that this length is a multiple of
  9417. * 4 bytes.
  9418. */
  9419. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9420. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9421. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9422. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9423. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9424. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9425. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9426. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9427. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9428. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9429. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9430. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9431. do { \
  9432. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value);\
  9433. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9434. } while (0)
  9435. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9436. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9437. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9438. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9439. do { \
  9440. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, \
  9441. value); \
  9442. (word) |= (value) << \
  9443. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9444. } while (0)
  9445. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9446. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9447. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9448. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9449. do { \
  9450. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value);\
  9451. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S;\
  9452. } while (0)
  9453. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9454. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9455. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9456. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9457. do { \
  9458. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, \
  9459. value); \
  9460. (word) |= (value) << \
  9461. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9462. } while (0)
  9463. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9464. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9465. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9466. typedef enum {
  9467. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9468. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9469. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9470. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9471. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9472. /* Host <-> Target Peer type is assigned up to 127 */
  9473. HTT_PEER_TYPE_HOST_MAX = 127,
  9474. /* Reserved from 128 - 255 for target internal use.*/
  9475. /* Temporarily created during offload roam */
  9476. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128,
  9477. } HTT_PEER_TYPE;
  9478. /** 2 word representation of MAC addr */
  9479. typedef struct {
  9480. /** upper 4 bytes of MAC address */
  9481. A_UINT32 mac_addr31to0;
  9482. /** lower 2 bytes of MAC address */
  9483. A_UINT32 mac_addr47to32;
  9484. } htt_mac_addr;
  9485. /** macro to convert MAC address from char array to HTT word format */
  9486. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) \
  9487. do { \
  9488. (phtt_mac_addr)->mac_addr31to0 = \
  9489. (((c_macaddr)[0] << 0) | \
  9490. ((c_macaddr)[1] << 8) | \
  9491. ((c_macaddr)[2] << 16) | \
  9492. ((c_macaddr)[3] << 24)); \
  9493. (phtt_mac_addr)->mac_addr47to32 = \
  9494. ((c_macaddr)[4] | ((c_macaddr)[5] << 8)); \
  9495. } while (0)
  9496. #endif