htt.h 472 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431
  1. /*
  2. * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. */
  162. #define HTT_CURRENT_VERSION_MAJOR 3
  163. #define HTT_CURRENT_VERSION_MINOR 50
  164. #define HTT_NUM_TX_FRAG_DESC 1024
  165. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  166. #define HTT_CHECK_SET_VAL(field, val) \
  167. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  168. /* macros to assist in sign-extending fields from HTT messages */
  169. #define HTT_SIGN_BIT_MASK(field) \
  170. ((field ## _M + (1 << field ## _S)) >> 1)
  171. #define HTT_SIGN_BIT(_val, field) \
  172. (_val & HTT_SIGN_BIT_MASK(field))
  173. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  174. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  175. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  176. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  177. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  178. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  179. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  180. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  181. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  182. /*
  183. * TEMPORARY:
  184. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  185. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  186. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  187. * updated.
  188. */
  189. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  190. /*
  191. * TEMPORARY:
  192. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  193. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  194. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  195. * updated.
  196. */
  197. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  198. /* HTT Access Category values */
  199. enum HTT_AC_WMM {
  200. /* WMM Access Categories */
  201. HTT_AC_WMM_BE = 0x0,
  202. HTT_AC_WMM_BK = 0x1,
  203. HTT_AC_WMM_VI = 0x2,
  204. HTT_AC_WMM_VO = 0x3,
  205. /* extension Access Categories */
  206. HTT_AC_EXT_NON_QOS = 0x4,
  207. HTT_AC_EXT_UCAST_MGMT = 0x5,
  208. HTT_AC_EXT_MCAST_DATA = 0x6,
  209. HTT_AC_EXT_MCAST_MGMT = 0x7,
  210. };
  211. enum HTT_AC_WMM_MASK {
  212. /* WMM Access Categories */
  213. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  214. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  215. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  216. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  217. /* extension Access Categories */
  218. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  219. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  220. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  221. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  222. };
  223. #define HTT_AC_MASK_WMM \
  224. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  225. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  226. #define HTT_AC_MASK_EXT \
  227. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  228. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  229. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  230. /*
  231. * htt_dbg_stats_type -
  232. * bit positions for each stats type within a stats type bitmask
  233. * The bitmask contains 24 bits.
  234. */
  235. enum htt_dbg_stats_type {
  236. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  237. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  238. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  239. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  240. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  241. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  242. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  243. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  244. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  245. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  246. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  247. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  248. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  249. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  250. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  251. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  252. /* bits 16-23 currently reserved */
  253. /* keep this last */
  254. HTT_DBG_NUM_STATS
  255. };
  256. /*=== HTT option selection TLVs ===
  257. * Certain HTT messages have alternatives or options.
  258. * For such cases, the host and target need to agree on which option to use.
  259. * Option specification TLVs can be appended to the VERSION_REQ and
  260. * VERSION_CONF messages to select options other than the default.
  261. * These TLVs are entirely optional - if they are not provided, there is a
  262. * well-defined default for each option. If they are provided, they can be
  263. * provided in any order. Each TLV can be present or absent independent of
  264. * the presence / absence of other TLVs.
  265. *
  266. * The HTT option selection TLVs use the following format:
  267. * |31 16|15 8|7 0|
  268. * |---------------------------------+----------------+----------------|
  269. * | value (payload) | length | tag |
  270. * |-------------------------------------------------------------------|
  271. * The value portion need not be only 2 bytes; it can be extended by any
  272. * integer number of 4-byte units. The total length of the TLV, including
  273. * the tag and length fields, must be a multiple of 4 bytes. The length
  274. * field specifies the total TLV size in 4-byte units. Thus, the typical
  275. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  276. * field, would store 0x1 in its length field, to show that the TLV occupies
  277. * a single 4-byte unit.
  278. */
  279. /*--- TLV header format - applies to all HTT option TLVs ---*/
  280. enum HTT_OPTION_TLV_TAGS {
  281. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  282. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  283. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  284. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  285. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  286. };
  287. PREPACK struct htt_option_tlv_header_t {
  288. A_UINT8 tag;
  289. A_UINT8 length;
  290. } POSTPACK;
  291. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  292. #define HTT_OPTION_TLV_TAG_S 0
  293. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  294. #define HTT_OPTION_TLV_LENGTH_S 8
  295. /*
  296. * value0 - 16 bit value field stored in word0
  297. * The TLV's value field may be longer than 2 bytes, in which case
  298. * the remainder of the value is stored in word1, word2, etc.
  299. */
  300. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  301. #define HTT_OPTION_TLV_VALUE0_S 16
  302. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  303. do { \
  304. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  305. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  306. } while (0)
  307. #define HTT_OPTION_TLV_TAG_GET(word) \
  308. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  309. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  310. do { \
  311. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  312. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  313. } while (0)
  314. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  315. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  316. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  317. do { \
  318. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  319. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  320. } while (0)
  321. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  322. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  323. /*--- format of specific HTT option TLVs ---*/
  324. /*
  325. * HTT option TLV for specifying LL bus address size
  326. * Some chips require bus addresses used by the target to access buffers
  327. * within the host's memory to be 32 bits; others require bus addresses
  328. * used by the target to access buffers within the host's memory to be
  329. * 64 bits.
  330. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  331. * a suffix to the VERSION_CONF message to specify which bus address format
  332. * the target requires.
  333. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  334. * default to providing bus addresses to the target in 32-bit format.
  335. */
  336. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  337. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  338. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  339. };
  340. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  341. struct htt_option_tlv_header_t hdr;
  342. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  343. } POSTPACK;
  344. /*
  345. * HTT option TLV for specifying whether HL systems should indicate
  346. * over-the-air tx completion for individual frames, or should instead
  347. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  348. * requests an OTA tx completion for a particular tx frame.
  349. * This option does not apply to LL systems, where the TX_COMPL_IND
  350. * is mandatory.
  351. * This option is primarily intended for HL systems in which the tx frame
  352. * downloads over the host --> target bus are as slow as or slower than
  353. * the transmissions over the WLAN PHY. For cases where the bus is faster
  354. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  355. * and consquently will send one TX_COMPL_IND message that covers several
  356. * tx frames. For cases where the WLAN PHY is faster than the bus,
  357. * the target will end up transmitting very short A-MPDUs, and consequently
  358. * sending many TX_COMPL_IND messages, which each cover a very small number
  359. * of tx frames.
  360. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  361. * a suffix to the VERSION_REQ message to request whether the host desires to
  362. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  363. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  364. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  365. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  366. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  367. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  368. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  369. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  370. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  371. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  372. * TLV.
  373. */
  374. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  375. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  376. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  377. };
  378. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  379. struct htt_option_tlv_header_t hdr;
  380. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  381. } POSTPACK;
  382. /*
  383. * HTT option TLV for specifying how many tx queue groups the target
  384. * may establish.
  385. * This TLV specifies the maximum value the target may send in the
  386. * txq_group_id field of any TXQ_GROUP information elements sent by
  387. * the target to the host. This allows the host to pre-allocate an
  388. * appropriate number of tx queue group structs.
  389. *
  390. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  391. * a suffix to the VERSION_REQ message to specify whether the host supports
  392. * tx queue groups at all, and if so if there is any limit on the number of
  393. * tx queue groups that the host supports.
  394. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  395. * a suffix to the VERSION_CONF message. If the host has specified in the
  396. * VER_REQ message a limit on the number of tx queue groups the host can
  397. * supprt, the target shall limit its specification of the maximum tx groups
  398. * to be no larger than this host-specified limit.
  399. *
  400. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  401. * shall preallocate 4 tx queue group structs, and the target shall not
  402. * specify a txq_group_id larger than 3.
  403. */
  404. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  405. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  406. /*
  407. * values 1 through N specify the max number of tx queue groups
  408. * the sender supports
  409. */
  410. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  411. };
  412. /* TEMPORARY backwards-compatibility alias for a typo fix -
  413. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  414. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  415. * to support the old name (with the typo) until all references to the
  416. * old name are replaced with the new name.
  417. */
  418. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  419. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  420. struct htt_option_tlv_header_t hdr;
  421. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  422. } POSTPACK;
  423. /*
  424. * HTT option TLV for specifying whether the target supports an extended
  425. * version of the HTT tx descriptor. If the target provides this TLV
  426. * and specifies in the TLV that the target supports an extended version
  427. * of the HTT tx descriptor, the target must check the "extension" bit in
  428. * the HTT tx descriptor, and if the extension bit is set, to expect a
  429. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  430. * descriptor. Furthermore, the target must provide room for the HTT
  431. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  432. * This option is intended for systems where the host needs to explicitly
  433. * control the transmission parameters such as tx power for individual
  434. * tx frames.
  435. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  436. * as a suffix to the VERSION_CONF message to explicitly specify whether
  437. * the target supports the HTT tx MSDU extension descriptor.
  438. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  439. * by the host as lack of target support for the HTT tx MSDU extension
  440. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  441. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  442. * the HTT tx MSDU extension descriptor.
  443. * The host is not required to provide the HTT tx MSDU extension descriptor
  444. * just because the target supports it; the target must check the
  445. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  446. * extension descriptor is present.
  447. */
  448. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  449. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  450. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  451. };
  452. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  453. struct htt_option_tlv_header_t hdr;
  454. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  455. } POSTPACK;
  456. /*=== host -> target messages ===============================================*/
  457. enum htt_h2t_msg_type {
  458. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  459. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  460. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  461. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  462. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  463. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  464. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  465. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  466. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  467. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  468. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  469. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  470. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  471. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  472. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  473. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  474. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  475. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  476. /* keep this last */
  477. HTT_H2T_NUM_MSGS
  478. };
  479. /*
  480. * HTT host to target message type -
  481. * stored in bits 7:0 of the first word of the message
  482. */
  483. #define HTT_H2T_MSG_TYPE_M 0xff
  484. #define HTT_H2T_MSG_TYPE_S 0
  485. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  486. do { \
  487. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  488. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  489. } while (0)
  490. #define HTT_H2T_MSG_TYPE_GET(word) \
  491. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  492. /**
  493. * @brief host -> target version number request message definition
  494. *
  495. * |31 24|23 16|15 8|7 0|
  496. * |----------------+----------------+----------------+----------------|
  497. * | reserved | msg type |
  498. * |-------------------------------------------------------------------|
  499. * : option request TLV (optional) |
  500. * :...................................................................:
  501. *
  502. * The VER_REQ message may consist of a single 4-byte word, or may be
  503. * extended with TLVs that specify which HTT options the host is requesting
  504. * from the target.
  505. * The following option TLVs may be appended to the VER_REQ message:
  506. * - HL_SUPPRESS_TX_COMPL_IND
  507. * - HL_MAX_TX_QUEUE_GROUPS
  508. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  509. * may be appended to the VER_REQ message (but only one TLV of each type).
  510. *
  511. * Header fields:
  512. * - MSG_TYPE
  513. * Bits 7:0
  514. * Purpose: identifies this as a version number request message
  515. * Value: 0x0
  516. */
  517. #define HTT_VER_REQ_BYTES 4
  518. /* TBDXXX: figure out a reasonable number */
  519. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  520. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  521. /**
  522. * @brief HTT tx MSDU descriptor
  523. *
  524. * @details
  525. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  526. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  527. * the target firmware needs for the FW's tx processing, particularly
  528. * for creating the HW msdu descriptor.
  529. * The same HTT tx descriptor is used for HL and LL systems, though
  530. * a few fields within the tx descriptor are used only by LL or
  531. * only by HL.
  532. * The HTT tx descriptor is defined in two manners: by a struct with
  533. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  534. * definitions.
  535. * The target should use the struct def, for simplicitly and clarity,
  536. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  537. * neutral. Specifically, the host shall use the get/set macros built
  538. * around the mask + shift defs.
  539. */
  540. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  541. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  542. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  543. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  544. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  545. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  546. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  547. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  548. #define HTT_TX_VDEV_ID_WORD 0
  549. #define HTT_TX_VDEV_ID_MASK 0x3f
  550. #define HTT_TX_VDEV_ID_SHIFT 16
  551. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  552. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  553. #define HTT_TX_MSDU_LEN_DWORD 1
  554. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  555. /*
  556. * HTT_VAR_PADDR macros
  557. * Allow physical / bus addresses to be either a single 32-bit value,
  558. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  559. */
  560. #define HTT_VAR_PADDR32(var_name) \
  561. A_UINT32 var_name
  562. #define HTT_VAR_PADDR64_LE(var_name) \
  563. struct { \
  564. /* little-endian: lo precedes hi */ \
  565. A_UINT32 lo; \
  566. A_UINT32 hi; \
  567. } var_name
  568. /*
  569. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  570. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  571. * addresses are stored in a XXX-bit field.
  572. * This macro is used to define both htt_tx_msdu_desc32_t and
  573. * htt_tx_msdu_desc64_t structs.
  574. */
  575. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  576. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  577. { \
  578. /* DWORD 0: flags and meta-data */ \
  579. A_UINT32 \
  580. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  581. \
  582. /* pkt_subtype - \
  583. * Detailed specification of the tx frame contents, extending the \
  584. * general specification provided by pkt_type. \
  585. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  586. * pkt_type | pkt_subtype \
  587. * ============================================================== \
  588. * 802.3 | bit 0:3 - Reserved \
  589. * | bit 4: 0x0 - Copy-Engine Classification Results \
  590. * | not appended to the HTT message \
  591. * | 0x1 - Copy-Engine Classification Results \
  592. * | appended to the HTT message in the \
  593. * | format: \
  594. * | [HTT tx desc, frame header, \
  595. * | CE classification results] \
  596. * | The CE classification results begin \
  597. * | at the next 4-byte boundary after \
  598. * | the frame header. \
  599. * ------------+------------------------------------------------- \
  600. * Eth2 | bit 0:3 - Reserved \
  601. * | bit 4: 0x0 - Copy-Engine Classification Results \
  602. * | not appended to the HTT message \
  603. * | 0x1 - Copy-Engine Classification Results \
  604. * | appended to the HTT message. \
  605. * | See the above specification of the \
  606. * | CE classification results location. \
  607. * ------------+------------------------------------------------- \
  608. * native WiFi | bit 0:3 - Reserved \
  609. * | bit 4: 0x0 - Copy-Engine Classification Results \
  610. * | not appended to the HTT message \
  611. * | 0x1 - Copy-Engine Classification Results \
  612. * | appended to the HTT message. \
  613. * | See the above specification of the \
  614. * | CE classification results location. \
  615. * ------------+------------------------------------------------- \
  616. * mgmt | 0x0 - 802.11 MAC header absent \
  617. * | 0x1 - 802.11 MAC header present \
  618. * ------------+------------------------------------------------- \
  619. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  620. * | 0x1 - 802.11 MAC header present \
  621. * | bit 1: 0x0 - allow aggregation \
  622. * | 0x1 - don't allow aggregation \
  623. * | bit 2: 0x0 - perform encryption \
  624. * | 0x1 - don't perform encryption \
  625. * | bit 3: 0x0 - perform tx classification / queuing \
  626. * | 0x1 - don't perform tx classification; \
  627. * | insert the frame into the "misc" \
  628. * | tx queue \
  629. * | bit 4: 0x0 - Copy-Engine Classification Results \
  630. * | not appended to the HTT message \
  631. * | 0x1 - Copy-Engine Classification Results \
  632. * | appended to the HTT message. \
  633. * | See the above specification of the \
  634. * | CE classification results location. \
  635. */ \
  636. pkt_subtype: 5, \
  637. \
  638. /* pkt_type - \
  639. * General specification of the tx frame contents. \
  640. * The htt_pkt_type enum should be used to specify and check the \
  641. * value of this field. \
  642. */ \
  643. pkt_type: 3, \
  644. \
  645. /* vdev_id - \
  646. * ID for the vdev that is sending this tx frame. \
  647. * For certain non-standard packet types, e.g. pkt_type == raw \
  648. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  649. * This field is used primarily for determining where to queue \
  650. * broadcast and multicast frames. \
  651. */ \
  652. vdev_id: 6, \
  653. /* ext_tid - \
  654. * The extended traffic ID. \
  655. * If the TID is unknown, the extended TID is set to \
  656. * HTT_TX_EXT_TID_INVALID. \
  657. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  658. * value of the QoS TID. \
  659. * If the tx frame is non-QoS data, then the extended TID is set to \
  660. * HTT_TX_EXT_TID_NON_QOS. \
  661. * If the tx frame is multicast or broadcast, then the extended TID \
  662. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  663. */ \
  664. ext_tid: 5, \
  665. \
  666. /* postponed - \
  667. * This flag indicates whether the tx frame has been downloaded to \
  668. * the target before but discarded by the target, and now is being \
  669. * downloaded again; or if this is a new frame that is being \
  670. * downloaded for the first time. \
  671. * This flag allows the target to determine the correct order for \
  672. * transmitting new vs. old frames. \
  673. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  674. * This flag only applies to HL systems, since in LL systems, \
  675. * the tx flow control is handled entirely within the target. \
  676. */ \
  677. postponed: 1, \
  678. \
  679. /* extension - \
  680. * This flag indicates whether a HTT tx MSDU extension descriptor \
  681. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  682. * \
  683. * 0x0 - no extension MSDU descriptor is present \
  684. * 0x1 - an extension MSDU descriptor immediately follows the \
  685. * regular MSDU descriptor \
  686. */ \
  687. extension: 1, \
  688. \
  689. /* cksum_offload - \
  690. * This flag indicates whether checksum offload is enabled or not \
  691. * for this frame. Target FW use this flag to turn on HW checksumming \
  692. * 0x0 - No checksum offload \
  693. * 0x1 - L3 header checksum only \
  694. * 0x2 - L4 checksum only \
  695. * 0x3 - L3 header checksum + L4 checksum \
  696. */ \
  697. cksum_offload: 2, \
  698. \
  699. /* tx_comp_req - \
  700. * This flag indicates whether Tx Completion \
  701. * from fw is required or not. \
  702. * This flag is only relevant if tx completion is not \
  703. * universally enabled. \
  704. * For all LL systems, tx completion is mandatory, \
  705. * so this flag will be irrelevant. \
  706. * For HL systems tx completion is optional, but HL systems in which \
  707. * the bus throughput exceeds the WLAN throughput will \
  708. * probably want to always use tx completion, and thus \
  709. * would not check this flag. \
  710. * This flag is required when tx completions are not used universally, \
  711. * but are still required for certain tx frames for which \
  712. * an OTA delivery acknowledgment is needed by the host. \
  713. * In practice, this would be for HL systems in which the \
  714. * bus throughput is less than the WLAN throughput. \
  715. * \
  716. * 0x0 - Tx Completion Indication from Fw not required \
  717. * 0x1 - Tx Completion Indication from Fw is required \
  718. */ \
  719. tx_compl_req: 1; \
  720. \
  721. \
  722. /* DWORD 1: MSDU length and ID */ \
  723. A_UINT32 \
  724. len: 16, /* MSDU length, in bytes */ \
  725. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  726. * and this id is used to calculate fragmentation \
  727. * descriptor pointer inside the target based on \
  728. * the base address, configured inside the target. \
  729. */ \
  730. \
  731. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  732. /* frags_desc_ptr - \
  733. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  734. * where the tx frame's fragments reside in memory. \
  735. * This field only applies to LL systems, since in HL systems the \
  736. * (degenerate single-fragment) fragmentation descriptor is created \
  737. * within the target. \
  738. */ \
  739. _paddr__frags_desc_ptr_; \
  740. \
  741. /* DWORD 3 (or 4): peerid, chanfreq */ \
  742. /* \
  743. * Peer ID : Target can use this value to know which peer-id packet \
  744. * destined to. \
  745. * It's intended to be specified by host in case of NAWDS. \
  746. */ \
  747. A_UINT16 peerid; \
  748. \
  749. /* \
  750. * Channel frequency: This identifies the desired channel \
  751. * frequency (in mhz) for tx frames. This is used by FW to help \
  752. * determine when it is safe to transmit or drop frames for \
  753. * off-channel operation. \
  754. * The default value of zero indicates to FW that the corresponding \
  755. * VDEV's home channel (if there is one) is the desired channel \
  756. * frequency. \
  757. */ \
  758. A_UINT16 chanfreq; \
  759. \
  760. /* Reason reserved is commented is increasing the htt structure size \
  761. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  762. * A_UINT32 reserved_dword3_bits0_31; \
  763. */ \
  764. } POSTPACK
  765. /* define a htt_tx_msdu_desc32_t type */
  766. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  767. /* define a htt_tx_msdu_desc64_t type */
  768. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  769. /*
  770. * Make htt_tx_msdu_desc_t be an alias for either
  771. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  772. */
  773. #if HTT_PADDR64
  774. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  775. #else
  776. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  777. #endif
  778. /* decriptor information for Management frame*/
  779. /*
  780. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  781. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  782. */
  783. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  784. extern A_UINT32 mgmt_hdr_len;
  785. PREPACK struct htt_mgmt_tx_desc_t {
  786. A_UINT32 msg_type;
  787. #if HTT_PADDR64
  788. A_UINT64 frag_paddr; /* DMAble address of the data */
  789. #else
  790. A_UINT32 frag_paddr; /* DMAble address of the data */
  791. #endif
  792. A_UINT32 desc_id; /* returned to host during completion
  793. * to free the meory*/
  794. A_UINT32 len; /* Fragment length */
  795. A_UINT32 vdev_id; /* virtual device ID*/
  796. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  797. } POSTPACK;
  798. PREPACK struct htt_mgmt_tx_compl_ind {
  799. A_UINT32 desc_id;
  800. A_UINT32 status;
  801. } POSTPACK;
  802. /*
  803. * This SDU header size comes from the summation of the following:
  804. * 1. Max of:
  805. * a. Native WiFi header, for native WiFi frames: 24 bytes
  806. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  807. * b. 802.11 header, for raw frames: 36 bytes
  808. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  809. * QoS header, HT header)
  810. * c. 802.3 header, for ethernet frames: 14 bytes
  811. * (destination address, source address, ethertype / length)
  812. * 2. Max of:
  813. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  814. * b. IPv6 header, up through the Traffic Class: 2 bytes
  815. * 3. 802.1Q VLAN header: 4 bytes
  816. * 4. LLC/SNAP header: 8 bytes
  817. */
  818. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  819. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  820. #define HTT_TX_HDR_SIZE_ETHERNET 14
  821. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  822. A_COMPILE_TIME_ASSERT(
  823. htt_encap_hdr_size_max_check_nwifi,
  824. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  825. A_COMPILE_TIME_ASSERT(
  826. htt_encap_hdr_size_max_check_enet,
  827. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  828. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  829. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  830. #define HTT_TX_HDR_SIZE_802_1Q 4
  831. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  832. #define HTT_COMMON_TX_FRM_HDR_LEN \
  833. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  834. HTT_TX_HDR_SIZE_802_1Q + \
  835. HTT_TX_HDR_SIZE_LLC_SNAP)
  836. #define HTT_HL_TX_FRM_HDR_LEN \
  837. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  838. #define HTT_LL_TX_FRM_HDR_LEN \
  839. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  840. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  841. /* dword 0 */
  842. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  843. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  844. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  845. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  846. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  847. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  848. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  849. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  850. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  851. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  852. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  853. #define HTT_TX_DESC_PKT_TYPE_S 13
  854. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  855. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  856. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  857. #define HTT_TX_DESC_VDEV_ID_S 16
  858. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  859. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  860. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  861. #define HTT_TX_DESC_EXT_TID_S 22
  862. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  863. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  864. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  865. #define HTT_TX_DESC_POSTPONED_S 27
  866. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  867. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  868. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  869. #define HTT_TX_DESC_EXTENSION_S 28
  870. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  871. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  872. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  873. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  874. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  875. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  876. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  877. #define HTT_TX_DESC_TX_COMP_S 31
  878. /* dword 1 */
  879. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  880. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  881. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  882. #define HTT_TX_DESC_FRM_LEN_S 0
  883. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  884. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  885. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  886. #define HTT_TX_DESC_FRM_ID_S 16
  887. /* dword 2 */
  888. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  889. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  890. /* for systems using 64-bit format for bus addresses */
  891. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  892. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  893. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  894. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  895. /* for systems using 32-bit format for bus addresses */
  896. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  897. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  898. /* dword 3 */
  899. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  900. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  901. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  902. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  903. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  904. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  905. #if HTT_PADDR64
  906. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  907. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  908. #else
  909. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  910. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  911. #endif
  912. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  913. #define HTT_TX_DESC_PEER_ID_S 0
  914. /*
  915. * TEMPORARY:
  916. * The original definitions for the PEER_ID fields contained typos
  917. * (with _DESC_PADDR appended to this PEER_ID field name).
  918. * Retain deprecated original names for PEER_ID fields until all code that
  919. * refers to them has been updated.
  920. */
  921. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  922. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  923. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  924. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  925. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  926. HTT_TX_DESC_PEER_ID_M
  927. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  928. HTT_TX_DESC_PEER_ID_S
  929. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  930. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  931. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  932. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  933. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  934. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  935. #if HTT_PADDR64
  936. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  937. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  938. #else
  939. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  940. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  941. #endif
  942. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  943. #define HTT_TX_DESC_CHAN_FREQ_S 16
  944. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  945. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  946. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  947. do { \
  948. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  949. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  950. } while (0)
  951. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  952. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  953. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  954. do { \
  955. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  956. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  957. } while (0)
  958. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  959. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  960. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  961. do { \
  962. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  963. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  964. } while (0)
  965. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  966. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  967. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  968. do { \
  969. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  970. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  971. } while (0)
  972. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  973. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  974. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  975. do { \
  976. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  977. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  978. } while (0)
  979. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  980. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  981. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  982. do { \
  983. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  984. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  985. } while (0)
  986. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  987. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  988. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  989. do { \
  990. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  991. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  992. } while (0)
  993. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  994. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  995. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  996. do { \
  997. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  998. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  999. } while (0)
  1000. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1001. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1002. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1003. do { \
  1004. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1005. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1006. } while (0)
  1007. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1008. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1009. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1010. do { \
  1011. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1012. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1013. } while (0)
  1014. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1015. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1016. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1017. do { \
  1018. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1019. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1020. } while (0)
  1021. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1022. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1023. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1024. do { \
  1025. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1026. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1027. } while (0)
  1028. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1029. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1030. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1031. do { \
  1032. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1033. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1034. } while (0)
  1035. /* enums used in the HTT tx MSDU extension descriptor */
  1036. enum {
  1037. htt_tx_guard_interval_regular = 0,
  1038. htt_tx_guard_interval_short = 1,
  1039. };
  1040. enum {
  1041. htt_tx_preamble_type_ofdm = 0,
  1042. htt_tx_preamble_type_cck = 1,
  1043. htt_tx_preamble_type_ht = 2,
  1044. htt_tx_preamble_type_vht = 3,
  1045. };
  1046. enum {
  1047. htt_tx_bandwidth_5MHz = 0,
  1048. htt_tx_bandwidth_10MHz = 1,
  1049. htt_tx_bandwidth_20MHz = 2,
  1050. htt_tx_bandwidth_40MHz = 3,
  1051. htt_tx_bandwidth_80MHz = 4,
  1052. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1053. };
  1054. /**
  1055. * @brief HTT tx MSDU extension descriptor
  1056. * @details
  1057. * If the target supports HTT tx MSDU extension descriptors, the host has
  1058. * the option of appending the following struct following the regular
  1059. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1060. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1061. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1062. * tx specs for each frame.
  1063. */
  1064. PREPACK struct htt_tx_msdu_desc_ext_t {
  1065. /* DWORD 0: flags */
  1066. A_UINT32
  1067. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1068. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1069. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1070. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1071. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1072. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1073. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1074. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1075. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1076. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1077. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1078. /* DWORD 1: tx power, tx rate, tx BW */
  1079. A_UINT32
  1080. /* pwr -
  1081. * Specify what power the tx frame needs to be transmitted at.
  1082. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1083. * The value needs to be appropriately sign-extended when extracting
  1084. * the value from the message and storing it in a variable that is
  1085. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1086. * automatically handles this sign-extension.)
  1087. * If the transmission uses multiple tx chains, this power spec is
  1088. * the total transmit power, assuming incoherent combination of
  1089. * per-chain power to produce the total power.
  1090. */
  1091. pwr: 8,
  1092. /* mcs_mask -
  1093. * Specify the allowable values for MCS index (modulation and coding)
  1094. * to use for transmitting the frame.
  1095. *
  1096. * For HT / VHT preamble types, this mask directly corresponds to
  1097. * the HT or VHT MCS indices that are allowed. For each bit N set
  1098. * within the mask, MCS index N is allowed for transmitting the frame.
  1099. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1100. * rates versus OFDM rates, so the host has the option of specifying
  1101. * that the target must transmit the frame with CCK or OFDM rates
  1102. * (not HT or VHT), but leaving the decision to the target whether
  1103. * to use CCK or OFDM.
  1104. *
  1105. * For CCK and OFDM, the bits within this mask are interpreted as
  1106. * follows:
  1107. * bit 0 -> CCK 1 Mbps rate is allowed
  1108. * bit 1 -> CCK 2 Mbps rate is allowed
  1109. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1110. * bit 3 -> CCK 11 Mbps rate is allowed
  1111. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1112. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1113. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1114. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1115. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1116. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1117. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1118. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1119. *
  1120. * The MCS index specification needs to be compatible with the
  1121. * bandwidth mask specification. For example, a MCS index == 9
  1122. * specification is inconsistent with a preamble type == VHT,
  1123. * Nss == 1, and channel bandwidth == 20 MHz.
  1124. *
  1125. * Furthermore, the host has only a limited ability to specify to
  1126. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1127. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1128. */
  1129. mcs_mask: 12,
  1130. /* nss_mask -
  1131. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1132. * Each bit in this mask corresponds to a Nss value:
  1133. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1134. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1135. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1136. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1137. * The values in the Nss mask must be suitable for the recipient, e.g.
  1138. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1139. * recipient which only supports 2x2 MIMO.
  1140. */
  1141. nss_mask: 4,
  1142. /* guard_interval -
  1143. * Specify a htt_tx_guard_interval enum value to indicate whether
  1144. * the transmission should use a regular guard interval or a
  1145. * short guard interval.
  1146. */
  1147. guard_interval: 1,
  1148. /* preamble_type_mask -
  1149. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1150. * may choose from for transmitting this frame.
  1151. * The bits in this mask correspond to the values in the
  1152. * htt_tx_preamble_type enum. For example, to allow the target
  1153. * to transmit the frame as either CCK or OFDM, this field would
  1154. * be set to
  1155. * (1 << htt_tx_preamble_type_ofdm) |
  1156. * (1 << htt_tx_preamble_type_cck)
  1157. */
  1158. preamble_type_mask: 4,
  1159. reserved1_31_29: 3; /* unused, set to 0x0 */
  1160. /* DWORD 2: tx chain mask, tx retries */
  1161. A_UINT32
  1162. /* chain_mask - specify which chains to transmit from */
  1163. chain_mask: 4,
  1164. /* retry_limit -
  1165. * Specify the maximum number of transmissions, including the
  1166. * initial transmission, to attempt before giving up if no ack
  1167. * is received.
  1168. * If the tx rate is specified, then all retries shall use the
  1169. * same rate as the initial transmission.
  1170. * If no tx rate is specified, the target can choose whether to
  1171. * retain the original rate during the retransmissions, or to
  1172. * fall back to a more robust rate.
  1173. */
  1174. retry_limit: 4,
  1175. /* bandwidth_mask -
  1176. * Specify what channel widths may be used for the transmission.
  1177. * A value of zero indicates "don't care" - the target may choose
  1178. * the transmission bandwidth.
  1179. * The bits within this mask correspond to the htt_tx_bandwidth
  1180. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1181. * The bandwidth_mask must be consistent with the preamble_type_mask
  1182. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1183. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1184. */
  1185. bandwidth_mask: 6,
  1186. reserved2_31_14: 18; /* unused, set to 0x0 */
  1187. /* DWORD 3: tx expiry time (TSF) LSBs */
  1188. A_UINT32 expire_tsf_lo;
  1189. /* DWORD 4: tx expiry time (TSF) MSBs */
  1190. A_UINT32 expire_tsf_hi;
  1191. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1192. } POSTPACK;
  1193. /* DWORD 0 */
  1194. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1195. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1196. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1197. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1198. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1199. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1200. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1201. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1202. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1203. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1204. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1205. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1206. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1207. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1208. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1209. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1210. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1211. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1213. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1214. /* DWORD 1 */
  1215. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1216. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1217. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1218. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1219. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1220. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1221. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1222. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1223. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1224. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1225. /* DWORD 2 */
  1226. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1227. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1228. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1229. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1230. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1231. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1232. /* DWORD 0 */
  1233. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1234. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1235. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1236. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1237. do { \
  1238. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1239. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1240. } while (0)
  1241. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1242. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1243. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1244. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1245. do { \
  1246. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1247. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1248. } while (0)
  1249. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1250. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1251. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1252. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1253. do { \
  1254. HTT_CHECK_SET_VAL( \
  1255. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1256. ((_var) |= ((_val) \
  1257. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1258. } while (0)
  1259. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1260. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1261. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1262. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1263. do { \
  1264. HTT_CHECK_SET_VAL( \
  1265. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1266. ((_var) |= ((_val) \
  1267. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1268. } while (0)
  1269. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1270. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1271. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1272. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1273. do { \
  1274. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1275. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1276. } while (0)
  1277. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1278. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1279. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1280. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1281. do { \
  1282. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1283. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1284. } while (0)
  1285. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1286. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1287. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1288. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1289. do { \
  1290. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1291. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1292. } while (0)
  1293. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1294. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1295. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1296. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1297. do { \
  1298. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1299. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1300. } while (0)
  1301. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1302. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1303. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1304. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1305. do { \
  1306. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1307. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1308. } while (0)
  1309. /* DWORD 1 */
  1310. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1311. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1312. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1313. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1314. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1315. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1316. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1317. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1318. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1319. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1320. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1321. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1322. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1323. do { \
  1324. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1325. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1326. } while (0)
  1327. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1328. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1329. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1330. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1331. do { \
  1332. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1333. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1334. } while (0)
  1335. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1336. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1337. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1338. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1339. do { \
  1340. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1341. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1342. } while (0)
  1343. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1344. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1345. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1346. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1347. do { \
  1348. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1349. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1350. } while (0)
  1351. /* DWORD 2 */
  1352. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1353. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1354. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1355. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1356. do { \
  1357. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1358. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1359. } while (0)
  1360. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1361. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1362. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1363. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1364. do { \
  1365. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1366. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1367. } while (0)
  1368. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1369. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1370. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1371. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1372. do { \
  1373. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1374. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1375. } while (0)
  1376. typedef enum {
  1377. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1378. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1379. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1380. } htt_11ax_ltf_subtype_t;
  1381. typedef enum {
  1382. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1383. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1384. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1385. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1386. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1387. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1388. } htt_tx_ext2_preamble_type_t;
  1389. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1390. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1391. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1392. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1393. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1394. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1395. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1396. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1397. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1398. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1399. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1400. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1401. /**
  1402. * @brief HTT tx MSDU extension descriptor v2
  1403. * @details
  1404. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1405. * is received as tcl_exit_base->host_meta_info in firmware.
  1406. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1407. * are already part of tcl_exit_base.
  1408. */
  1409. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1410. /* DWORD 0: flags */
  1411. A_UINT32
  1412. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1413. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1414. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1415. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1416. valid_retries : 1, /* if set, tx retries spec is valid */
  1417. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1418. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1419. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1420. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1421. valid_key_flags : 1, /* if set, key flags is valid */
  1422. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1423. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1424. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1425. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1426. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1427. 1 = ENCRYPT,
  1428. 2 ~ 3 - Reserved */
  1429. /* retry_limit -
  1430. * Specify the maximum number of transmissions, including the
  1431. * initial transmission, to attempt before giving up if no ack
  1432. * is received.
  1433. * If the tx rate is specified, then all retries shall use the
  1434. * same rate as the initial transmission.
  1435. * If no tx rate is specified, the target can choose whether to
  1436. * retain the original rate during the retransmissions, or to
  1437. * fall back to a more robust rate.
  1438. */
  1439. retry_limit : 4,
  1440. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1441. * Valid only for 11ax preamble types HE_SU
  1442. * and HE_EXT_SU
  1443. */
  1444. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1445. * Valid only for 11ax preamble types HE_SU
  1446. * and HE_EXT_SU
  1447. */
  1448. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1449. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1450. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1451. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1452. */
  1453. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1454. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1455. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1456. * Use cases:
  1457. * Any time firmware uses TQM-BYPASS for Data
  1458. * TID, firmware expect host to set this bit.
  1459. */
  1460. /* DWORD 1: tx power, tx rate */
  1461. A_UINT32
  1462. power : 8, /* unit of the power field is 0.5 dbm
  1463. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1464. * signed value ranging from -64dbm to 63.5 dbm
  1465. */
  1466. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1467. * Setting more than one MCS isn't currently
  1468. * supported by the target (but is supported
  1469. * in the interface in case in the future
  1470. * the target supports specifications of
  1471. * a limited set of MCS values.
  1472. */
  1473. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1474. * Setting more than one Nss isn't currently
  1475. * supported by the target (but is supported
  1476. * in the interface in case in the future
  1477. * the target supports specifications of
  1478. * a limited set of Nss values.
  1479. */
  1480. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1481. update_peer_cache : 1; /* When set these custom values will be
  1482. * used for all packets, until the next
  1483. * update via this ext header.
  1484. * This is to make sure not all packets
  1485. * need to include this header.
  1486. */
  1487. /* DWORD 2: tx chain mask, tx retries */
  1488. A_UINT32
  1489. /* chain_mask - specify which chains to transmit from */
  1490. chain_mask : 8,
  1491. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1492. * TODO: Update Enum values for key_flags
  1493. */
  1494. /*
  1495. * Channel frequency: This identifies the desired channel
  1496. * frequency (in MHz) for tx frames. This is used by FW to help
  1497. * determine when it is safe to transmit or drop frames for
  1498. * off-channel operation.
  1499. * The default value of zero indicates to FW that the corresponding
  1500. * VDEV's home channel (if there is one) is the desired channel
  1501. * frequency.
  1502. */
  1503. chanfreq : 16;
  1504. /* DWORD 3: tx expiry time (TSF) LSBs */
  1505. A_UINT32 expire_tsf_lo;
  1506. /* DWORD 4: tx expiry time (TSF) MSBs */
  1507. A_UINT32 expire_tsf_hi;
  1508. /* DWORD 5: reserved
  1509. * This structure can be expanded further up to 60 bytes
  1510. * by adding further DWORDs as needed.
  1511. */
  1512. A_UINT32
  1513. /* learning_frame
  1514. * When this flag is set, this frame will be dropped by FW
  1515. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1516. */
  1517. learning_frame : 1,
  1518. rsvd0 : 31;
  1519. } POSTPACK;
  1520. /* DWORD 0 */
  1521. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1522. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1523. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1524. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1525. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1526. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1527. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1528. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1529. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1530. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1531. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1532. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1533. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1534. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1535. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1536. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1537. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1538. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1539. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1540. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1541. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1542. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1543. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1544. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1545. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1546. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1547. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1548. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1549. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1550. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1551. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1552. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1553. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1554. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1555. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1556. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1557. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1558. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1559. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1560. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1561. /* DWORD 1 */
  1562. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1563. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1564. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1565. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1566. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1567. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1568. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1569. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1570. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1571. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1572. /* DWORD 2 */
  1573. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1574. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1575. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1576. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1577. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1578. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1579. /* DWORD 5 */
  1580. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1582. /* DWORD 0 */
  1583. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1584. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1585. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1586. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1587. do { \
  1588. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1589. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1590. } while (0)
  1591. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1592. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1593. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1594. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1595. do { \
  1596. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1597. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1598. } while (0)
  1599. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1600. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1601. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1602. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1603. do { \
  1604. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1605. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1606. } while (0)
  1607. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1608. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1609. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1610. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1611. do { \
  1612. HTT_CHECK_SET_VAL( \
  1613. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1614. ((_var) |= ((_val) \
  1615. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1616. } while (0)
  1617. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1618. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1619. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1620. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1621. do { \
  1622. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1623. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1624. } while (0)
  1625. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1626. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1627. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1628. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1629. do { \
  1630. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1631. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1632. } while (0)
  1633. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1634. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1635. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1636. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1637. do { \
  1638. HTT_CHECK_SET_VAL( \
  1639. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1640. ((_var) |= ((_val) \
  1641. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1642. } while (0)
  1643. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1644. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1645. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1646. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1647. do { \
  1648. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1649. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1650. } while (0)
  1651. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1652. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1653. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1654. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1655. do { \
  1656. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1657. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1658. } while (0)
  1659. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1660. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1661. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1662. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1663. do { \
  1664. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1665. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1666. } while (0)
  1667. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1668. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1669. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1670. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1671. do { \
  1672. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1673. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1674. } while (0)
  1675. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1676. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1677. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1678. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1679. do { \
  1680. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1681. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1682. } while (0)
  1683. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1684. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1685. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1686. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1687. do { \
  1688. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1689. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1690. } while (0)
  1691. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1692. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1693. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1694. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1695. do { \
  1696. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1697. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1698. } while (0)
  1699. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1700. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1701. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1702. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1703. do { \
  1704. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1705. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1706. } while (0)
  1707. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1708. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1709. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1710. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1711. do { \
  1712. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1713. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1714. } while (0)
  1715. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1716. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1717. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1718. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1719. do { \
  1720. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1721. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1722. } while (0)
  1723. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1724. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1725. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1726. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1727. do { \
  1728. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1729. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1730. } while (0)
  1731. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1732. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1733. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1734. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1735. do { \
  1736. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1737. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1738. } while (0)
  1739. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1740. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1741. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1742. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1743. do { \
  1744. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1745. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1746. } while (0)
  1747. /* DWORD 1 */
  1748. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1749. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1750. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1751. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1752. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1753. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1754. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1755. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1756. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1757. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1758. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1759. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1760. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1761. do { \
  1762. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1763. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1764. } while (0)
  1765. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1766. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1767. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1768. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1769. do { \
  1770. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1771. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1772. } while (0)
  1773. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1774. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1775. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1776. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1777. do { \
  1778. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1779. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1780. } while (0)
  1781. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1782. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1783. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1784. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1785. do { \
  1786. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1787. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1788. } while (0)
  1789. /* DWORD 2 */
  1790. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1791. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1792. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1793. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1794. do { \
  1795. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1796. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1797. } while (0)
  1798. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1799. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1800. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1801. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1802. do { \
  1803. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1804. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1805. } while (0)
  1806. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1807. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1808. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1809. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1810. do { \
  1811. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1812. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1813. } while (0)
  1814. /* DWORD 5 */
  1815. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1816. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1817. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1818. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1819. do { \
  1820. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1821. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1822. } while (0)
  1823. typedef enum {
  1824. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1825. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1826. } htt_tcl_metadata_type;
  1827. /**
  1828. * @brief HTT TCL command number format
  1829. * @details
  1830. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1831. * available to firmware as tcl_exit_base->tcl_status_number.
  1832. * For regular / multicast packets host will send vdev and mac id and for
  1833. * NAWDS packets, host will send peer id.
  1834. * A_UINT32 is used to avoid endianness conversion problems.
  1835. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1836. */
  1837. typedef struct {
  1838. A_UINT32
  1839. type: 1, /* vdev_id based or peer_id based */
  1840. rsvd: 31;
  1841. } htt_tx_tcl_vdev_or_peer_t;
  1842. typedef struct {
  1843. A_UINT32
  1844. type: 1, /* vdev_id based or peer_id based */
  1845. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1846. vdev_id: 8,
  1847. pdev_id: 2,
  1848. host_inspected:1,
  1849. rsvd: 19;
  1850. } htt_tx_tcl_vdev_metadata;
  1851. typedef struct {
  1852. A_UINT32
  1853. type: 1, /* vdev_id based or peer_id based */
  1854. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1855. peer_id: 14,
  1856. rsvd: 16;
  1857. } htt_tx_tcl_peer_metadata;
  1858. PREPACK struct htt_tx_tcl_metadata {
  1859. union {
  1860. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1861. htt_tx_tcl_vdev_metadata vdev_meta;
  1862. htt_tx_tcl_peer_metadata peer_meta;
  1863. };
  1864. } POSTPACK;
  1865. /* DWORD 0 */
  1866. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1867. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1868. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1869. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1870. /* VDEV metadata */
  1871. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1872. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1873. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1874. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1875. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1876. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1877. /* PEER metadata */
  1878. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1879. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1880. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1881. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1882. HTT_TX_TCL_METADATA_TYPE_S)
  1883. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1884. do { \
  1885. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1886. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1887. } while (0)
  1888. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1889. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1890. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1891. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1892. do { \
  1893. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1894. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1895. } while (0)
  1896. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1897. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1898. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1899. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1900. do { \
  1901. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1902. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1903. } while (0)
  1904. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1905. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1906. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1907. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1908. do { \
  1909. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1910. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1911. } while (0)
  1912. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1913. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1914. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1915. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1916. do { \
  1917. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1918. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1919. } while (0)
  1920. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1921. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1922. HTT_TX_TCL_METADATA_PEER_ID_S)
  1923. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1924. do { \
  1925. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1926. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1927. } while (0)
  1928. typedef enum {
  1929. HTT_TX_FW2WBM_TX_STATUS_OK,
  1930. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1931. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1932. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1933. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1934. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  1935. HTT_TX_FW2WBM_TX_STATUS_MAX
  1936. } htt_tx_fw2wbm_tx_status_t;
  1937. typedef enum {
  1938. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  1939. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  1940. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1941. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1942. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1943. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1944. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1945. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1946. } htt_tx_fw2wbm_reinject_reason_t;
  1947. /**
  1948. * @brief HTT TX WBM Completion from firmware to host
  1949. * @details
  1950. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1951. * DWORD 3 and 4 for software based completions (Exception frames and
  1952. * TQM bypass frames)
  1953. * For software based completions, wbm_release_ring->release_source_module will
  1954. * be set to release_source_fw
  1955. */
  1956. PREPACK struct htt_tx_wbm_completion {
  1957. A_UINT32
  1958. sch_cmd_id: 24,
  1959. exception_frame: 1, /* If set, this packet was queued via exception path */
  1960. rsvd0_31_25: 7;
  1961. A_UINT32
  1962. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1963. * reception of an ACK or BA, this field indicates
  1964. * the RSSI of the received ACK or BA frame.
  1965. * When the frame is removed as result of a direct
  1966. * remove command from the SW, this field is set
  1967. * to 0x0 (which is never a valid value when real
  1968. * RSSI is available).
  1969. * Units: dB w.r.t noise floor
  1970. */
  1971. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1972. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1973. rsvd1_31_16: 16;
  1974. } POSTPACK;
  1975. /* DWORD 0 */
  1976. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1977. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1978. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1979. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1980. /* DWORD 1 */
  1981. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1982. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1983. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1984. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1985. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1986. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  1987. /* DWORD 0 */
  1988. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  1989. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  1990. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  1991. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  1992. do { \
  1993. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  1994. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  1995. } while (0)
  1996. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  1997. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  1998. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  1999. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2000. do { \
  2001. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2002. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2003. } while (0)
  2004. /* DWORD 1 */
  2005. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2006. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2007. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2008. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2009. do { \
  2010. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2011. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2012. } while (0)
  2013. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2014. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2015. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2016. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2017. do { \
  2018. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2019. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2020. } while (0)
  2021. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2022. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2023. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2024. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2025. do { \
  2026. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2027. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2028. } while (0)
  2029. /**
  2030. * @brief HTT TX WBM Completion from firmware to host
  2031. * @details
  2032. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2033. * (WBM) offload HW.
  2034. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2035. * For software based completions, release_source_module will
  2036. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2037. * struct wbm_release_ring and then switch to this after looking at
  2038. * release_source_module.
  2039. */
  2040. PREPACK struct htt_tx_wbm_completion_v2 {
  2041. A_UINT32
  2042. used_by_hw0; /* Refer to struct wbm_release_ring */
  2043. A_UINT32
  2044. used_by_hw1; /* Refer to struct wbm_release_ring */
  2045. A_UINT32
  2046. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2047. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2048. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2049. exception_frame: 1,
  2050. rsvd0: 12, /* For future use */
  2051. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2052. rsvd1: 1; /* For future use */
  2053. A_UINT32
  2054. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2055. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2056. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2057. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2058. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2059. */
  2060. A_UINT32
  2061. data1: 32;
  2062. A_UINT32
  2063. data2: 32;
  2064. A_UINT32
  2065. used_by_hw3; /* Refer to struct wbm_release_ring */
  2066. } POSTPACK;
  2067. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2068. /* DWORD 3 */
  2069. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2070. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2071. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2072. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2073. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2074. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2075. /* DWORD 3 */
  2076. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2077. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2078. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2079. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2080. do { \
  2081. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2082. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2083. } while (0)
  2084. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2085. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2086. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2087. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2088. do { \
  2089. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2090. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2091. } while (0)
  2092. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2093. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2094. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2095. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2096. do { \
  2097. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2098. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2099. } while (0)
  2100. /**
  2101. * @brief HTT TX WBM transmit status from firmware to host
  2102. * @details
  2103. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2104. * (WBM) offload HW.
  2105. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2106. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2107. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2108. */
  2109. PREPACK struct htt_tx_wbm_transmit_status {
  2110. A_UINT32
  2111. sch_cmd_id: 24,
  2112. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2113. * reception of an ACK or BA, this field indicates
  2114. * the RSSI of the received ACK or BA frame.
  2115. * When the frame is removed as result of a direct
  2116. * remove command from the SW, this field is set
  2117. * to 0x0 (which is never a valid value when real
  2118. * RSSI is available).
  2119. * Units: dB w.r.t noise floor
  2120. */
  2121. A_UINT32
  2122. reserved0: 32;
  2123. A_UINT32
  2124. reserved1: 32;
  2125. } POSTPACK;
  2126. /* DWORD 4 */
  2127. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2128. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2129. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2130. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2131. /* DWORD 4 */
  2132. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2133. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2134. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2135. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2136. do { \
  2137. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2138. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2139. } while (0)
  2140. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2141. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2142. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2143. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2144. do { \
  2145. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2146. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2147. } while (0)
  2148. /**
  2149. * @brief HTT TX WBM reinject status from firmware to host
  2150. * @details
  2151. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2152. * (WBM) offload HW.
  2153. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2154. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2155. */
  2156. PREPACK struct htt_tx_wbm_reinject_status {
  2157. A_UINT32
  2158. reserved0: 32;
  2159. A_UINT32
  2160. reserved1: 32;
  2161. A_UINT32
  2162. reserved2: 32;
  2163. } POSTPACK;
  2164. /**
  2165. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2166. * @details
  2167. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2168. * (WBM) offload HW.
  2169. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2170. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2171. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2172. * STA side.
  2173. */
  2174. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2175. A_UINT32
  2176. mec_sa_addr_31_0;
  2177. A_UINT32
  2178. mec_sa_addr_47_32: 16,
  2179. sa_ast_index: 16;
  2180. A_UINT32
  2181. vdev_id: 8,
  2182. reserved0: 24;
  2183. } POSTPACK;
  2184. /* DWORD 4 - mec_sa_addr_31_0 */
  2185. /* DWORD 5 */
  2186. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2187. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2188. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2189. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2190. /* DWORD 6 */
  2191. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2192. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2193. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2194. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2195. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2196. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2197. do { \
  2198. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2199. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2200. } while (0)
  2201. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2202. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2203. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2204. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2205. do { \
  2206. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2207. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2208. } while (0)
  2209. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2210. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2211. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2212. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2213. do { \
  2214. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2215. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2216. } while (0)
  2217. typedef enum {
  2218. TX_FLOW_PRIORITY_BE,
  2219. TX_FLOW_PRIORITY_HIGH,
  2220. TX_FLOW_PRIORITY_LOW,
  2221. } htt_tx_flow_priority_t;
  2222. typedef enum {
  2223. TX_FLOW_LATENCY_SENSITIVE,
  2224. TX_FLOW_LATENCY_INSENSITIVE,
  2225. } htt_tx_flow_latency_t;
  2226. typedef enum {
  2227. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2228. TX_FLOW_INTERACTIVE_TRAFFIC,
  2229. TX_FLOW_PERIODIC_TRAFFIC,
  2230. TX_FLOW_BURSTY_TRAFFIC,
  2231. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2232. } htt_tx_flow_traffic_pattern_t;
  2233. /**
  2234. * @brief HTT TX Flow search metadata format
  2235. * @details
  2236. * Host will set this metadata in flow table's flow search entry along with
  2237. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2238. * firmware and TQM ring if the flow search entry wins.
  2239. * This metadata is available to firmware in that first MSDU's
  2240. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2241. * to one of the available flows for specific tid and returns the tqm flow
  2242. * pointer as part of htt_tx_map_flow_info message.
  2243. */
  2244. PREPACK struct htt_tx_flow_metadata {
  2245. A_UINT32
  2246. rsvd0_1_0: 2,
  2247. tid: 4,
  2248. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2249. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2250. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2251. * Else choose final tid based on latency, priority.
  2252. */
  2253. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2254. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2255. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2256. } POSTPACK;
  2257. /* DWORD 0 */
  2258. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2259. #define HTT_TX_FLOW_METADATA_TID_S 2
  2260. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2261. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2262. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2263. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2264. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2265. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2266. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2267. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2268. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2269. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2270. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2271. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2272. /* DWORD 0 */
  2273. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2274. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2275. HTT_TX_FLOW_METADATA_TID_S)
  2276. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2277. do { \
  2278. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2279. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2280. } while (0)
  2281. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2282. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2283. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2284. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2285. do { \
  2286. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2287. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2288. } while (0)
  2289. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2290. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2291. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2292. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2293. do { \
  2294. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2295. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2296. } while (0)
  2297. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2298. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2299. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2300. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2301. do { \
  2302. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2303. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2304. } while (0)
  2305. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2306. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2307. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2308. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2309. do { \
  2310. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2311. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2312. } while (0)
  2313. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2314. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2315. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2316. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2317. do { \
  2318. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2319. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2320. } while (0)
  2321. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2322. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2323. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2324. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2325. do { \
  2326. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2327. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2328. } while (0)
  2329. /**
  2330. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2331. *
  2332. * @details
  2333. * HTT wds entry from source port learning
  2334. * Host will learn wds entries from rx and send this message to firmware
  2335. * to enable firmware to configure/delete AST entries for wds clients.
  2336. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2337. * and when SA's entry is deleted, firmware removes this AST entry
  2338. *
  2339. * The message would appear as follows:
  2340. *
  2341. * |31 30|29 |17 16|15 8|7 0|
  2342. * |----------------+----------------+----------------+----------------|
  2343. * | rsvd0 |PDVID| vdev_id | msg_type |
  2344. * |-------------------------------------------------------------------|
  2345. * | sa_addr_31_0 |
  2346. * |-------------------------------------------------------------------|
  2347. * | | ta_peer_id | sa_addr_47_32 |
  2348. * |-------------------------------------------------------------------|
  2349. * Where PDVID = pdev_id
  2350. *
  2351. * The message is interpreted as follows:
  2352. *
  2353. * dword0 - b'0:7 - msg_type: This will be set to
  2354. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2355. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2356. *
  2357. * dword0 - b'8:15 - vdev_id
  2358. *
  2359. * dword0 - b'16:17 - pdev_id
  2360. *
  2361. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2362. *
  2363. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2364. *
  2365. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2366. *
  2367. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2368. */
  2369. PREPACK struct htt_wds_entry {
  2370. A_UINT32
  2371. msg_type: 8,
  2372. vdev_id: 8,
  2373. pdev_id: 2,
  2374. rsvd0: 14;
  2375. A_UINT32 sa_addr_31_0;
  2376. A_UINT32
  2377. sa_addr_47_32: 16,
  2378. ta_peer_id: 14,
  2379. rsvd2: 2;
  2380. } POSTPACK;
  2381. /* DWORD 0 */
  2382. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2383. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2384. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2385. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2386. /* DWORD 2 */
  2387. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2388. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2389. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2390. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2391. /* DWORD 0 */
  2392. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2393. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2394. HTT_WDS_ENTRY_VDEV_ID_S)
  2395. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2396. do { \
  2397. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2398. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2399. } while (0)
  2400. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2401. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2402. HTT_WDS_ENTRY_PDEV_ID_S)
  2403. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2404. do { \
  2405. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2406. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2407. } while (0)
  2408. /* DWORD 2 */
  2409. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2410. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2411. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2412. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2413. do { \
  2414. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2415. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2416. } while (0)
  2417. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2418. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2419. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2420. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2421. do { \
  2422. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2423. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2424. } while (0)
  2425. /**
  2426. * @brief MAC DMA rx ring setup specification
  2427. * @details
  2428. * To allow for dynamic rx ring reconfiguration and to avoid race
  2429. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2430. * it uses. Instead, it sends this message to the target, indicating how
  2431. * the rx ring used by the host should be set up and maintained.
  2432. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2433. * specifications.
  2434. *
  2435. * |31 16|15 8|7 0|
  2436. * |---------------------------------------------------------------|
  2437. * header: | reserved | num rings | msg type |
  2438. * |---------------------------------------------------------------|
  2439. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2440. #if HTT_PADDR64
  2441. * | FW_IDX shadow register physical address (bits 63:32) |
  2442. #endif
  2443. * |---------------------------------------------------------------|
  2444. * | rx ring base physical address (bits 31:0) |
  2445. #if HTT_PADDR64
  2446. * | rx ring base physical address (bits 63:32) |
  2447. #endif
  2448. * |---------------------------------------------------------------|
  2449. * | rx ring buffer size | rx ring length |
  2450. * |---------------------------------------------------------------|
  2451. * | FW_IDX initial value | enabled flags |
  2452. * |---------------------------------------------------------------|
  2453. * | MSDU payload offset | 802.11 header offset |
  2454. * |---------------------------------------------------------------|
  2455. * | PPDU end offset | PPDU start offset |
  2456. * |---------------------------------------------------------------|
  2457. * | MPDU end offset | MPDU start offset |
  2458. * |---------------------------------------------------------------|
  2459. * | MSDU end offset | MSDU start offset |
  2460. * |---------------------------------------------------------------|
  2461. * | frag info offset | rx attention offset |
  2462. * |---------------------------------------------------------------|
  2463. * payload 2, if present, has the same format as payload 1
  2464. * Header fields:
  2465. * - MSG_TYPE
  2466. * Bits 7:0
  2467. * Purpose: identifies this as an rx ring configuration message
  2468. * Value: 0x2
  2469. * - NUM_RINGS
  2470. * Bits 15:8
  2471. * Purpose: indicates whether the host is setting up one rx ring or two
  2472. * Value: 1 or 2
  2473. * Payload:
  2474. * for systems using 64-bit format for bus addresses:
  2475. * - IDX_SHADOW_REG_PADDR_LO
  2476. * Bits 31:0
  2477. * Value: lower 4 bytes of physical address of the host's
  2478. * FW_IDX shadow register
  2479. * - IDX_SHADOW_REG_PADDR_HI
  2480. * Bits 31:0
  2481. * Value: upper 4 bytes of physical address of the host's
  2482. * FW_IDX shadow register
  2483. * - RING_BASE_PADDR_LO
  2484. * Bits 31:0
  2485. * Value: lower 4 bytes of physical address of the host's rx ring
  2486. * - RING_BASE_PADDR_HI
  2487. * Bits 31:0
  2488. * Value: uppper 4 bytes of physical address of the host's rx ring
  2489. * for systems using 32-bit format for bus addresses:
  2490. * - IDX_SHADOW_REG_PADDR
  2491. * Bits 31:0
  2492. * Value: physical address of the host's FW_IDX shadow register
  2493. * - RING_BASE_PADDR
  2494. * Bits 31:0
  2495. * Value: physical address of the host's rx ring
  2496. * - RING_LEN
  2497. * Bits 15:0
  2498. * Value: number of elements in the rx ring
  2499. * - RING_BUF_SZ
  2500. * Bits 31:16
  2501. * Value: size of the buffers referenced by the rx ring, in byte units
  2502. * - ENABLED_FLAGS
  2503. * Bits 15:0
  2504. * Value: 1-bit flags to show whether different rx fields are enabled
  2505. * bit 0: 802.11 header enabled (1) or disabled (0)
  2506. * bit 1: MSDU payload enabled (1) or disabled (0)
  2507. * bit 2: PPDU start enabled (1) or disabled (0)
  2508. * bit 3: PPDU end enabled (1) or disabled (0)
  2509. * bit 4: MPDU start enabled (1) or disabled (0)
  2510. * bit 5: MPDU end enabled (1) or disabled (0)
  2511. * bit 6: MSDU start enabled (1) or disabled (0)
  2512. * bit 7: MSDU end enabled (1) or disabled (0)
  2513. * bit 8: rx attention enabled (1) or disabled (0)
  2514. * bit 9: frag info enabled (1) or disabled (0)
  2515. * bit 10: unicast rx enabled (1) or disabled (0)
  2516. * bit 11: multicast rx enabled (1) or disabled (0)
  2517. * bit 12: ctrl rx enabled (1) or disabled (0)
  2518. * bit 13: mgmt rx enabled (1) or disabled (0)
  2519. * bit 14: null rx enabled (1) or disabled (0)
  2520. * bit 15: phy data rx enabled (1) or disabled (0)
  2521. * - IDX_INIT_VAL
  2522. * Bits 31:16
  2523. * Purpose: Specify the initial value for the FW_IDX.
  2524. * Value: the number of buffers initially present in the host's rx ring
  2525. * - OFFSET_802_11_HDR
  2526. * Bits 15:0
  2527. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2528. * - OFFSET_MSDU_PAYLOAD
  2529. * Bits 31:16
  2530. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2531. * - OFFSET_PPDU_START
  2532. * Bits 15:0
  2533. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2534. * - OFFSET_PPDU_END
  2535. * Bits 31:16
  2536. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2537. * - OFFSET_MPDU_START
  2538. * Bits 15:0
  2539. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2540. * - OFFSET_MPDU_END
  2541. * Bits 31:16
  2542. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2543. * - OFFSET_MSDU_START
  2544. * Bits 15:0
  2545. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2546. * - OFFSET_MSDU_END
  2547. * Bits 31:16
  2548. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2549. * - OFFSET_RX_ATTN
  2550. * Bits 15:0
  2551. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2552. * - OFFSET_FRAG_INFO
  2553. * Bits 31:16
  2554. * Value: offset in QUAD-bytes of frag info table
  2555. */
  2556. /* header fields */
  2557. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2558. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2559. /* payload fields */
  2560. /* for systems using a 64-bit format for bus addresses */
  2561. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2562. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2563. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2564. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2565. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2566. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2567. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2568. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2569. /* for systems using a 32-bit format for bus addresses */
  2570. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2571. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2572. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2573. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2574. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2575. #define HTT_RX_RING_CFG_LEN_S 0
  2576. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2577. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2578. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2579. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2580. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2581. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2582. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2583. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2584. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2585. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2586. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2587. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2588. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2589. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2590. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2591. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2592. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2593. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2594. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2595. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2596. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2597. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2598. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2599. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2600. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2601. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2602. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2603. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2604. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2605. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2606. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2607. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2608. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2609. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2610. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2611. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2612. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2613. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2614. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2615. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2616. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2617. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2618. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2619. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2620. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2621. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2622. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2623. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2624. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2625. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2626. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2627. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2628. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2629. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2630. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2631. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2632. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2633. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2634. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2635. #if HTT_PADDR64
  2636. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2637. #else
  2638. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2639. #endif
  2640. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2641. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2642. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2643. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2644. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2645. do { \
  2646. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2647. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2648. } while (0)
  2649. /* degenerate case for 32-bit fields */
  2650. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2651. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2652. ((_var) = (_val))
  2653. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2654. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2655. ((_var) = (_val))
  2656. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2657. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2658. ((_var) = (_val))
  2659. /* degenerate case for 32-bit fields */
  2660. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2661. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2662. ((_var) = (_val))
  2663. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2664. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2665. ((_var) = (_val))
  2666. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2667. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2668. ((_var) = (_val))
  2669. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2670. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2671. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2672. do { \
  2673. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2674. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2675. } while (0)
  2676. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2677. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2678. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2679. do { \
  2680. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2681. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2682. } while (0)
  2683. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2684. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2685. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2686. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2687. do { \
  2688. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2689. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2690. } while (0)
  2691. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2692. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2693. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2694. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2695. do { \
  2696. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2697. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2698. } while (0)
  2699. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2700. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2701. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2702. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2703. do { \
  2704. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2705. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2706. } while (0)
  2707. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2708. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2709. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2710. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2711. do { \
  2712. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2713. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2714. } while (0)
  2715. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2716. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2717. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2718. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2719. do { \
  2720. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2721. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2722. } while (0)
  2723. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2724. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2725. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2726. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2727. do { \
  2728. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2729. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2730. } while (0)
  2731. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2732. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2733. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2734. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2735. do { \
  2736. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2737. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2738. } while (0)
  2739. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2740. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2741. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2742. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2743. do { \
  2744. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2745. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2746. } while (0)
  2747. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2748. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2749. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2750. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2751. do { \
  2752. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2753. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2754. } while (0)
  2755. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2756. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2757. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2758. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2759. do { \
  2760. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2761. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2762. } while (0)
  2763. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2764. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2765. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2766. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2767. do { \
  2768. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2769. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2770. } while (0)
  2771. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2772. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2773. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2774. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2775. do { \
  2776. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2777. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2778. } while (0)
  2779. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2780. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2781. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2782. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2783. do { \
  2784. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2785. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2786. } while (0)
  2787. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2788. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2789. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2790. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2791. do { \
  2792. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2793. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2794. } while (0)
  2795. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2796. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2797. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2798. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2799. do { \
  2800. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2801. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2802. } while (0)
  2803. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2804. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2805. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2806. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2807. do { \
  2808. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2809. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2810. } while (0)
  2811. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2812. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2813. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2814. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2815. do { \
  2816. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2817. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2818. } while (0)
  2819. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2820. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2821. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2822. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2823. do { \
  2824. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2825. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2826. } while (0)
  2827. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2828. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2829. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2830. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2831. do { \
  2832. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2833. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2834. } while (0)
  2835. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2836. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2837. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2838. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2839. do { \
  2840. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2841. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2842. } while (0)
  2843. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2844. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2845. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2846. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2847. do { \
  2848. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2849. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2850. } while (0)
  2851. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2852. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2853. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2854. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2855. do { \
  2856. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2857. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2858. } while (0)
  2859. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2860. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2861. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2862. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2863. do { \
  2864. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2865. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2866. } while (0)
  2867. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2868. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2869. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2870. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2871. do { \
  2872. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2873. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2874. } while (0)
  2875. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2876. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2877. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2878. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2879. do { \
  2880. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2881. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2882. } while (0)
  2883. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2884. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2885. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2886. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2887. do { \
  2888. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2889. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2890. } while (0)
  2891. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2892. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2893. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2894. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2895. do { \
  2896. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2897. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2898. } while (0)
  2899. /**
  2900. * @brief host -> target FW statistics retrieve
  2901. *
  2902. * @details
  2903. * The following field definitions describe the format of the HTT host
  2904. * to target FW stats retrieve message. The message specifies the type of
  2905. * stats host wants to retrieve.
  2906. *
  2907. * |31 24|23 16|15 8|7 0|
  2908. * |-----------------------------------------------------------|
  2909. * | stats types request bitmask | msg type |
  2910. * |-----------------------------------------------------------|
  2911. * | stats types reset bitmask | reserved |
  2912. * |-----------------------------------------------------------|
  2913. * | stats type | config value |
  2914. * |-----------------------------------------------------------|
  2915. * | cookie LSBs |
  2916. * |-----------------------------------------------------------|
  2917. * | cookie MSBs |
  2918. * |-----------------------------------------------------------|
  2919. * Header fields:
  2920. * - MSG_TYPE
  2921. * Bits 7:0
  2922. * Purpose: identifies this is a stats upload request message
  2923. * Value: 0x3
  2924. * - UPLOAD_TYPES
  2925. * Bits 31:8
  2926. * Purpose: identifies which types of FW statistics to upload
  2927. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2928. * - RESET_TYPES
  2929. * Bits 31:8
  2930. * Purpose: identifies which types of FW statistics to reset
  2931. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2932. * - CFG_VAL
  2933. * Bits 23:0
  2934. * Purpose: give an opaque configuration value to the specified stats type
  2935. * Value: stats-type specific configuration value
  2936. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  2937. * bits 7:0 - how many per-MPDU byte counts to include in a record
  2938. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  2939. * bits 23:16 - how many per-MSDU byte counts to include in a record
  2940. * - CFG_STAT_TYPE
  2941. * Bits 31:24
  2942. * Purpose: specify which stats type (if any) the config value applies to
  2943. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  2944. * a valid configuration specification
  2945. * - COOKIE_LSBS
  2946. * Bits 31:0
  2947. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2948. * message with its preceding host->target stats request message.
  2949. * Value: LSBs of the opaque cookie specified by the host-side requestor
  2950. * - COOKIE_MSBS
  2951. * Bits 31:0
  2952. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2953. * message with its preceding host->target stats request message.
  2954. * Value: MSBs of the opaque cookie specified by the host-side requestor
  2955. */
  2956. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  2957. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  2958. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  2959. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  2960. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  2961. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  2962. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  2963. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  2964. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  2965. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  2966. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  2967. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  2968. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  2969. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  2970. do { \
  2971. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  2972. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  2973. } while (0)
  2974. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  2975. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  2976. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  2977. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  2978. do { \
  2979. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  2980. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  2981. } while (0)
  2982. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  2983. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  2984. HTT_H2T_STATS_REQ_CFG_VAL_S)
  2985. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  2986. do { \
  2987. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  2988. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  2989. } while (0)
  2990. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  2991. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  2992. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  2993. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  2994. do { \
  2995. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  2996. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  2997. } while (0)
  2998. /**
  2999. * @brief host -> target HTT out-of-band sync request
  3000. *
  3001. * @details
  3002. * The HTT SYNC tells the target to suspend processing of subsequent
  3003. * HTT host-to-target messages until some other target agent locally
  3004. * informs the target HTT FW that the current sync counter is equal to
  3005. * or greater than (in a modulo sense) the sync counter specified in
  3006. * the SYNC message.
  3007. * This allows other host-target components to synchronize their operation
  3008. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3009. * security key has been downloaded to and activated by the target.
  3010. * In the absence of any explicit synchronization counter value
  3011. * specification, the target HTT FW will use zero as the default current
  3012. * sync value.
  3013. *
  3014. * |31 24|23 16|15 8|7 0|
  3015. * |-----------------------------------------------------------|
  3016. * | reserved | sync count | msg type |
  3017. * |-----------------------------------------------------------|
  3018. * Header fields:
  3019. * - MSG_TYPE
  3020. * Bits 7:0
  3021. * Purpose: identifies this as a sync message
  3022. * Value: 0x4
  3023. * - SYNC_COUNT
  3024. * Bits 15:8
  3025. * Purpose: specifies what sync value the HTT FW will wait for from
  3026. * an out-of-band specification to resume its operation
  3027. * Value: in-band sync counter value to compare against the out-of-band
  3028. * counter spec.
  3029. * The HTT target FW will suspend its host->target message processing
  3030. * as long as
  3031. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3032. */
  3033. #define HTT_H2T_SYNC_MSG_SZ 4
  3034. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3035. #define HTT_H2T_SYNC_COUNT_S 8
  3036. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3037. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3038. HTT_H2T_SYNC_COUNT_S)
  3039. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3040. do { \
  3041. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3042. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3043. } while (0)
  3044. /**
  3045. * @brief HTT aggregation configuration
  3046. */
  3047. #define HTT_AGGR_CFG_MSG_SZ 4
  3048. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3049. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3050. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3051. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3052. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3053. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3054. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3055. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3056. do { \
  3057. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3058. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3059. } while (0)
  3060. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3061. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3062. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3063. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3064. do { \
  3065. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3066. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3067. } while (0)
  3068. /**
  3069. * @brief host -> target HTT configure max amsdu info per vdev
  3070. *
  3071. * @details
  3072. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3073. *
  3074. * |31 21|20 16|15 8|7 0|
  3075. * |-----------------------------------------------------------|
  3076. * | reserved | vdev id | max amsdu | msg type |
  3077. * |-----------------------------------------------------------|
  3078. * Header fields:
  3079. * - MSG_TYPE
  3080. * Bits 7:0
  3081. * Purpose: identifies this as a aggr cfg ex message
  3082. * Value: 0xa
  3083. * - MAX_NUM_AMSDU_SUBFRM
  3084. * Bits 15:8
  3085. * Purpose: max MSDUs per A-MSDU
  3086. * - VDEV_ID
  3087. * Bits 20:16
  3088. * Purpose: ID of the vdev to which this limit is applied
  3089. */
  3090. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3091. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3092. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3093. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3094. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3095. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3096. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3097. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3098. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3099. do { \
  3100. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3101. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3102. } while (0)
  3103. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3104. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3105. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3106. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3107. do { \
  3108. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3109. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3110. } while (0)
  3111. /**
  3112. * @brief HTT WDI_IPA Config Message
  3113. *
  3114. * @details
  3115. * The HTT WDI_IPA config message is created/sent by host at driver
  3116. * init time. It contains information about data structures used on
  3117. * WDI_IPA TX and RX path.
  3118. * TX CE ring is used for pushing packet metadata from IPA uC
  3119. * to WLAN FW
  3120. * TX Completion ring is used for generating TX completions from
  3121. * WLAN FW to IPA uC
  3122. * RX Indication ring is used for indicating RX packets from FW
  3123. * to IPA uC
  3124. * RX Ring2 is used as either completion ring or as second
  3125. * indication ring. when Ring2 is used as completion ring, IPA uC
  3126. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3127. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3128. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3129. * indicated in RX Indication ring. Please see WDI_IPA specification
  3130. * for more details.
  3131. * |31 24|23 16|15 8|7 0|
  3132. * |----------------+----------------+----------------+----------------|
  3133. * | tx pkt pool size | Rsvd | msg_type |
  3134. * |-------------------------------------------------------------------|
  3135. * | tx comp ring base (bits 31:0) |
  3136. #if HTT_PADDR64
  3137. * | tx comp ring base (bits 63:32) |
  3138. #endif
  3139. * |-------------------------------------------------------------------|
  3140. * | tx comp ring size |
  3141. * |-------------------------------------------------------------------|
  3142. * | tx comp WR_IDX physical address (bits 31:0) |
  3143. #if HTT_PADDR64
  3144. * | tx comp WR_IDX physical address (bits 63:32) |
  3145. #endif
  3146. * |-------------------------------------------------------------------|
  3147. * | tx CE WR_IDX physical address (bits 31:0) |
  3148. #if HTT_PADDR64
  3149. * | tx CE WR_IDX physical address (bits 63:32) |
  3150. #endif
  3151. * |-------------------------------------------------------------------|
  3152. * | rx indication ring base (bits 31:0) |
  3153. #if HTT_PADDR64
  3154. * | rx indication ring base (bits 63:32) |
  3155. #endif
  3156. * |-------------------------------------------------------------------|
  3157. * | rx indication ring size |
  3158. * |-------------------------------------------------------------------|
  3159. * | rx ind RD_IDX physical address (bits 31:0) |
  3160. #if HTT_PADDR64
  3161. * | rx ind RD_IDX physical address (bits 63:32) |
  3162. #endif
  3163. * |-------------------------------------------------------------------|
  3164. * | rx ind WR_IDX physical address (bits 31:0) |
  3165. #if HTT_PADDR64
  3166. * | rx ind WR_IDX physical address (bits 63:32) |
  3167. #endif
  3168. * |-------------------------------------------------------------------|
  3169. * |-------------------------------------------------------------------|
  3170. * | rx ring2 base (bits 31:0) |
  3171. #if HTT_PADDR64
  3172. * | rx ring2 base (bits 63:32) |
  3173. #endif
  3174. * |-------------------------------------------------------------------|
  3175. * | rx ring2 size |
  3176. * |-------------------------------------------------------------------|
  3177. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3178. #if HTT_PADDR64
  3179. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3180. #endif
  3181. * |-------------------------------------------------------------------|
  3182. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3183. #if HTT_PADDR64
  3184. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3185. #endif
  3186. * |-------------------------------------------------------------------|
  3187. *
  3188. * Header fields:
  3189. * Header fields:
  3190. * - MSG_TYPE
  3191. * Bits 7:0
  3192. * Purpose: Identifies this as WDI_IPA config message
  3193. * value: = 0x8
  3194. * - TX_PKT_POOL_SIZE
  3195. * Bits 15:0
  3196. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3197. * WDI_IPA TX path
  3198. * For systems using 32-bit format for bus addresses:
  3199. * - TX_COMP_RING_BASE_ADDR
  3200. * Bits 31:0
  3201. * Purpose: TX Completion Ring base address in DDR
  3202. * - TX_COMP_RING_SIZE
  3203. * Bits 31:0
  3204. * Purpose: TX Completion Ring size (must be power of 2)
  3205. * - TX_COMP_WR_IDX_ADDR
  3206. * Bits 31:0
  3207. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3208. * updates the Write Index for WDI_IPA TX completion ring
  3209. * - TX_CE_WR_IDX_ADDR
  3210. * Bits 31:0
  3211. * Purpose: DDR address where IPA uC
  3212. * updates the WR Index for TX CE ring
  3213. * (needed for fusion platforms)
  3214. * - RX_IND_RING_BASE_ADDR
  3215. * Bits 31:0
  3216. * Purpose: RX Indication Ring base address in DDR
  3217. * - RX_IND_RING_SIZE
  3218. * Bits 31:0
  3219. * Purpose: RX Indication Ring size
  3220. * - RX_IND_RD_IDX_ADDR
  3221. * Bits 31:0
  3222. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3223. * RX indication ring
  3224. * - RX_IND_WR_IDX_ADDR
  3225. * Bits 31:0
  3226. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3227. * updates the Write Index for WDI_IPA RX indication ring
  3228. * - RX_RING2_BASE_ADDR
  3229. * Bits 31:0
  3230. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3231. * - RX_RING2_SIZE
  3232. * Bits 31:0
  3233. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3234. * - RX_RING2_RD_IDX_ADDR
  3235. * Bits 31:0
  3236. * Purpose: If Second RX ring is Indication ring, DDR address where
  3237. * IPA uC updates the Read Index for Ring2.
  3238. * If Second RX ring is completion ring, this is NOT used
  3239. * - RX_RING2_WR_IDX_ADDR
  3240. * Bits 31:0
  3241. * Purpose: If Second RX ring is Indication ring, DDR address where
  3242. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3243. * If second RX ring is completion ring, DDR address where
  3244. * IPA uC updates the Write Index for Ring 2.
  3245. * For systems using 64-bit format for bus addresses:
  3246. * - TX_COMP_RING_BASE_ADDR_LO
  3247. * Bits 31:0
  3248. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3249. * - TX_COMP_RING_BASE_ADDR_HI
  3250. * Bits 31:0
  3251. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3252. * - TX_COMP_RING_SIZE
  3253. * Bits 31:0
  3254. * Purpose: TX Completion Ring size (must be power of 2)
  3255. * - TX_COMP_WR_IDX_ADDR_LO
  3256. * Bits 31:0
  3257. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3258. * Lower 4 bytes of DDR address where WIFI FW
  3259. * updates the Write Index for WDI_IPA TX completion ring
  3260. * - TX_COMP_WR_IDX_ADDR_HI
  3261. * Bits 31:0
  3262. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3263. * Higher 4 bytes of DDR address where WIFI FW
  3264. * updates the Write Index for WDI_IPA TX completion ring
  3265. * - TX_CE_WR_IDX_ADDR_LO
  3266. * Bits 31:0
  3267. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3268. * updates the WR Index for TX CE ring
  3269. * (needed for fusion platforms)
  3270. * - TX_CE_WR_IDX_ADDR_HI
  3271. * Bits 31:0
  3272. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3273. * updates the WR Index for TX CE ring
  3274. * (needed for fusion platforms)
  3275. * - RX_IND_RING_BASE_ADDR_LO
  3276. * Bits 31:0
  3277. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3278. * - RX_IND_RING_BASE_ADDR_HI
  3279. * Bits 31:0
  3280. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3281. * - RX_IND_RING_SIZE
  3282. * Bits 31:0
  3283. * Purpose: RX Indication Ring size
  3284. * - RX_IND_RD_IDX_ADDR_LO
  3285. * Bits 31:0
  3286. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3287. * for WDI_IPA RX indication ring
  3288. * - RX_IND_RD_IDX_ADDR_HI
  3289. * Bits 31:0
  3290. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3291. * for WDI_IPA RX indication ring
  3292. * - RX_IND_WR_IDX_ADDR_LO
  3293. * Bits 31:0
  3294. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3295. * Lower 4 bytes of DDR address where WIFI FW
  3296. * updates the Write Index for WDI_IPA RX indication ring
  3297. * - RX_IND_WR_IDX_ADDR_HI
  3298. * Bits 31:0
  3299. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3300. * Higher 4 bytes of DDR address where WIFI FW
  3301. * updates the Write Index for WDI_IPA RX indication ring
  3302. * - RX_RING2_BASE_ADDR_LO
  3303. * Bits 31:0
  3304. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3305. * - RX_RING2_BASE_ADDR_HI
  3306. * Bits 31:0
  3307. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3308. * - RX_RING2_SIZE
  3309. * Bits 31:0
  3310. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3311. * - RX_RING2_RD_IDX_ADDR_LO
  3312. * Bits 31:0
  3313. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3314. * DDR address where IPA uC updates the Read Index for Ring2.
  3315. * If Second RX ring is completion ring, this is NOT used
  3316. * - RX_RING2_RD_IDX_ADDR_HI
  3317. * Bits 31:0
  3318. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3319. * DDR address where IPA uC updates the Read Index for Ring2.
  3320. * If Second RX ring is completion ring, this is NOT used
  3321. * - RX_RING2_WR_IDX_ADDR_LO
  3322. * Bits 31:0
  3323. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3324. * DDR address where WIFI FW updates the Write Index
  3325. * for WDI_IPA RX ring2
  3326. * If second RX ring is completion ring, lower 4 bytes of
  3327. * DDR address where IPA uC updates the Write Index for Ring 2.
  3328. * - RX_RING2_WR_IDX_ADDR_HI
  3329. * Bits 31:0
  3330. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3331. * DDR address where WIFI FW updates the Write Index
  3332. * for WDI_IPA RX ring2
  3333. * If second RX ring is completion ring, higher 4 bytes of
  3334. * DDR address where IPA uC updates the Write Index for Ring 2.
  3335. */
  3336. #if HTT_PADDR64
  3337. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3338. #else
  3339. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3340. #endif
  3341. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3342. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3343. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3344. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3345. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3346. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3347. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3348. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3349. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3350. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3351. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3352. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3353. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3354. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3355. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3356. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3357. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3358. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3359. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3360. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3361. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3362. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3363. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3364. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3365. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3366. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3367. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3368. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3369. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3370. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3371. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3372. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3373. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3374. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3375. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3376. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3377. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3378. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3379. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3380. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3381. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3382. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3383. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3384. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3385. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3386. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3387. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3388. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3389. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3390. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3391. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3392. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3393. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3394. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3395. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3396. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3397. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3398. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3399. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3400. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3401. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3402. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3403. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3404. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3405. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3406. do { \
  3407. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3408. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3409. } while (0)
  3410. /* for systems using 32-bit format for bus addr */
  3411. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3412. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3413. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3414. do { \
  3415. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3416. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3417. } while (0)
  3418. /* for systems using 64-bit format for bus addr */
  3419. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3420. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3421. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3422. do { \
  3423. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3424. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3425. } while (0)
  3426. /* for systems using 64-bit format for bus addr */
  3427. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3428. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3429. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3430. do { \
  3431. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3432. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3433. } while (0)
  3434. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3435. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3436. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3437. do { \
  3438. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3439. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3440. } while (0)
  3441. /* for systems using 32-bit format for bus addr */
  3442. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3443. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3444. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3445. do { \
  3446. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3447. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3448. } while (0)
  3449. /* for systems using 64-bit format for bus addr */
  3450. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3451. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3452. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3453. do { \
  3454. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3455. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3456. } while (0)
  3457. /* for systems using 64-bit format for bus addr */
  3458. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3459. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3460. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3461. do { \
  3462. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3463. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3464. } while (0)
  3465. /* for systems using 32-bit format for bus addr */
  3466. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3467. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3468. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3469. do { \
  3470. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3471. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3472. } while (0)
  3473. /* for systems using 64-bit format for bus addr */
  3474. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3475. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3476. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3477. do { \
  3478. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3479. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3480. } while (0)
  3481. /* for systems using 64-bit format for bus addr */
  3482. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3483. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3484. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3485. do { \
  3486. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3487. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3488. } while (0)
  3489. /* for systems using 32-bit format for bus addr */
  3490. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3491. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3492. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3493. do { \
  3494. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3495. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3496. } while (0)
  3497. /* for systems using 64-bit format for bus addr */
  3498. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3499. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3500. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3501. do { \
  3502. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3503. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3504. } while (0)
  3505. /* for systems using 64-bit format for bus addr */
  3506. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3507. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3508. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3509. do { \
  3510. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3511. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3512. } while (0)
  3513. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3514. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3515. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3516. do { \
  3517. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3518. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3519. } while (0)
  3520. /* for systems using 32-bit format for bus addr */
  3521. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3522. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3523. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3524. do { \
  3525. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3526. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3527. } while (0)
  3528. /* for systems using 64-bit format for bus addr */
  3529. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3530. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3531. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3532. do { \
  3533. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3534. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3535. } while (0)
  3536. /* for systems using 64-bit format for bus addr */
  3537. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3538. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3539. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3540. do { \
  3541. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3542. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3543. } while (0)
  3544. /* for systems using 32-bit format for bus addr */
  3545. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3546. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3547. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3548. do { \
  3549. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3550. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3551. } while (0)
  3552. /* for systems using 64-bit format for bus addr */
  3553. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3554. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3555. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3556. do { \
  3557. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3558. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3559. } while (0)
  3560. /* for systems using 64-bit format for bus addr */
  3561. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3562. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3563. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3564. do { \
  3565. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3566. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3567. } while (0)
  3568. /* for systems using 32-bit format for bus addr */
  3569. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3570. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3571. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3572. do { \
  3573. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3574. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3575. } while (0)
  3576. /* for systems using 64-bit format for bus addr */
  3577. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3578. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3579. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3580. do { \
  3581. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3582. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3583. } while (0)
  3584. /* for systems using 64-bit format for bus addr */
  3585. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3586. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3587. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3588. do { \
  3589. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3590. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3591. } while (0)
  3592. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3593. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3594. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3595. do { \
  3596. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3597. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3598. } while (0)
  3599. /* for systems using 32-bit format for bus addr */
  3600. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3601. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3602. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3603. do { \
  3604. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3605. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3606. } while (0)
  3607. /* for systems using 64-bit format for bus addr */
  3608. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3609. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3610. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3611. do { \
  3612. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3613. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3614. } while (0)
  3615. /* for systems using 64-bit format for bus addr */
  3616. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3617. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3618. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3619. do { \
  3620. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3621. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3622. } while (0)
  3623. /* for systems using 32-bit format for bus addr */
  3624. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3625. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3626. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3627. do { \
  3628. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3629. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3630. } while (0)
  3631. /* for systems using 64-bit format for bus addr */
  3632. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3633. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3634. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3635. do { \
  3636. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3637. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3638. } while (0)
  3639. /* for systems using 64-bit format for bus addr */
  3640. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3641. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3642. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3643. do { \
  3644. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3645. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3646. } while (0)
  3647. /*
  3648. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3649. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3650. * addresses are stored in a XXX-bit field.
  3651. * This macro is used to define both htt_wdi_ipa_config32_t and
  3652. * htt_wdi_ipa_config64_t structs.
  3653. */
  3654. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3655. _paddr__tx_comp_ring_base_addr_, \
  3656. _paddr__tx_comp_wr_idx_addr_, \
  3657. _paddr__tx_ce_wr_idx_addr_, \
  3658. _paddr__rx_ind_ring_base_addr_, \
  3659. _paddr__rx_ind_rd_idx_addr_, \
  3660. _paddr__rx_ind_wr_idx_addr_, \
  3661. _paddr__rx_ring2_base_addr_,\
  3662. _paddr__rx_ring2_rd_idx_addr_,\
  3663. _paddr__rx_ring2_wr_idx_addr_) \
  3664. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3665. { \
  3666. /* DWORD 0: flags and meta-data */ \
  3667. A_UINT32 \
  3668. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3669. reserved: 8, \
  3670. tx_pkt_pool_size: 16;\
  3671. /* DWORD 1 */\
  3672. _paddr__tx_comp_ring_base_addr_;\
  3673. /* DWORD 2 (or 3)*/\
  3674. A_UINT32 tx_comp_ring_size;\
  3675. /* DWORD 3 (or 4)*/\
  3676. _paddr__tx_comp_wr_idx_addr_;\
  3677. /* DWORD 4 (or 6)*/\
  3678. _paddr__tx_ce_wr_idx_addr_;\
  3679. /* DWORD 5 (or 8)*/\
  3680. _paddr__rx_ind_ring_base_addr_;\
  3681. /* DWORD 6 (or 10)*/\
  3682. A_UINT32 rx_ind_ring_size;\
  3683. /* DWORD 7 (or 11)*/\
  3684. _paddr__rx_ind_rd_idx_addr_;\
  3685. /* DWORD 8 (or 13)*/\
  3686. _paddr__rx_ind_wr_idx_addr_;\
  3687. /* DWORD 9 (or 15)*/\
  3688. _paddr__rx_ring2_base_addr_;\
  3689. /* DWORD 10 (or 17) */\
  3690. A_UINT32 rx_ring2_size;\
  3691. /* DWORD 11 (or 18) */\
  3692. _paddr__rx_ring2_rd_idx_addr_;\
  3693. /* DWORD 12 (or 20) */\
  3694. _paddr__rx_ring2_wr_idx_addr_;\
  3695. } POSTPACK
  3696. /* define a htt_wdi_ipa_config32_t type */
  3697. TEMPLATE_HTT_WDI_IPA_CONFIG_T(32, HTT_VAR_PADDR32(tx_comp_ring_base_addr), HTT_VAR_PADDR32(tx_comp_wr_idx_addr), HTT_VAR_PADDR32(tx_ce_wr_idx_addr), HTT_VAR_PADDR32(rx_ind_ring_base_addr), HTT_VAR_PADDR32(rx_ind_rd_idx_addr),HTT_VAR_PADDR32(rx_ind_wr_idx_addr), HTT_VAR_PADDR32(rx_ring2_base_addr), HTT_VAR_PADDR32(rx_ring2_rd_idx_addr), HTT_VAR_PADDR32(rx_ring2_wr_idx_addr));
  3698. /* define a htt_wdi_ipa_config64_t type */
  3699. TEMPLATE_HTT_WDI_IPA_CONFIG_T(64, HTT_VAR_PADDR64_LE(tx_comp_ring_base_addr), HTT_VAR_PADDR64_LE(tx_comp_wr_idx_addr), HTT_VAR_PADDR64_LE(tx_ce_wr_idx_addr), HTT_VAR_PADDR64_LE(rx_ind_ring_base_addr), HTT_VAR_PADDR64_LE(rx_ind_rd_idx_addr), HTT_VAR_PADDR64_LE(rx_ind_wr_idx_addr), HTT_VAR_PADDR64_LE(rx_ring2_base_addr), HTT_VAR_PADDR64_LE(rx_ring2_rd_idx_addr), HTT_VAR_PADDR64_LE(rx_ring2_wr_idx_addr));
  3700. #if HTT_PADDR64
  3701. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3702. #else
  3703. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3704. #endif
  3705. enum htt_wdi_ipa_op_code {
  3706. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3707. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3708. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3709. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3710. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3711. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3712. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3713. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3714. /* keep this last */
  3715. HTT_WDI_IPA_OPCODE_MAX
  3716. };
  3717. /**
  3718. * @brief HTT WDI_IPA Operation Request Message
  3719. *
  3720. * @details
  3721. * HTT WDI_IPA Operation Request message is sent by host
  3722. * to either suspend or resume WDI_IPA TX or RX path.
  3723. * |31 24|23 16|15 8|7 0|
  3724. * |----------------+----------------+----------------+----------------|
  3725. * | op_code | Rsvd | msg_type |
  3726. * |-------------------------------------------------------------------|
  3727. *
  3728. * Header fields:
  3729. * - MSG_TYPE
  3730. * Bits 7:0
  3731. * Purpose: Identifies this as WDI_IPA Operation Request message
  3732. * value: = 0x9
  3733. * - OP_CODE
  3734. * Bits 31:16
  3735. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3736. * value: = enum htt_wdi_ipa_op_code
  3737. */
  3738. PREPACK struct htt_wdi_ipa_op_request_t
  3739. {
  3740. /* DWORD 0: flags and meta-data */
  3741. A_UINT32
  3742. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3743. reserved: 8,
  3744. op_code: 16;
  3745. } POSTPACK;
  3746. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3747. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3748. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3749. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3750. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3751. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3752. do { \
  3753. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3754. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3755. } while (0)
  3756. /*
  3757. * @brief host -> target HTT_SRING_SETUP message
  3758. *
  3759. * @details
  3760. * After target is booted up, Host can send SRING setup message for
  3761. * each host facing LMAC SRING. Target setups up HW registers based
  3762. * on setup message and confirms back to Host if response_required is set.
  3763. * Host should wait for confirmation message before sending new SRING
  3764. * setup message
  3765. *
  3766. * The message would appear as follows:
  3767. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3768. * |--------------- +-----------------+----------------+------------------|
  3769. * | ring_type | ring_id | pdev_id | msg_type |
  3770. * |----------------------------------------------------------------------|
  3771. * | ring_base_addr_lo |
  3772. * |----------------------------------------------------------------------|
  3773. * | ring_base_addr_hi |
  3774. * |----------------------------------------------------------------------|
  3775. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3776. * |----------------------------------------------------------------------|
  3777. * | ring_head_offset32_remote_addr_lo |
  3778. * |----------------------------------------------------------------------|
  3779. * | ring_head_offset32_remote_addr_hi |
  3780. * |----------------------------------------------------------------------|
  3781. * | ring_tail_offset32_remote_addr_lo |
  3782. * |----------------------------------------------------------------------|
  3783. * | ring_tail_offset32_remote_addr_hi |
  3784. * |----------------------------------------------------------------------|
  3785. * | ring_msi_addr_lo |
  3786. * |----------------------------------------------------------------------|
  3787. * | ring_msi_addr_hi |
  3788. * |----------------------------------------------------------------------|
  3789. * | ring_msi_data |
  3790. * |----------------------------------------------------------------------|
  3791. * | intr_timer_th |IM| intr_batch_counter_th |
  3792. * |----------------------------------------------------------------------|
  3793. * | reserved |RR|PTCF| intr_low_threshold |
  3794. * |----------------------------------------------------------------------|
  3795. * Where
  3796. * IM = sw_intr_mode
  3797. * RR = response_required
  3798. * PTCF = prefetch_timer_cfg
  3799. *
  3800. * The message is interpreted as follows:
  3801. * dword0 - b'0:7 - msg_type: This will be set to
  3802. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3803. * b'8:15 - pdev_id:
  3804. * 0 (for rings at SOC/UMAC level),
  3805. * 1/2/3 mac id (for rings at LMAC level)
  3806. * b'16:23 - ring_id: identify which ring is to setup,
  3807. * more details can be got from enum htt_srng_ring_id
  3808. * b'24:31 - ring_type: identify type of host rings,
  3809. * more details can be got from enum htt_srng_ring_type
  3810. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3811. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3812. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3813. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3814. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3815. * SW_TO_HW_RING.
  3816. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3817. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3818. * Lower 32 bits of memory address of the remote variable
  3819. * storing the 4-byte word offset that identifies the head
  3820. * element within the ring.
  3821. * (The head offset variable has type A_UINT32.)
  3822. * Valid for HW_TO_SW and SW_TO_SW rings.
  3823. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3824. * Upper 32 bits of memory address of the remote variable
  3825. * storing the 4-byte word offset that identifies the head
  3826. * element within the ring.
  3827. * (The head offset variable has type A_UINT32.)
  3828. * Valid for HW_TO_SW and SW_TO_SW rings.
  3829. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3830. * Lower 32 bits of memory address of the remote variable
  3831. * storing the 4-byte word offset that identifies the tail
  3832. * element within the ring.
  3833. * (The tail offset variable has type A_UINT32.)
  3834. * Valid for HW_TO_SW and SW_TO_SW rings.
  3835. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3836. * Upper 32 bits of memory address of the remote variable
  3837. * storing the 4-byte word offset that identifies the tail
  3838. * element within the ring.
  3839. * (The tail offset variable has type A_UINT32.)
  3840. * Valid for HW_TO_SW and SW_TO_SW rings.
  3841. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3842. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3843. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3844. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3845. * dword10 - b'0:31 - ring_msi_data: MSI data
  3846. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3847. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3848. * dword11 - b'0:14 - intr_batch_counter_th:
  3849. * batch counter threshold is in units of 4-byte words.
  3850. * HW internally maintains and increments batch count.
  3851. * (see SRING spec for detail description).
  3852. * When batch count reaches threshold value, an interrupt
  3853. * is generated by HW.
  3854. * b'15 - sw_intr_mode:
  3855. * This configuration shall be static.
  3856. * Only programmed at power up.
  3857. * 0: generate pulse style sw interrupts
  3858. * 1: generate level style sw interrupts
  3859. * b'16:31 - intr_timer_th:
  3860. * The timer init value when timer is idle or is
  3861. * initialized to start downcounting.
  3862. * In 8us units (to cover a range of 0 to 524 ms)
  3863. * dword12 - b'0:15 - intr_low_threshold:
  3864. * Used only by Consumer ring to generate ring_sw_int_p.
  3865. * Ring entries low threshold water mark, that is used
  3866. * in combination with the interrupt timer as well as
  3867. * the the clearing of the level interrupt.
  3868. * b'16:18 - prefetch_timer_cfg:
  3869. * Used only by Consumer ring to set timer mode to
  3870. * support Application prefetch handling.
  3871. * The external tail offset/pointer will be updated
  3872. * at following intervals:
  3873. * 3'b000: (Prefetch feature disabled; used only for debug)
  3874. * 3'b001: 1 usec
  3875. * 3'b010: 4 usec
  3876. * 3'b011: 8 usec (default)
  3877. * 3'b100: 16 usec
  3878. * Others: Reserverd
  3879. * b'19 - response_required:
  3880. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3881. * b'20:31 - reserved: reserved for future use
  3882. */
  3883. PREPACK struct htt_sring_setup_t {
  3884. A_UINT32 msg_type: 8,
  3885. pdev_id: 8,
  3886. ring_id: 8,
  3887. ring_type: 8;
  3888. A_UINT32 ring_base_addr_lo;
  3889. A_UINT32 ring_base_addr_hi;
  3890. A_UINT32 ring_size: 16,
  3891. ring_entry_size: 8,
  3892. ring_misc_cfg_flag: 8;
  3893. A_UINT32 ring_head_offset32_remote_addr_lo;
  3894. A_UINT32 ring_head_offset32_remote_addr_hi;
  3895. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3896. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3897. A_UINT32 ring_msi_addr_lo;
  3898. A_UINT32 ring_msi_addr_hi;
  3899. A_UINT32 ring_msi_data;
  3900. A_UINT32 intr_batch_counter_th: 15,
  3901. sw_intr_mode: 1,
  3902. intr_timer_th: 16;
  3903. A_UINT32 intr_low_threshold: 16,
  3904. prefetch_timer_cfg: 3,
  3905. response_required: 1,
  3906. reserved1: 12;
  3907. } POSTPACK;
  3908. enum htt_srng_ring_type {
  3909. HTT_HW_TO_SW_RING = 0,
  3910. HTT_SW_TO_HW_RING,
  3911. HTT_SW_TO_SW_RING,
  3912. /* Insert new ring types above this line */
  3913. };
  3914. enum htt_srng_ring_id {
  3915. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  3916. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  3917. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3918. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3919. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  3920. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  3921. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  3922. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  3923. /* Add Other SRING which can't be directly configured by host software above this line */
  3924. };
  3925. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  3926. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  3927. #define HTT_SRING_SETUP_PDEV_ID_S 8
  3928. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  3929. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  3930. HTT_SRING_SETUP_PDEV_ID_S)
  3931. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  3932. do { \
  3933. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  3934. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  3935. } while (0)
  3936. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  3937. #define HTT_SRING_SETUP_RING_ID_S 16
  3938. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  3939. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  3940. HTT_SRING_SETUP_RING_ID_S)
  3941. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  3942. do { \
  3943. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  3944. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  3945. } while (0)
  3946. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  3947. #define HTT_SRING_SETUP_RING_TYPE_S 24
  3948. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  3949. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  3950. HTT_SRING_SETUP_RING_TYPE_S)
  3951. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  3952. do { \
  3953. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  3954. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  3955. } while (0)
  3956. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  3957. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  3958. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  3959. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  3960. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  3961. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3962. do { \
  3963. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  3964. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  3965. } while (0)
  3966. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  3967. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  3968. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  3969. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  3970. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  3971. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3972. do { \
  3973. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  3974. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  3975. } while (0)
  3976. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  3977. #define HTT_SRING_SETUP_RING_SIZE_S 0
  3978. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  3979. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  3980. HTT_SRING_SETUP_RING_SIZE_S)
  3981. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  3982. do { \
  3983. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  3984. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  3985. } while (0)
  3986. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  3987. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  3988. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  3989. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  3990. HTT_SRING_SETUP_ENTRY_SIZE_S)
  3991. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  3992. do { \
  3993. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  3994. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  3995. } while (0)
  3996. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  3997. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  3998. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  3999. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4000. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4001. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4002. do { \
  4003. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4004. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4005. } while (0)
  4006. /* This control bit is applicable to only Producer, which updates Ring ID field
  4007. * of each descriptor before pushing into the ring.
  4008. * 0: updates ring_id(default)
  4009. * 1: ring_id updating disabled */
  4010. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4011. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4012. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4013. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4014. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4015. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4016. do { \
  4017. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4018. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4019. } while (0)
  4020. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4021. * of each descriptor before pushing into the ring.
  4022. * 0: updates Loopcnt(default)
  4023. * 1: Loopcnt updating disabled */
  4024. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4025. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4026. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4027. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4028. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4029. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4030. do { \
  4031. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4032. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4033. } while (0)
  4034. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4035. * into security_id port of GXI/AXI. */
  4036. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4037. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4038. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4039. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4040. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4041. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4042. do { \
  4043. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4044. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4045. } while (0)
  4046. /* During MSI write operation, SRNG drives value of this register bit into
  4047. * swap bit of GXI/AXI. */
  4048. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4049. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4050. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4051. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4052. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4053. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4054. do { \
  4055. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4056. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4057. } while (0)
  4058. /* During Pointer write operation, SRNG drives value of this register bit into
  4059. * swap bit of GXI/AXI. */
  4060. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4061. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4062. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4063. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4064. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4065. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4066. do { \
  4067. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4068. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4069. } while (0)
  4070. /* During any data or TLV write operation, SRNG drives value of this register
  4071. * bit into swap bit of GXI/AXI. */
  4072. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4073. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4074. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4075. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4076. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4077. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4078. do { \
  4079. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4080. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4081. } while (0)
  4082. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4083. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4084. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4085. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4086. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4087. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4088. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4089. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4090. do { \
  4091. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4092. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4093. } while (0)
  4094. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4095. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4096. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4097. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4098. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4099. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4100. do { \
  4101. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4102. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4103. } while (0)
  4104. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4105. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4106. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4107. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4108. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4109. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4110. do { \
  4111. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4112. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4113. } while (0)
  4114. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4115. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4116. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4117. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4118. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4119. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4120. do { \
  4121. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4122. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4123. } while (0)
  4124. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4125. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4126. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4127. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4128. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4129. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4130. do { \
  4131. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4132. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4133. } while (0)
  4134. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4135. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4136. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4137. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4138. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4139. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4140. do { \
  4141. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4142. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4143. } while (0)
  4144. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4145. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4146. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4147. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4148. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4149. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4150. do { \
  4151. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4152. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4153. } while (0)
  4154. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4155. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4156. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4157. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4158. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4159. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4160. do { \
  4161. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4162. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4163. } while (0)
  4164. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4165. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4166. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4167. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4168. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4169. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4170. do { \
  4171. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4172. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4173. } while (0)
  4174. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4175. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4176. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4177. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4178. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4179. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4180. do { \
  4181. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4182. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4183. } while (0)
  4184. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4185. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4186. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4187. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4188. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4189. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4190. do { \
  4191. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4192. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4193. } while (0)
  4194. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4195. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4196. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4197. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4198. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4199. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4200. do { \
  4201. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4202. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4203. } while (0)
  4204. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4205. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4206. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4207. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4208. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4209. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4210. do { \
  4211. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4212. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4213. } while (0)
  4214. /**
  4215. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4216. *
  4217. * @details
  4218. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4219. * configure RXDMA rings.
  4220. * The configuration is per ring based and includes both packet subtypes
  4221. * and PPDU/MPDU TLVs.
  4222. *
  4223. * The message would appear as follows:
  4224. *
  4225. * |31 26|25|24|23 16|15 8|7 0|
  4226. * |-----------------+----------------+----------------+---------------|
  4227. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  4228. * |-------------------------------------------------------------------|
  4229. * | rsvd2 | ring_buffer_size |
  4230. * |-------------------------------------------------------------------|
  4231. * | packet_type_enable_flags_0 |
  4232. * |-------------------------------------------------------------------|
  4233. * | packet_type_enable_flags_1 |
  4234. * |-------------------------------------------------------------------|
  4235. * | packet_type_enable_flags_2 |
  4236. * |-------------------------------------------------------------------|
  4237. * | packet_type_enable_flags_3 |
  4238. * |-------------------------------------------------------------------|
  4239. * | tlv_filter_in_flags |
  4240. * |-------------------------------------------------------------------|
  4241. * Where:
  4242. * PS = pkt_swap
  4243. * SS = status_swap
  4244. * The message is interpreted as follows:
  4245. * dword0 - b'0:7 - msg_type: This will be set to
  4246. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4247. * b'8:15 - pdev_id:
  4248. * 0 (for rings at SOC/UMAC level),
  4249. * 1/2/3 mac id (for rings at LMAC level)
  4250. * b'16:23 - ring_id : Identify the ring to configure.
  4251. * More details can be got from enum htt_srng_ring_id
  4252. * b'24 - status_swap: 1 is to swap status TLV
  4253. * b'25 - pkt_swap: 1 is to swap packet TLV
  4254. * b'26:31 - rsvd1: reserved for future use
  4255. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4256. * in byte units.
  4257. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4258. * - b'16:31 - rsvd2: Reserved for future use
  4259. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4260. * Enable MGMT packet from 0b0000 to 0b1001
  4261. * bits from low to high: FP, MD, MO - 3 bits
  4262. * FP: Filter_Pass
  4263. * MD: Monitor_Direct
  4264. * MO: Monitor_Other
  4265. * 10 mgmt subtypes * 3 bits -> 30 bits
  4266. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4267. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4268. * Enable MGMT packet from 0b1010 to 0b1111
  4269. * bits from low to high: FP, MD, MO - 3 bits
  4270. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4271. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4272. * Enable CTRL packet from 0b0000 to 0b1001
  4273. * bits from low to high: FP, MD, MO - 3 bits
  4274. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4275. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4276. * Enable CTRL packet from 0b1010 to 0b1111,
  4277. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4278. * bits from low to high: FP, MD, MO - 3 bits
  4279. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4280. * dword6 - b'0:31 - tlv_filter_in_flags:
  4281. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4282. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4283. */
  4284. PREPACK struct htt_rx_ring_selection_cfg_t {
  4285. A_UINT32 msg_type: 8,
  4286. pdev_id: 8,
  4287. ring_id: 8,
  4288. status_swap: 1,
  4289. pkt_swap: 1,
  4290. rsvd1: 6;
  4291. A_UINT32 ring_buffer_size: 16,
  4292. rsvd2: 16;
  4293. A_UINT32 packet_type_enable_flags_0;
  4294. A_UINT32 packet_type_enable_flags_1;
  4295. A_UINT32 packet_type_enable_flags_2;
  4296. A_UINT32 packet_type_enable_flags_3;
  4297. A_UINT32 tlv_filter_in_flags;
  4298. } POSTPACK;
  4299. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4300. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4301. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4302. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4303. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4304. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4305. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4306. do { \
  4307. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4308. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4309. } while (0)
  4310. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4311. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4312. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4313. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4314. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4315. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4316. do { \
  4317. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4318. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4319. } while (0)
  4320. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4321. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4322. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4323. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4324. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4325. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4326. do { \
  4327. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4328. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4329. } while (0)
  4330. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4331. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4332. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4333. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4334. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4335. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4336. do { \
  4337. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4338. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4339. } while (0)
  4340. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4341. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4342. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4343. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4344. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4345. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4346. do { \
  4347. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4348. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4349. } while (0)
  4350. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4351. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4352. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4353. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4354. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4355. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4356. do { \
  4357. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4358. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4359. } while (0)
  4360. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4361. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4362. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4363. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4364. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4365. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4366. do { \
  4367. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4368. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4369. } while (0)
  4370. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4371. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4372. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4373. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4374. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4375. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4376. do { \
  4377. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4378. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4379. } while (0)
  4380. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4381. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4382. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4383. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4384. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4385. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4386. do { \
  4387. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4388. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4389. } while (0)
  4390. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4391. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4392. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4393. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4394. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4395. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4396. do { \
  4397. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4398. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4399. } while (0)
  4400. /*
  4401. * Subtype based MGMT frames enable bits.
  4402. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4403. */
  4404. /* association request */
  4405. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4406. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4407. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4408. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4409. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4410. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4411. /* association response */
  4412. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4413. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4414. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4415. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4416. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4417. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4418. /* Reassociation request */
  4419. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4420. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4421. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4422. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4423. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4424. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4425. /* Reassociation response */
  4426. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4427. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4428. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4429. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4430. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4431. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4432. /* Probe request */
  4433. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4434. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4435. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4436. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4437. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4438. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4439. /* Probe response */
  4440. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4441. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4442. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4443. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4444. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4445. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4446. /* Timing Advertisement */
  4447. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4448. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4449. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4450. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4451. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4452. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4453. /* Reserved */
  4454. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4455. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4456. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4457. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4458. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4459. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4460. /* Beacon */
  4461. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000001
  4462. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4463. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000001
  4464. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4465. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x00000001
  4466. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4467. /* ATIM */
  4468. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x00000001
  4469. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4470. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x00000001
  4471. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4472. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x00000001
  4473. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4474. /* Disassociation */
  4475. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4476. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4477. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4479. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4481. /* Authentication */
  4482. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4484. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4485. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4487. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4488. /* Deauthentication */
  4489. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4492. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4494. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4495. /* Action */
  4496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4497. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4502. /* Action No Ack */
  4503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4505. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4509. /* Reserved */
  4510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4512. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4513. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4514. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4515. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4516. /*
  4517. * Subtype based CTRL frames enable bits.
  4518. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4519. */
  4520. /* Reserved */
  4521. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4522. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4523. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4524. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4525. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4526. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4527. /* Reserved */
  4528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4529. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4530. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4532. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4533. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4534. /* Reserved */
  4535. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4536. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4537. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4539. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4540. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4541. /* Reserved */
  4542. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4543. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4544. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4545. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4546. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4547. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4548. /* Reserved */
  4549. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4550. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4552. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4554. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4555. /* Reserved */
  4556. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4557. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4558. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4559. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4560. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4561. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4562. /* Reserved */
  4563. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4564. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4565. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4566. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4567. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4568. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4569. /* Control Wrapper */
  4570. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4571. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4572. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4573. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4574. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4575. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4576. /* Block Ack Request */
  4577. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4578. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4579. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4580. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4581. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4582. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4583. /* Block Ack*/
  4584. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4585. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4586. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4587. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4588. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4589. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4590. /* PS-POLL */
  4591. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4592. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4595. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4596. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4597. /* RTS */
  4598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4599. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4601. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4602. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4604. /* CTS */
  4605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4611. /* ACK */
  4612. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4616. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4617. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4618. /* CF-END */
  4619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4625. /* CF-END + CF-ACK */
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4632. /* Multicast data */
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4639. /* Unicast data */
  4640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4645. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4646. /* NULL data */
  4647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4648. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4649. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4650. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4651. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4654. do { \
  4655. HTT_CHECK_SET_VAL(httsym, value); \
  4656. (word) |= (value) << httsym##_S; \
  4657. } while (0)
  4658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4659. (((word) & httsym##_M) >> httsym##_S)
  4660. #define htt_rx_ring_pkt_enable_subtype_set( \
  4661. word, flag, mode, type, subtype, val) \
  4662. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4663. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4664. #define htt_rx_ring_pkt_enable_subtype_get( \
  4665. word, flag, mode, type, subtype) \
  4666. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4667. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4668. /* Definition to filter in TLVs */
  4669. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4670. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4671. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4672. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4673. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4674. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4675. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4676. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4677. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4678. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4679. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4680. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4681. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4682. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4683. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4684. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4685. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4686. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4687. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4688. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4689. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4690. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4691. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4692. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4693. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4694. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4695. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4696. do { \
  4697. HTT_CHECK_SET_VAL(httsym, enable); \
  4698. (word) |= (enable) << httsym##_S; \
  4699. } while (0)
  4700. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4701. (((word) & httsym##_M) >> httsym##_S)
  4702. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4703. HTT_RX_RING_TLV_ENABLE_SET( \
  4704. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4705. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4706. HTT_RX_RING_TLV_ENABLE_GET( \
  4707. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4708. /**
  4709. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4710. * host --> target Receive Flow Steering configuration message definition.
  4711. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4712. * The reason for this is we want RFS to be configured and ready before MAC
  4713. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4714. *
  4715. * |31 24|23 16|15 9|8|7 0|
  4716. * |----------------+----------------+----------------+----------------|
  4717. * | reserved |E| msg type |
  4718. * |-------------------------------------------------------------------|
  4719. * Where E = RFS enable flag
  4720. *
  4721. * The RFS_CONFIG message consists of a single 4-byte word.
  4722. *
  4723. * Header fields:
  4724. * - MSG_TYPE
  4725. * Bits 7:0
  4726. * Purpose: identifies this as a RFS config msg
  4727. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4728. * - RFS_CONFIG
  4729. * Bit 8
  4730. * Purpose: Tells target whether to enable (1) or disable (0)
  4731. * flow steering feature when sending rx indication messages to host
  4732. */
  4733. #define HTT_H2T_RFS_CONFIG_M 0x100
  4734. #define HTT_H2T_RFS_CONFIG_S 8
  4735. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4736. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4737. HTT_H2T_RFS_CONFIG_S)
  4738. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4739. do { \
  4740. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4741. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4742. } while (0)
  4743. #define HTT_RFS_CFG_REQ_BYTES 4
  4744. /**
  4745. * @brief host -> target FW extended statistics retrieve
  4746. *
  4747. * @details
  4748. * The following field definitions describe the format of the HTT host
  4749. * to target FW extended stats retrieve message.
  4750. * The message specifies the type of stats the host wants to retrieve.
  4751. *
  4752. * |31 24|23 16|15 8|7 0|
  4753. * |-----------------------------------------------------------|
  4754. * | reserved | stats type | pdev_mask | msg type |
  4755. * |-----------------------------------------------------------|
  4756. * | config param [0] |
  4757. * |-----------------------------------------------------------|
  4758. * | config param [1] |
  4759. * |-----------------------------------------------------------|
  4760. * | config param [2] |
  4761. * |-----------------------------------------------------------|
  4762. * | config param [3] |
  4763. * |-----------------------------------------------------------|
  4764. * | reserved |
  4765. * |-----------------------------------------------------------|
  4766. * | cookie LSBs |
  4767. * |-----------------------------------------------------------|
  4768. * | cookie MSBs |
  4769. * |-----------------------------------------------------------|
  4770. * Header fields:
  4771. * - MSG_TYPE
  4772. * Bits 7:0
  4773. * Purpose: identifies this is a extended stats upload request message
  4774. * Value: 0x10
  4775. * - PDEV_MASK
  4776. * Bits 8:15
  4777. * Purpose: identifies the mask of PDEVs to retrieve stats from
  4778. * Value: This is a overloaded field, refer to usage and interpretation of
  4779. * PDEV in interface document.
  4780. * Bit 8 : Reserved for SOC stats
  4781. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4782. * Indicates MACID_MASK in DBS
  4783. * - STATS_TYPE
  4784. * Bits 23:16
  4785. * Purpose: identifies which FW statistics to upload
  4786. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  4787. * - Reserved
  4788. * Bits 31:24
  4789. * - CONFIG_PARAM [0]
  4790. * Bits 31:0
  4791. * Purpose: give an opaque configuration value to the specified stats type
  4792. * Value: stats-type specific configuration value
  4793. * Refer to htt_stats.h for interpretation for each stats sub_type
  4794. * - CONFIG_PARAM [1]
  4795. * Bits 31:0
  4796. * Purpose: give an opaque configuration value to the specified stats type
  4797. * Value: stats-type specific configuration value
  4798. * Refer to htt_stats.h for interpretation for each stats sub_type
  4799. * - CONFIG_PARAM [2]
  4800. * Bits 31:0
  4801. * Purpose: give an opaque configuration value to the specified stats type
  4802. * Value: stats-type specific configuration value
  4803. * Refer to htt_stats.h for interpretation for each stats sub_type
  4804. * - CONFIG_PARAM [3]
  4805. * Bits 31:0
  4806. * Purpose: give an opaque configuration value to the specified stats type
  4807. * Value: stats-type specific configuration value
  4808. * Refer to htt_stats.h for interpretation for each stats sub_type
  4809. * - Reserved [31:0] for future use.
  4810. * - COOKIE_LSBS
  4811. * Bits 31:0
  4812. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4813. * message with its preceding host->target stats request message.
  4814. * Value: LSBs of the opaque cookie specified by the host-side requestor
  4815. * - COOKIE_MSBS
  4816. * Bits 31:0
  4817. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4818. * message with its preceding host->target stats request message.
  4819. * Value: MSBs of the opaque cookie specified by the host-side requestor
  4820. */
  4821. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  4822. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  4823. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  4824. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  4825. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  4826. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  4827. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  4828. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  4829. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  4830. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  4831. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  4832. do { \
  4833. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  4834. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  4835. } while (0)
  4836. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  4837. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  4838. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  4839. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  4840. do { \
  4841. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  4842. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  4843. } while (0)
  4844. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  4845. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  4846. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  4847. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  4848. do { \
  4849. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  4850. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  4851. } while (0)
  4852. /**
  4853. * @brief host -> target FW PPDU_STATS request message
  4854. *
  4855. * @details
  4856. * The following field definitions describe the format of the HTT host
  4857. * to target FW for PPDU_STATS_CFG msg.
  4858. * The message allows the host to configure the PPDU_STATS_IND messages
  4859. * produced by the target.
  4860. *
  4861. * |31 24|23 16|15 8|7 0|
  4862. * |-----------------------------------------------------------|
  4863. * | REQ bit mask | pdev_mask | msg type |
  4864. * |-----------------------------------------------------------|
  4865. * Header fields:
  4866. * - MSG_TYPE
  4867. * Bits 7:0
  4868. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  4869. * Value: 0x11
  4870. * - PDEV_MASK
  4871. * Bits 8:15
  4872. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  4873. * Value: This is a overloaded field, refer to usage and interpretation of
  4874. * PDEV in interface document.
  4875. * Bit 8 : Reserved for SOC stats
  4876. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4877. * Indicates MACID_MASK in DBS
  4878. * - REQ_TLV_BIT_MASK
  4879. * Bits 16:31
  4880. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  4881. * needs to be included in the target's PPDU_STATS_IND messages.
  4882. * Value: refer htt_ppdu_stats_tlv_tag_t
  4883. *
  4884. */
  4885. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  4886. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  4887. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  4888. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  4889. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  4890. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  4891. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  4892. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  4893. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  4894. do { \
  4895. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  4896. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  4897. } while (0)
  4898. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  4899. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  4900. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  4901. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  4902. do { \
  4903. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  4904. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  4905. } while (0)
  4906. /*=== target -> host messages ===============================================*/
  4907. enum htt_t2h_msg_type {
  4908. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  4909. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  4910. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  4911. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  4912. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  4913. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  4914. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  4915. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  4916. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  4917. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  4918. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  4919. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  4920. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  4921. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  4922. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  4923. /* only used for HL, add HTT MSG for HTT CREDIT update */
  4924. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  4925. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  4926. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  4927. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  4928. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  4929. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  4930. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  4931. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  4932. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  4933. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  4934. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  4935. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  4936. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  4937. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  4938. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  4939. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  4940. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  4941. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  4942. HTT_T2H_MSG_TYPE_TEST,
  4943. /* keep this last */
  4944. HTT_T2H_NUM_MSGS
  4945. };
  4946. /*
  4947. * HTT target to host message type -
  4948. * stored in bits 7:0 of the first word of the message
  4949. */
  4950. #define HTT_T2H_MSG_TYPE_M 0xff
  4951. #define HTT_T2H_MSG_TYPE_S 0
  4952. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  4953. do { \
  4954. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  4955. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  4956. } while (0)
  4957. #define HTT_T2H_MSG_TYPE_GET(word) \
  4958. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  4959. /**
  4960. * @brief target -> host version number confirmation message definition
  4961. *
  4962. * |31 24|23 16|15 8|7 0|
  4963. * |----------------+----------------+----------------+----------------|
  4964. * | reserved | major number | minor number | msg type |
  4965. * |-------------------------------------------------------------------|
  4966. * : option request TLV (optional) |
  4967. * :...................................................................:
  4968. *
  4969. * The VER_CONF message may consist of a single 4-byte word, or may be
  4970. * extended with TLVs that specify HTT options selected by the target.
  4971. * The following option TLVs may be appended to the VER_CONF message:
  4972. * - LL_BUS_ADDR_SIZE
  4973. * - HL_SUPPRESS_TX_COMPL_IND
  4974. * - MAX_TX_QUEUE_GROUPS
  4975. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  4976. * may be appended to the VER_CONF message (but only one TLV of each type).
  4977. *
  4978. * Header fields:
  4979. * - MSG_TYPE
  4980. * Bits 7:0
  4981. * Purpose: identifies this as a version number confirmation message
  4982. * Value: 0x0
  4983. * - VER_MINOR
  4984. * Bits 15:8
  4985. * Purpose: Specify the minor number of the HTT message library version
  4986. * in use by the target firmware.
  4987. * The minor number specifies the specific revision within a range
  4988. * of fundamentally compatible HTT message definition revisions.
  4989. * Compatible revisions involve adding new messages or perhaps
  4990. * adding new fields to existing messages, in a backwards-compatible
  4991. * manner.
  4992. * Incompatible revisions involve changing the message type values,
  4993. * or redefining existing messages.
  4994. * Value: minor number
  4995. * - VER_MAJOR
  4996. * Bits 15:8
  4997. * Purpose: Specify the major number of the HTT message library version
  4998. * in use by the target firmware.
  4999. * The major number specifies the family of minor revisions that are
  5000. * fundamentally compatible with each other, but not with prior or
  5001. * later families.
  5002. * Value: major number
  5003. */
  5004. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5005. #define HTT_VER_CONF_MINOR_S 8
  5006. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5007. #define HTT_VER_CONF_MAJOR_S 16
  5008. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5009. do { \
  5010. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5011. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5012. } while (0)
  5013. #define HTT_VER_CONF_MINOR_GET(word) \
  5014. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5015. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5016. do { \
  5017. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5018. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5019. } while (0)
  5020. #define HTT_VER_CONF_MAJOR_GET(word) \
  5021. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5022. #define HTT_VER_CONF_BYTES 4
  5023. /**
  5024. * @brief - target -> host HTT Rx In order indication message
  5025. *
  5026. * @details
  5027. *
  5028. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5029. * |----------------+-------------------+---------------------+---------------|
  5030. * | peer ID | P| F| O| ext TID | msg type |
  5031. * |--------------------------------------------------------------------------|
  5032. * | MSDU count | Reserved | vdev id |
  5033. * |--------------------------------------------------------------------------|
  5034. * | MSDU 0 bus address (bits 31:0) |
  5035. #if HTT_PADDR64
  5036. * | MSDU 0 bus address (bits 63:32) |
  5037. #endif
  5038. * |--------------------------------------------------------------------------|
  5039. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5040. * |--------------------------------------------------------------------------|
  5041. * | MSDU 1 bus address (bits 31:0) |
  5042. #if HTT_PADDR64
  5043. * | MSDU 1 bus address (bits 63:32) |
  5044. #endif
  5045. * |--------------------------------------------------------------------------|
  5046. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5047. * |--------------------------------------------------------------------------|
  5048. */
  5049. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5050. *
  5051. * @details
  5052. * bits
  5053. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5054. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5055. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5056. * | | frag | | | | fail |chksum fail|
  5057. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5058. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5059. */
  5060. struct htt_rx_in_ord_paddr_ind_hdr_t
  5061. {
  5062. A_UINT32 /* word 0 */
  5063. msg_type: 8,
  5064. ext_tid: 5,
  5065. offload: 1,
  5066. frag: 1,
  5067. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5068. peer_id: 16;
  5069. A_UINT32 /* word 1 */
  5070. vap_id: 8,
  5071. reserved_1: 8,
  5072. msdu_cnt: 16;
  5073. };
  5074. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5075. {
  5076. A_UINT32 dma_addr;
  5077. A_UINT32
  5078. length: 16,
  5079. fw_desc: 8,
  5080. msdu_info:8;
  5081. };
  5082. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5083. {
  5084. A_UINT32 dma_addr_lo;
  5085. A_UINT32 dma_addr_hi;
  5086. A_UINT32
  5087. length: 16,
  5088. fw_desc: 8,
  5089. msdu_info:8;
  5090. };
  5091. #if HTT_PADDR64
  5092. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5093. #else
  5094. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5095. #endif
  5096. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5097. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5098. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5099. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5100. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5101. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5102. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5103. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5104. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5105. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5106. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5107. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5108. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5109. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5110. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5111. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5112. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5113. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5114. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5115. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5116. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5117. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5118. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5119. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5120. /* for systems using 64-bit format for bus addresses */
  5121. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5122. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5123. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5124. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5125. /* for systems using 32-bit format for bus addresses */
  5126. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5127. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5128. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5129. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5130. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5131. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5132. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5133. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5134. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5135. do { \
  5136. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5137. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5138. } while (0)
  5139. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5140. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5141. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5142. do { \
  5143. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5144. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5145. } while (0)
  5146. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5147. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5148. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5149. do { \
  5150. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5151. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5152. } while (0)
  5153. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5154. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5155. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5156. do { \
  5157. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5158. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5159. } while (0)
  5160. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5161. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5162. /* for systems using 64-bit format for bus addresses */
  5163. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5164. do { \
  5165. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5166. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5167. } while (0)
  5168. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5169. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5170. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5171. do { \
  5172. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5173. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5174. } while (0)
  5175. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5176. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5177. /* for systems using 32-bit format for bus addresses */
  5178. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5179. do { \
  5180. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5181. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5182. } while (0)
  5183. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5184. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5185. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5186. do { \
  5187. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5188. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5189. } while (0)
  5190. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5191. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5192. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5193. do { \
  5194. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5195. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5196. } while (0)
  5197. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5198. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5199. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5200. do { \
  5201. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5202. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5203. } while (0)
  5204. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5205. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5206. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5207. do { \
  5208. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5209. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5210. } while (0)
  5211. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5212. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5213. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5214. do { \
  5215. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5216. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5217. } while (0)
  5218. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5219. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5220. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5221. do { \
  5222. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5223. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5224. } while (0)
  5225. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5226. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5227. /* definitions used within target -> host rx indication message */
  5228. PREPACK struct htt_rx_ind_hdr_prefix_t
  5229. {
  5230. A_UINT32 /* word 0 */
  5231. msg_type: 8,
  5232. ext_tid: 5,
  5233. release_valid: 1,
  5234. flush_valid: 1,
  5235. reserved0: 1,
  5236. peer_id: 16;
  5237. A_UINT32 /* word 1 */
  5238. flush_start_seq_num: 6,
  5239. flush_end_seq_num: 6,
  5240. release_start_seq_num: 6,
  5241. release_end_seq_num: 6,
  5242. num_mpdu_ranges: 8;
  5243. } POSTPACK;
  5244. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5245. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5246. #define HTT_TGT_RSSI_INVALID 0x80
  5247. PREPACK struct htt_rx_ppdu_desc_t
  5248. {
  5249. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5250. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5251. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5252. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5253. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5254. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5255. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5256. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5257. A_UINT32 /* word 0 */
  5258. rssi_cmb: 8,
  5259. timestamp_submicrosec: 8,
  5260. phy_err_code: 8,
  5261. phy_err: 1,
  5262. legacy_rate: 4,
  5263. legacy_rate_sel: 1,
  5264. end_valid: 1,
  5265. start_valid: 1;
  5266. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5267. union {
  5268. A_UINT32 /* word 1 */
  5269. rssi0_pri20: 8,
  5270. rssi0_ext20: 8,
  5271. rssi0_ext40: 8,
  5272. rssi0_ext80: 8;
  5273. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5274. } u0;
  5275. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5276. union {
  5277. A_UINT32 /* word 2 */
  5278. rssi1_pri20: 8,
  5279. rssi1_ext20: 8,
  5280. rssi1_ext40: 8,
  5281. rssi1_ext80: 8;
  5282. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5283. } u1;
  5284. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5285. union {
  5286. A_UINT32 /* word 3 */
  5287. rssi2_pri20: 8,
  5288. rssi2_ext20: 8,
  5289. rssi2_ext40: 8,
  5290. rssi2_ext80: 8;
  5291. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5292. } u2;
  5293. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5294. union {
  5295. A_UINT32 /* word 4 */
  5296. rssi3_pri20: 8,
  5297. rssi3_ext20: 8,
  5298. rssi3_ext40: 8,
  5299. rssi3_ext80: 8;
  5300. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5301. } u3;
  5302. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5303. A_UINT32 tsf32; /* word 5 */
  5304. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5305. A_UINT32 timestamp_microsec; /* word 6 */
  5306. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5307. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5308. A_UINT32 /* word 7 */
  5309. vht_sig_a1: 24,
  5310. preamble_type: 8;
  5311. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5312. A_UINT32 /* word 8 */
  5313. vht_sig_a2: 24,
  5314. reserved0: 8;
  5315. } POSTPACK;
  5316. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5317. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5318. PREPACK struct htt_rx_ind_hdr_suffix_t
  5319. {
  5320. A_UINT32 /* word 0 */
  5321. fw_rx_desc_bytes: 16,
  5322. reserved0: 16;
  5323. } POSTPACK;
  5324. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5325. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5326. PREPACK struct htt_rx_ind_hdr_t
  5327. {
  5328. struct htt_rx_ind_hdr_prefix_t prefix;
  5329. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5330. struct htt_rx_ind_hdr_suffix_t suffix;
  5331. } POSTPACK;
  5332. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5333. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5334. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5335. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5336. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5337. /*
  5338. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5339. * the offset into the HTT rx indication message at which the
  5340. * FW rx PPDU descriptor resides
  5341. */
  5342. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5343. /*
  5344. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5345. * the offset into the HTT rx indication message at which the
  5346. * header suffix (FW rx MSDU byte count) resides
  5347. */
  5348. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5349. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5350. /*
  5351. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5352. * the offset into the HTT rx indication message at which the per-MSDU
  5353. * information starts
  5354. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5355. * per-MSDU information portion of the message. The per-MSDU info itself
  5356. * starts at byte 12.
  5357. */
  5358. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5359. /**
  5360. * @brief target -> host rx indication message definition
  5361. *
  5362. * @details
  5363. * The following field definitions describe the format of the rx indication
  5364. * message sent from the target to the host.
  5365. * The message consists of three major sections:
  5366. * 1. a fixed-length header
  5367. * 2. a variable-length list of firmware rx MSDU descriptors
  5368. * 3. one or more 4-octet MPDU range information elements
  5369. * The fixed length header itself has two sub-sections
  5370. * 1. the message meta-information, including identification of the
  5371. * sender and type of the received data, and a 4-octet flush/release IE
  5372. * 2. the firmware rx PPDU descriptor
  5373. *
  5374. * The format of the message is depicted below.
  5375. * in this depiction, the following abbreviations are used for information
  5376. * elements within the message:
  5377. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5378. * elements associated with the PPDU start are valid.
  5379. * Specifically, the following fields are valid only if SV is set:
  5380. * RSSI (all variants), L, legacy rate, preamble type, service,
  5381. * VHT-SIG-A
  5382. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5383. * elements associated with the PPDU end are valid.
  5384. * Specifically, the following fields are valid only if EV is set:
  5385. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5386. * - L - Legacy rate selector - if legacy rates are used, this flag
  5387. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5388. * (L == 0) PHY.
  5389. * - P - PHY error flag - boolean indication of whether the rx frame had
  5390. * a PHY error
  5391. *
  5392. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5393. * |----------------+-------------------+---------------------+---------------|
  5394. * | peer ID | |RV|FV| ext TID | msg type |
  5395. * |--------------------------------------------------------------------------|
  5396. * | num | release | release | flush | flush |
  5397. * | MPDU | end | start | end | start |
  5398. * | ranges | seq num | seq num | seq num | seq num |
  5399. * |==========================================================================|
  5400. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5401. * |V|V| | rate | | | timestamp | RSSI |
  5402. * |--------------------------------------------------------------------------|
  5403. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5404. * |--------------------------------------------------------------------------|
  5405. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5406. * |--------------------------------------------------------------------------|
  5407. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5408. * |--------------------------------------------------------------------------|
  5409. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5410. * |--------------------------------------------------------------------------|
  5411. * | TSF LSBs |
  5412. * |--------------------------------------------------------------------------|
  5413. * | microsec timestamp |
  5414. * |--------------------------------------------------------------------------|
  5415. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5416. * |--------------------------------------------------------------------------|
  5417. * | service | HT-SIG / VHT-SIG-A2 |
  5418. * |==========================================================================|
  5419. * | reserved | FW rx desc bytes |
  5420. * |--------------------------------------------------------------------------|
  5421. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5422. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5423. * |--------------------------------------------------------------------------|
  5424. * : : :
  5425. * |--------------------------------------------------------------------------|
  5426. * | alignment | MSDU Rx |
  5427. * | padding | desc Bn |
  5428. * |--------------------------------------------------------------------------|
  5429. * | reserved | MPDU range status | MPDU count |
  5430. * |--------------------------------------------------------------------------|
  5431. * : reserved : MPDU range status : MPDU count :
  5432. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5433. *
  5434. * Header fields:
  5435. * - MSG_TYPE
  5436. * Bits 7:0
  5437. * Purpose: identifies this as an rx indication message
  5438. * Value: 0x1
  5439. * - EXT_TID
  5440. * Bits 12:8
  5441. * Purpose: identify the traffic ID of the rx data, including
  5442. * special "extended" TID values for multicast, broadcast, and
  5443. * non-QoS data frames
  5444. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5445. * - FLUSH_VALID (FV)
  5446. * Bit 13
  5447. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5448. * is valid
  5449. * Value:
  5450. * 1 -> flush IE is valid and needs to be processed
  5451. * 0 -> flush IE is not valid and should be ignored
  5452. * - REL_VALID (RV)
  5453. * Bit 13
  5454. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5455. * is valid
  5456. * Value:
  5457. * 1 -> release IE is valid and needs to be processed
  5458. * 0 -> release IE is not valid and should be ignored
  5459. * - PEER_ID
  5460. * Bits 31:16
  5461. * Purpose: Identify, by ID, which peer sent the rx data
  5462. * Value: ID of the peer who sent the rx data
  5463. * - FLUSH_SEQ_NUM_START
  5464. * Bits 5:0
  5465. * Purpose: Indicate the start of a series of MPDUs to flush
  5466. * Not all MPDUs within this series are necessarily valid - the host
  5467. * must check each sequence number within this range to see if the
  5468. * corresponding MPDU is actually present.
  5469. * This field is only valid if the FV bit is set.
  5470. * Value:
  5471. * The sequence number for the first MPDUs to check to flush.
  5472. * The sequence number is masked by 0x3f.
  5473. * - FLUSH_SEQ_NUM_END
  5474. * Bits 11:6
  5475. * Purpose: Indicate the end of a series of MPDUs to flush
  5476. * Value:
  5477. * The sequence number one larger than the sequence number of the
  5478. * last MPDU to check to flush.
  5479. * The sequence number is masked by 0x3f.
  5480. * Not all MPDUs within this series are necessarily valid - the host
  5481. * must check each sequence number within this range to see if the
  5482. * corresponding MPDU is actually present.
  5483. * This field is only valid if the FV bit is set.
  5484. * - REL_SEQ_NUM_START
  5485. * Bits 17:12
  5486. * Purpose: Indicate the start of a series of MPDUs to release.
  5487. * All MPDUs within this series are present and valid - the host
  5488. * need not check each sequence number within this range to see if
  5489. * the corresponding MPDU is actually present.
  5490. * This field is only valid if the RV bit is set.
  5491. * Value:
  5492. * The sequence number for the first MPDUs to check to release.
  5493. * The sequence number is masked by 0x3f.
  5494. * - REL_SEQ_NUM_END
  5495. * Bits 23:18
  5496. * Purpose: Indicate the end of a series of MPDUs to release.
  5497. * Value:
  5498. * The sequence number one larger than the sequence number of the
  5499. * last MPDU to check to release.
  5500. * The sequence number is masked by 0x3f.
  5501. * All MPDUs within this series are present and valid - the host
  5502. * need not check each sequence number within this range to see if
  5503. * the corresponding MPDU is actually present.
  5504. * This field is only valid if the RV bit is set.
  5505. * - NUM_MPDU_RANGES
  5506. * Bits 31:24
  5507. * Purpose: Indicate how many ranges of MPDUs are present.
  5508. * Each MPDU range consists of a series of contiguous MPDUs within the
  5509. * rx frame sequence which all have the same MPDU status.
  5510. * Value: 1-63 (typically a small number, like 1-3)
  5511. *
  5512. * Rx PPDU descriptor fields:
  5513. * - RSSI_CMB
  5514. * Bits 7:0
  5515. * Purpose: Combined RSSI from all active rx chains, across the active
  5516. * bandwidth.
  5517. * Value: RSSI dB units w.r.t. noise floor
  5518. * - TIMESTAMP_SUBMICROSEC
  5519. * Bits 15:8
  5520. * Purpose: high-resolution timestamp
  5521. * Value:
  5522. * Sub-microsecond time of PPDU reception.
  5523. * This timestamp ranges from [0,MAC clock MHz).
  5524. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5525. * to form a high-resolution, large range rx timestamp.
  5526. * - PHY_ERR_CODE
  5527. * Bits 23:16
  5528. * Purpose:
  5529. * If the rx frame processing resulted in a PHY error, indicate what
  5530. * type of rx PHY error occurred.
  5531. * Value:
  5532. * This field is valid if the "P" (PHY_ERR) flag is set.
  5533. * TBD: document/specify the values for this field
  5534. * - PHY_ERR
  5535. * Bit 24
  5536. * Purpose: indicate whether the rx PPDU had a PHY error
  5537. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5538. * - LEGACY_RATE
  5539. * Bits 28:25
  5540. * Purpose:
  5541. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5542. * specify which rate was used.
  5543. * Value:
  5544. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5545. * flag.
  5546. * If LEGACY_RATE_SEL is 0:
  5547. * 0x8: OFDM 48 Mbps
  5548. * 0x9: OFDM 24 Mbps
  5549. * 0xA: OFDM 12 Mbps
  5550. * 0xB: OFDM 6 Mbps
  5551. * 0xC: OFDM 54 Mbps
  5552. * 0xD: OFDM 36 Mbps
  5553. * 0xE: OFDM 18 Mbps
  5554. * 0xF: OFDM 9 Mbps
  5555. * If LEGACY_RATE_SEL is 1:
  5556. * 0x8: CCK 11 Mbps long preamble
  5557. * 0x9: CCK 5.5 Mbps long preamble
  5558. * 0xA: CCK 2 Mbps long preamble
  5559. * 0xB: CCK 1 Mbps long preamble
  5560. * 0xC: CCK 11 Mbps short preamble
  5561. * 0xD: CCK 5.5 Mbps short preamble
  5562. * 0xE: CCK 2 Mbps short preamble
  5563. * - LEGACY_RATE_SEL
  5564. * Bit 29
  5565. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5566. * Value:
  5567. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5568. * used a legacy rate.
  5569. * 0 -> OFDM, 1 -> CCK
  5570. * - END_VALID
  5571. * Bit 30
  5572. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5573. * the start of the PPDU are valid. Specifically, the following
  5574. * fields are only valid if END_VALID is set:
  5575. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5576. * TIMESTAMP_SUBMICROSEC
  5577. * Value:
  5578. * 0 -> rx PPDU desc end fields are not valid
  5579. * 1 -> rx PPDU desc end fields are valid
  5580. * - START_VALID
  5581. * Bit 31
  5582. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5583. * the end of the PPDU are valid. Specifically, the following
  5584. * fields are only valid if START_VALID is set:
  5585. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5586. * VHT-SIG-A
  5587. * Value:
  5588. * 0 -> rx PPDU desc start fields are not valid
  5589. * 1 -> rx PPDU desc start fields are valid
  5590. * - RSSI0_PRI20
  5591. * Bits 7:0
  5592. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5593. * Value: RSSI dB units w.r.t. noise floor
  5594. *
  5595. * - RSSI0_EXT20
  5596. * Bits 7:0
  5597. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5598. * (if the rx bandwidth was >= 40 MHz)
  5599. * Value: RSSI dB units w.r.t. noise floor
  5600. * - RSSI0_EXT40
  5601. * Bits 7:0
  5602. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5603. * (if the rx bandwidth was >= 80 MHz)
  5604. * Value: RSSI dB units w.r.t. noise floor
  5605. * - RSSI0_EXT80
  5606. * Bits 7:0
  5607. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5608. * (if the rx bandwidth was >= 160 MHz)
  5609. * Value: RSSI dB units w.r.t. noise floor
  5610. *
  5611. * - RSSI1_PRI20
  5612. * Bits 7:0
  5613. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5614. * Value: RSSI dB units w.r.t. noise floor
  5615. * - RSSI1_EXT20
  5616. * Bits 7:0
  5617. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5618. * (if the rx bandwidth was >= 40 MHz)
  5619. * Value: RSSI dB units w.r.t. noise floor
  5620. * - RSSI1_EXT40
  5621. * Bits 7:0
  5622. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5623. * (if the rx bandwidth was >= 80 MHz)
  5624. * Value: RSSI dB units w.r.t. noise floor
  5625. * - RSSI1_EXT80
  5626. * Bits 7:0
  5627. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5628. * (if the rx bandwidth was >= 160 MHz)
  5629. * Value: RSSI dB units w.r.t. noise floor
  5630. *
  5631. * - RSSI2_PRI20
  5632. * Bits 7:0
  5633. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5634. * Value: RSSI dB units w.r.t. noise floor
  5635. * - RSSI2_EXT20
  5636. * Bits 7:0
  5637. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5638. * (if the rx bandwidth was >= 40 MHz)
  5639. * Value: RSSI dB units w.r.t. noise floor
  5640. * - RSSI2_EXT40
  5641. * Bits 7:0
  5642. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5643. * (if the rx bandwidth was >= 80 MHz)
  5644. * Value: RSSI dB units w.r.t. noise floor
  5645. * - RSSI2_EXT80
  5646. * Bits 7:0
  5647. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5648. * (if the rx bandwidth was >= 160 MHz)
  5649. * Value: RSSI dB units w.r.t. noise floor
  5650. *
  5651. * - RSSI3_PRI20
  5652. * Bits 7:0
  5653. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5654. * Value: RSSI dB units w.r.t. noise floor
  5655. * - RSSI3_EXT20
  5656. * Bits 7:0
  5657. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5658. * (if the rx bandwidth was >= 40 MHz)
  5659. * Value: RSSI dB units w.r.t. noise floor
  5660. * - RSSI3_EXT40
  5661. * Bits 7:0
  5662. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5663. * (if the rx bandwidth was >= 80 MHz)
  5664. * Value: RSSI dB units w.r.t. noise floor
  5665. * - RSSI3_EXT80
  5666. * Bits 7:0
  5667. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5668. * (if the rx bandwidth was >= 160 MHz)
  5669. * Value: RSSI dB units w.r.t. noise floor
  5670. *
  5671. * - TSF32
  5672. * Bits 31:0
  5673. * Purpose: specify the time the rx PPDU was received, in TSF units
  5674. * Value: 32 LSBs of the TSF
  5675. * - TIMESTAMP_MICROSEC
  5676. * Bits 31:0
  5677. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5678. * Value: PPDU rx time, in microseconds
  5679. * - VHT_SIG_A1
  5680. * Bits 23:0
  5681. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5682. * from the rx PPDU
  5683. * Value:
  5684. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5685. * VHT-SIG-A1 data.
  5686. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5687. * first 24 bits of the HT-SIG data.
  5688. * Otherwise, this field is invalid.
  5689. * Refer to the the 802.11 protocol for the definition of the
  5690. * HT-SIG and VHT-SIG-A1 fields
  5691. * - VHT_SIG_A2
  5692. * Bits 23:0
  5693. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5694. * from the rx PPDU
  5695. * Value:
  5696. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5697. * VHT-SIG-A2 data.
  5698. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5699. * last 24 bits of the HT-SIG data.
  5700. * Otherwise, this field is invalid.
  5701. * Refer to the the 802.11 protocol for the definition of the
  5702. * HT-SIG and VHT-SIG-A2 fields
  5703. * - PREAMBLE_TYPE
  5704. * Bits 31:24
  5705. * Purpose: indicate the PHY format of the received burst
  5706. * Value:
  5707. * 0x4: Legacy (OFDM/CCK)
  5708. * 0x8: HT
  5709. * 0x9: HT with TxBF
  5710. * 0xC: VHT
  5711. * 0xD: VHT with TxBF
  5712. * - SERVICE
  5713. * Bits 31:24
  5714. * Purpose: TBD
  5715. * Value: TBD
  5716. *
  5717. * Rx MSDU descriptor fields:
  5718. * - FW_RX_DESC_BYTES
  5719. * Bits 15:0
  5720. * Purpose: Indicate how many bytes in the Rx indication are used for
  5721. * FW Rx descriptors
  5722. *
  5723. * Payload fields:
  5724. * - MPDU_COUNT
  5725. * Bits 7:0
  5726. * Purpose: Indicate how many sequential MPDUs share the same status.
  5727. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5728. * - MPDU_STATUS
  5729. * Bits 15:8
  5730. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5731. * received successfully.
  5732. * Value:
  5733. * 0x1: success
  5734. * 0x2: FCS error
  5735. * 0x3: duplicate error
  5736. * 0x4: replay error
  5737. * 0x5: invalid peer
  5738. */
  5739. /* header fields */
  5740. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5741. #define HTT_RX_IND_EXT_TID_S 8
  5742. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5743. #define HTT_RX_IND_FLUSH_VALID_S 13
  5744. #define HTT_RX_IND_REL_VALID_M 0x4000
  5745. #define HTT_RX_IND_REL_VALID_S 14
  5746. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5747. #define HTT_RX_IND_PEER_ID_S 16
  5748. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5749. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5750. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5751. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5752. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5753. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5754. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5755. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5756. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5757. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5758. /* rx PPDU descriptor fields */
  5759. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5760. #define HTT_RX_IND_RSSI_CMB_S 0
  5761. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5762. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5763. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5764. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5765. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5766. #define HTT_RX_IND_PHY_ERR_S 24
  5767. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5768. #define HTT_RX_IND_LEGACY_RATE_S 25
  5769. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5770. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  5771. #define HTT_RX_IND_END_VALID_M 0x40000000
  5772. #define HTT_RX_IND_END_VALID_S 30
  5773. #define HTT_RX_IND_START_VALID_M 0x80000000
  5774. #define HTT_RX_IND_START_VALID_S 31
  5775. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  5776. #define HTT_RX_IND_RSSI_PRI20_S 0
  5777. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  5778. #define HTT_RX_IND_RSSI_EXT20_S 8
  5779. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  5780. #define HTT_RX_IND_RSSI_EXT40_S 16
  5781. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  5782. #define HTT_RX_IND_RSSI_EXT80_S 24
  5783. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  5784. #define HTT_RX_IND_VHT_SIG_A1_S 0
  5785. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  5786. #define HTT_RX_IND_VHT_SIG_A2_S 0
  5787. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  5788. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  5789. #define HTT_RX_IND_SERVICE_M 0xff000000
  5790. #define HTT_RX_IND_SERVICE_S 24
  5791. /* rx MSDU descriptor fields */
  5792. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  5793. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  5794. /* payload fields */
  5795. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  5796. #define HTT_RX_IND_MPDU_COUNT_S 0
  5797. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  5798. #define HTT_RX_IND_MPDU_STATUS_S 8
  5799. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  5800. do { \
  5801. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  5802. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  5803. } while (0)
  5804. #define HTT_RX_IND_EXT_TID_GET(word) \
  5805. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  5806. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  5807. do { \
  5808. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  5809. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  5810. } while (0)
  5811. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  5812. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  5813. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  5814. do { \
  5815. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  5816. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  5817. } while (0)
  5818. #define HTT_RX_IND_REL_VALID_GET(word) \
  5819. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  5820. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  5821. do { \
  5822. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  5823. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  5824. } while (0)
  5825. #define HTT_RX_IND_PEER_ID_GET(word) \
  5826. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  5827. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  5828. do { \
  5829. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  5830. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  5831. } while (0)
  5832. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  5833. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  5834. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  5835. do { \
  5836. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  5837. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  5838. } while (0)
  5839. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  5840. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  5841. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  5842. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  5843. do { \
  5844. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  5845. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  5846. } while (0)
  5847. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  5848. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  5849. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  5850. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  5851. do { \
  5852. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  5853. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  5854. } while (0)
  5855. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  5856. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  5857. HTT_RX_IND_REL_SEQ_NUM_START_S)
  5858. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  5859. do { \
  5860. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  5861. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  5862. } while (0)
  5863. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  5864. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  5865. HTT_RX_IND_REL_SEQ_NUM_END_S)
  5866. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  5867. do { \
  5868. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  5869. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  5870. } while (0)
  5871. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  5872. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  5873. HTT_RX_IND_NUM_MPDU_RANGES_S)
  5874. /* FW rx PPDU descriptor fields */
  5875. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  5876. do { \
  5877. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  5878. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  5879. } while (0)
  5880. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  5881. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  5882. HTT_RX_IND_RSSI_CMB_S)
  5883. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  5884. do { \
  5885. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  5886. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  5887. } while (0)
  5888. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  5889. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  5890. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  5891. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  5892. do { \
  5893. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  5894. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  5895. } while (0)
  5896. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  5897. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  5898. HTT_RX_IND_PHY_ERR_CODE_S)
  5899. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  5900. do { \
  5901. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  5902. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  5903. } while (0)
  5904. #define HTT_RX_IND_PHY_ERR_GET(word) \
  5905. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  5906. HTT_RX_IND_PHY_ERR_S)
  5907. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  5908. do { \
  5909. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  5910. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  5911. } while (0)
  5912. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  5913. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  5914. HTT_RX_IND_LEGACY_RATE_S)
  5915. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  5916. do { \
  5917. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  5918. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  5919. } while (0)
  5920. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  5921. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  5922. HTT_RX_IND_LEGACY_RATE_SEL_S)
  5923. #define HTT_RX_IND_END_VALID_SET(word, value) \
  5924. do { \
  5925. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  5926. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  5927. } while (0)
  5928. #define HTT_RX_IND_END_VALID_GET(word) \
  5929. (((word) & HTT_RX_IND_END_VALID_M) >> \
  5930. HTT_RX_IND_END_VALID_S)
  5931. #define HTT_RX_IND_START_VALID_SET(word, value) \
  5932. do { \
  5933. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  5934. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  5935. } while (0)
  5936. #define HTT_RX_IND_START_VALID_GET(word) \
  5937. (((word) & HTT_RX_IND_START_VALID_M) >> \
  5938. HTT_RX_IND_START_VALID_S)
  5939. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  5940. do { \
  5941. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  5942. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  5943. } while (0)
  5944. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  5945. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  5946. HTT_RX_IND_RSSI_PRI20_S)
  5947. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  5948. do { \
  5949. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  5950. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  5951. } while (0)
  5952. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  5953. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  5954. HTT_RX_IND_RSSI_EXT20_S)
  5955. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  5956. do { \
  5957. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  5958. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  5959. } while (0)
  5960. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  5961. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  5962. HTT_RX_IND_RSSI_EXT40_S)
  5963. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  5964. do { \
  5965. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  5966. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  5967. } while (0)
  5968. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  5969. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  5970. HTT_RX_IND_RSSI_EXT80_S)
  5971. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  5972. do { \
  5973. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  5974. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  5975. } while (0)
  5976. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  5977. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  5978. HTT_RX_IND_VHT_SIG_A1_S)
  5979. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  5980. do { \
  5981. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  5982. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  5983. } while (0)
  5984. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  5985. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  5986. HTT_RX_IND_VHT_SIG_A2_S)
  5987. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  5988. do { \
  5989. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  5990. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  5991. } while (0)
  5992. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  5993. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  5994. HTT_RX_IND_PREAMBLE_TYPE_S)
  5995. #define HTT_RX_IND_SERVICE_SET(word, value) \
  5996. do { \
  5997. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  5998. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  5999. } while (0)
  6000. #define HTT_RX_IND_SERVICE_GET(word) \
  6001. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6002. HTT_RX_IND_SERVICE_S)
  6003. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6004. do { \
  6005. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6006. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6007. } while (0)
  6008. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6009. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6010. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6011. do { \
  6012. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6013. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6014. } while (0)
  6015. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6016. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6017. #define HTT_RX_IND_HL_BYTES \
  6018. (HTT_RX_IND_HDR_BYTES + \
  6019. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  6020. 4 /* single MPDU range information element */)
  6021. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6022. /* Could we use one macro entry? */
  6023. #define HTT_WORD_SET(word, field, value) \
  6024. do { \
  6025. HTT_CHECK_SET_VAL(field, value); \
  6026. (word) |= ((value) << field ## _S); \
  6027. } while (0)
  6028. #define HTT_WORD_GET(word, field) \
  6029. (((word) & field ## _M) >> field ## _S)
  6030. PREPACK struct hl_htt_rx_ind_base {
  6031. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6032. } POSTPACK;
  6033. /*
  6034. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6035. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6036. * HL host needed info. The field is just after the msdu fw rx desc.
  6037. */
  6038. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6039. struct htt_rx_ind_hl_rx_desc_t {
  6040. A_UINT8 ver;
  6041. A_UINT8 len;
  6042. struct {
  6043. A_UINT8
  6044. first_msdu: 1,
  6045. last_msdu: 1,
  6046. c3_failed: 1,
  6047. c4_failed: 1,
  6048. ipv6: 1,
  6049. tcp: 1,
  6050. udp: 1,
  6051. reserved: 1;
  6052. } flags;
  6053. };
  6054. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6055. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6056. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6057. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6058. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6059. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6060. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6061. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6062. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6063. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6064. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6065. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6066. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6067. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6068. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6069. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6070. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6071. /* This structure is used in HL, the basic descriptor information
  6072. * used by host. the structure is translated by FW from HW desc
  6073. * or generated by FW. But in HL monitor mode, the host would use
  6074. * the same structure with LL.
  6075. */
  6076. PREPACK struct hl_htt_rx_desc_base {
  6077. A_UINT32
  6078. seq_num:12,
  6079. encrypted:1,
  6080. chan_info_present:1,
  6081. resv0:2,
  6082. mcast_bcast:1,
  6083. fragment:1,
  6084. key_id_oct:8,
  6085. resv1:6;
  6086. A_UINT32
  6087. pn_31_0;
  6088. union {
  6089. struct {
  6090. A_UINT16 pn_47_32;
  6091. A_UINT16 pn_63_48;
  6092. } pn16;
  6093. A_UINT32 pn_63_32;
  6094. } u0;
  6095. A_UINT32
  6096. pn_95_64;
  6097. A_UINT32
  6098. pn_127_96;
  6099. } POSTPACK;
  6100. /*
  6101. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6102. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6103. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6104. * Please see htt_chan_change_t for description of the fields.
  6105. */
  6106. PREPACK struct htt_chan_info_t
  6107. {
  6108. A_UINT32 primary_chan_center_freq_mhz: 16,
  6109. contig_chan1_center_freq_mhz: 16;
  6110. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6111. phy_mode: 8,
  6112. reserved: 8;
  6113. } POSTPACK;
  6114. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6115. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6116. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6117. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6118. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6119. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6120. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6121. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6122. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6123. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6124. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6125. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6126. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6127. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6128. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6129. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6130. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6131. /* Channel information */
  6132. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6133. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6134. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6135. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6136. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6137. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6138. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6139. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6140. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6141. do { \
  6142. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6143. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6144. } while (0)
  6145. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6146. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6147. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6148. do { \
  6149. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6150. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6151. } while (0)
  6152. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6153. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6154. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6155. do { \
  6156. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6157. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6158. } while (0)
  6159. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6160. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6161. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6162. do { \
  6163. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6164. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6165. } while (0)
  6166. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6167. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6168. /*
  6169. * @brief target -> host rx reorder flush message definition
  6170. *
  6171. * @details
  6172. * The following field definitions describe the format of the rx flush
  6173. * message sent from the target to the host.
  6174. * The message consists of a 4-octet header, followed by one or more
  6175. * 4-octet payload information elements.
  6176. *
  6177. * |31 24|23 8|7 0|
  6178. * |--------------------------------------------------------------|
  6179. * | TID | peer ID | msg type |
  6180. * |--------------------------------------------------------------|
  6181. * | seq num end | seq num start | MPDU status | reserved |
  6182. * |--------------------------------------------------------------|
  6183. * First DWORD:
  6184. * - MSG_TYPE
  6185. * Bits 7:0
  6186. * Purpose: identifies this as an rx flush message
  6187. * Value: 0x2
  6188. * - PEER_ID
  6189. * Bits 23:8 (only bits 18:8 actually used)
  6190. * Purpose: identify which peer's rx data is being flushed
  6191. * Value: (rx) peer ID
  6192. * - TID
  6193. * Bits 31:24 (only bits 27:24 actually used)
  6194. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6195. * Value: traffic identifier
  6196. * Second DWORD:
  6197. * - MPDU_STATUS
  6198. * Bits 15:8
  6199. * Purpose:
  6200. * Indicate whether the flushed MPDUs should be discarded or processed.
  6201. * Value:
  6202. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6203. * stages of rx processing
  6204. * other: discard the MPDUs
  6205. * It is anticipated that flush messages will always have
  6206. * MPDU status == 1, but the status flag is included for
  6207. * flexibility.
  6208. * - SEQ_NUM_START
  6209. * Bits 23:16
  6210. * Purpose:
  6211. * Indicate the start of a series of consecutive MPDUs being flushed.
  6212. * Not all MPDUs within this range are necessarily valid - the host
  6213. * must check each sequence number within this range to see if the
  6214. * corresponding MPDU is actually present.
  6215. * Value:
  6216. * The sequence number for the first MPDU in the sequence.
  6217. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6218. * - SEQ_NUM_END
  6219. * Bits 30:24
  6220. * Purpose:
  6221. * Indicate the end of a series of consecutive MPDUs being flushed.
  6222. * Value:
  6223. * The sequence number one larger than the sequence number of the
  6224. * last MPDU being flushed.
  6225. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6226. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6227. * are to be released for further rx processing.
  6228. * Not all MPDUs within this range are necessarily valid - the host
  6229. * must check each sequence number within this range to see if the
  6230. * corresponding MPDU is actually present.
  6231. */
  6232. /* first DWORD */
  6233. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6234. #define HTT_RX_FLUSH_PEER_ID_S 8
  6235. #define HTT_RX_FLUSH_TID_M 0xff000000
  6236. #define HTT_RX_FLUSH_TID_S 24
  6237. /* second DWORD */
  6238. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6239. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6240. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6241. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6242. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6243. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6244. #define HTT_RX_FLUSH_BYTES 8
  6245. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6246. do { \
  6247. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6248. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6249. } while (0)
  6250. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6251. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6252. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6253. do { \
  6254. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6255. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6256. } while (0)
  6257. #define HTT_RX_FLUSH_TID_GET(word) \
  6258. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6259. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6260. do { \
  6261. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6262. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6263. } while (0)
  6264. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6265. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6266. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6267. do { \
  6268. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6269. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6270. } while (0)
  6271. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6272. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6273. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6274. do { \
  6275. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6276. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6277. } while (0)
  6278. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6279. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6280. /*
  6281. * @brief target -> host rx pn check indication message
  6282. *
  6283. * @details
  6284. * The following field definitions describe the format of the Rx PN check
  6285. * indication message sent from the target to the host.
  6286. * The message consists of a 4-octet header, followed by the start and
  6287. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6288. * IE is one octet containing the sequence number that failed the PN
  6289. * check.
  6290. *
  6291. * |31 24|23 8|7 0|
  6292. * |--------------------------------------------------------------|
  6293. * | TID | peer ID | msg type |
  6294. * |--------------------------------------------------------------|
  6295. * | Reserved | PN IE count | seq num end | seq num start|
  6296. * |--------------------------------------------------------------|
  6297. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6298. * |--------------------------------------------------------------|
  6299. * First DWORD:
  6300. * - MSG_TYPE
  6301. * Bits 7:0
  6302. * Purpose: Identifies this as an rx pn check indication message
  6303. * Value: 0x2
  6304. * - PEER_ID
  6305. * Bits 23:8 (only bits 18:8 actually used)
  6306. * Purpose: identify which peer
  6307. * Value: (rx) peer ID
  6308. * - TID
  6309. * Bits 31:24 (only bits 27:24 actually used)
  6310. * Purpose: identify traffic identifier
  6311. * Value: traffic identifier
  6312. * Second DWORD:
  6313. * - SEQ_NUM_START
  6314. * Bits 7:0
  6315. * Purpose:
  6316. * Indicates the starting sequence number of the MPDU in this
  6317. * series of MPDUs that went though PN check.
  6318. * Value:
  6319. * The sequence number for the first MPDU in the sequence.
  6320. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6321. * - SEQ_NUM_END
  6322. * Bits 15:8
  6323. * Purpose:
  6324. * Indicates the ending sequence number of the MPDU in this
  6325. * series of MPDUs that went though PN check.
  6326. * Value:
  6327. * The sequence number one larger then the sequence number of the last
  6328. * MPDU being flushed.
  6329. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6330. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6331. * for invalid PN numbers and are ready to be released for further processing.
  6332. * Not all MPDUs within this range are necessarily valid - the host
  6333. * must check each sequence number within this range to see if the
  6334. * corresponding MPDU is actually present.
  6335. * - PN_IE_COUNT
  6336. * Bits 23:16
  6337. * Purpose:
  6338. * Used to determine the variable number of PN information elements in this
  6339. * message
  6340. *
  6341. * PN information elements:
  6342. * - PN_IE_x-
  6343. * Purpose:
  6344. * Each PN information element contains the sequence number of the MPDU that
  6345. * has failed the target PN check.
  6346. * Value:
  6347. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6348. * that failed the PN check.
  6349. */
  6350. /* first DWORD */
  6351. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6352. #define HTT_RX_PN_IND_PEER_ID_S 8
  6353. #define HTT_RX_PN_IND_TID_M 0xff000000
  6354. #define HTT_RX_PN_IND_TID_S 24
  6355. /* second DWORD */
  6356. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6357. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6358. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6359. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6360. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6361. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6362. #define HTT_RX_PN_IND_BYTES 8
  6363. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6364. do { \
  6365. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6366. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6367. } while (0)
  6368. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6369. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6370. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6371. do { \
  6372. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6373. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6374. } while (0)
  6375. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6376. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6377. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6378. do { \
  6379. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6380. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6381. } while (0)
  6382. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6383. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  6384. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6385. do { \
  6386. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6387. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6388. } while (0)
  6389. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6390. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6391. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6392. do { \
  6393. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6394. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6395. } while (0)
  6396. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6397. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6398. /*
  6399. * @brief target -> host rx offload deliver message for LL system
  6400. *
  6401. * @details
  6402. * In a low latency system this message is sent whenever the offload
  6403. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6404. * The DMA of the actual packets into host memory is done before sending out
  6405. * this message. This message indicates only how many MSDUs to reap. The
  6406. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6407. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6408. * DMA'd by the MAC directly into host memory these packets do not contain
  6409. * the MAC descriptors in the header portion of the packet. Instead they contain
  6410. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6411. * message, the packets are delivered directly to the NW stack without going
  6412. * through the regular reorder buffering and PN checking path since it has
  6413. * already been done in target.
  6414. *
  6415. * |31 24|23 16|15 8|7 0|
  6416. * |-----------------------------------------------------------------------|
  6417. * | Total MSDU count | reserved | msg type |
  6418. * |-----------------------------------------------------------------------|
  6419. *
  6420. * @brief target -> host rx offload deliver message for HL system
  6421. *
  6422. * @details
  6423. * In a high latency system this message is sent whenever the offload manager
  6424. * flushes out the packets it has coalesced in its coalescing buffer. The
  6425. * actual packets are also carried along with this message. When the host
  6426. * receives this message, it is expected to deliver these packets to the NW
  6427. * stack directly instead of routing them through the reorder buffering and
  6428. * PN checking path since it has already been done in target.
  6429. *
  6430. * |31 24|23 16|15 8|7 0|
  6431. * |-----------------------------------------------------------------------|
  6432. * | Total MSDU count | reserved | msg type |
  6433. * |-----------------------------------------------------------------------|
  6434. * | peer ID | MSDU length |
  6435. * |-----------------------------------------------------------------------|
  6436. * | MSDU payload | FW Desc | tid | vdev ID |
  6437. * |-----------------------------------------------------------------------|
  6438. * | MSDU payload contd. |
  6439. * |-----------------------------------------------------------------------|
  6440. * | peer ID | MSDU length |
  6441. * |-----------------------------------------------------------------------|
  6442. * | MSDU payload | FW Desc | tid | vdev ID |
  6443. * |-----------------------------------------------------------------------|
  6444. * | MSDU payload contd. |
  6445. * |-----------------------------------------------------------------------|
  6446. *
  6447. */
  6448. /* first DWORD */
  6449. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6450. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6451. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6452. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6453. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6454. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6455. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6456. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6457. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6458. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6459. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6460. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6461. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6462. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6463. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6464. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6465. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6466. do { \
  6467. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6468. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6469. } while (0)
  6470. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6471. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6472. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6473. do { \
  6474. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6475. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6476. } while (0)
  6477. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6478. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6479. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6480. do { \
  6481. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6482. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6483. } while (0)
  6484. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6485. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6486. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6487. do { \
  6488. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6489. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6490. } while (0)
  6491. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6492. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6493. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6494. do { \
  6495. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6496. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6497. } while (0)
  6498. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6499. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6500. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6501. do { \
  6502. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6503. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6504. } while (0)
  6505. /**
  6506. * @brief target -> host rx peer map/unmap message definition
  6507. *
  6508. * @details
  6509. * The following diagram shows the format of the rx peer map message sent
  6510. * from the target to the host. This layout assumes the target operates
  6511. * as little-endian.
  6512. *
  6513. * This message always contains a SW peer ID. The main purpose of the
  6514. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6515. * with, so that the host can use that peer ID to determine which peer
  6516. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6517. * other purposes, such as identifying during tx completions which peer
  6518. * the tx frames in question were transmitted to.
  6519. *
  6520. * In certain generations of chips, the peer map message also contains
  6521. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6522. * to identify which peer the frame needs to be forwarded to (i.e. the
  6523. * peer assocated with the Destination MAC Address within the packet),
  6524. * and particularly which vdev needs to transmit the frame (for cases
  6525. * of inter-vdev rx --> tx forwarding).
  6526. * This DA-based peer ID that is provided for certain rx frames
  6527. * (the rx frames that need to be re-transmitted as tx frames)
  6528. * is the ID that the HW uses for referring to the peer in question,
  6529. * rather than the peer ID that the SW+FW use to refer to the peer.
  6530. *
  6531. *
  6532. * |31 24|23 16|15 8|7 0|
  6533. * |-----------------------------------------------------------------------|
  6534. * | SW peer ID | VDEV ID | msg type |
  6535. * |-----------------------------------------------------------------------|
  6536. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6537. * |-----------------------------------------------------------------------|
  6538. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6539. * |-----------------------------------------------------------------------|
  6540. *
  6541. *
  6542. * The following diagram shows the format of the rx peer unmap message sent
  6543. * from the target to the host.
  6544. *
  6545. * |31 24|23 16|15 8|7 0|
  6546. * |-----------------------------------------------------------------------|
  6547. * | SW peer ID | VDEV ID | msg type |
  6548. * |-----------------------------------------------------------------------|
  6549. *
  6550. * The following field definitions describe the format of the rx peer map
  6551. * and peer unmap messages sent from the target to the host.
  6552. * - MSG_TYPE
  6553. * Bits 7:0
  6554. * Purpose: identifies this as an rx peer map or peer unmap message
  6555. * Value: peer map -> 0x3, peer unmap -> 0x4
  6556. * - VDEV_ID
  6557. * Bits 15:8
  6558. * Purpose: Indicates which virtual device the peer is associated
  6559. * with.
  6560. * Value: vdev ID (used in the host to look up the vdev object)
  6561. * - PEER_ID (a.k.a. SW_PEER_ID)
  6562. * Bits 31:16
  6563. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6564. * freeing (unmap)
  6565. * Value: (rx) peer ID
  6566. * - MAC_ADDR_L32 (peer map only)
  6567. * Bits 31:0
  6568. * Purpose: Identifies which peer node the peer ID is for.
  6569. * Value: lower 4 bytes of peer node's MAC address
  6570. * - MAC_ADDR_U16 (peer map only)
  6571. * Bits 15:0
  6572. * Purpose: Identifies which peer node the peer ID is for.
  6573. * Value: upper 2 bytes of peer node's MAC address
  6574. * - HW_PEER_ID
  6575. * Bits 31:16
  6576. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6577. * address, so for rx frames marked for rx --> tx forwarding, the
  6578. * host can determine from the HW peer ID provided as meta-data with
  6579. * the rx frame which peer the frame is supposed to be forwarded to.
  6580. * Value: ID used by the MAC HW to identify the peer
  6581. */
  6582. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6583. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6584. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6585. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6586. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6587. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6588. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6589. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6590. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6591. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6592. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6593. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6594. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6595. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6596. do { \
  6597. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6598. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6599. } while (0)
  6600. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6601. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6602. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6603. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6604. do { \
  6605. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6606. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6607. } while (0)
  6608. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6609. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6610. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  6611. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  6612. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  6613. do { \
  6614. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  6615. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  6616. } while (0)
  6617. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  6618. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  6619. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6620. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  6621. #define HTT_RX_PEER_MAP_BYTES 12
  6622. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6623. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6624. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  6625. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  6626. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6627. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6628. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6629. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6630. #define HTT_RX_PEER_UNMAP_BYTES 4
  6631. /**
  6632. * @brief target -> host rx peer map V2 message definition
  6633. *
  6634. * @details
  6635. * The following diagram shows the format of the rx peer map v2 message sent
  6636. * from the target to the host. This layout assumes the target operates
  6637. * as little-endian.
  6638. *
  6639. * This message always contains a SW peer ID. The main purpose of the
  6640. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6641. * with, so that the host can use that peer ID to determine which peer
  6642. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6643. * other purposes, such as identifying during tx completions which peer
  6644. * the tx frames in question were transmitted to.
  6645. *
  6646. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  6647. * is used during rx --> tx frame forwarding to identify which peer the
  6648. * frame needs to be forwarded to (i.e. the peer assocated with the
  6649. * Destination MAC Address within the packet), and particularly which vdev
  6650. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  6651. * This DA-based peer ID that is provided for certain rx frames
  6652. * (the rx frames that need to be re-transmitted as tx frames)
  6653. * is the ID that the HW uses for referring to the peer in question,
  6654. * rather than the peer ID that the SW+FW use to refer to the peer.
  6655. *
  6656. *
  6657. * |31 24|23 16|15 8|7 0|
  6658. * |-----------------------------------------------------------------------|
  6659. * | SW peer ID | VDEV ID | msg type |
  6660. * |-----------------------------------------------------------------------|
  6661. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6662. * |-----------------------------------------------------------------------|
  6663. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6664. * |-----------------------------------------------------------------------|
  6665. * | Reserved_17_31 | Next Hop | AST Hash Value |
  6666. * |-----------------------------------------------------------------------|
  6667. * | Reserved_0 |
  6668. * |-----------------------------------------------------------------------|
  6669. * | Reserved_1 |
  6670. * |-----------------------------------------------------------------------|
  6671. * | Reserved_2 |
  6672. * |-----------------------------------------------------------------------|
  6673. * | Reserved_3 |
  6674. * |-----------------------------------------------------------------------|
  6675. *
  6676. *
  6677. * The following field definitions describe the format of the rx peer map v2
  6678. * messages sent from the target to the host.
  6679. * - MSG_TYPE
  6680. * Bits 7:0
  6681. * Purpose: identifies this as an rx peer map v2 message
  6682. * Value: peer map v2 -> 0x1e
  6683. * - VDEV_ID
  6684. * Bits 15:8
  6685. * Purpose: Indicates which virtual device the peer is associated with.
  6686. * Value: vdev ID (used in the host to look up the vdev object)
  6687. * - SW_PEER_ID
  6688. * Bits 31:16
  6689. * Purpose: The peer ID (index) that WAL is allocating
  6690. * Value: (rx) peer ID
  6691. * - MAC_ADDR_L32
  6692. * Bits 31:0
  6693. * Purpose: Identifies which peer node the peer ID is for.
  6694. * Value: lower 4 bytes of peer node's MAC address
  6695. * - MAC_ADDR_U16
  6696. * Bits 15:0
  6697. * Purpose: Identifies which peer node the peer ID is for.
  6698. * Value: upper 2 bytes of peer node's MAC address
  6699. * - HW_PEER_ID
  6700. * Bits 31:16
  6701. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6702. * address, so for rx frames marked for rx --> tx forwarding, the
  6703. * host can determine from the HW peer ID provided as meta-data with
  6704. * the rx frame which peer the frame is supposed to be forwarded to.
  6705. * Value: ID used by the MAC HW to identify the peer
  6706. * - AST_HASH_VALUE
  6707. * Bits 15:0
  6708. * Purpose: Indicates AST Hash value is required for the TCL AST index
  6709. * override feature.
  6710. * - NEXT_HOP
  6711. * Bit 16
  6712. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  6713. * (Wireless Distribution System).
  6714. */
  6715. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  6716. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  6717. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  6718. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  6719. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  6720. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  6721. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  6722. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  6723. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  6724. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  6725. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  6726. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  6727. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  6728. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  6729. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  6730. do { \
  6731. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  6732. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  6733. } while (0)
  6734. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  6735. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  6736. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  6737. do { \
  6738. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  6739. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  6740. } while (0)
  6741. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  6742. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  6743. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  6744. do { \
  6745. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  6746. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  6747. } while (0)
  6748. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  6749. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  6750. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  6751. do { \
  6752. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  6753. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  6754. } while (0)
  6755. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  6756. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  6757. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  6758. do { \
  6759. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  6760. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  6761. } while (0)
  6762. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  6763. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  6764. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6765. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  6766. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  6767. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  6768. #define HTT_RX_PEER_MAP_V2_BYTES 32
  6769. /**
  6770. * @brief target -> host rx peer unmap V2 message definition
  6771. *
  6772. *
  6773. * The following diagram shows the format of the rx peer unmap message sent
  6774. * from the target to the host.
  6775. *
  6776. * |31 24|23 16|15 8|7 0|
  6777. * |-----------------------------------------------------------------------|
  6778. * | SW peer ID | VDEV ID | msg type |
  6779. * |-----------------------------------------------------------------------|
  6780. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6781. * |-----------------------------------------------------------------------|
  6782. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  6783. * |-----------------------------------------------------------------------|
  6784. * | Peer Delete Duration |
  6785. * |-----------------------------------------------------------------------|
  6786. * | Reserved_0 |
  6787. * |-----------------------------------------------------------------------|
  6788. * | Reserved_1 |
  6789. * |-----------------------------------------------------------------------|
  6790. * | Reserved_2 |
  6791. * |-----------------------------------------------------------------------|
  6792. *
  6793. *
  6794. * The following field definitions describe the format of the rx peer unmap
  6795. * messages sent from the target to the host.
  6796. * - MSG_TYPE
  6797. * Bits 7:0
  6798. * Purpose: identifies this as an rx peer unmap v2 message
  6799. * Value: peer unmap v2 -> 0x1f
  6800. * - VDEV_ID
  6801. * Bits 15:8
  6802. * Purpose: Indicates which virtual device the peer is associated
  6803. * with.
  6804. * Value: vdev ID (used in the host to look up the vdev object)
  6805. * - SW_PEER_ID
  6806. * Bits 31:16
  6807. * Purpose: The peer ID (index) that WAL is freeing
  6808. * Value: (rx) peer ID
  6809. * - MAC_ADDR_L32
  6810. * Bits 31:0
  6811. * Purpose: Identifies which peer node the peer ID is for.
  6812. * Value: lower 4 bytes of peer node's MAC address
  6813. * - MAC_ADDR_U16
  6814. * Bits 15:0
  6815. * Purpose: Identifies which peer node the peer ID is for.
  6816. * Value: upper 2 bytes of peer node's MAC address
  6817. * - NEXT_HOP
  6818. * Bits 16
  6819. * Purpose: Bit indicates next_hop AST entry used for WDS
  6820. * (Wireless Distribution System).
  6821. * - PEER_DELETE_DURATION
  6822. * Bits 31:0
  6823. * Purpose: Time taken to delete peer, in msec,
  6824. * Used for monitoring / debugging PEER delete response delay
  6825. */
  6826. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  6827. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  6828. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  6829. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  6830. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  6831. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  6832. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  6833. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  6834. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  6835. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  6836. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  6837. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  6838. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  6839. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  6840. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  6841. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  6842. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  6843. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  6844. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  6845. do { \
  6846. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  6847. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  6848. } while (0)
  6849. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  6850. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  6851. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6852. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  6853. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  6854. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  6855. /**
  6856. * @brief target -> host message specifying security parameters
  6857. *
  6858. * @details
  6859. * The following diagram shows the format of the security specification
  6860. * message sent from the target to the host.
  6861. * This security specification message tells the host whether a PN check is
  6862. * necessary on rx data frames, and if so, how large the PN counter is.
  6863. * This message also tells the host about the security processing to apply
  6864. * to defragmented rx frames - specifically, whether a Message Integrity
  6865. * Check is required, and the Michael key to use.
  6866. *
  6867. * |31 24|23 16|15|14 8|7 0|
  6868. * |-----------------------------------------------------------------------|
  6869. * | peer ID | U| security type | msg type |
  6870. * |-----------------------------------------------------------------------|
  6871. * | Michael Key K0 |
  6872. * |-----------------------------------------------------------------------|
  6873. * | Michael Key K1 |
  6874. * |-----------------------------------------------------------------------|
  6875. * | WAPI RSC Low0 |
  6876. * |-----------------------------------------------------------------------|
  6877. * | WAPI RSC Low1 |
  6878. * |-----------------------------------------------------------------------|
  6879. * | WAPI RSC Hi0 |
  6880. * |-----------------------------------------------------------------------|
  6881. * | WAPI RSC Hi1 |
  6882. * |-----------------------------------------------------------------------|
  6883. *
  6884. * The following field definitions describe the format of the security
  6885. * indication message sent from the target to the host.
  6886. * - MSG_TYPE
  6887. * Bits 7:0
  6888. * Purpose: identifies this as a security specification message
  6889. * Value: 0xb
  6890. * - SEC_TYPE
  6891. * Bits 14:8
  6892. * Purpose: specifies which type of security applies to the peer
  6893. * Value: htt_sec_type enum value
  6894. * - UNICAST
  6895. * Bit 15
  6896. * Purpose: whether this security is applied to unicast or multicast data
  6897. * Value: 1 -> unicast, 0 -> multicast
  6898. * - PEER_ID
  6899. * Bits 31:16
  6900. * Purpose: The ID number for the peer the security specification is for
  6901. * Value: peer ID
  6902. * - MICHAEL_KEY_K0
  6903. * Bits 31:0
  6904. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  6905. * Value: Michael Key K0 (if security type is TKIP)
  6906. * - MICHAEL_KEY_K1
  6907. * Bits 31:0
  6908. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  6909. * Value: Michael Key K1 (if security type is TKIP)
  6910. * - WAPI_RSC_LOW0
  6911. * Bits 31:0
  6912. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  6913. * Value: WAPI RSC Low0 (if security type is WAPI)
  6914. * - WAPI_RSC_LOW1
  6915. * Bits 31:0
  6916. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  6917. * Value: WAPI RSC Low1 (if security type is WAPI)
  6918. * - WAPI_RSC_HI0
  6919. * Bits 31:0
  6920. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  6921. * Value: WAPI RSC Hi0 (if security type is WAPI)
  6922. * - WAPI_RSC_HI1
  6923. * Bits 31:0
  6924. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  6925. * Value: WAPI RSC Hi1 (if security type is WAPI)
  6926. */
  6927. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  6928. #define HTT_SEC_IND_SEC_TYPE_S 8
  6929. #define HTT_SEC_IND_UNICAST_M 0x00008000
  6930. #define HTT_SEC_IND_UNICAST_S 15
  6931. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  6932. #define HTT_SEC_IND_PEER_ID_S 16
  6933. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  6934. do { \
  6935. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  6936. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  6937. } while (0)
  6938. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  6939. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  6940. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  6941. do { \
  6942. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  6943. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  6944. } while (0)
  6945. #define HTT_SEC_IND_UNICAST_GET(word) \
  6946. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  6947. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  6948. do { \
  6949. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  6950. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  6951. } while (0)
  6952. #define HTT_SEC_IND_PEER_ID_GET(word) \
  6953. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  6954. #define HTT_SEC_IND_BYTES 28
  6955. /**
  6956. * @brief target -> host rx ADDBA / DELBA message definitions
  6957. *
  6958. * @details
  6959. * The following diagram shows the format of the rx ADDBA message sent
  6960. * from the target to the host:
  6961. *
  6962. * |31 20|19 16|15 8|7 0|
  6963. * |---------------------------------------------------------------------|
  6964. * | peer ID | TID | window size | msg type |
  6965. * |---------------------------------------------------------------------|
  6966. *
  6967. * The following diagram shows the format of the rx DELBA message sent
  6968. * from the target to the host:
  6969. *
  6970. * |31 20|19 16|15 8|7 0|
  6971. * |---------------------------------------------------------------------|
  6972. * | peer ID | TID | reserved | msg type |
  6973. * |---------------------------------------------------------------------|
  6974. *
  6975. * The following field definitions describe the format of the rx ADDBA
  6976. * and DELBA messages sent from the target to the host.
  6977. * - MSG_TYPE
  6978. * Bits 7:0
  6979. * Purpose: identifies this as an rx ADDBA or DELBA message
  6980. * Value: ADDBA -> 0x5, DELBA -> 0x6
  6981. * - WIN_SIZE
  6982. * Bits 15:8 (ADDBA only)
  6983. * Purpose: Specifies the length of the block ack window (max = 64).
  6984. * Value:
  6985. * block ack window length specified by the received ADDBA
  6986. * management message.
  6987. * - TID
  6988. * Bits 19:16
  6989. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  6990. * Value:
  6991. * TID specified by the received ADDBA or DELBA management message.
  6992. * - PEER_ID
  6993. * Bits 31:20
  6994. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  6995. * Value:
  6996. * ID (hash value) used by the host for fast, direct lookup of
  6997. * host SW peer info, including rx reorder states.
  6998. */
  6999. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7000. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7001. #define HTT_RX_ADDBA_TID_M 0xf0000
  7002. #define HTT_RX_ADDBA_TID_S 16
  7003. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7004. #define HTT_RX_ADDBA_PEER_ID_S 20
  7005. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7006. do { \
  7007. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7008. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7009. } while (0)
  7010. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7011. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7012. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7013. do { \
  7014. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7015. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7016. } while (0)
  7017. #define HTT_RX_ADDBA_TID_GET(word) \
  7018. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7019. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7020. do { \
  7021. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7022. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7023. } while (0)
  7024. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7025. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7026. #define HTT_RX_ADDBA_BYTES 4
  7027. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7028. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7029. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7030. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7031. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7032. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7033. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7034. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7035. #define HTT_RX_DELBA_BYTES 4
  7036. /**
  7037. * @brief tx queue group information element definition
  7038. *
  7039. * @details
  7040. * The following diagram shows the format of the tx queue group
  7041. * information element, which can be included in target --> host
  7042. * messages to specify the number of tx "credits" (tx descriptors
  7043. * for LL, or tx buffers for HL) available to a particular group
  7044. * of host-side tx queues, and which host-side tx queues belong to
  7045. * the group.
  7046. *
  7047. * |31|30 24|23 16|15|14|13 0|
  7048. * |------------------------------------------------------------------------|
  7049. * | X| reserved | tx queue grp ID | A| S| credit count |
  7050. * |------------------------------------------------------------------------|
  7051. * | vdev ID mask | AC mask |
  7052. * |------------------------------------------------------------------------|
  7053. *
  7054. * The following definitions describe the fields within the tx queue group
  7055. * information element:
  7056. * - credit_count
  7057. * Bits 13:1
  7058. * Purpose: specify how many tx credits are available to the tx queue group
  7059. * Value: An absolute or relative, positive or negative credit value
  7060. * The 'A' bit specifies whether the value is absolute or relative.
  7061. * The 'S' bit specifies whether the value is positive or negative.
  7062. * A negative value can only be relative, not absolute.
  7063. * An absolute value replaces any prior credit value the host has for
  7064. * the tx queue group in question.
  7065. * A relative value is added to the prior credit value the host has for
  7066. * the tx queue group in question.
  7067. * - sign
  7068. * Bit 14
  7069. * Purpose: specify whether the credit count is positive or negative
  7070. * Value: 0 -> positive, 1 -> negative
  7071. * - absolute
  7072. * Bit 15
  7073. * Purpose: specify whether the credit count is absolute or relative
  7074. * Value: 0 -> relative, 1 -> absolute
  7075. * - txq_group_id
  7076. * Bits 23:16
  7077. * Purpose: indicate which tx queue group's credit and/or membership are
  7078. * being specified
  7079. * Value: 0 to max_tx_queue_groups-1
  7080. * - reserved
  7081. * Bits 30:16
  7082. * Value: 0x0
  7083. * - eXtension
  7084. * Bit 31
  7085. * Purpose: specify whether another tx queue group info element follows
  7086. * Value: 0 -> no more tx queue group information elements
  7087. * 1 -> another tx queue group information element immediately follows
  7088. * - ac_mask
  7089. * Bits 15:0
  7090. * Purpose: specify which Access Categories belong to the tx queue group
  7091. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7092. * the tx queue group.
  7093. * The AC bit-mask values are obtained by left-shifting by the
  7094. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7095. * - vdev_id_mask
  7096. * Bits 31:16
  7097. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7098. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7099. * belong to the tx queue group.
  7100. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7101. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7102. */
  7103. PREPACK struct htt_txq_group {
  7104. A_UINT32
  7105. credit_count: 14,
  7106. sign: 1,
  7107. absolute: 1,
  7108. tx_queue_group_id: 8,
  7109. reserved0: 7,
  7110. extension: 1;
  7111. A_UINT32
  7112. ac_mask: 16,
  7113. vdev_id_mask: 16;
  7114. } POSTPACK;
  7115. /* first word */
  7116. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7117. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7118. #define HTT_TXQ_GROUP_SIGN_S 14
  7119. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7120. #define HTT_TXQ_GROUP_ABS_S 15
  7121. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7122. #define HTT_TXQ_GROUP_ID_S 16
  7123. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7124. #define HTT_TXQ_GROUP_EXT_S 31
  7125. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7126. /* second word */
  7127. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7128. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7129. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7130. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7131. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7132. do { \
  7133. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7134. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7135. } while (0)
  7136. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7137. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7138. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7139. do { \
  7140. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7141. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7142. } while (0)
  7143. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7144. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7145. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7146. do { \
  7147. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7148. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7149. } while (0)
  7150. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7151. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7152. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7153. do { \
  7154. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7155. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7156. } while (0)
  7157. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7158. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7159. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7160. do { \
  7161. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7162. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7163. } while (0)
  7164. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7165. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7166. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7167. do { \
  7168. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7169. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7170. } while (0)
  7171. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7172. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7173. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7174. do { \
  7175. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7176. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7177. } while (0)
  7178. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7179. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7180. /**
  7181. * @brief target -> host TX completion indication message definition
  7182. *
  7183. * @details
  7184. * The following diagram shows the format of the TX completion indication sent
  7185. * from the target to the host
  7186. *
  7187. * |31 27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7188. * |------------------------------------------------------------|
  7189. * header: | rsvd |TP|A1|A0| num | t_i| tid |status| msg_type |
  7190. * |------------------------------------------------------------|
  7191. * payload: | MSDU1 ID | MSDU0 ID |
  7192. * |------------------------------------------------------------|
  7193. * : MSDU3 ID : MSDU2 ID :
  7194. * |------------------------------------------------------------|
  7195. * | struct htt_tx_compl_ind_append_retries |
  7196. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7197. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7198. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7199. * Where:
  7200. * A0 = append (a.k.a. append0)
  7201. * A1 = append1
  7202. * TP = MSDU tx power presence
  7203. *
  7204. * The following field definitions describe the format of the TX completion
  7205. * indication sent from the target to the host
  7206. * Header fields:
  7207. * - msg_type
  7208. * Bits 7:0
  7209. * Purpose: identifies this as HTT TX completion indication
  7210. * Value: 0x7
  7211. * - status
  7212. * Bits 10:8
  7213. * Purpose: the TX completion status of payload fragmentations descriptors
  7214. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7215. * - tid
  7216. * Bits 14:11
  7217. * Purpose: the tid associated with those fragmentation descriptors. It is
  7218. * valid or not, depending on the tid_invalid bit.
  7219. * Value: 0 to 15
  7220. * - tid_invalid
  7221. * Bits 15:15
  7222. * Purpose: this bit indicates whether the tid field is valid or not
  7223. * Value: 0 indicates valid; 1 indicates invalid
  7224. * - num
  7225. * Bits 23:16
  7226. * Purpose: the number of payload in this indication
  7227. * Value: 1 to 255
  7228. * - append (a.k.a. append0)
  7229. * Bits 24:24
  7230. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7231. * the number of tx retries for one MSDU at the end of this message
  7232. * Value: 0 indicates no appending; 1 indicates appending
  7233. * - append1
  7234. * Bits 25:25
  7235. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7236. * contains the timestamp info for each TX msdu id in payload.
  7237. * The order of the timestamps matches the order of the MSDU IDs.
  7238. * Note that a big-endian host needs to account for the reordering
  7239. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7240. * conversion) when determining which tx timestamp corresponds to
  7241. * which MSDU ID.
  7242. * Value: 0 indicates no appending; 1 indicates appending
  7243. * - msdu_tx_power_presence
  7244. * Bits 26:26
  7245. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7246. * for each MSDU referenced by the TX_COMPL_IND message.
  7247. * The tx power is reported in 0.5 dBm units.
  7248. * The order of the per-MSDU tx power reports matches the order
  7249. * of the MSDU IDs.
  7250. * Note that a big-endian host needs to account for the reordering
  7251. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7252. * conversion) when determining which Tx Power corresponds to
  7253. * which MSDU ID.
  7254. * Value: 0 indicates MSDU tx power reports are not appended,
  7255. * 1 indicates MSDU tx power reports are appended
  7256. * Payload fields:
  7257. * - hmsdu_id
  7258. * Bits 15:0
  7259. * Purpose: this ID is used to track the Tx buffer in host
  7260. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7261. */
  7262. #define HTT_TX_COMPL_IND_STATUS_S 8
  7263. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7264. #define HTT_TX_COMPL_IND_TID_S 11
  7265. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7266. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7267. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7268. #define HTT_TX_COMPL_IND_NUM_S 16
  7269. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7270. #define HTT_TX_COMPL_IND_APPEND_S 24
  7271. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7272. #define HTT_TX_COMPL_IND_APPEND1_S 25
  7273. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  7274. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  7275. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  7276. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7277. do { \
  7278. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7279. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7280. } while (0)
  7281. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7282. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7283. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7284. do { \
  7285. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7286. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7287. } while (0)
  7288. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7289. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7290. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7291. do { \
  7292. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7293. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7294. } while (0)
  7295. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7296. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7297. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7298. do { \
  7299. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7300. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7301. } while (0)
  7302. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7303. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7304. HTT_TX_COMPL_IND_TID_INV_S)
  7305. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7306. do { \
  7307. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7308. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7309. } while (0)
  7310. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7311. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7312. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  7313. do { \
  7314. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  7315. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  7316. } while (0)
  7317. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  7318. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  7319. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  7320. do { \
  7321. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  7322. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  7323. } while (0)
  7324. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  7325. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  7326. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  7327. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7328. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7329. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7330. #define HTT_TX_COMPL_IND_STAT_OK 0
  7331. /* DISCARD:
  7332. * current meaning:
  7333. * MSDUs were queued for transmission but filtered by HW or SW
  7334. * without any over the air attempts
  7335. * legacy meaning (HL Rome):
  7336. * MSDUs were discarded by the target FW without any over the air
  7337. * attempts due to lack of space
  7338. */
  7339. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7340. /* NO_ACK:
  7341. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7342. */
  7343. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7344. /* POSTPONE:
  7345. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7346. * be downloaded again later (in the appropriate order), when they are
  7347. * deliverable.
  7348. */
  7349. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7350. /*
  7351. * The PEER_DEL tx completion status is used for HL cases
  7352. * where the peer the frame is for has been deleted.
  7353. * The host has already discarded its copy of the frame, but
  7354. * it still needs the tx completion to restore its credit.
  7355. */
  7356. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7357. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7358. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7359. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7360. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7361. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7362. PREPACK struct htt_tx_compl_ind_base {
  7363. A_UINT32 hdr;
  7364. A_UINT16 payload[1/*or more*/];
  7365. } POSTPACK;
  7366. PREPACK struct htt_tx_compl_ind_append_retries {
  7367. A_UINT16 msdu_id;
  7368. A_UINT8 tx_retries;
  7369. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  7370. 0: this is the last append_retries struct */
  7371. } POSTPACK;
  7372. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  7373. A_UINT32 timestamp[1/*or more*/];
  7374. } POSTPACK;
  7375. /**
  7376. * @brief target -> host rate-control update indication message
  7377. *
  7378. * @details
  7379. * The following diagram shows the format of the RC Update message
  7380. * sent from the target to the host, while processing the tx-completion
  7381. * of a transmitted PPDU.
  7382. *
  7383. * |31 24|23 16|15 8|7 0|
  7384. * |-------------------------------------------------------------|
  7385. * | peer ID | vdev ID | msg_type |
  7386. * |-------------------------------------------------------------|
  7387. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7388. * |-------------------------------------------------------------|
  7389. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7390. * |-------------------------------------------------------------|
  7391. * | : |
  7392. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7393. * | : |
  7394. * |-------------------------------------------------------------|
  7395. * | : |
  7396. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7397. * | : |
  7398. * |-------------------------------------------------------------|
  7399. * : :
  7400. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7401. *
  7402. */
  7403. typedef struct {
  7404. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7405. A_UINT32 rate_code_flags;
  7406. A_UINT32 flags; /* Encodes information such as excessive
  7407. retransmission, aggregate, some info
  7408. from .11 frame control,
  7409. STBC, LDPC, (SGI and Tx Chain Mask
  7410. are encoded in ptx_rc->flags field),
  7411. AMPDU truncation (BT/time based etc.),
  7412. RTS/CTS attempt */
  7413. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  7414. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  7415. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  7416. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7417. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  7418. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7419. } HTT_RC_TX_DONE_PARAMS;
  7420. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  7421. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7422. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7423. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7424. #define HTT_RC_UPDATE_VDEVID_S 8
  7425. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7426. #define HTT_RC_UPDATE_PEERID_S 16
  7427. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7428. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7429. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7430. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7431. do { \
  7432. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7433. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7434. } while (0)
  7435. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7436. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7437. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7438. do { \
  7439. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7440. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7441. } while (0)
  7442. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7443. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7444. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7445. do { \
  7446. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7447. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7448. } while (0)
  7449. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7450. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7451. /**
  7452. * @brief target -> host rx fragment indication message definition
  7453. *
  7454. * @details
  7455. * The following field definitions describe the format of the rx fragment
  7456. * indication message sent from the target to the host.
  7457. * The rx fragment indication message shares the format of the
  7458. * rx indication message, but not all fields from the rx indication message
  7459. * are relevant to the rx fragment indication message.
  7460. *
  7461. *
  7462. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7463. * |-----------+-------------------+---------------------+-------------|
  7464. * | peer ID | |FV| ext TID | msg type |
  7465. * |-------------------------------------------------------------------|
  7466. * | | flush | flush |
  7467. * | | end | start |
  7468. * | | seq num | seq num |
  7469. * |-------------------------------------------------------------------|
  7470. * | reserved | FW rx desc bytes |
  7471. * |-------------------------------------------------------------------|
  7472. * | | FW MSDU Rx |
  7473. * | | desc B0 |
  7474. * |-------------------------------------------------------------------|
  7475. * Header fields:
  7476. * - MSG_TYPE
  7477. * Bits 7:0
  7478. * Purpose: identifies this as an rx fragment indication message
  7479. * Value: 0xa
  7480. * - EXT_TID
  7481. * Bits 12:8
  7482. * Purpose: identify the traffic ID of the rx data, including
  7483. * special "extended" TID values for multicast, broadcast, and
  7484. * non-QoS data frames
  7485. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7486. * - FLUSH_VALID (FV)
  7487. * Bit 13
  7488. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7489. * is valid
  7490. * Value:
  7491. * 1 -> flush IE is valid and needs to be processed
  7492. * 0 -> flush IE is not valid and should be ignored
  7493. * - PEER_ID
  7494. * Bits 31:16
  7495. * Purpose: Identify, by ID, which peer sent the rx data
  7496. * Value: ID of the peer who sent the rx data
  7497. * - FLUSH_SEQ_NUM_START
  7498. * Bits 5:0
  7499. * Purpose: Indicate the start of a series of MPDUs to flush
  7500. * Not all MPDUs within this series are necessarily valid - the host
  7501. * must check each sequence number within this range to see if the
  7502. * corresponding MPDU is actually present.
  7503. * This field is only valid if the FV bit is set.
  7504. * Value:
  7505. * The sequence number for the first MPDUs to check to flush.
  7506. * The sequence number is masked by 0x3f.
  7507. * - FLUSH_SEQ_NUM_END
  7508. * Bits 11:6
  7509. * Purpose: Indicate the end of a series of MPDUs to flush
  7510. * Value:
  7511. * The sequence number one larger than the sequence number of the
  7512. * last MPDU to check to flush.
  7513. * The sequence number is masked by 0x3f.
  7514. * Not all MPDUs within this series are necessarily valid - the host
  7515. * must check each sequence number within this range to see if the
  7516. * corresponding MPDU is actually present.
  7517. * This field is only valid if the FV bit is set.
  7518. * Rx descriptor fields:
  7519. * - FW_RX_DESC_BYTES
  7520. * Bits 15:0
  7521. * Purpose: Indicate how many bytes in the Rx indication are used for
  7522. * FW Rx descriptors
  7523. * Value: 1
  7524. */
  7525. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7526. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7527. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7528. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7529. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7530. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7531. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7532. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7533. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7534. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7535. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7536. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7537. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7538. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7539. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7540. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7541. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7542. #define HTT_RX_FRAG_IND_BYTES \
  7543. (4 /* msg hdr */ + \
  7544. 4 /* flush spec */ + \
  7545. 4 /* (unused) FW rx desc bytes spec */ + \
  7546. 4 /* FW rx desc */)
  7547. /**
  7548. * @brief target -> host test message definition
  7549. *
  7550. * @details
  7551. * The following field definitions describe the format of the test
  7552. * message sent from the target to the host.
  7553. * The message consists of a 4-octet header, followed by a variable
  7554. * number of 32-bit integer values, followed by a variable number
  7555. * of 8-bit character values.
  7556. *
  7557. * |31 16|15 8|7 0|
  7558. * |-----------------------------------------------------------|
  7559. * | num chars | num ints | msg type |
  7560. * |-----------------------------------------------------------|
  7561. * | int 0 |
  7562. * |-----------------------------------------------------------|
  7563. * | int 1 |
  7564. * |-----------------------------------------------------------|
  7565. * | ... |
  7566. * |-----------------------------------------------------------|
  7567. * | char 3 | char 2 | char 1 | char 0 |
  7568. * |-----------------------------------------------------------|
  7569. * | | | ... | char 4 |
  7570. * |-----------------------------------------------------------|
  7571. * - MSG_TYPE
  7572. * Bits 7:0
  7573. * Purpose: identifies this as a test message
  7574. * Value: HTT_MSG_TYPE_TEST
  7575. * - NUM_INTS
  7576. * Bits 15:8
  7577. * Purpose: indicate how many 32-bit integers follow the message header
  7578. * - NUM_CHARS
  7579. * Bits 31:16
  7580. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7581. */
  7582. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7583. #define HTT_RX_TEST_NUM_INTS_S 8
  7584. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7585. #define HTT_RX_TEST_NUM_CHARS_S 16
  7586. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7587. do { \
  7588. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7589. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7590. } while (0)
  7591. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7592. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7593. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7594. do { \
  7595. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7596. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7597. } while (0)
  7598. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7599. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7600. /**
  7601. * @brief target -> host packet log message
  7602. *
  7603. * @details
  7604. * The following field definitions describe the format of the packet log
  7605. * message sent from the target to the host.
  7606. * The message consists of a 4-octet header,followed by a variable number
  7607. * of 32-bit character values.
  7608. *
  7609. * |31 16|15 12|11 10|9 8|7 0|
  7610. * |------------------------------------------------------------------|
  7611. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  7612. * |------------------------------------------------------------------|
  7613. * | payload |
  7614. * |------------------------------------------------------------------|
  7615. * - MSG_TYPE
  7616. * Bits 7:0
  7617. * Purpose: identifies this as a pktlog message
  7618. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  7619. * - mac_id
  7620. * Bits 9:8
  7621. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  7622. * Value: 0-3
  7623. * - pdev_id
  7624. * Bits 11:10
  7625. * Purpose: pdev_id
  7626. * Value: 0-3
  7627. * 0 (for rings at SOC level),
  7628. * 1/2/3 PDEV -> 0/1/2
  7629. * - payload_size
  7630. * Bits 31:16
  7631. * Purpose: explicitly specify the payload size
  7632. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  7633. */
  7634. PREPACK struct htt_pktlog_msg {
  7635. A_UINT32 header;
  7636. A_UINT32 payload[1/* or more */];
  7637. } POSTPACK;
  7638. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  7639. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  7640. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  7641. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  7642. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  7643. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  7644. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  7645. do { \
  7646. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  7647. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  7648. } while (0)
  7649. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  7650. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  7651. HTT_T2H_PKTLOG_MAC_ID_S)
  7652. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  7653. do { \
  7654. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  7655. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  7656. } while (0)
  7657. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  7658. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  7659. HTT_T2H_PKTLOG_PDEV_ID_S)
  7660. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  7661. do { \
  7662. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  7663. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  7664. } while (0)
  7665. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  7666. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  7667. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  7668. /*
  7669. * Rx reorder statistics
  7670. * NB: all the fields must be defined in 4 octets size.
  7671. */
  7672. struct rx_reorder_stats {
  7673. /* Non QoS MPDUs received */
  7674. A_UINT32 deliver_non_qos;
  7675. /* MPDUs received in-order */
  7676. A_UINT32 deliver_in_order;
  7677. /* Flush due to reorder timer expired */
  7678. A_UINT32 deliver_flush_timeout;
  7679. /* Flush due to move out of window */
  7680. A_UINT32 deliver_flush_oow;
  7681. /* Flush due to DELBA */
  7682. A_UINT32 deliver_flush_delba;
  7683. /* MPDUs dropped due to FCS error */
  7684. A_UINT32 fcs_error;
  7685. /* MPDUs dropped due to monitor mode non-data packet */
  7686. A_UINT32 mgmt_ctrl;
  7687. /* Unicast-data MPDUs dropped due to invalid peer */
  7688. A_UINT32 invalid_peer;
  7689. /* MPDUs dropped due to duplication (non aggregation) */
  7690. A_UINT32 dup_non_aggr;
  7691. /* MPDUs dropped due to processed before */
  7692. A_UINT32 dup_past;
  7693. /* MPDUs dropped due to duplicate in reorder queue */
  7694. A_UINT32 dup_in_reorder;
  7695. /* Reorder timeout happened */
  7696. A_UINT32 reorder_timeout;
  7697. /* invalid bar ssn */
  7698. A_UINT32 invalid_bar_ssn;
  7699. /* reorder reset due to bar ssn */
  7700. A_UINT32 ssn_reset;
  7701. /* Flush due to delete peer */
  7702. A_UINT32 deliver_flush_delpeer;
  7703. /* Flush due to offload*/
  7704. A_UINT32 deliver_flush_offload;
  7705. /* Flush due to out of buffer*/
  7706. A_UINT32 deliver_flush_oob;
  7707. /* MPDUs dropped due to PN check fail */
  7708. A_UINT32 pn_fail;
  7709. /* MPDUs dropped due to unable to allocate memory */
  7710. A_UINT32 store_fail;
  7711. /* Number of times the tid pool alloc succeeded */
  7712. A_UINT32 tid_pool_alloc_succ;
  7713. /* Number of times the MPDU pool alloc succeeded */
  7714. A_UINT32 mpdu_pool_alloc_succ;
  7715. /* Number of times the MSDU pool alloc succeeded */
  7716. A_UINT32 msdu_pool_alloc_succ;
  7717. /* Number of times the tid pool alloc failed */
  7718. A_UINT32 tid_pool_alloc_fail;
  7719. /* Number of times the MPDU pool alloc failed */
  7720. A_UINT32 mpdu_pool_alloc_fail;
  7721. /* Number of times the MSDU pool alloc failed */
  7722. A_UINT32 msdu_pool_alloc_fail;
  7723. /* Number of times the tid pool freed */
  7724. A_UINT32 tid_pool_free;
  7725. /* Number of times the MPDU pool freed */
  7726. A_UINT32 mpdu_pool_free;
  7727. /* Number of times the MSDU pool freed */
  7728. A_UINT32 msdu_pool_free;
  7729. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  7730. A_UINT32 msdu_queued;
  7731. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  7732. A_UINT32 msdu_recycled;
  7733. /* Number of MPDUs with invalid peer but A2 found in AST */
  7734. A_UINT32 invalid_peer_a2_in_ast;
  7735. /* Number of MPDUs with invalid peer but A3 found in AST */
  7736. A_UINT32 invalid_peer_a3_in_ast;
  7737. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  7738. A_UINT32 invalid_peer_bmc_mpdus;
  7739. /* Number of MSDUs with err attention word */
  7740. A_UINT32 rxdesc_err_att;
  7741. /* Number of MSDUs with flag of peer_idx_invalid */
  7742. A_UINT32 rxdesc_err_peer_idx_inv;
  7743. /* Number of MSDUs with flag of peer_idx_timeout */
  7744. A_UINT32 rxdesc_err_peer_idx_to;
  7745. /* Number of MSDUs with flag of overflow */
  7746. A_UINT32 rxdesc_err_ov;
  7747. /* Number of MSDUs with flag of msdu_length_err */
  7748. A_UINT32 rxdesc_err_msdu_len;
  7749. /* Number of MSDUs with flag of mpdu_length_err */
  7750. A_UINT32 rxdesc_err_mpdu_len;
  7751. /* Number of MSDUs with flag of tkip_mic_err */
  7752. A_UINT32 rxdesc_err_tkip_mic;
  7753. /* Number of MSDUs with flag of decrypt_err */
  7754. A_UINT32 rxdesc_err_decrypt;
  7755. /* Number of MSDUs with flag of fcs_err */
  7756. A_UINT32 rxdesc_err_fcs;
  7757. /* Number of Unicast (bc_mc bit is not set in attention word)
  7758. * frames with invalid peer handler
  7759. */
  7760. A_UINT32 rxdesc_uc_msdus_inv_peer;
  7761. /* Number of unicast frame directly (direct bit is set in attention word)
  7762. * to DUT with invalid peer handler
  7763. */
  7764. A_UINT32 rxdesc_direct_msdus_inv_peer;
  7765. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  7766. * frames with invalid peer handler
  7767. */
  7768. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  7769. /* Number of MSDUs dropped due to no first MSDU flag */
  7770. A_UINT32 rxdesc_no_1st_msdu;
  7771. /* Number of MSDUs droped due to ring overflow */
  7772. A_UINT32 msdu_drop_ring_ov;
  7773. /* Number of MSDUs dropped due to FC mismatch */
  7774. A_UINT32 msdu_drop_fc_mismatch;
  7775. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  7776. A_UINT32 msdu_drop_mgmt_remote_ring;
  7777. /* Number of MSDUs dropped due to errors not reported in attention word */
  7778. A_UINT32 msdu_drop_misc;
  7779. /* Number of MSDUs go to offload before reorder */
  7780. A_UINT32 offload_msdu_wal;
  7781. /* Number of data frame dropped by offload after reorder */
  7782. A_UINT32 offload_msdu_reorder;
  7783. /* Number of MPDUs with sequence number in the past and within the BA window */
  7784. A_UINT32 dup_past_within_window;
  7785. /* Number of MPDUs with sequence number in the past and outside the BA window */
  7786. A_UINT32 dup_past_outside_window;
  7787. /* Number of MSDUs with decrypt/MIC error */
  7788. A_UINT32 rxdesc_err_decrypt_mic;
  7789. /* Number of data MSDUs received on both local and remote rings */
  7790. A_UINT32 data_msdus_on_both_rings;
  7791. /* MPDUs never filled */
  7792. A_UINT32 holes_not_filled;
  7793. };
  7794. /*
  7795. * Rx Remote buffer statistics
  7796. * NB: all the fields must be defined in 4 octets size.
  7797. */
  7798. struct rx_remote_buffer_mgmt_stats {
  7799. /* Total number of MSDUs reaped for Rx processing */
  7800. A_UINT32 remote_reaped;
  7801. /* MSDUs recycled within firmware */
  7802. A_UINT32 remote_recycled;
  7803. /* MSDUs stored by Data Rx */
  7804. A_UINT32 data_rx_msdus_stored;
  7805. /* Number of HTT indications from WAL Rx MSDU */
  7806. A_UINT32 wal_rx_ind;
  7807. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  7808. A_UINT32 wal_rx_ind_unconsumed;
  7809. /* Number of HTT indications from Data Rx MSDU */
  7810. A_UINT32 data_rx_ind;
  7811. /* Number of unconsumed HTT indications from Data Rx MSDU */
  7812. A_UINT32 data_rx_ind_unconsumed;
  7813. /* Number of HTT indications from ATHBUF */
  7814. A_UINT32 athbuf_rx_ind;
  7815. /* Number of remote buffers requested for refill */
  7816. A_UINT32 refill_buf_req;
  7817. /* Number of remote buffers filled by the host */
  7818. A_UINT32 refill_buf_rsp;
  7819. /* Number of times MAC hw_index = f/w write_index */
  7820. A_INT32 mac_no_bufs;
  7821. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  7822. A_INT32 fw_indices_equal;
  7823. /* Number of times f/w finds no buffers to post */
  7824. A_INT32 host_no_bufs;
  7825. };
  7826. /*
  7827. * TXBF MU/SU packets and NDPA statistics
  7828. * NB: all the fields must be defined in 4 octets size.
  7829. */
  7830. struct rx_txbf_musu_ndpa_pkts_stats {
  7831. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  7832. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  7833. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  7834. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  7835. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  7836. A_UINT32 reserved[3]; /* must be set to 0x0 */
  7837. };
  7838. /*
  7839. * htt_dbg_stats_status -
  7840. * present - The requested stats have been delivered in full.
  7841. * This indicates that either the stats information was contained
  7842. * in its entirety within this message, or else this message
  7843. * completes the delivery of the requested stats info that was
  7844. * partially delivered through earlier STATS_CONF messages.
  7845. * partial - The requested stats have been delivered in part.
  7846. * One or more subsequent STATS_CONF messages with the same
  7847. * cookie value will be sent to deliver the remainder of the
  7848. * information.
  7849. * error - The requested stats could not be delivered, for example due
  7850. * to a shortage of memory to construct a message holding the
  7851. * requested stats.
  7852. * invalid - The requested stat type is either not recognized, or the
  7853. * target is configured to not gather the stats type in question.
  7854. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7855. * series_done - This special value indicates that no further stats info
  7856. * elements are present within a series of stats info elems
  7857. * (within a stats upload confirmation message).
  7858. */
  7859. enum htt_dbg_stats_status {
  7860. HTT_DBG_STATS_STATUS_PRESENT = 0,
  7861. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  7862. HTT_DBG_STATS_STATUS_ERROR = 2,
  7863. HTT_DBG_STATS_STATUS_INVALID = 3,
  7864. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  7865. };
  7866. /**
  7867. * @brief target -> host statistics upload
  7868. *
  7869. * @details
  7870. * The following field definitions describe the format of the HTT target
  7871. * to host stats upload confirmation message.
  7872. * The message contains a cookie echoed from the HTT host->target stats
  7873. * upload request, which identifies which request the confirmation is
  7874. * for, and a series of tag-length-value stats information elements.
  7875. * The tag-length header for each stats info element also includes a
  7876. * status field, to indicate whether the request for the stat type in
  7877. * question was fully met, partially met, unable to be met, or invalid
  7878. * (if the stat type in question is disabled in the target).
  7879. * A special value of all 1's in this status field is used to indicate
  7880. * the end of the series of stats info elements.
  7881. *
  7882. *
  7883. * |31 16|15 8|7 5|4 0|
  7884. * |------------------------------------------------------------|
  7885. * | reserved | msg type |
  7886. * |------------------------------------------------------------|
  7887. * | cookie LSBs |
  7888. * |------------------------------------------------------------|
  7889. * | cookie MSBs |
  7890. * |------------------------------------------------------------|
  7891. * | stats entry length | reserved | S |stat type|
  7892. * |------------------------------------------------------------|
  7893. * | |
  7894. * | type-specific stats info |
  7895. * | |
  7896. * |------------------------------------------------------------|
  7897. * | stats entry length | reserved | S |stat type|
  7898. * |------------------------------------------------------------|
  7899. * | |
  7900. * | type-specific stats info |
  7901. * | |
  7902. * |------------------------------------------------------------|
  7903. * | n/a | reserved | 111 | n/a |
  7904. * |------------------------------------------------------------|
  7905. * Header fields:
  7906. * - MSG_TYPE
  7907. * Bits 7:0
  7908. * Purpose: identifies this is a statistics upload confirmation message
  7909. * Value: 0x9
  7910. * - COOKIE_LSBS
  7911. * Bits 31:0
  7912. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7913. * message with its preceding host->target stats request message.
  7914. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7915. * - COOKIE_MSBS
  7916. * Bits 31:0
  7917. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7918. * message with its preceding host->target stats request message.
  7919. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7920. *
  7921. * Stats Information Element tag-length header fields:
  7922. * - STAT_TYPE
  7923. * Bits 4:0
  7924. * Purpose: identifies the type of statistics info held in the
  7925. * following information element
  7926. * Value: htt_dbg_stats_type
  7927. * - STATUS
  7928. * Bits 7:5
  7929. * Purpose: indicate whether the requested stats are present
  7930. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  7931. * the completion of the stats entry series
  7932. * - LENGTH
  7933. * Bits 31:16
  7934. * Purpose: indicate the stats information size
  7935. * Value: This field specifies the number of bytes of stats information
  7936. * that follows the element tag-length header.
  7937. * It is expected but not required that this length is a multiple of
  7938. * 4 bytes. Even if the length is not an integer multiple of 4, the
  7939. * subsequent stats entry header will begin on a 4-byte aligned
  7940. * boundary.
  7941. */
  7942. #define HTT_T2H_STATS_COOKIE_SIZE 8
  7943. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  7944. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  7945. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  7946. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  7947. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  7948. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  7949. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  7950. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  7951. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  7952. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  7953. do { \
  7954. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  7955. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  7956. } while (0)
  7957. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  7958. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  7959. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  7960. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  7961. do { \
  7962. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  7963. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  7964. } while (0)
  7965. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  7966. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  7967. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  7968. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  7969. do { \
  7970. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  7971. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  7972. } while (0)
  7973. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  7974. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  7975. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  7976. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  7977. #define HTT_MAX_AGGR 64
  7978. #define HTT_HL_MAX_AGGR 18
  7979. /**
  7980. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  7981. *
  7982. * @details
  7983. * The following field definitions describe the format of the HTT host
  7984. * to target frag_desc/msdu_ext bank configuration message.
  7985. * The message contains the based address and the min and max id of the
  7986. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  7987. * MSDU_EXT/FRAG_DESC.
  7988. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  7989. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  7990. * the hardware does the mapping/translation.
  7991. *
  7992. * Total banks that can be configured is configured to 16.
  7993. *
  7994. * This should be called before any TX has be initiated by the HTT
  7995. *
  7996. * |31 16|15 8|7 5|4 0|
  7997. * |------------------------------------------------------------|
  7998. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  7999. * |------------------------------------------------------------|
  8000. * | BANK0_BASE_ADDRESS (bits 31:0) |
  8001. #if HTT_PADDR64
  8002. * | BANK0_BASE_ADDRESS (bits 63:32) |
  8003. #endif
  8004. * |------------------------------------------------------------|
  8005. * | ... |
  8006. * |------------------------------------------------------------|
  8007. * | BANK15_BASE_ADDRESS (bits 31:0) |
  8008. #if HTT_PADDR64
  8009. * | BANK15_BASE_ADDRESS (bits 63:32) |
  8010. #endif
  8011. * |------------------------------------------------------------|
  8012. * | BANK0_MAX_ID | BANK0_MIN_ID |
  8013. * |------------------------------------------------------------|
  8014. * | ... |
  8015. * |------------------------------------------------------------|
  8016. * | BANK15_MAX_ID | BANK15_MIN_ID |
  8017. * |------------------------------------------------------------|
  8018. * Header fields:
  8019. * - MSG_TYPE
  8020. * Bits 7:0
  8021. * Value: 0x6
  8022. * for systems with 64-bit format for bus addresses:
  8023. * - BANKx_BASE_ADDRESS_LO
  8024. * Bits 31:0
  8025. * Purpose: Provide a mechanism to specify the base address of the
  8026. * MSDU_EXT bank physical/bus address.
  8027. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8028. * - BANKx_BASE_ADDRESS_HI
  8029. * Bits 31:0
  8030. * Purpose: Provide a mechanism to specify the base address of the
  8031. * MSDU_EXT bank physical/bus address.
  8032. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8033. * for systems with 32-bit format for bus addresses:
  8034. * - BANKx_BASE_ADDRESS
  8035. * Bits 31:0
  8036. * Purpose: Provide a mechanism to specify the base address of the
  8037. * MSDU_EXT bank physical/bus address.
  8038. * Value: MSDU_EXT bank physical / bus address
  8039. * - BANKx_MIN_ID
  8040. * Bits 15:0
  8041. * Purpose: Provide a mechanism to specify the min index that needs to
  8042. * mapped.
  8043. * - BANKx_MAX_ID
  8044. * Bits 31:16
  8045. * Purpose: Provide a mechanism to specify the max index that needs to
  8046. * mapped.
  8047. *
  8048. */
  8049. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8050. * safe value.
  8051. * @note MAX supported banks is 16.
  8052. */
  8053. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8054. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8055. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8056. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8057. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8058. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8059. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8060. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8061. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8062. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8063. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8064. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8065. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8066. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8067. do { \
  8068. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8069. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8070. } while (0)
  8071. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8072. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8073. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8074. do { \
  8075. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  8076. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  8077. } while (0)
  8078. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8079. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8080. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8081. do { \
  8082. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8083. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8084. } while (0)
  8085. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8086. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8087. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8088. do { \
  8089. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8090. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8091. } while (0)
  8092. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8093. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8094. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8095. do { \
  8096. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8097. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8098. } while (0)
  8099. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8100. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8101. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8102. do { \
  8103. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8104. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8105. } while (0)
  8106. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8107. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  8108. /*
  8109. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  8110. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  8111. * addresses are stored in a XXX-bit field.
  8112. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  8113. * htt_tx_frag_desc64_bank_cfg_t structs.
  8114. */
  8115. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  8116. _paddr_bits_, \
  8117. _paddr__bank_base_address_) \
  8118. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  8119. /** word 0 \
  8120. * msg_type: 8, \
  8121. * pdev_id: 2, \
  8122. * swap: 1, \
  8123. * reserved0: 5, \
  8124. * num_banks: 8, \
  8125. * desc_size: 8; \
  8126. */ \
  8127. A_UINT32 word0; \
  8128. /* \
  8129. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  8130. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  8131. * the second A_UINT32). \
  8132. */ \
  8133. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8134. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8135. } POSTPACK
  8136. /* define htt_tx_frag_desc32_bank_cfg_t */
  8137. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  8138. /* define htt_tx_frag_desc64_bank_cfg_t */
  8139. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  8140. /*
  8141. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  8142. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  8143. */
  8144. #if HTT_PADDR64
  8145. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  8146. #else
  8147. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  8148. #endif
  8149. /**
  8150. * @brief target -> host HTT TX Credit total count update message definition
  8151. *
  8152. *|31 16|15|14 9| 8 |7 0 |
  8153. *|---------------------+--+----------+-------+----------|
  8154. *|cur htt credit delta | Q| reserved | sign | msg type |
  8155. *|------------------------------------------------------|
  8156. *
  8157. * Header fields:
  8158. * - MSG_TYPE
  8159. * Bits 7:0
  8160. * Purpose: identifies this as a htt tx credit delta update message
  8161. * Value: 0xe
  8162. * - SIGN
  8163. * Bits 8
  8164. * identifies whether credit delta is positive or negative
  8165. * Value:
  8166. * - 0x0: credit delta is positive, rebalance in some buffers
  8167. * - 0x1: credit delta is negative, rebalance out some buffers
  8168. * - reserved
  8169. * Bits 14:9
  8170. * Value: 0x0
  8171. * - TXQ_GRP
  8172. * Bit 15
  8173. * Purpose: indicates whether any tx queue group information elements
  8174. * are appended to the tx credit update message
  8175. * Value: 0 -> no tx queue group information element is present
  8176. * 1 -> a tx queue group information element immediately follows
  8177. * - DELTA_COUNT
  8178. * Bits 31:16
  8179. * Purpose: Specify current htt credit delta absolute count
  8180. */
  8181. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8182. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8183. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8184. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8185. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8186. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8187. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8188. do { \
  8189. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8190. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8191. } while (0)
  8192. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8193. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8194. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8195. do { \
  8196. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8197. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8198. } while (0)
  8199. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8200. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8201. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8202. do { \
  8203. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8204. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8205. } while (0)
  8206. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8207. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8208. #define HTT_TX_CREDIT_MSG_BYTES 4
  8209. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8210. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8211. /**
  8212. * @brief HTT WDI_IPA Operation Response Message
  8213. *
  8214. * @details
  8215. * HTT WDI_IPA Operation Response message is sent by target
  8216. * to host confirming suspend or resume operation.
  8217. * |31 24|23 16|15 8|7 0|
  8218. * |----------------+----------------+----------------+----------------|
  8219. * | op_code | Rsvd | msg_type |
  8220. * |-------------------------------------------------------------------|
  8221. * | Rsvd | Response len |
  8222. * |-------------------------------------------------------------------|
  8223. * | |
  8224. * | Response-type specific info |
  8225. * | |
  8226. * | |
  8227. * |-------------------------------------------------------------------|
  8228. * Header fields:
  8229. * - MSG_TYPE
  8230. * Bits 7:0
  8231. * Purpose: Identifies this as WDI_IPA Operation Response message
  8232. * value: = 0x13
  8233. * - OP_CODE
  8234. * Bits 31:16
  8235. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  8236. * value: = enum htt_wdi_ipa_op_code
  8237. * - RSP_LEN
  8238. * Bits 16:0
  8239. * Purpose: length for the response-type specific info
  8240. * value: = length in bytes for response-type specific info
  8241. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8242. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8243. */
  8244. PREPACK struct htt_wdi_ipa_op_response_t
  8245. {
  8246. /* DWORD 0: flags and meta-data */
  8247. A_UINT32
  8248. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8249. reserved1: 8,
  8250. op_code: 16;
  8251. A_UINT32
  8252. rsp_len: 16,
  8253. reserved2: 16;
  8254. } POSTPACK;
  8255. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8256. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8257. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8258. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8259. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8260. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8261. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8262. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8263. do { \
  8264. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8265. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8266. } while (0)
  8267. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8268. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8269. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8270. do { \
  8271. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8272. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8273. } while (0)
  8274. enum htt_phy_mode {
  8275. htt_phy_mode_11a = 0,
  8276. htt_phy_mode_11g = 1,
  8277. htt_phy_mode_11b = 2,
  8278. htt_phy_mode_11g_only = 3,
  8279. htt_phy_mode_11na_ht20 = 4,
  8280. htt_phy_mode_11ng_ht20 = 5,
  8281. htt_phy_mode_11na_ht40 = 6,
  8282. htt_phy_mode_11ng_ht40 = 7,
  8283. htt_phy_mode_11ac_vht20 = 8,
  8284. htt_phy_mode_11ac_vht40 = 9,
  8285. htt_phy_mode_11ac_vht80 = 10,
  8286. htt_phy_mode_11ac_vht20_2g = 11,
  8287. htt_phy_mode_11ac_vht40_2g = 12,
  8288. htt_phy_mode_11ac_vht80_2g = 13,
  8289. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8290. htt_phy_mode_11ac_vht160 = 15,
  8291. htt_phy_mode_max,
  8292. };
  8293. /**
  8294. * @brief target -> host HTT channel change indication
  8295. * @details
  8296. * Specify when a channel change occurs.
  8297. * This allows the host to precisely determine which rx frames arrived
  8298. * on the old channel and which rx frames arrived on the new channel.
  8299. *
  8300. *|31 |7 0 |
  8301. *|-------------------------------------------+----------|
  8302. *| reserved | msg type |
  8303. *|------------------------------------------------------|
  8304. *| primary_chan_center_freq_mhz |
  8305. *|------------------------------------------------------|
  8306. *| contiguous_chan1_center_freq_mhz |
  8307. *|------------------------------------------------------|
  8308. *| contiguous_chan2_center_freq_mhz |
  8309. *|------------------------------------------------------|
  8310. *| phy_mode |
  8311. *|------------------------------------------------------|
  8312. *
  8313. * Header fields:
  8314. * - MSG_TYPE
  8315. * Bits 7:0
  8316. * Purpose: identifies this as a htt channel change indication message
  8317. * Value: 0x15
  8318. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8319. * Bits 31:0
  8320. * Purpose: identify the (center of the) new 20 MHz primary channel
  8321. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8322. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8323. * Bits 31:0
  8324. * Purpose: identify the (center of the) contiguous frequency range
  8325. * comprising the new channel.
  8326. * For example, if the new channel is a 80 MHz channel extending
  8327. * 60 MHz beyond the primary channel, this field would be 30 larger
  8328. * than the primary channel center frequency field.
  8329. * Value: center frequency of the contiguous frequency range comprising
  8330. * the full channel in MHz units
  8331. * (80+80 channels also use the CONTIG_CHAN2 field)
  8332. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8333. * Bits 31:0
  8334. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8335. * within a VHT 80+80 channel.
  8336. * This field is only relevant for VHT 80+80 channels.
  8337. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8338. * channel (arbitrary value for cases besides VHT 80+80)
  8339. * - PHY_MODE
  8340. * Bits 31:0
  8341. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8342. * and band
  8343. * Value: htt_phy_mode enum value
  8344. */
  8345. PREPACK struct htt_chan_change_t
  8346. {
  8347. /* DWORD 0: flags and meta-data */
  8348. A_UINT32
  8349. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8350. reserved1: 24;
  8351. A_UINT32 primary_chan_center_freq_mhz;
  8352. A_UINT32 contig_chan1_center_freq_mhz;
  8353. A_UINT32 contig_chan2_center_freq_mhz;
  8354. A_UINT32 phy_mode;
  8355. } POSTPACK;
  8356. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8357. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8358. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8359. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8360. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8361. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8362. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8363. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8364. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8365. do { \
  8366. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  8367. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8368. } while (0)
  8369. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8370. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8371. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8372. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8373. do { \
  8374. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  8375. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8376. } while (0)
  8377. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8378. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8379. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8380. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8381. do { \
  8382. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  8383. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8384. } while (0)
  8385. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8386. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8387. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8388. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8389. do { \
  8390. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  8391. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8392. } while (0)
  8393. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8394. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8395. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8396. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8397. /**
  8398. * @brief rx offload packet error message
  8399. *
  8400. * @details
  8401. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8402. * of target payload like mic err.
  8403. *
  8404. * |31 24|23 16|15 8|7 0|
  8405. * |----------------+----------------+----------------+----------------|
  8406. * | tid | vdev_id | msg_sub_type | msg_type |
  8407. * |-------------------------------------------------------------------|
  8408. * : (sub-type dependent content) :
  8409. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8410. * Header fields:
  8411. * - msg_type
  8412. * Bits 7:0
  8413. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8414. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8415. * - msg_sub_type
  8416. * Bits 15:8
  8417. * Purpose: Identifies which type of rx error is reported by this message
  8418. * value: htt_rx_ofld_pkt_err_type
  8419. * - vdev_id
  8420. * Bits 23:16
  8421. * Purpose: Identifies which vdev received the erroneous rx frame
  8422. * value:
  8423. * - tid
  8424. * Bits 31:24
  8425. * Purpose: Identifies the traffic type of the rx frame
  8426. * value:
  8427. *
  8428. * - The payload fields used if the sub-type == MIC error are shown below.
  8429. * Note - MIC err is per MSDU, while PN is per MPDU.
  8430. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8431. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8432. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8433. * instead of sending separate HTT messages for each wrong MSDU within
  8434. * the MPDU.
  8435. *
  8436. * |31 24|23 16|15 8|7 0|
  8437. * |----------------+----------------+----------------+----------------|
  8438. * | Rsvd | key_id | peer_id |
  8439. * |-------------------------------------------------------------------|
  8440. * | receiver MAC addr 31:0 |
  8441. * |-------------------------------------------------------------------|
  8442. * | Rsvd | receiver MAC addr 47:32 |
  8443. * |-------------------------------------------------------------------|
  8444. * | transmitter MAC addr 31:0 |
  8445. * |-------------------------------------------------------------------|
  8446. * | Rsvd | transmitter MAC addr 47:32 |
  8447. * |-------------------------------------------------------------------|
  8448. * | PN 31:0 |
  8449. * |-------------------------------------------------------------------|
  8450. * | Rsvd | PN 47:32 |
  8451. * |-------------------------------------------------------------------|
  8452. * - peer_id
  8453. * Bits 15:0
  8454. * Purpose: identifies which peer is frame is from
  8455. * value:
  8456. * - key_id
  8457. * Bits 23:16
  8458. * Purpose: identifies key_id of rx frame
  8459. * value:
  8460. * - RA_31_0 (receiver MAC addr 31:0)
  8461. * Bits 31:0
  8462. * Purpose: identifies by MAC address which vdev received the frame
  8463. * value: MAC address lower 4 bytes
  8464. * - RA_47_32 (receiver MAC addr 47:32)
  8465. * Bits 15:0
  8466. * Purpose: identifies by MAC address which vdev received the frame
  8467. * value: MAC address upper 2 bytes
  8468. * - TA_31_0 (transmitter MAC addr 31:0)
  8469. * Bits 31:0
  8470. * Purpose: identifies by MAC address which peer transmitted the frame
  8471. * value: MAC address lower 4 bytes
  8472. * - TA_47_32 (transmitter MAC addr 47:32)
  8473. * Bits 15:0
  8474. * Purpose: identifies by MAC address which peer transmitted the frame
  8475. * value: MAC address upper 2 bytes
  8476. * - PN_31_0
  8477. * Bits 31:0
  8478. * Purpose: Identifies pn of rx frame
  8479. * value: PN lower 4 bytes
  8480. * - PN_47_32
  8481. * Bits 15:0
  8482. * Purpose: Identifies pn of rx frame
  8483. * value:
  8484. * TKIP or CCMP: PN upper 2 bytes
  8485. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8486. */
  8487. enum htt_rx_ofld_pkt_err_type {
  8488. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8489. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8490. };
  8491. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8492. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8493. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8494. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8495. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8496. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8497. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8498. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8499. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8500. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8501. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8502. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8503. do { \
  8504. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8505. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8506. } while (0)
  8507. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8508. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8509. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8510. do { \
  8511. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8512. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8513. } while (0)
  8514. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8515. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8516. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8517. do { \
  8518. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8519. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8520. } while (0)
  8521. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8522. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8523. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8524. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8525. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8526. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8527. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8528. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8529. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8530. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8531. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8532. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8533. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8534. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8535. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8536. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8537. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8538. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8539. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8540. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8541. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8542. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8543. do { \
  8544. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8545. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8546. } while (0)
  8547. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8548. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8549. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8550. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8551. do { \
  8552. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8553. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8554. } while (0)
  8555. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8556. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8557. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8558. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8559. do { \
  8560. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8561. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8562. } while (0)
  8563. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8564. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8565. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8566. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8567. do { \
  8568. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8569. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8570. } while (0)
  8571. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8572. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8573. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8574. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8575. do { \
  8576. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8577. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8578. } while (0)
  8579. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8580. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8581. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8582. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8583. do { \
  8584. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8585. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8586. } while (0)
  8587. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8588. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8589. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8590. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8591. do { \
  8592. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8593. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8594. } while (0)
  8595. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8596. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8597. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8598. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8599. do { \
  8600. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8601. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8602. } while (0)
  8603. /**
  8604. * @brief peer rate report message
  8605. *
  8606. * @details
  8607. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8608. * justified rate of all the peers.
  8609. *
  8610. * |31 24|23 16|15 8|7 0|
  8611. * |----------------+----------------+----------------+----------------|
  8612. * | peer_count | | msg_type |
  8613. * |-------------------------------------------------------------------|
  8614. * : Payload (variant number of peer rate report) :
  8615. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8616. * Header fields:
  8617. * - msg_type
  8618. * Bits 7:0
  8619. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8620. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8621. * - reserved
  8622. * Bits 15:8
  8623. * Purpose:
  8624. * value:
  8625. * - peer_count
  8626. * Bits 31:16
  8627. * Purpose: Specify how many peer rate report elements are present in the payload.
  8628. * value:
  8629. *
  8630. * Payload:
  8631. * There are variant number of peer rate report follow the first 32 bits.
  8632. * The peer rate report is defined as follows.
  8633. *
  8634. * |31 20|19 16|15 0|
  8635. * |-----------------------+---------+---------------------------------|-
  8636. * | reserved | phy | peer_id | \
  8637. * |-------------------------------------------------------------------| -> report #0
  8638. * | rate | /
  8639. * |-----------------------+---------+---------------------------------|-
  8640. * | reserved | phy | peer_id | \
  8641. * |-------------------------------------------------------------------| -> report #1
  8642. * | rate | /
  8643. * |-----------------------+---------+---------------------------------|-
  8644. * | reserved | phy | peer_id | \
  8645. * |-------------------------------------------------------------------| -> report #2
  8646. * | rate | /
  8647. * |-------------------------------------------------------------------|-
  8648. * : :
  8649. * : :
  8650. * : :
  8651. * :-------------------------------------------------------------------:
  8652. *
  8653. * - peer_id
  8654. * Bits 15:0
  8655. * Purpose: identify the peer
  8656. * value:
  8657. * - phy
  8658. * Bits 19:16
  8659. * Purpose: identify which phy is in use
  8660. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8661. * Please see enum htt_peer_report_phy_type for detail.
  8662. * - reserved
  8663. * Bits 31:20
  8664. * Purpose:
  8665. * value:
  8666. * - rate
  8667. * Bits 31:0
  8668. * Purpose: represent the justified rate of the peer specified by peer_id
  8669. * value:
  8670. */
  8671. enum htt_peer_rate_report_phy_type {
  8672. HTT_PEER_RATE_REPORT_11B = 0,
  8673. HTT_PEER_RATE_REPORT_11A_G,
  8674. HTT_PEER_RATE_REPORT_11N,
  8675. HTT_PEER_RATE_REPORT_11AC,
  8676. };
  8677. #define HTT_PEER_RATE_REPORT_SIZE 8
  8678. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8679. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8680. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8681. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8682. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8683. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8684. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8685. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8686. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8687. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8688. do { \
  8689. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8690. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8691. } while (0)
  8692. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8693. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8694. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8695. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8696. do { \
  8697. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8698. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8699. } while (0)
  8700. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8701. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8702. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8703. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8704. do { \
  8705. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8706. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8707. } while (0)
  8708. /**
  8709. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8710. *
  8711. * @details
  8712. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  8713. * a flow of descriptors.
  8714. *
  8715. * This message is in TLV format and indicates the parameters to be setup a
  8716. * flow in the host. Each entry indicates that a particular flow ID is ready to
  8717. * receive descriptors from a specified pool.
  8718. *
  8719. * The message would appear as follows:
  8720. *
  8721. * |31 24|23 16|15 8|7 0|
  8722. * |----------------+----------------+----------------+----------------|
  8723. * header | reserved | num_flows | msg_type |
  8724. * |-------------------------------------------------------------------|
  8725. * | |
  8726. * : payload :
  8727. * | |
  8728. * |-------------------------------------------------------------------|
  8729. *
  8730. * The header field is one DWORD long and is interpreted as follows:
  8731. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  8732. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  8733. * this message
  8734. * b'16-31 - reserved: These bits are reserved for future use
  8735. *
  8736. * Payload:
  8737. * The payload would contain multiple objects of the following structure. Each
  8738. * object represents a flow.
  8739. *
  8740. * |31 24|23 16|15 8|7 0|
  8741. * |----------------+----------------+----------------+----------------|
  8742. * header | reserved | num_flows | msg_type |
  8743. * |-------------------------------------------------------------------|
  8744. * payload0| flow_type |
  8745. * |-------------------------------------------------------------------|
  8746. * | flow_id |
  8747. * |-------------------------------------------------------------------|
  8748. * | reserved0 | flow_pool_id |
  8749. * |-------------------------------------------------------------------|
  8750. * | reserved1 | flow_pool_size |
  8751. * |-------------------------------------------------------------------|
  8752. * | reserved2 |
  8753. * |-------------------------------------------------------------------|
  8754. * payload1| flow_type |
  8755. * |-------------------------------------------------------------------|
  8756. * | flow_id |
  8757. * |-------------------------------------------------------------------|
  8758. * | reserved0 | flow_pool_id |
  8759. * |-------------------------------------------------------------------|
  8760. * | reserved1 | flow_pool_size |
  8761. * |-------------------------------------------------------------------|
  8762. * | reserved2 |
  8763. * |-------------------------------------------------------------------|
  8764. * | . |
  8765. * | . |
  8766. * | . |
  8767. * |-------------------------------------------------------------------|
  8768. *
  8769. * Each payload is 5 DWORDS long and is interpreted as follows:
  8770. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  8771. * this flow is associated. It can be VDEV, peer,
  8772. * or tid (AC). Based on enum htt_flow_type.
  8773. *
  8774. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8775. * object. For flow_type vdev it is set to the
  8776. * vdevid, for peer it is peerid and for tid, it is
  8777. * tid_num.
  8778. *
  8779. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  8780. * in the host for this flow
  8781. * b'16:31 - reserved0: This field in reserved for the future. In case
  8782. * we have a hierarchical implementation (HCM) of
  8783. * pools, it can be used to indicate the ID of the
  8784. * parent-pool.
  8785. *
  8786. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  8787. * Descriptors for this flow will be
  8788. * allocated from this pool in the host.
  8789. * b'16:31 - reserved1: This field in reserved for the future. In case
  8790. * we have a hierarchical implementation of pools,
  8791. * it can be used to indicate the max number of
  8792. * descriptors in the pool. The b'0:15 can be used
  8793. * to indicate min number of descriptors in the
  8794. * HCM scheme.
  8795. *
  8796. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  8797. * we have a hierarchical implementation of pools,
  8798. * b'0:15 can be used to indicate the
  8799. * priority-based borrowing (PBB) threshold of
  8800. * the flow's pool. The b'16:31 are still left
  8801. * reserved.
  8802. */
  8803. enum htt_flow_type {
  8804. FLOW_TYPE_VDEV = 0,
  8805. /* Insert new flow types above this line */
  8806. };
  8807. PREPACK struct htt_flow_pool_map_payload_t {
  8808. A_UINT32 flow_type;
  8809. A_UINT32 flow_id;
  8810. A_UINT32 flow_pool_id:16,
  8811. reserved0:16;
  8812. A_UINT32 flow_pool_size:16,
  8813. reserved1:16;
  8814. A_UINT32 reserved2;
  8815. } POSTPACK;
  8816. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  8817. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  8818. (sizeof(struct htt_flow_pool_map_payload_t))
  8819. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  8820. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  8821. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  8822. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  8823. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  8824. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  8825. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  8826. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  8827. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  8828. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  8829. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  8830. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  8831. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  8832. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  8833. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  8834. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  8835. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  8836. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  8837. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  8838. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  8839. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  8840. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  8841. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  8842. do { \
  8843. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  8844. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  8845. } while (0)
  8846. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  8847. do { \
  8848. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  8849. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  8850. } while (0)
  8851. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  8852. do { \
  8853. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  8854. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  8855. } while (0)
  8856. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  8857. do { \
  8858. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  8859. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  8860. } while (0)
  8861. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  8862. do { \
  8863. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  8864. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  8865. } while (0)
  8866. /**
  8867. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  8868. *
  8869. * @details
  8870. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  8871. * down a flow of descriptors.
  8872. * This message indicates that for the flow (whose ID is provided) is wanting
  8873. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  8874. * pool of descriptors from where descriptors are being allocated for this
  8875. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  8876. * be unmapped by the host.
  8877. *
  8878. * The message would appear as follows:
  8879. *
  8880. * |31 24|23 16|15 8|7 0|
  8881. * |----------------+----------------+----------------+----------------|
  8882. * | reserved0 | msg_type |
  8883. * |-------------------------------------------------------------------|
  8884. * | flow_type |
  8885. * |-------------------------------------------------------------------|
  8886. * | flow_id |
  8887. * |-------------------------------------------------------------------|
  8888. * | reserved1 | flow_pool_id |
  8889. * |-------------------------------------------------------------------|
  8890. *
  8891. * The message is interpreted as follows:
  8892. * dword0 - b'0:7 - msg_type: This will be set to
  8893. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  8894. * b'8:31 - reserved0: Reserved for future use
  8895. *
  8896. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  8897. * this flow is associated. It can be VDEV, peer,
  8898. * or tid (AC). Based on enum htt_flow_type.
  8899. *
  8900. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8901. * object. For flow_type vdev it is set to the
  8902. * vdevid, for peer it is peerid and for tid, it is
  8903. * tid_num.
  8904. *
  8905. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  8906. * used in the host for this flow
  8907. * b'16:31 - reserved0: This field in reserved for the future.
  8908. *
  8909. */
  8910. PREPACK struct htt_flow_pool_unmap_t {
  8911. A_UINT32 msg_type:8,
  8912. reserved0:24;
  8913. A_UINT32 flow_type;
  8914. A_UINT32 flow_id;
  8915. A_UINT32 flow_pool_id:16,
  8916. reserved1:16;
  8917. } POSTPACK;
  8918. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  8919. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  8920. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  8921. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  8922. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  8923. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  8924. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  8925. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  8926. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  8927. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  8928. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  8929. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  8930. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  8931. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  8932. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  8933. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  8934. do { \
  8935. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  8936. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  8937. } while (0)
  8938. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  8939. do { \
  8940. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  8941. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  8942. } while (0)
  8943. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  8944. do { \
  8945. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  8946. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  8947. } while (0)
  8948. /**
  8949. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  8950. *
  8951. * @details
  8952. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  8953. * SRNG ring setup is done
  8954. *
  8955. * This message indicates whether the last setup operation is successful.
  8956. * It will be sent to host when host set respose_required bit in
  8957. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  8958. * The message would appear as follows:
  8959. *
  8960. * |31 24|23 16|15 8|7 0|
  8961. * |--------------- +----------------+----------------+----------------|
  8962. * | setup_status | ring_id | pdev_id | msg_type |
  8963. * |-------------------------------------------------------------------|
  8964. *
  8965. * The message is interpreted as follows:
  8966. * dword0 - b'0:7 - msg_type: This will be set to
  8967. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  8968. * b'8:15 - pdev_id:
  8969. * 0 (for rings at SOC/UMAC level),
  8970. * 1/2/3 mac id (for rings at LMAC level)
  8971. * b'16:23 - ring_id: Identify the ring which is set up
  8972. * More details can be got from enum htt_srng_ring_id
  8973. * b'24:31 - setup_status: Indicate status of setup operation
  8974. * Refer to htt_ring_setup_status
  8975. */
  8976. PREPACK struct htt_sring_setup_done_t {
  8977. A_UINT32 msg_type: 8,
  8978. pdev_id: 8,
  8979. ring_id: 8,
  8980. setup_status: 8;
  8981. } POSTPACK;
  8982. enum htt_ring_setup_status {
  8983. htt_ring_setup_status_ok = 0,
  8984. htt_ring_setup_status_error,
  8985. };
  8986. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  8987. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  8988. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  8989. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  8990. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  8991. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  8992. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  8993. do { \
  8994. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  8995. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  8996. } while (0)
  8997. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  8998. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  8999. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  9000. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  9001. HTT_SRING_SETUP_DONE_RING_ID_S)
  9002. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  9003. do { \
  9004. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  9005. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  9006. } while (0)
  9007. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  9008. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  9009. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  9010. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  9011. HTT_SRING_SETUP_DONE_STATUS_S)
  9012. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  9013. do { \
  9014. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  9015. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  9016. } while (0)
  9017. /**
  9018. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9019. *
  9020. * @details
  9021. * HTT TX map flow entry with tqm flow pointer
  9022. * Sent from firmware to host to add tqm flow pointer in corresponding
  9023. * flow search entry. Flow metadata is replayed back to host as part of this
  9024. * struct to enable host to find the specific flow search entry
  9025. *
  9026. * The message would appear as follows:
  9027. *
  9028. * |31 28|27 18|17 14|13 8|7 0|
  9029. * |-------+------------------------------------------+----------------|
  9030. * | rsvd0 | fse_hsh_idx | msg_type |
  9031. * |-------------------------------------------------------------------|
  9032. * | rsvd1 | tid | peer_id |
  9033. * |-------------------------------------------------------------------|
  9034. * | tqm_flow_pntr_lo |
  9035. * |-------------------------------------------------------------------|
  9036. * | tqm_flow_pntr_hi |
  9037. * |-------------------------------------------------------------------|
  9038. * | fse_meta_data |
  9039. * |-------------------------------------------------------------------|
  9040. *
  9041. * The message is interpreted as follows:
  9042. *
  9043. * dword0 - b'0:7 - msg_type: This will be set to
  9044. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9045. *
  9046. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9047. * for this flow entry
  9048. *
  9049. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9050. *
  9051. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9052. *
  9053. * dword1 - b'14:17 - tid
  9054. *
  9055. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9056. *
  9057. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9058. *
  9059. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9060. *
  9061. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9062. * given by host
  9063. */
  9064. PREPACK struct htt_tx_map_flow_info {
  9065. A_UINT32
  9066. msg_type: 8,
  9067. fse_hsh_idx: 20,
  9068. rsvd0: 4;
  9069. A_UINT32
  9070. peer_id: 14,
  9071. tid: 4,
  9072. rsvd1: 14;
  9073. A_UINT32 tqm_flow_pntr_lo;
  9074. A_UINT32 tqm_flow_pntr_hi;
  9075. struct htt_tx_flow_metadata fse_meta_data;
  9076. } POSTPACK;
  9077. /* DWORD 0 */
  9078. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9079. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9080. /* DWORD 1 */
  9081. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9082. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9083. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9084. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9085. /* DWORD 0 */
  9086. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9087. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9088. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9089. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9090. do { \
  9091. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9092. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9093. } while (0)
  9094. /* DWORD 1 */
  9095. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9096. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9097. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9098. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9099. do { \
  9100. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9101. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9102. } while (0)
  9103. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9104. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9105. HTT_TX_MAP_FLOW_INFO_TID_S)
  9106. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9107. do { \
  9108. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  9109. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  9110. } while (0)
  9111. /*
  9112. * htt_dbg_ext_stats_status -
  9113. * present - The requested stats have been delivered in full.
  9114. * This indicates that either the stats information was contained
  9115. * in its entirety within this message, or else this message
  9116. * completes the delivery of the requested stats info that was
  9117. * partially delivered through earlier STATS_CONF messages.
  9118. * partial - The requested stats have been delivered in part.
  9119. * One or more subsequent STATS_CONF messages with the same
  9120. * cookie value will be sent to deliver the remainder of the
  9121. * information.
  9122. * error - The requested stats could not be delivered, for example due
  9123. * to a shortage of memory to construct a message holding the
  9124. * requested stats.
  9125. * invalid - The requested stat type is either not recognized, or the
  9126. * target is configured to not gather the stats type in question.
  9127. */
  9128. enum htt_dbg_ext_stats_status {
  9129. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  9130. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  9131. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  9132. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  9133. };
  9134. /**
  9135. * @brief target -> host ppdu stats upload
  9136. *
  9137. * @details
  9138. * The following field definitions describe the format of the HTT target
  9139. * to host ppdu stats indication message.
  9140. *
  9141. *
  9142. * |31 16|15 12|11 10|9 8|7 0 |
  9143. * |----------------------------------------------------------------------|
  9144. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  9145. * |----------------------------------------------------------------------|
  9146. * | ppdu_id |
  9147. * |----------------------------------------------------------------------|
  9148. * | Timestamp in us |
  9149. * |----------------------------------------------------------------------|
  9150. * | reserved |
  9151. * |----------------------------------------------------------------------|
  9152. * | type-specific stats info |
  9153. * | (see htt_ppdu_stats.h) |
  9154. * |----------------------------------------------------------------------|
  9155. * Header fields:
  9156. * - MSG_TYPE
  9157. * Bits 7:0
  9158. * Purpose: Identifies this is a PPDU STATS indication
  9159. * message.
  9160. * Value: 0x1d
  9161. * - mac_id
  9162. * Bits 9:8
  9163. * Purpose: mac_id of this ppdu_id
  9164. * Value: 0-3
  9165. * - pdev_id
  9166. * Bits 11:10
  9167. * Purpose: pdev_id of this ppdu_id
  9168. * Value: 0-3
  9169. * 0 (for rings at SOC level),
  9170. * 1/2/3 PDEV -> 0/1/2
  9171. * - payload_size
  9172. * Bits 31:16
  9173. * Purpose: total tlv size
  9174. * Value: payload_size in bytes
  9175. */
  9176. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  9177. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  9178. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  9179. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  9180. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  9181. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  9182. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  9183. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  9184. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  9185. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  9186. do { \
  9187. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  9188. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  9189. } while (0)
  9190. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  9191. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  9192. HTT_T2H_PPDU_STATS_MAC_ID_S)
  9193. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  9194. do { \
  9195. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  9196. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  9197. } while (0)
  9198. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  9199. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  9200. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  9201. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  9202. do { \
  9203. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  9204. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  9205. } while (0)
  9206. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  9207. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  9208. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  9209. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  9210. do { \
  9211. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  9212. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  9213. } while (0)
  9214. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  9215. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  9216. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  9217. /**
  9218. * @brief target -> host extended statistics upload
  9219. *
  9220. * @details
  9221. * The following field definitions describe the format of the HTT target
  9222. * to host stats upload confirmation message.
  9223. * The message contains a cookie echoed from the HTT host->target stats
  9224. * upload request, which identifies which request the confirmation is
  9225. * for, and a single stats can span over multiple HTT stats indication
  9226. * due to the HTT message size limitation so every HTT ext stats indication
  9227. * will have tag-length-value stats information elements.
  9228. * The tag-length header for each HTT stats IND message also includes a
  9229. * status field, to indicate whether the request for the stat type in
  9230. * question was fully met, partially met, unable to be met, or invalid
  9231. * (if the stat type in question is disabled in the target).
  9232. * A Done bit 1's indicate the end of the of stats info elements.
  9233. *
  9234. *
  9235. * |31 16|15 12|11|10 8|7 5|4 0|
  9236. * |--------------------------------------------------------------|
  9237. * | reserved | msg type |
  9238. * |--------------------------------------------------------------|
  9239. * | cookie LSBs |
  9240. * |--------------------------------------------------------------|
  9241. * | cookie MSBs |
  9242. * |--------------------------------------------------------------|
  9243. * | stats entry length | rsvd | D| S | stat type |
  9244. * |--------------------------------------------------------------|
  9245. * | type-specific stats info |
  9246. * | (see htt_stats.h) |
  9247. * |--------------------------------------------------------------|
  9248. * Header fields:
  9249. * - MSG_TYPE
  9250. * Bits 7:0
  9251. * Purpose: Identifies this is a extended statistics upload confirmation
  9252. * message.
  9253. * Value: 0x1c
  9254. * - COOKIE_LSBS
  9255. * Bits 31:0
  9256. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9257. * message with its preceding host->target stats request message.
  9258. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9259. * - COOKIE_MSBS
  9260. * Bits 31:0
  9261. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9262. * message with its preceding host->target stats request message.
  9263. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9264. *
  9265. * Stats Information Element tag-length header fields:
  9266. * - STAT_TYPE
  9267. * Bits 7:0
  9268. * Purpose: identifies the type of statistics info held in the
  9269. * following information element
  9270. * Value: htt_dbg_ext_stats_type
  9271. * - STATUS
  9272. * Bits 10:8
  9273. * Purpose: indicate whether the requested stats are present
  9274. * Value: htt_dbg_ext_stats_status
  9275. * - DONE
  9276. * Bits 11
  9277. * Purpose:
  9278. * Indicates the completion of the stats entry, this will be the last
  9279. * stats conf HTT segment for the requested stats type.
  9280. * Value:
  9281. * 0 -> the stats retrieval is ongoing
  9282. * 1 -> the stats retrieval is complete
  9283. * - LENGTH
  9284. * Bits 31:16
  9285. * Purpose: indicate the stats information size
  9286. * Value: This field specifies the number of bytes of stats information
  9287. * that follows the element tag-length header.
  9288. * It is expected but not required that this length is a multiple of
  9289. * 4 bytes.
  9290. */
  9291. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9292. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9293. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9294. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9295. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9296. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9297. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9298. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9299. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9300. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9301. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9302. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9303. do { \
  9304. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  9305. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9306. } while (0)
  9307. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9308. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9309. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9310. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9311. do { \
  9312. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  9313. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9314. } while (0)
  9315. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9316. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9317. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9318. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9319. do { \
  9320. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  9321. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  9322. } while (0)
  9323. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9324. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9325. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9326. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9327. do { \
  9328. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  9329. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9330. } while (0)
  9331. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9332. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9333. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9334. typedef enum {
  9335. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9336. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9337. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9338. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9339. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9340. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  9341. /* Reserved from 128 - 255 for target internal use.*/
  9342. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  9343. } HTT_PEER_TYPE;
  9344. /** 2 word representation of MAC addr */
  9345. typedef struct {
  9346. /** upper 4 bytes of MAC address */
  9347. A_UINT32 mac_addr31to0;
  9348. /** lower 2 bytes of MAC address */
  9349. A_UINT32 mac_addr47to32;
  9350. } htt_mac_addr;
  9351. /** macro to convert MAC address from char array to HTT word format */
  9352. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  9353. (phtt_mac_addr)->mac_addr31to0 = \
  9354. (((c_macaddr)[0] << 0) | \
  9355. ((c_macaddr)[1] << 8) | \
  9356. ((c_macaddr)[2] << 16) | \
  9357. ((c_macaddr)[3] << 24)); \
  9358. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  9359. } while (0)
  9360. /**
  9361. * @brief target -> host monitor mac header indication message
  9362. *
  9363. * @details
  9364. * The following diagram shows the format of the monitor mac header message
  9365. * sent from the target to the host.
  9366. * This message is primarily sent when promiscuous rx mode is enabled.
  9367. * One message is sent per rx PPDU.
  9368. *
  9369. * |31 24|23 16|15 8|7 0|
  9370. * |-------------------------------------------------------------|
  9371. * | peer_id | reserved0 | msg_type |
  9372. * |-------------------------------------------------------------|
  9373. * | reserved1 | num_mpdu |
  9374. * |-------------------------------------------------------------|
  9375. * | struct hw_rx_desc |
  9376. * | (see wal_rx_desc.h) |
  9377. * |-------------------------------------------------------------|
  9378. * | struct ieee80211_frame_addr4 |
  9379. * | (see ieee80211_defs.h) |
  9380. * |-------------------------------------------------------------|
  9381. * | struct ieee80211_frame_addr4 |
  9382. * | (see ieee80211_defs.h) |
  9383. * |-------------------------------------------------------------|
  9384. * | ...... |
  9385. * |-------------------------------------------------------------|
  9386. *
  9387. * Header fields:
  9388. * - msg_type
  9389. * Bits 7:0
  9390. * Purpose: Identifies this is a monitor mac header indication message.
  9391. * Value: 0x20
  9392. * - peer_id
  9393. * Bits 31:16
  9394. * Purpose: Software peer id given by host during association,
  9395. * During promiscuous mode, the peer ID will be invalid (0xFF)
  9396. * for rx PPDUs received from unassociated peers.
  9397. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  9398. * - num_mpdu
  9399. * Bits 15:0
  9400. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  9401. * delivered within the message.
  9402. * Value: 1 to 32
  9403. * num_mpdu is limited to a maximum value of 32, due to buffer
  9404. * size limits. For PPDUs with more than 32 MPDUs, only the
  9405. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  9406. * the PPDU will be provided.
  9407. */
  9408. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  9409. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  9410. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  9411. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  9412. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  9413. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  9414. do { \
  9415. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  9416. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  9417. } while (0)
  9418. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  9419. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  9420. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  9421. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  9422. do { \
  9423. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  9424. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  9425. } while (0)
  9426. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  9427. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  9428. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  9429. #endif