htt.h 645 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358
  1. /*
  2. * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  177. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  178. * for a MSDU.
  179. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  180. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  181. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  182. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  183. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  184. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  185. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  186. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  187. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  188. * htt_tx_data_hdr_information
  189. * 3.73 Add channel pre-calibration data upload and download messages defs for
  190. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  191. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  192. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  193. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  194. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  195. * 3.78 Add htt_ppdu_id def.
  196. * 3.79 Add HTT_NUM_AC_WMM def.
  197. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  198. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  199. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  200. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  201. * 3.84 Add fisa_control_bits_v2 def.
  202. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  203. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  204. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  205. */
  206. #define HTT_CURRENT_VERSION_MAJOR 3
  207. #define HTT_CURRENT_VERSION_MINOR 87
  208. #define HTT_NUM_TX_FRAG_DESC 1024
  209. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  210. #define HTT_CHECK_SET_VAL(field, val) \
  211. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  212. /* macros to assist in sign-extending fields from HTT messages */
  213. #define HTT_SIGN_BIT_MASK(field) \
  214. ((field ## _M + (1 << field ## _S)) >> 1)
  215. #define HTT_SIGN_BIT(_val, field) \
  216. (_val & HTT_SIGN_BIT_MASK(field))
  217. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  218. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  219. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  220. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  221. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  222. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  223. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  224. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  225. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  226. /*
  227. * TEMPORARY:
  228. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  229. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  230. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  231. * updated.
  232. */
  233. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  234. /*
  235. * TEMPORARY:
  236. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  237. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  238. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  239. * updated.
  240. */
  241. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  242. /*
  243. * htt_dbg_stats_type -
  244. * bit positions for each stats type within a stats type bitmask
  245. * The bitmask contains 24 bits.
  246. */
  247. enum htt_dbg_stats_type {
  248. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  249. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  250. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  251. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  252. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  253. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  254. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  255. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  256. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  257. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  258. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  259. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  260. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  261. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  262. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  263. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  264. /* bits 16-23 currently reserved */
  265. /* keep this last */
  266. HTT_DBG_NUM_STATS
  267. };
  268. /*=== HTT option selection TLVs ===
  269. * Certain HTT messages have alternatives or options.
  270. * For such cases, the host and target need to agree on which option to use.
  271. * Option specification TLVs can be appended to the VERSION_REQ and
  272. * VERSION_CONF messages to select options other than the default.
  273. * These TLVs are entirely optional - if they are not provided, there is a
  274. * well-defined default for each option. If they are provided, they can be
  275. * provided in any order. Each TLV can be present or absent independent of
  276. * the presence / absence of other TLVs.
  277. *
  278. * The HTT option selection TLVs use the following format:
  279. * |31 16|15 8|7 0|
  280. * |---------------------------------+----------------+----------------|
  281. * | value (payload) | length | tag |
  282. * |-------------------------------------------------------------------|
  283. * The value portion need not be only 2 bytes; it can be extended by any
  284. * integer number of 4-byte units. The total length of the TLV, including
  285. * the tag and length fields, must be a multiple of 4 bytes. The length
  286. * field specifies the total TLV size in 4-byte units. Thus, the typical
  287. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  288. * field, would store 0x1 in its length field, to show that the TLV occupies
  289. * a single 4-byte unit.
  290. */
  291. /*--- TLV header format - applies to all HTT option TLVs ---*/
  292. enum HTT_OPTION_TLV_TAGS {
  293. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  294. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  295. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  296. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  297. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  298. };
  299. PREPACK struct htt_option_tlv_header_t {
  300. A_UINT8 tag;
  301. A_UINT8 length;
  302. } POSTPACK;
  303. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  304. #define HTT_OPTION_TLV_TAG_S 0
  305. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  306. #define HTT_OPTION_TLV_LENGTH_S 8
  307. /*
  308. * value0 - 16 bit value field stored in word0
  309. * The TLV's value field may be longer than 2 bytes, in which case
  310. * the remainder of the value is stored in word1, word2, etc.
  311. */
  312. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  313. #define HTT_OPTION_TLV_VALUE0_S 16
  314. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  315. do { \
  316. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  317. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  318. } while (0)
  319. #define HTT_OPTION_TLV_TAG_GET(word) \
  320. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  321. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  322. do { \
  323. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  324. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  325. } while (0)
  326. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  327. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  328. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  329. do { \
  330. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  331. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  332. } while (0)
  333. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  334. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  335. /*--- format of specific HTT option TLVs ---*/
  336. /*
  337. * HTT option TLV for specifying LL bus address size
  338. * Some chips require bus addresses used by the target to access buffers
  339. * within the host's memory to be 32 bits; others require bus addresses
  340. * used by the target to access buffers within the host's memory to be
  341. * 64 bits.
  342. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  343. * a suffix to the VERSION_CONF message to specify which bus address format
  344. * the target requires.
  345. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  346. * default to providing bus addresses to the target in 32-bit format.
  347. */
  348. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  349. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  350. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  351. };
  352. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  353. struct htt_option_tlv_header_t hdr;
  354. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  355. } POSTPACK;
  356. /*
  357. * HTT option TLV for specifying whether HL systems should indicate
  358. * over-the-air tx completion for individual frames, or should instead
  359. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  360. * requests an OTA tx completion for a particular tx frame.
  361. * This option does not apply to LL systems, where the TX_COMPL_IND
  362. * is mandatory.
  363. * This option is primarily intended for HL systems in which the tx frame
  364. * downloads over the host --> target bus are as slow as or slower than
  365. * the transmissions over the WLAN PHY. For cases where the bus is faster
  366. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  367. * and consquently will send one TX_COMPL_IND message that covers several
  368. * tx frames. For cases where the WLAN PHY is faster than the bus,
  369. * the target will end up transmitting very short A-MPDUs, and consequently
  370. * sending many TX_COMPL_IND messages, which each cover a very small number
  371. * of tx frames.
  372. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  373. * a suffix to the VERSION_REQ message to request whether the host desires to
  374. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  375. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  376. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  377. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  378. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  379. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  380. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  381. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  382. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  383. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  384. * TLV.
  385. */
  386. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  387. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  388. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  389. };
  390. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  391. struct htt_option_tlv_header_t hdr;
  392. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  393. } POSTPACK;
  394. /*
  395. * HTT option TLV for specifying how many tx queue groups the target
  396. * may establish.
  397. * This TLV specifies the maximum value the target may send in the
  398. * txq_group_id field of any TXQ_GROUP information elements sent by
  399. * the target to the host. This allows the host to pre-allocate an
  400. * appropriate number of tx queue group structs.
  401. *
  402. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  403. * a suffix to the VERSION_REQ message to specify whether the host supports
  404. * tx queue groups at all, and if so if there is any limit on the number of
  405. * tx queue groups that the host supports.
  406. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  407. * a suffix to the VERSION_CONF message. If the host has specified in the
  408. * VER_REQ message a limit on the number of tx queue groups the host can
  409. * supprt, the target shall limit its specification of the maximum tx groups
  410. * to be no larger than this host-specified limit.
  411. *
  412. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  413. * shall preallocate 4 tx queue group structs, and the target shall not
  414. * specify a txq_group_id larger than 3.
  415. */
  416. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  417. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  418. /*
  419. * values 1 through N specify the max number of tx queue groups
  420. * the sender supports
  421. */
  422. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  423. };
  424. /* TEMPORARY backwards-compatibility alias for a typo fix -
  425. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  426. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  427. * to support the old name (with the typo) until all references to the
  428. * old name are replaced with the new name.
  429. */
  430. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  431. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  432. struct htt_option_tlv_header_t hdr;
  433. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  434. } POSTPACK;
  435. /*
  436. * HTT option TLV for specifying whether the target supports an extended
  437. * version of the HTT tx descriptor. If the target provides this TLV
  438. * and specifies in the TLV that the target supports an extended version
  439. * of the HTT tx descriptor, the target must check the "extension" bit in
  440. * the HTT tx descriptor, and if the extension bit is set, to expect a
  441. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  442. * descriptor. Furthermore, the target must provide room for the HTT
  443. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  444. * This option is intended for systems where the host needs to explicitly
  445. * control the transmission parameters such as tx power for individual
  446. * tx frames.
  447. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  448. * as a suffix to the VERSION_CONF message to explicitly specify whether
  449. * the target supports the HTT tx MSDU extension descriptor.
  450. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  451. * by the host as lack of target support for the HTT tx MSDU extension
  452. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  453. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  454. * the HTT tx MSDU extension descriptor.
  455. * The host is not required to provide the HTT tx MSDU extension descriptor
  456. * just because the target supports it; the target must check the
  457. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  458. * extension descriptor is present.
  459. */
  460. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  461. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  462. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  463. };
  464. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  465. struct htt_option_tlv_header_t hdr;
  466. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  467. } POSTPACK;
  468. /*=== host -> target messages ===============================================*/
  469. enum htt_h2t_msg_type {
  470. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  471. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  472. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  473. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  474. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  475. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  476. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  477. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  478. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  479. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  480. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  481. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  482. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  483. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  484. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  485. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  486. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  487. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  488. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  489. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  490. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  491. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  492. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  493. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  494. /* keep this last */
  495. HTT_H2T_NUM_MSGS
  496. };
  497. /*
  498. * HTT host to target message type -
  499. * stored in bits 7:0 of the first word of the message
  500. */
  501. #define HTT_H2T_MSG_TYPE_M 0xff
  502. #define HTT_H2T_MSG_TYPE_S 0
  503. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  504. do { \
  505. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  506. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  507. } while (0)
  508. #define HTT_H2T_MSG_TYPE_GET(word) \
  509. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  510. /**
  511. * @brief host -> target version number request message definition
  512. *
  513. * |31 24|23 16|15 8|7 0|
  514. * |----------------+----------------+----------------+----------------|
  515. * | reserved | msg type |
  516. * |-------------------------------------------------------------------|
  517. * : option request TLV (optional) |
  518. * :...................................................................:
  519. *
  520. * The VER_REQ message may consist of a single 4-byte word, or may be
  521. * extended with TLVs that specify which HTT options the host is requesting
  522. * from the target.
  523. * The following option TLVs may be appended to the VER_REQ message:
  524. * - HL_SUPPRESS_TX_COMPL_IND
  525. * - HL_MAX_TX_QUEUE_GROUPS
  526. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  527. * may be appended to the VER_REQ message (but only one TLV of each type).
  528. *
  529. * Header fields:
  530. * - MSG_TYPE
  531. * Bits 7:0
  532. * Purpose: identifies this as a version number request message
  533. * Value: 0x0
  534. */
  535. #define HTT_VER_REQ_BYTES 4
  536. /* TBDXXX: figure out a reasonable number */
  537. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  538. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  539. /**
  540. * @brief HTT tx MSDU descriptor
  541. *
  542. * @details
  543. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  544. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  545. * the target firmware needs for the FW's tx processing, particularly
  546. * for creating the HW msdu descriptor.
  547. * The same HTT tx descriptor is used for HL and LL systems, though
  548. * a few fields within the tx descriptor are used only by LL or
  549. * only by HL.
  550. * The HTT tx descriptor is defined in two manners: by a struct with
  551. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  552. * definitions.
  553. * The target should use the struct def, for simplicitly and clarity,
  554. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  555. * neutral. Specifically, the host shall use the get/set macros built
  556. * around the mask + shift defs.
  557. */
  558. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  559. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  560. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  561. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  562. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  563. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  564. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  565. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  566. #define HTT_TX_VDEV_ID_WORD 0
  567. #define HTT_TX_VDEV_ID_MASK 0x3f
  568. #define HTT_TX_VDEV_ID_SHIFT 16
  569. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  570. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  571. #define HTT_TX_MSDU_LEN_DWORD 1
  572. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  573. /*
  574. * HTT_VAR_PADDR macros
  575. * Allow physical / bus addresses to be either a single 32-bit value,
  576. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  577. */
  578. #define HTT_VAR_PADDR32(var_name) \
  579. A_UINT32 var_name
  580. #define HTT_VAR_PADDR64_LE(var_name) \
  581. struct { \
  582. /* little-endian: lo precedes hi */ \
  583. A_UINT32 lo; \
  584. A_UINT32 hi; \
  585. } var_name
  586. /*
  587. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  588. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  589. * addresses are stored in a XXX-bit field.
  590. * This macro is used to define both htt_tx_msdu_desc32_t and
  591. * htt_tx_msdu_desc64_t structs.
  592. */
  593. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  594. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  595. { \
  596. /* DWORD 0: flags and meta-data */ \
  597. A_UINT32 \
  598. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  599. \
  600. /* pkt_subtype - \
  601. * Detailed specification of the tx frame contents, extending the \
  602. * general specification provided by pkt_type. \
  603. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  604. * pkt_type | pkt_subtype \
  605. * ============================================================== \
  606. * 802.3 | bit 0:3 - Reserved \
  607. * | bit 4: 0x0 - Copy-Engine Classification Results \
  608. * | not appended to the HTT message \
  609. * | 0x1 - Copy-Engine Classification Results \
  610. * | appended to the HTT message in the \
  611. * | format: \
  612. * | [HTT tx desc, frame header, \
  613. * | CE classification results] \
  614. * | The CE classification results begin \
  615. * | at the next 4-byte boundary after \
  616. * | the frame header. \
  617. * ------------+------------------------------------------------- \
  618. * Eth2 | bit 0:3 - Reserved \
  619. * | bit 4: 0x0 - Copy-Engine Classification Results \
  620. * | not appended to the HTT message \
  621. * | 0x1 - Copy-Engine Classification Results \
  622. * | appended to the HTT message. \
  623. * | See the above specification of the \
  624. * | CE classification results location. \
  625. * ------------+------------------------------------------------- \
  626. * native WiFi | bit 0:3 - Reserved \
  627. * | bit 4: 0x0 - Copy-Engine Classification Results \
  628. * | not appended to the HTT message \
  629. * | 0x1 - Copy-Engine Classification Results \
  630. * | appended to the HTT message. \
  631. * | See the above specification of the \
  632. * | CE classification results location. \
  633. * ------------+------------------------------------------------- \
  634. * mgmt | 0x0 - 802.11 MAC header absent \
  635. * | 0x1 - 802.11 MAC header present \
  636. * ------------+------------------------------------------------- \
  637. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  638. * | 0x1 - 802.11 MAC header present \
  639. * | bit 1: 0x0 - allow aggregation \
  640. * | 0x1 - don't allow aggregation \
  641. * | bit 2: 0x0 - perform encryption \
  642. * | 0x1 - don't perform encryption \
  643. * | bit 3: 0x0 - perform tx classification / queuing \
  644. * | 0x1 - don't perform tx classification; \
  645. * | insert the frame into the "misc" \
  646. * | tx queue \
  647. * | bit 4: 0x0 - Copy-Engine Classification Results \
  648. * | not appended to the HTT message \
  649. * | 0x1 - Copy-Engine Classification Results \
  650. * | appended to the HTT message. \
  651. * | See the above specification of the \
  652. * | CE classification results location. \
  653. */ \
  654. pkt_subtype: 5, \
  655. \
  656. /* pkt_type - \
  657. * General specification of the tx frame contents. \
  658. * The htt_pkt_type enum should be used to specify and check the \
  659. * value of this field. \
  660. */ \
  661. pkt_type: 3, \
  662. \
  663. /* vdev_id - \
  664. * ID for the vdev that is sending this tx frame. \
  665. * For certain non-standard packet types, e.g. pkt_type == raw \
  666. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  667. * This field is used primarily for determining where to queue \
  668. * broadcast and multicast frames. \
  669. */ \
  670. vdev_id: 6, \
  671. /* ext_tid - \
  672. * The extended traffic ID. \
  673. * If the TID is unknown, the extended TID is set to \
  674. * HTT_TX_EXT_TID_INVALID. \
  675. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  676. * value of the QoS TID. \
  677. * If the tx frame is non-QoS data, then the extended TID is set to \
  678. * HTT_TX_EXT_TID_NON_QOS. \
  679. * If the tx frame is multicast or broadcast, then the extended TID \
  680. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  681. */ \
  682. ext_tid: 5, \
  683. \
  684. /* postponed - \
  685. * This flag indicates whether the tx frame has been downloaded to \
  686. * the target before but discarded by the target, and now is being \
  687. * downloaded again; or if this is a new frame that is being \
  688. * downloaded for the first time. \
  689. * This flag allows the target to determine the correct order for \
  690. * transmitting new vs. old frames. \
  691. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  692. * This flag only applies to HL systems, since in LL systems, \
  693. * the tx flow control is handled entirely within the target. \
  694. */ \
  695. postponed: 1, \
  696. \
  697. /* extension - \
  698. * This flag indicates whether a HTT tx MSDU extension descriptor \
  699. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  700. * \
  701. * 0x0 - no extension MSDU descriptor is present \
  702. * 0x1 - an extension MSDU descriptor immediately follows the \
  703. * regular MSDU descriptor \
  704. */ \
  705. extension: 1, \
  706. \
  707. /* cksum_offload - \
  708. * This flag indicates whether checksum offload is enabled or not \
  709. * for this frame. Target FW use this flag to turn on HW checksumming \
  710. * 0x0 - No checksum offload \
  711. * 0x1 - L3 header checksum only \
  712. * 0x2 - L4 checksum only \
  713. * 0x3 - L3 header checksum + L4 checksum \
  714. */ \
  715. cksum_offload: 2, \
  716. \
  717. /* tx_comp_req - \
  718. * This flag indicates whether Tx Completion \
  719. * from fw is required or not. \
  720. * This flag is only relevant if tx completion is not \
  721. * universally enabled. \
  722. * For all LL systems, tx completion is mandatory, \
  723. * so this flag will be irrelevant. \
  724. * For HL systems tx completion is optional, but HL systems in which \
  725. * the bus throughput exceeds the WLAN throughput will \
  726. * probably want to always use tx completion, and thus \
  727. * would not check this flag. \
  728. * This flag is required when tx completions are not used universally, \
  729. * but are still required for certain tx frames for which \
  730. * an OTA delivery acknowledgment is needed by the host. \
  731. * In practice, this would be for HL systems in which the \
  732. * bus throughput is less than the WLAN throughput. \
  733. * \
  734. * 0x0 - Tx Completion Indication from Fw not required \
  735. * 0x1 - Tx Completion Indication from Fw is required \
  736. */ \
  737. tx_compl_req: 1; \
  738. \
  739. \
  740. /* DWORD 1: MSDU length and ID */ \
  741. A_UINT32 \
  742. len: 16, /* MSDU length, in bytes */ \
  743. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  744. * and this id is used to calculate fragmentation \
  745. * descriptor pointer inside the target based on \
  746. * the base address, configured inside the target. \
  747. */ \
  748. \
  749. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  750. /* frags_desc_ptr - \
  751. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  752. * where the tx frame's fragments reside in memory. \
  753. * This field only applies to LL systems, since in HL systems the \
  754. * (degenerate single-fragment) fragmentation descriptor is created \
  755. * within the target. \
  756. */ \
  757. _paddr__frags_desc_ptr_; \
  758. \
  759. /* DWORD 3 (or 4): peerid, chanfreq */ \
  760. /* \
  761. * Peer ID : Target can use this value to know which peer-id packet \
  762. * destined to. \
  763. * It's intended to be specified by host in case of NAWDS. \
  764. */ \
  765. A_UINT16 peerid; \
  766. \
  767. /* \
  768. * Channel frequency: This identifies the desired channel \
  769. * frequency (in mhz) for tx frames. This is used by FW to help \
  770. * determine when it is safe to transmit or drop frames for \
  771. * off-channel operation. \
  772. * The default value of zero indicates to FW that the corresponding \
  773. * VDEV's home channel (if there is one) is the desired channel \
  774. * frequency. \
  775. */ \
  776. A_UINT16 chanfreq; \
  777. \
  778. /* Reason reserved is commented is increasing the htt structure size \
  779. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  780. * A_UINT32 reserved_dword3_bits0_31; \
  781. */ \
  782. } POSTPACK
  783. /* define a htt_tx_msdu_desc32_t type */
  784. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  785. /* define a htt_tx_msdu_desc64_t type */
  786. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  787. /*
  788. * Make htt_tx_msdu_desc_t be an alias for either
  789. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  790. */
  791. #if HTT_PADDR64
  792. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  793. #else
  794. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  795. #endif
  796. /* decriptor information for Management frame*/
  797. /*
  798. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  799. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  800. */
  801. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  802. extern A_UINT32 mgmt_hdr_len;
  803. PREPACK struct htt_mgmt_tx_desc_t {
  804. A_UINT32 msg_type;
  805. #if HTT_PADDR64
  806. A_UINT64 frag_paddr; /* DMAble address of the data */
  807. #else
  808. A_UINT32 frag_paddr; /* DMAble address of the data */
  809. #endif
  810. A_UINT32 desc_id; /* returned to host during completion
  811. * to free the meory*/
  812. A_UINT32 len; /* Fragment length */
  813. A_UINT32 vdev_id; /* virtual device ID*/
  814. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  815. } POSTPACK;
  816. PREPACK struct htt_mgmt_tx_compl_ind {
  817. A_UINT32 desc_id;
  818. A_UINT32 status;
  819. } POSTPACK;
  820. /*
  821. * This SDU header size comes from the summation of the following:
  822. * 1. Max of:
  823. * a. Native WiFi header, for native WiFi frames: 24 bytes
  824. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  825. * b. 802.11 header, for raw frames: 36 bytes
  826. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  827. * QoS header, HT header)
  828. * c. 802.3 header, for ethernet frames: 14 bytes
  829. * (destination address, source address, ethertype / length)
  830. * 2. Max of:
  831. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  832. * b. IPv6 header, up through the Traffic Class: 2 bytes
  833. * 3. 802.1Q VLAN header: 4 bytes
  834. * 4. LLC/SNAP header: 8 bytes
  835. */
  836. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  837. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  838. #define HTT_TX_HDR_SIZE_ETHERNET 14
  839. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  840. A_COMPILE_TIME_ASSERT(
  841. htt_encap_hdr_size_max_check_nwifi,
  842. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  843. A_COMPILE_TIME_ASSERT(
  844. htt_encap_hdr_size_max_check_enet,
  845. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  846. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  847. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  848. #define HTT_TX_HDR_SIZE_802_1Q 4
  849. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  850. #define HTT_COMMON_TX_FRM_HDR_LEN \
  851. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  852. HTT_TX_HDR_SIZE_802_1Q + \
  853. HTT_TX_HDR_SIZE_LLC_SNAP)
  854. #define HTT_HL_TX_FRM_HDR_LEN \
  855. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  856. #define HTT_LL_TX_FRM_HDR_LEN \
  857. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  858. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  859. /* dword 0 */
  860. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  861. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  862. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  863. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  864. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  865. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  866. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  867. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  868. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  869. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  870. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  871. #define HTT_TX_DESC_PKT_TYPE_S 13
  872. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  873. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  874. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  875. #define HTT_TX_DESC_VDEV_ID_S 16
  876. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  877. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  878. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  879. #define HTT_TX_DESC_EXT_TID_S 22
  880. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  881. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  882. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  883. #define HTT_TX_DESC_POSTPONED_S 27
  884. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  885. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  886. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  887. #define HTT_TX_DESC_EXTENSION_S 28
  888. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  889. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  890. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  891. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  892. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  893. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  894. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  895. #define HTT_TX_DESC_TX_COMP_S 31
  896. /* dword 1 */
  897. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  898. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  899. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  900. #define HTT_TX_DESC_FRM_LEN_S 0
  901. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  902. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  903. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  904. #define HTT_TX_DESC_FRM_ID_S 16
  905. /* dword 2 */
  906. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  907. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  908. /* for systems using 64-bit format for bus addresses */
  909. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  910. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  911. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  912. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  913. /* for systems using 32-bit format for bus addresses */
  914. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  915. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  916. /* dword 3 */
  917. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  918. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  919. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  920. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  921. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  922. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  923. #if HTT_PADDR64
  924. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  925. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  926. #else
  927. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  928. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  929. #endif
  930. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  931. #define HTT_TX_DESC_PEER_ID_S 0
  932. /*
  933. * TEMPORARY:
  934. * The original definitions for the PEER_ID fields contained typos
  935. * (with _DESC_PADDR appended to this PEER_ID field name).
  936. * Retain deprecated original names for PEER_ID fields until all code that
  937. * refers to them has been updated.
  938. */
  939. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  940. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  941. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  942. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  943. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  944. HTT_TX_DESC_PEER_ID_M
  945. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  946. HTT_TX_DESC_PEER_ID_S
  947. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  948. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  949. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  950. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  951. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  952. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  953. #if HTT_PADDR64
  954. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  955. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  956. #else
  957. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  958. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  959. #endif
  960. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  961. #define HTT_TX_DESC_CHAN_FREQ_S 16
  962. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  963. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  964. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  965. do { \
  966. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  967. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  968. } while (0)
  969. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  970. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  971. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  972. do { \
  973. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  974. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  975. } while (0)
  976. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  977. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  978. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  979. do { \
  980. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  981. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  982. } while (0)
  983. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  984. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  985. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  986. do { \
  987. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  988. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  989. } while (0)
  990. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  991. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  992. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  993. do { \
  994. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  995. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  996. } while (0)
  997. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  998. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  999. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1000. do { \
  1001. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1002. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1003. } while (0)
  1004. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1005. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1006. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1007. do { \
  1008. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1009. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1010. } while (0)
  1011. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1012. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1013. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1014. do { \
  1015. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1016. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1017. } while (0)
  1018. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1019. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1020. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1021. do { \
  1022. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1023. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1024. } while (0)
  1025. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1026. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1027. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1028. do { \
  1029. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1030. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1031. } while (0)
  1032. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1033. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1034. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1035. do { \
  1036. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1037. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1038. } while (0)
  1039. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1040. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1041. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1042. do { \
  1043. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1044. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1045. } while (0)
  1046. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1047. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1048. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1049. do { \
  1050. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1051. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1052. } while (0)
  1053. /* enums used in the HTT tx MSDU extension descriptor */
  1054. enum {
  1055. htt_tx_guard_interval_regular = 0,
  1056. htt_tx_guard_interval_short = 1,
  1057. };
  1058. enum {
  1059. htt_tx_preamble_type_ofdm = 0,
  1060. htt_tx_preamble_type_cck = 1,
  1061. htt_tx_preamble_type_ht = 2,
  1062. htt_tx_preamble_type_vht = 3,
  1063. };
  1064. enum {
  1065. htt_tx_bandwidth_5MHz = 0,
  1066. htt_tx_bandwidth_10MHz = 1,
  1067. htt_tx_bandwidth_20MHz = 2,
  1068. htt_tx_bandwidth_40MHz = 3,
  1069. htt_tx_bandwidth_80MHz = 4,
  1070. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1071. };
  1072. /**
  1073. * @brief HTT tx MSDU extension descriptor
  1074. * @details
  1075. * If the target supports HTT tx MSDU extension descriptors, the host has
  1076. * the option of appending the following struct following the regular
  1077. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1078. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1079. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1080. * tx specs for each frame.
  1081. */
  1082. PREPACK struct htt_tx_msdu_desc_ext_t {
  1083. /* DWORD 0: flags */
  1084. A_UINT32
  1085. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1086. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1087. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1088. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1089. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1090. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1091. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1092. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1093. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1094. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1095. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1096. /* DWORD 1: tx power, tx rate, tx BW */
  1097. A_UINT32
  1098. /* pwr -
  1099. * Specify what power the tx frame needs to be transmitted at.
  1100. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1101. * The value needs to be appropriately sign-extended when extracting
  1102. * the value from the message and storing it in a variable that is
  1103. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1104. * automatically handles this sign-extension.)
  1105. * If the transmission uses multiple tx chains, this power spec is
  1106. * the total transmit power, assuming incoherent combination of
  1107. * per-chain power to produce the total power.
  1108. */
  1109. pwr: 8,
  1110. /* mcs_mask -
  1111. * Specify the allowable values for MCS index (modulation and coding)
  1112. * to use for transmitting the frame.
  1113. *
  1114. * For HT / VHT preamble types, this mask directly corresponds to
  1115. * the HT or VHT MCS indices that are allowed. For each bit N set
  1116. * within the mask, MCS index N is allowed for transmitting the frame.
  1117. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1118. * rates versus OFDM rates, so the host has the option of specifying
  1119. * that the target must transmit the frame with CCK or OFDM rates
  1120. * (not HT or VHT), but leaving the decision to the target whether
  1121. * to use CCK or OFDM.
  1122. *
  1123. * For CCK and OFDM, the bits within this mask are interpreted as
  1124. * follows:
  1125. * bit 0 -> CCK 1 Mbps rate is allowed
  1126. * bit 1 -> CCK 2 Mbps rate is allowed
  1127. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1128. * bit 3 -> CCK 11 Mbps rate is allowed
  1129. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1130. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1131. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1132. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1133. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1134. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1135. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1136. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1137. *
  1138. * The MCS index specification needs to be compatible with the
  1139. * bandwidth mask specification. For example, a MCS index == 9
  1140. * specification is inconsistent with a preamble type == VHT,
  1141. * Nss == 1, and channel bandwidth == 20 MHz.
  1142. *
  1143. * Furthermore, the host has only a limited ability to specify to
  1144. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1145. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1146. */
  1147. mcs_mask: 12,
  1148. /* nss_mask -
  1149. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1150. * Each bit in this mask corresponds to a Nss value:
  1151. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1152. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1153. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1154. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1155. * The values in the Nss mask must be suitable for the recipient, e.g.
  1156. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1157. * recipient which only supports 2x2 MIMO.
  1158. */
  1159. nss_mask: 4,
  1160. /* guard_interval -
  1161. * Specify a htt_tx_guard_interval enum value to indicate whether
  1162. * the transmission should use a regular guard interval or a
  1163. * short guard interval.
  1164. */
  1165. guard_interval: 1,
  1166. /* preamble_type_mask -
  1167. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1168. * may choose from for transmitting this frame.
  1169. * The bits in this mask correspond to the values in the
  1170. * htt_tx_preamble_type enum. For example, to allow the target
  1171. * to transmit the frame as either CCK or OFDM, this field would
  1172. * be set to
  1173. * (1 << htt_tx_preamble_type_ofdm) |
  1174. * (1 << htt_tx_preamble_type_cck)
  1175. */
  1176. preamble_type_mask: 4,
  1177. reserved1_31_29: 3; /* unused, set to 0x0 */
  1178. /* DWORD 2: tx chain mask, tx retries */
  1179. A_UINT32
  1180. /* chain_mask - specify which chains to transmit from */
  1181. chain_mask: 4,
  1182. /* retry_limit -
  1183. * Specify the maximum number of transmissions, including the
  1184. * initial transmission, to attempt before giving up if no ack
  1185. * is received.
  1186. * If the tx rate is specified, then all retries shall use the
  1187. * same rate as the initial transmission.
  1188. * If no tx rate is specified, the target can choose whether to
  1189. * retain the original rate during the retransmissions, or to
  1190. * fall back to a more robust rate.
  1191. */
  1192. retry_limit: 4,
  1193. /* bandwidth_mask -
  1194. * Specify what channel widths may be used for the transmission.
  1195. * A value of zero indicates "don't care" - the target may choose
  1196. * the transmission bandwidth.
  1197. * The bits within this mask correspond to the htt_tx_bandwidth
  1198. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1199. * The bandwidth_mask must be consistent with the preamble_type_mask
  1200. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1201. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1202. */
  1203. bandwidth_mask: 6,
  1204. reserved2_31_14: 18; /* unused, set to 0x0 */
  1205. /* DWORD 3: tx expiry time (TSF) LSBs */
  1206. A_UINT32 expire_tsf_lo;
  1207. /* DWORD 4: tx expiry time (TSF) MSBs */
  1208. A_UINT32 expire_tsf_hi;
  1209. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1210. } POSTPACK;
  1211. /* DWORD 0 */
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1213. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1214. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1216. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1217. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1218. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1219. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1220. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1221. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1222. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1223. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1224. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1225. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1226. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1227. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1228. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1229. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1230. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1231. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1232. /* DWORD 1 */
  1233. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1234. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1235. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1236. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1237. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1238. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1239. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1240. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1241. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1242. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1243. /* DWORD 2 */
  1244. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1245. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1246. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1247. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1248. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1249. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1250. /* DWORD 0 */
  1251. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1252. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1253. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1254. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1255. do { \
  1256. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1257. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1258. } while (0)
  1259. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1260. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1261. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1262. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1263. do { \
  1264. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1265. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1266. } while (0)
  1267. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1268. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1269. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1270. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1271. do { \
  1272. HTT_CHECK_SET_VAL( \
  1273. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1274. ((_var) |= ((_val) \
  1275. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1276. } while (0)
  1277. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1278. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1279. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1280. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1281. do { \
  1282. HTT_CHECK_SET_VAL( \
  1283. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1284. ((_var) |= ((_val) \
  1285. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1286. } while (0)
  1287. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1288. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1289. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1290. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1291. do { \
  1292. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1293. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1294. } while (0)
  1295. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1296. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1297. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1298. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1299. do { \
  1300. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1301. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1302. } while (0)
  1303. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1304. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1305. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1306. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1307. do { \
  1308. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1309. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1310. } while (0)
  1311. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1312. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1313. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1314. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1315. do { \
  1316. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1317. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1318. } while (0)
  1319. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1320. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1321. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1322. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1323. do { \
  1324. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1325. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1326. } while (0)
  1327. /* DWORD 1 */
  1328. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1329. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1330. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1331. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1332. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1333. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1334. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1335. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1336. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1337. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1338. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1339. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1340. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1341. do { \
  1342. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1343. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1344. } while (0)
  1345. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1346. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1347. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1348. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1349. do { \
  1350. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1351. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1352. } while (0)
  1353. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1354. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1355. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1356. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1357. do { \
  1358. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1359. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1360. } while (0)
  1361. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1362. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1363. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1364. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1365. do { \
  1366. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1367. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1368. } while (0)
  1369. /* DWORD 2 */
  1370. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1371. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1372. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1373. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1374. do { \
  1375. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1376. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1377. } while (0)
  1378. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1379. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1380. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1381. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1382. do { \
  1383. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1384. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1385. } while (0)
  1386. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1387. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1388. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1389. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1390. do { \
  1391. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1392. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1393. } while (0)
  1394. typedef enum {
  1395. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1396. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1397. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1398. } htt_11ax_ltf_subtype_t;
  1399. typedef enum {
  1400. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1401. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1402. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1403. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1404. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1405. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1406. } htt_tx_ext2_preamble_type_t;
  1407. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1408. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1409. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1410. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1411. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1412. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1413. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1414. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1415. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1416. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1417. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1418. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1419. /**
  1420. * @brief HTT tx MSDU extension descriptor v2
  1421. * @details
  1422. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1423. * is received as tcl_exit_base->host_meta_info in firmware.
  1424. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1425. * are already part of tcl_exit_base.
  1426. */
  1427. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1428. /* DWORD 0: flags */
  1429. A_UINT32
  1430. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1431. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1432. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1433. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1434. valid_retries : 1, /* if set, tx retries spec is valid */
  1435. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1436. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1437. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1438. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1439. valid_key_flags : 1, /* if set, key flags is valid */
  1440. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1441. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1442. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1443. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1444. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1445. 1 = ENCRYPT,
  1446. 2 ~ 3 - Reserved */
  1447. /* retry_limit -
  1448. * Specify the maximum number of transmissions, including the
  1449. * initial transmission, to attempt before giving up if no ack
  1450. * is received.
  1451. * If the tx rate is specified, then all retries shall use the
  1452. * same rate as the initial transmission.
  1453. * If no tx rate is specified, the target can choose whether to
  1454. * retain the original rate during the retransmissions, or to
  1455. * fall back to a more robust rate.
  1456. */
  1457. retry_limit : 4,
  1458. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1459. * Valid only for 11ax preamble types HE_SU
  1460. * and HE_EXT_SU
  1461. */
  1462. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1463. * Valid only for 11ax preamble types HE_SU
  1464. * and HE_EXT_SU
  1465. */
  1466. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1467. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1468. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1469. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1470. */
  1471. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1472. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1473. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1474. * Use cases:
  1475. * Any time firmware uses TQM-BYPASS for Data
  1476. * TID, firmware expect host to set this bit.
  1477. */
  1478. /* DWORD 1: tx power, tx rate */
  1479. A_UINT32
  1480. power : 8, /* unit of the power field is 0.5 dbm
  1481. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1482. * signed value ranging from -64dbm to 63.5 dbm
  1483. */
  1484. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1485. * Setting more than one MCS isn't currently
  1486. * supported by the target (but is supported
  1487. * in the interface in case in the future
  1488. * the target supports specifications of
  1489. * a limited set of MCS values.
  1490. */
  1491. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1492. * Setting more than one Nss isn't currently
  1493. * supported by the target (but is supported
  1494. * in the interface in case in the future
  1495. * the target supports specifications of
  1496. * a limited set of Nss values.
  1497. */
  1498. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1499. update_peer_cache : 1; /* When set these custom values will be
  1500. * used for all packets, until the next
  1501. * update via this ext header.
  1502. * This is to make sure not all packets
  1503. * need to include this header.
  1504. */
  1505. /* DWORD 2: tx chain mask, tx retries */
  1506. A_UINT32
  1507. /* chain_mask - specify which chains to transmit from */
  1508. chain_mask : 8,
  1509. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1510. * TODO: Update Enum values for key_flags
  1511. */
  1512. /*
  1513. * Channel frequency: This identifies the desired channel
  1514. * frequency (in MHz) for tx frames. This is used by FW to help
  1515. * determine when it is safe to transmit or drop frames for
  1516. * off-channel operation.
  1517. * The default value of zero indicates to FW that the corresponding
  1518. * VDEV's home channel (if there is one) is the desired channel
  1519. * frequency.
  1520. */
  1521. chanfreq : 16;
  1522. /* DWORD 3: tx expiry time (TSF) LSBs */
  1523. A_UINT32 expire_tsf_lo;
  1524. /* DWORD 4: tx expiry time (TSF) MSBs */
  1525. A_UINT32 expire_tsf_hi;
  1526. /* DWORD 5: flags to control routing / processing of the MSDU */
  1527. A_UINT32
  1528. /* learning_frame
  1529. * When this flag is set, this frame will be dropped by FW
  1530. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1531. */
  1532. learning_frame : 1,
  1533. /* send_as_standalone
  1534. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1535. * i.e. with no A-MSDU or A-MPDU aggregation.
  1536. * The scope is extended to other use-cases.
  1537. */
  1538. send_as_standalone : 1,
  1539. /* is_host_opaque_valid
  1540. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1541. * with valid information.
  1542. */
  1543. is_host_opaque_valid : 1,
  1544. rsvd0 : 29;
  1545. /* DWORD 6 : Host opaque cookie for special frames */
  1546. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1547. rsvd1 : 16;
  1548. /*
  1549. * This structure can be expanded further up to 40 bytes
  1550. * by adding further DWORDs as needed.
  1551. */
  1552. } POSTPACK;
  1553. /* DWORD 0 */
  1554. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1555. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1556. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1557. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1558. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1559. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1560. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1561. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1562. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1563. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1564. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1565. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1566. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1567. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1568. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1569. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1570. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1571. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1572. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1573. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1574. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1575. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1576. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1577. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1578. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1579. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1580. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1581. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1582. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1583. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1584. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1585. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1586. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1587. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1588. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1589. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1590. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1591. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1592. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1593. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1594. /* DWORD 1 */
  1595. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1596. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1597. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1598. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1599. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1600. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1601. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1602. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1603. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1604. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1605. /* DWORD 2 */
  1606. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1607. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1608. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1609. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1610. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1611. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1612. /* DWORD 5 */
  1613. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1614. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1615. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1616. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1617. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1618. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1619. /* DWORD 6 */
  1620. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1621. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1622. /* DWORD 0 */
  1623. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1624. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1625. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1626. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1627. do { \
  1628. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1629. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1630. } while (0)
  1631. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1632. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1633. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1634. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1635. do { \
  1636. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1637. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1638. } while (0)
  1639. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1640. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1641. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1642. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1643. do { \
  1644. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1645. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1646. } while (0)
  1647. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1648. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1649. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1650. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1651. do { \
  1652. HTT_CHECK_SET_VAL( \
  1653. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1654. ((_var) |= ((_val) \
  1655. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1656. } while (0)
  1657. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1658. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1659. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1660. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1661. do { \
  1662. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1663. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1664. } while (0)
  1665. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1666. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1667. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1668. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1669. do { \
  1670. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1671. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1672. } while (0)
  1673. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1674. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1675. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1676. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1677. do { \
  1678. HTT_CHECK_SET_VAL( \
  1679. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1680. ((_var) |= ((_val) \
  1681. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1682. } while (0)
  1683. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1684. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1685. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1686. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1687. do { \
  1688. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1689. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1690. } while (0)
  1691. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1692. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1693. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1694. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1695. do { \
  1696. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1697. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1698. } while (0)
  1699. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1700. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1701. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1702. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1703. do { \
  1704. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1705. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1706. } while (0)
  1707. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1708. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1709. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1710. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1711. do { \
  1712. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1713. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1714. } while (0)
  1715. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1716. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1717. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1718. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1719. do { \
  1720. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1721. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1722. } while (0)
  1723. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1724. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1725. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1726. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1727. do { \
  1728. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1729. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1730. } while (0)
  1731. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1732. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1733. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1734. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1735. do { \
  1736. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1737. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1738. } while (0)
  1739. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1740. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1741. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1742. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1743. do { \
  1744. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1745. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1746. } while (0)
  1747. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1748. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1749. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1750. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1751. do { \
  1752. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1753. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1754. } while (0)
  1755. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1756. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1757. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1758. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1759. do { \
  1760. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1761. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1762. } while (0)
  1763. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1764. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1765. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1766. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1767. do { \
  1768. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1769. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1770. } while (0)
  1771. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1772. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1773. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1774. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1775. do { \
  1776. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1777. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1778. } while (0)
  1779. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1780. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1781. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1782. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1783. do { \
  1784. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1785. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1786. } while (0)
  1787. /* DWORD 1 */
  1788. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1789. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1790. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1791. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1792. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1793. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1794. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1795. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1796. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1797. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1798. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1799. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1800. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1801. do { \
  1802. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1803. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1804. } while (0)
  1805. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1806. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1807. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1808. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1809. do { \
  1810. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1811. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1812. } while (0)
  1813. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1814. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1815. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1816. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1817. do { \
  1818. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1819. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1820. } while (0)
  1821. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1822. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1823. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1824. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1825. do { \
  1826. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1827. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1828. } while (0)
  1829. /* DWORD 2 */
  1830. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1831. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1832. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1833. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1834. do { \
  1835. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1836. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1837. } while (0)
  1838. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1839. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1840. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1841. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1842. do { \
  1843. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1844. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1845. } while (0)
  1846. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1847. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1848. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1849. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1850. do { \
  1851. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1852. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1853. } while (0)
  1854. /* DWORD 5 */
  1855. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1856. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1857. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1858. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1859. do { \
  1860. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1861. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1862. } while (0)
  1863. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  1864. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  1865. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  1866. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  1867. do { \
  1868. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  1869. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  1870. } while (0)
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  1872. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  1873. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  1875. do { \
  1876. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  1877. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  1878. } while (0)
  1879. /* DWORD 6 */
  1880. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  1881. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  1882. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  1883. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1884. do { \
  1885. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  1886. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  1887. } while (0)
  1888. typedef enum {
  1889. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1890. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1891. } htt_tcl_metadata_type;
  1892. /**
  1893. * @brief HTT TCL command number format
  1894. * @details
  1895. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1896. * available to firmware as tcl_exit_base->tcl_status_number.
  1897. * For regular / multicast packets host will send vdev and mac id and for
  1898. * NAWDS packets, host will send peer id.
  1899. * A_UINT32 is used to avoid endianness conversion problems.
  1900. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1901. */
  1902. typedef struct {
  1903. A_UINT32
  1904. type: 1, /* vdev_id based or peer_id based */
  1905. rsvd: 31;
  1906. } htt_tx_tcl_vdev_or_peer_t;
  1907. typedef struct {
  1908. A_UINT32
  1909. type: 1, /* vdev_id based or peer_id based */
  1910. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1911. vdev_id: 8,
  1912. pdev_id: 2,
  1913. host_inspected:1,
  1914. rsvd: 19;
  1915. } htt_tx_tcl_vdev_metadata;
  1916. typedef struct {
  1917. A_UINT32
  1918. type: 1, /* vdev_id based or peer_id based */
  1919. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1920. peer_id: 14,
  1921. rsvd: 16;
  1922. } htt_tx_tcl_peer_metadata;
  1923. PREPACK struct htt_tx_tcl_metadata {
  1924. union {
  1925. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1926. htt_tx_tcl_vdev_metadata vdev_meta;
  1927. htt_tx_tcl_peer_metadata peer_meta;
  1928. };
  1929. } POSTPACK;
  1930. /* DWORD 0 */
  1931. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1932. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1933. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1934. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1935. /* VDEV metadata */
  1936. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1937. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1938. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1939. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1940. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1941. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1942. /* PEER metadata */
  1943. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1944. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1945. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1946. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1947. HTT_TX_TCL_METADATA_TYPE_S)
  1948. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1949. do { \
  1950. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1951. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1952. } while (0)
  1953. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1954. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1955. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1956. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1957. do { \
  1958. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1959. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1960. } while (0)
  1961. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1962. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1963. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1964. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1965. do { \
  1966. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1967. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1968. } while (0)
  1969. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1970. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1971. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1972. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1973. do { \
  1974. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1975. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1976. } while (0)
  1977. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1978. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1979. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1980. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1981. do { \
  1982. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1983. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1984. } while (0)
  1985. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1986. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1987. HTT_TX_TCL_METADATA_PEER_ID_S)
  1988. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1989. do { \
  1990. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1991. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1992. } while (0)
  1993. typedef enum {
  1994. HTT_TX_FW2WBM_TX_STATUS_OK,
  1995. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1996. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1997. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1998. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1999. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2000. HTT_TX_FW2WBM_TX_STATUS_MAX
  2001. } htt_tx_fw2wbm_tx_status_t;
  2002. typedef enum {
  2003. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2004. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2005. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2006. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2007. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2008. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2009. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2010. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2011. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2012. } htt_tx_fw2wbm_reinject_reason_t;
  2013. /**
  2014. * @brief HTT TX WBM Completion from firmware to host
  2015. * @details
  2016. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2017. * DWORD 3 and 4 for software based completions (Exception frames and
  2018. * TQM bypass frames)
  2019. * For software based completions, wbm_release_ring->release_source_module will
  2020. * be set to release_source_fw
  2021. */
  2022. PREPACK struct htt_tx_wbm_completion {
  2023. A_UINT32
  2024. sch_cmd_id: 24,
  2025. exception_frame: 1, /* If set, this packet was queued via exception path */
  2026. rsvd0_31_25: 7;
  2027. A_UINT32
  2028. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2029. * reception of an ACK or BA, this field indicates
  2030. * the RSSI of the received ACK or BA frame.
  2031. * When the frame is removed as result of a direct
  2032. * remove command from the SW, this field is set
  2033. * to 0x0 (which is never a valid value when real
  2034. * RSSI is available).
  2035. * Units: dB w.r.t noise floor
  2036. */
  2037. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2038. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2039. rsvd1_31_16: 16;
  2040. } POSTPACK;
  2041. /* DWORD 0 */
  2042. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2043. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2044. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2045. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2046. /* DWORD 1 */
  2047. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2048. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2049. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2050. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2051. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2052. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2053. /* DWORD 0 */
  2054. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2055. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2056. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2057. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2058. do { \
  2059. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2060. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2061. } while (0)
  2062. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2063. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2064. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2065. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2066. do { \
  2067. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2068. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2069. } while (0)
  2070. /* DWORD 1 */
  2071. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2072. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2073. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2074. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2075. do { \
  2076. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2077. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2078. } while (0)
  2079. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2080. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2081. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2082. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2083. do { \
  2084. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2085. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2086. } while (0)
  2087. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2088. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2089. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2090. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2091. do { \
  2092. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2093. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2094. } while (0)
  2095. /**
  2096. * @brief HTT TX WBM Completion from firmware to host
  2097. * @details
  2098. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2099. * (WBM) offload HW.
  2100. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2101. * For software based completions, release_source_module will
  2102. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2103. * struct wbm_release_ring and then switch to this after looking at
  2104. * release_source_module.
  2105. */
  2106. PREPACK struct htt_tx_wbm_completion_v2 {
  2107. A_UINT32
  2108. used_by_hw0; /* Refer to struct wbm_release_ring */
  2109. A_UINT32
  2110. used_by_hw1; /* Refer to struct wbm_release_ring */
  2111. A_UINT32
  2112. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2113. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2114. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2115. exception_frame: 1,
  2116. rsvd0: 12, /* For future use */
  2117. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2118. rsvd1: 1; /* For future use */
  2119. A_UINT32
  2120. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2121. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2122. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2123. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2124. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2125. */
  2126. A_UINT32
  2127. data1: 32;
  2128. A_UINT32
  2129. data2: 32;
  2130. A_UINT32
  2131. used_by_hw3; /* Refer to struct wbm_release_ring */
  2132. } POSTPACK;
  2133. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2134. /* DWORD 3 */
  2135. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2136. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2137. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2138. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2139. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2140. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2141. /* DWORD 3 */
  2142. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2143. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2144. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2145. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2146. do { \
  2147. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2148. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2149. } while (0)
  2150. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2151. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2152. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2153. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2154. do { \
  2155. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2156. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2157. } while (0)
  2158. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2159. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2160. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2161. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2162. do { \
  2163. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2164. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2165. } while (0)
  2166. /**
  2167. * @brief HTT TX WBM transmit status from firmware to host
  2168. * @details
  2169. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2170. * (WBM) offload HW.
  2171. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2172. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2173. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2174. */
  2175. PREPACK struct htt_tx_wbm_transmit_status {
  2176. A_UINT32
  2177. sch_cmd_id: 24,
  2178. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2179. * reception of an ACK or BA, this field indicates
  2180. * the RSSI of the received ACK or BA frame.
  2181. * When the frame is removed as result of a direct
  2182. * remove command from the SW, this field is set
  2183. * to 0x0 (which is never a valid value when real
  2184. * RSSI is available).
  2185. * Units: dB w.r.t noise floor
  2186. */
  2187. A_UINT32
  2188. sw_peer_id: 16,
  2189. tid_num: 5,
  2190. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2191. * and tid_num fields contain valid data.
  2192. * If this "valid" flag is not set, the
  2193. * sw_peer_id and tid_num fields must be ignored.
  2194. */
  2195. mcast: 1,
  2196. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2197. * contains valid data.
  2198. */
  2199. reserved0: 8;
  2200. A_UINT32
  2201. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2202. * packets in the wbm completion path
  2203. */
  2204. } POSTPACK;
  2205. /* DWORD 4 */
  2206. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2207. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2208. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2209. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2210. /* DWORD 5 */
  2211. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2212. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2213. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2214. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2215. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2216. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2217. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2218. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2219. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2220. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2221. /* DWORD 4 */
  2222. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2223. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2224. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2225. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2226. do { \
  2227. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2228. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2229. } while (0)
  2230. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2231. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2232. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2233. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2234. do { \
  2235. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2236. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2237. } while (0)
  2238. /* DWORD 5 */
  2239. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2240. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2241. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2242. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2243. do { \
  2244. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2245. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2246. } while (0)
  2247. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2248. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2249. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2250. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2251. do { \
  2252. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2253. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2254. } while (0)
  2255. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2256. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2257. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2258. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2259. do { \
  2260. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2261. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2262. } while (0)
  2263. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2264. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2265. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2266. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2267. do { \
  2268. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2269. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2270. } while (0)
  2271. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2272. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2273. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2274. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2275. do { \
  2276. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2277. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2278. } while (0)
  2279. /**
  2280. * @brief HTT TX WBM reinject status from firmware to host
  2281. * @details
  2282. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2283. * (WBM) offload HW.
  2284. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2285. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2286. */
  2287. PREPACK struct htt_tx_wbm_reinject_status {
  2288. A_UINT32
  2289. reserved0: 32;
  2290. A_UINT32
  2291. reserved1: 32;
  2292. A_UINT32
  2293. reserved2: 32;
  2294. } POSTPACK;
  2295. /**
  2296. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2297. * @details
  2298. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2299. * (WBM) offload HW.
  2300. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2301. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2302. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2303. * STA side.
  2304. */
  2305. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2306. A_UINT32
  2307. mec_sa_addr_31_0;
  2308. A_UINT32
  2309. mec_sa_addr_47_32: 16,
  2310. sa_ast_index: 16;
  2311. A_UINT32
  2312. vdev_id: 8,
  2313. reserved0: 24;
  2314. } POSTPACK;
  2315. /* DWORD 4 - mec_sa_addr_31_0 */
  2316. /* DWORD 5 */
  2317. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2318. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2319. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2320. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2321. /* DWORD 6 */
  2322. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2323. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2324. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2325. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2326. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2327. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2328. do { \
  2329. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2330. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2331. } while (0)
  2332. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2333. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2334. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2335. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2336. do { \
  2337. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2338. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2339. } while (0)
  2340. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2341. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2342. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2343. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2344. do { \
  2345. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2346. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2347. } while (0)
  2348. typedef enum {
  2349. TX_FLOW_PRIORITY_BE,
  2350. TX_FLOW_PRIORITY_HIGH,
  2351. TX_FLOW_PRIORITY_LOW,
  2352. } htt_tx_flow_priority_t;
  2353. typedef enum {
  2354. TX_FLOW_LATENCY_SENSITIVE,
  2355. TX_FLOW_LATENCY_INSENSITIVE,
  2356. } htt_tx_flow_latency_t;
  2357. typedef enum {
  2358. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2359. TX_FLOW_INTERACTIVE_TRAFFIC,
  2360. TX_FLOW_PERIODIC_TRAFFIC,
  2361. TX_FLOW_BURSTY_TRAFFIC,
  2362. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2363. } htt_tx_flow_traffic_pattern_t;
  2364. /**
  2365. * @brief HTT TX Flow search metadata format
  2366. * @details
  2367. * Host will set this metadata in flow table's flow search entry along with
  2368. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2369. * firmware and TQM ring if the flow search entry wins.
  2370. * This metadata is available to firmware in that first MSDU's
  2371. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2372. * to one of the available flows for specific tid and returns the tqm flow
  2373. * pointer as part of htt_tx_map_flow_info message.
  2374. */
  2375. PREPACK struct htt_tx_flow_metadata {
  2376. A_UINT32
  2377. rsvd0_1_0: 2,
  2378. tid: 4,
  2379. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2380. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2381. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2382. * Else choose final tid based on latency, priority.
  2383. */
  2384. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2385. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2386. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2387. } POSTPACK;
  2388. /* DWORD 0 */
  2389. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2390. #define HTT_TX_FLOW_METADATA_TID_S 2
  2391. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2392. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2393. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2394. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2395. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2396. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2397. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2398. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2399. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2400. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2401. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2402. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2403. /* DWORD 0 */
  2404. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2405. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2406. HTT_TX_FLOW_METADATA_TID_S)
  2407. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2408. do { \
  2409. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2410. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2411. } while (0)
  2412. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2413. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2414. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2415. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2416. do { \
  2417. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2418. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2419. } while (0)
  2420. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2421. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2422. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2423. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2424. do { \
  2425. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2426. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2427. } while (0)
  2428. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2429. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2430. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2431. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2432. do { \
  2433. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2434. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2435. } while (0)
  2436. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2437. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2438. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2439. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2440. do { \
  2441. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2442. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2443. } while (0)
  2444. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2445. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2446. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2447. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2448. do { \
  2449. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2450. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2451. } while (0)
  2452. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2453. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2454. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2455. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2456. do { \
  2457. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2458. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2459. } while (0)
  2460. /**
  2461. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2462. *
  2463. * @details
  2464. * HTT wds entry from source port learning
  2465. * Host will learn wds entries from rx and send this message to firmware
  2466. * to enable firmware to configure/delete AST entries for wds clients.
  2467. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2468. * and when SA's entry is deleted, firmware removes this AST entry
  2469. *
  2470. * The message would appear as follows:
  2471. *
  2472. * |31 30|29 |17 16|15 8|7 0|
  2473. * |----------------+----------------+----------------+----------------|
  2474. * | rsvd0 |PDVID| vdev_id | msg_type |
  2475. * |-------------------------------------------------------------------|
  2476. * | sa_addr_31_0 |
  2477. * |-------------------------------------------------------------------|
  2478. * | | ta_peer_id | sa_addr_47_32 |
  2479. * |-------------------------------------------------------------------|
  2480. * Where PDVID = pdev_id
  2481. *
  2482. * The message is interpreted as follows:
  2483. *
  2484. * dword0 - b'0:7 - msg_type: This will be set to
  2485. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2486. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2487. *
  2488. * dword0 - b'8:15 - vdev_id
  2489. *
  2490. * dword0 - b'16:17 - pdev_id
  2491. *
  2492. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2493. *
  2494. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2495. *
  2496. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2497. *
  2498. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2499. */
  2500. PREPACK struct htt_wds_entry {
  2501. A_UINT32
  2502. msg_type: 8,
  2503. vdev_id: 8,
  2504. pdev_id: 2,
  2505. rsvd0: 14;
  2506. A_UINT32 sa_addr_31_0;
  2507. A_UINT32
  2508. sa_addr_47_32: 16,
  2509. ta_peer_id: 14,
  2510. rsvd2: 2;
  2511. } POSTPACK;
  2512. /* DWORD 0 */
  2513. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2514. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2515. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2516. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2517. /* DWORD 2 */
  2518. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2519. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2520. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2521. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2522. /* DWORD 0 */
  2523. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2524. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2525. HTT_WDS_ENTRY_VDEV_ID_S)
  2526. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2527. do { \
  2528. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2529. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2530. } while (0)
  2531. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2532. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2533. HTT_WDS_ENTRY_PDEV_ID_S)
  2534. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2535. do { \
  2536. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2537. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2538. } while (0)
  2539. /* DWORD 2 */
  2540. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2541. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2542. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2543. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2544. do { \
  2545. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2546. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2547. } while (0)
  2548. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2549. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2550. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2551. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2552. do { \
  2553. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2554. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2555. } while (0)
  2556. /**
  2557. * @brief MAC DMA rx ring setup specification
  2558. * @details
  2559. * To allow for dynamic rx ring reconfiguration and to avoid race
  2560. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2561. * it uses. Instead, it sends this message to the target, indicating how
  2562. * the rx ring used by the host should be set up and maintained.
  2563. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2564. * specifications.
  2565. *
  2566. * |31 16|15 8|7 0|
  2567. * |---------------------------------------------------------------|
  2568. * header: | reserved | num rings | msg type |
  2569. * |---------------------------------------------------------------|
  2570. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2571. #if HTT_PADDR64
  2572. * | FW_IDX shadow register physical address (bits 63:32) |
  2573. #endif
  2574. * |---------------------------------------------------------------|
  2575. * | rx ring base physical address (bits 31:0) |
  2576. #if HTT_PADDR64
  2577. * | rx ring base physical address (bits 63:32) |
  2578. #endif
  2579. * |---------------------------------------------------------------|
  2580. * | rx ring buffer size | rx ring length |
  2581. * |---------------------------------------------------------------|
  2582. * | FW_IDX initial value | enabled flags |
  2583. * |---------------------------------------------------------------|
  2584. * | MSDU payload offset | 802.11 header offset |
  2585. * |---------------------------------------------------------------|
  2586. * | PPDU end offset | PPDU start offset |
  2587. * |---------------------------------------------------------------|
  2588. * | MPDU end offset | MPDU start offset |
  2589. * |---------------------------------------------------------------|
  2590. * | MSDU end offset | MSDU start offset |
  2591. * |---------------------------------------------------------------|
  2592. * | frag info offset | rx attention offset |
  2593. * |---------------------------------------------------------------|
  2594. * payload 2, if present, has the same format as payload 1
  2595. * Header fields:
  2596. * - MSG_TYPE
  2597. * Bits 7:0
  2598. * Purpose: identifies this as an rx ring configuration message
  2599. * Value: 0x2
  2600. * - NUM_RINGS
  2601. * Bits 15:8
  2602. * Purpose: indicates whether the host is setting up one rx ring or two
  2603. * Value: 1 or 2
  2604. * Payload:
  2605. * for systems using 64-bit format for bus addresses:
  2606. * - IDX_SHADOW_REG_PADDR_LO
  2607. * Bits 31:0
  2608. * Value: lower 4 bytes of physical address of the host's
  2609. * FW_IDX shadow register
  2610. * - IDX_SHADOW_REG_PADDR_HI
  2611. * Bits 31:0
  2612. * Value: upper 4 bytes of physical address of the host's
  2613. * FW_IDX shadow register
  2614. * - RING_BASE_PADDR_LO
  2615. * Bits 31:0
  2616. * Value: lower 4 bytes of physical address of the host's rx ring
  2617. * - RING_BASE_PADDR_HI
  2618. * Bits 31:0
  2619. * Value: uppper 4 bytes of physical address of the host's rx ring
  2620. * for systems using 32-bit format for bus addresses:
  2621. * - IDX_SHADOW_REG_PADDR
  2622. * Bits 31:0
  2623. * Value: physical address of the host's FW_IDX shadow register
  2624. * - RING_BASE_PADDR
  2625. * Bits 31:0
  2626. * Value: physical address of the host's rx ring
  2627. * - RING_LEN
  2628. * Bits 15:0
  2629. * Value: number of elements in the rx ring
  2630. * - RING_BUF_SZ
  2631. * Bits 31:16
  2632. * Value: size of the buffers referenced by the rx ring, in byte units
  2633. * - ENABLED_FLAGS
  2634. * Bits 15:0
  2635. * Value: 1-bit flags to show whether different rx fields are enabled
  2636. * bit 0: 802.11 header enabled (1) or disabled (0)
  2637. * bit 1: MSDU payload enabled (1) or disabled (0)
  2638. * bit 2: PPDU start enabled (1) or disabled (0)
  2639. * bit 3: PPDU end enabled (1) or disabled (0)
  2640. * bit 4: MPDU start enabled (1) or disabled (0)
  2641. * bit 5: MPDU end enabled (1) or disabled (0)
  2642. * bit 6: MSDU start enabled (1) or disabled (0)
  2643. * bit 7: MSDU end enabled (1) or disabled (0)
  2644. * bit 8: rx attention enabled (1) or disabled (0)
  2645. * bit 9: frag info enabled (1) or disabled (0)
  2646. * bit 10: unicast rx enabled (1) or disabled (0)
  2647. * bit 11: multicast rx enabled (1) or disabled (0)
  2648. * bit 12: ctrl rx enabled (1) or disabled (0)
  2649. * bit 13: mgmt rx enabled (1) or disabled (0)
  2650. * bit 14: null rx enabled (1) or disabled (0)
  2651. * bit 15: phy data rx enabled (1) or disabled (0)
  2652. * - IDX_INIT_VAL
  2653. * Bits 31:16
  2654. * Purpose: Specify the initial value for the FW_IDX.
  2655. * Value: the number of buffers initially present in the host's rx ring
  2656. * - OFFSET_802_11_HDR
  2657. * Bits 15:0
  2658. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2659. * - OFFSET_MSDU_PAYLOAD
  2660. * Bits 31:16
  2661. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2662. * - OFFSET_PPDU_START
  2663. * Bits 15:0
  2664. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2665. * - OFFSET_PPDU_END
  2666. * Bits 31:16
  2667. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2668. * - OFFSET_MPDU_START
  2669. * Bits 15:0
  2670. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2671. * - OFFSET_MPDU_END
  2672. * Bits 31:16
  2673. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2674. * - OFFSET_MSDU_START
  2675. * Bits 15:0
  2676. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2677. * - OFFSET_MSDU_END
  2678. * Bits 31:16
  2679. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2680. * - OFFSET_RX_ATTN
  2681. * Bits 15:0
  2682. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2683. * - OFFSET_FRAG_INFO
  2684. * Bits 31:16
  2685. * Value: offset in QUAD-bytes of frag info table
  2686. */
  2687. /* header fields */
  2688. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2689. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2690. /* payload fields */
  2691. /* for systems using a 64-bit format for bus addresses */
  2692. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2693. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2694. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2695. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2696. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2697. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2698. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2699. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2700. /* for systems using a 32-bit format for bus addresses */
  2701. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2702. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2703. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2704. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2705. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2706. #define HTT_RX_RING_CFG_LEN_S 0
  2707. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2708. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2709. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2710. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2711. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2712. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2713. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2714. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2715. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2716. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2717. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2718. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2719. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2720. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2721. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2722. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2723. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2724. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2725. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2726. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2727. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2728. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2729. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2730. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2731. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2732. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2733. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2734. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2735. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2736. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2737. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2738. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2739. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2740. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2741. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2742. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2743. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2744. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2745. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2746. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2747. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2748. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2749. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2750. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2751. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2752. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2753. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2754. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2755. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2756. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2757. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2758. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2759. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2760. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2761. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2762. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2763. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2764. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2765. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2766. #if HTT_PADDR64
  2767. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2768. #else
  2769. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2770. #endif
  2771. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2772. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2773. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2774. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2775. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2776. do { \
  2777. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2778. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2779. } while (0)
  2780. /* degenerate case for 32-bit fields */
  2781. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2782. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2783. ((_var) = (_val))
  2784. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2785. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2786. ((_var) = (_val))
  2787. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2788. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2789. ((_var) = (_val))
  2790. /* degenerate case for 32-bit fields */
  2791. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2792. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2793. ((_var) = (_val))
  2794. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2795. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2796. ((_var) = (_val))
  2797. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2798. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2799. ((_var) = (_val))
  2800. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2801. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2802. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2803. do { \
  2804. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2805. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2806. } while (0)
  2807. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2808. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2809. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2810. do { \
  2811. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2812. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2813. } while (0)
  2814. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2815. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2816. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2817. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2818. do { \
  2819. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2820. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2821. } while (0)
  2822. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2823. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2824. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2825. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2826. do { \
  2827. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2828. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2829. } while (0)
  2830. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2831. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2832. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2833. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2834. do { \
  2835. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2836. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2837. } while (0)
  2838. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2839. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2840. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2841. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2842. do { \
  2843. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2844. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2845. } while (0)
  2846. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2847. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2848. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2849. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2850. do { \
  2851. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2852. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2853. } while (0)
  2854. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2855. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2856. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2857. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2858. do { \
  2859. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2860. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2861. } while (0)
  2862. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2863. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2864. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2865. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2866. do { \
  2867. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2868. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2869. } while (0)
  2870. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2871. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2872. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2873. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2874. do { \
  2875. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2876. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2877. } while (0)
  2878. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2879. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2880. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2881. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2882. do { \
  2883. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2884. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2885. } while (0)
  2886. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2887. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2888. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2889. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2890. do { \
  2891. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2892. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2893. } while (0)
  2894. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2895. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2896. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2897. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2898. do { \
  2899. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2900. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2901. } while (0)
  2902. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2903. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2904. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2905. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2906. do { \
  2907. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2908. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2909. } while (0)
  2910. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2911. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2912. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2913. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2914. do { \
  2915. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2916. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2917. } while (0)
  2918. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2919. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2920. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2921. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2922. do { \
  2923. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2924. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2925. } while (0)
  2926. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2927. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2928. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2929. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2930. do { \
  2931. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2932. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2933. } while (0)
  2934. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2935. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2936. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2937. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2938. do { \
  2939. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2940. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2941. } while (0)
  2942. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2943. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2944. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2945. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2946. do { \
  2947. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2948. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2949. } while (0)
  2950. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2951. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2952. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2953. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2954. do { \
  2955. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2956. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2957. } while (0)
  2958. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2959. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2960. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2961. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2962. do { \
  2963. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2964. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2965. } while (0)
  2966. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2967. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2968. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2969. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2970. do { \
  2971. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2972. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2973. } while (0)
  2974. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2975. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2976. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2977. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2978. do { \
  2979. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2980. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2981. } while (0)
  2982. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2983. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2984. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2985. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2986. do { \
  2987. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2988. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2989. } while (0)
  2990. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2991. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2992. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2993. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2994. do { \
  2995. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2996. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2997. } while (0)
  2998. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2999. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3000. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3001. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3002. do { \
  3003. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3004. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3005. } while (0)
  3006. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3007. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3008. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3009. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3010. do { \
  3011. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3012. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3013. } while (0)
  3014. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3015. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3016. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3017. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3018. do { \
  3019. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3020. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3021. } while (0)
  3022. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3023. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3024. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3025. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3026. do { \
  3027. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3028. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3029. } while (0)
  3030. /**
  3031. * @brief host -> target FW statistics retrieve
  3032. *
  3033. * @details
  3034. * The following field definitions describe the format of the HTT host
  3035. * to target FW stats retrieve message. The message specifies the type of
  3036. * stats host wants to retrieve.
  3037. *
  3038. * |31 24|23 16|15 8|7 0|
  3039. * |-----------------------------------------------------------|
  3040. * | stats types request bitmask | msg type |
  3041. * |-----------------------------------------------------------|
  3042. * | stats types reset bitmask | reserved |
  3043. * |-----------------------------------------------------------|
  3044. * | stats type | config value |
  3045. * |-----------------------------------------------------------|
  3046. * | cookie LSBs |
  3047. * |-----------------------------------------------------------|
  3048. * | cookie MSBs |
  3049. * |-----------------------------------------------------------|
  3050. * Header fields:
  3051. * - MSG_TYPE
  3052. * Bits 7:0
  3053. * Purpose: identifies this is a stats upload request message
  3054. * Value: 0x3
  3055. * - UPLOAD_TYPES
  3056. * Bits 31:8
  3057. * Purpose: identifies which types of FW statistics to upload
  3058. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3059. * - RESET_TYPES
  3060. * Bits 31:8
  3061. * Purpose: identifies which types of FW statistics to reset
  3062. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3063. * - CFG_VAL
  3064. * Bits 23:0
  3065. * Purpose: give an opaque configuration value to the specified stats type
  3066. * Value: stats-type specific configuration value
  3067. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3068. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3069. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3070. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3071. * - CFG_STAT_TYPE
  3072. * Bits 31:24
  3073. * Purpose: specify which stats type (if any) the config value applies to
  3074. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3075. * a valid configuration specification
  3076. * - COOKIE_LSBS
  3077. * Bits 31:0
  3078. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3079. * message with its preceding host->target stats request message.
  3080. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3081. * - COOKIE_MSBS
  3082. * Bits 31:0
  3083. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3084. * message with its preceding host->target stats request message.
  3085. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3086. */
  3087. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3088. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3089. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3090. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3091. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3092. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3093. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3094. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3095. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3096. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3097. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3098. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3099. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3100. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3101. do { \
  3102. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3103. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3104. } while (0)
  3105. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3106. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3107. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3108. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3109. do { \
  3110. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3111. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3112. } while (0)
  3113. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3114. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3115. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3116. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3117. do { \
  3118. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3119. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3120. } while (0)
  3121. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3122. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3123. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3124. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3125. do { \
  3126. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3127. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3128. } while (0)
  3129. /**
  3130. * @brief host -> target HTT out-of-band sync request
  3131. *
  3132. * @details
  3133. * The HTT SYNC tells the target to suspend processing of subsequent
  3134. * HTT host-to-target messages until some other target agent locally
  3135. * informs the target HTT FW that the current sync counter is equal to
  3136. * or greater than (in a modulo sense) the sync counter specified in
  3137. * the SYNC message.
  3138. * This allows other host-target components to synchronize their operation
  3139. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3140. * security key has been downloaded to and activated by the target.
  3141. * In the absence of any explicit synchronization counter value
  3142. * specification, the target HTT FW will use zero as the default current
  3143. * sync value.
  3144. *
  3145. * |31 24|23 16|15 8|7 0|
  3146. * |-----------------------------------------------------------|
  3147. * | reserved | sync count | msg type |
  3148. * |-----------------------------------------------------------|
  3149. * Header fields:
  3150. * - MSG_TYPE
  3151. * Bits 7:0
  3152. * Purpose: identifies this as a sync message
  3153. * Value: 0x4
  3154. * - SYNC_COUNT
  3155. * Bits 15:8
  3156. * Purpose: specifies what sync value the HTT FW will wait for from
  3157. * an out-of-band specification to resume its operation
  3158. * Value: in-band sync counter value to compare against the out-of-band
  3159. * counter spec.
  3160. * The HTT target FW will suspend its host->target message processing
  3161. * as long as
  3162. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3163. */
  3164. #define HTT_H2T_SYNC_MSG_SZ 4
  3165. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3166. #define HTT_H2T_SYNC_COUNT_S 8
  3167. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3168. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3169. HTT_H2T_SYNC_COUNT_S)
  3170. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3171. do { \
  3172. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3173. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3174. } while (0)
  3175. /**
  3176. * @brief HTT aggregation configuration
  3177. */
  3178. #define HTT_AGGR_CFG_MSG_SZ 4
  3179. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3180. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3181. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3182. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3183. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3184. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3185. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3186. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3187. do { \
  3188. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3189. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3190. } while (0)
  3191. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3192. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3193. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3194. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3195. do { \
  3196. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3197. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3198. } while (0)
  3199. /**
  3200. * @brief host -> target HTT configure max amsdu info per vdev
  3201. *
  3202. * @details
  3203. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3204. *
  3205. * |31 21|20 16|15 8|7 0|
  3206. * |-----------------------------------------------------------|
  3207. * | reserved | vdev id | max amsdu | msg type |
  3208. * |-----------------------------------------------------------|
  3209. * Header fields:
  3210. * - MSG_TYPE
  3211. * Bits 7:0
  3212. * Purpose: identifies this as a aggr cfg ex message
  3213. * Value: 0xa
  3214. * - MAX_NUM_AMSDU_SUBFRM
  3215. * Bits 15:8
  3216. * Purpose: max MSDUs per A-MSDU
  3217. * - VDEV_ID
  3218. * Bits 20:16
  3219. * Purpose: ID of the vdev to which this limit is applied
  3220. */
  3221. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3222. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3223. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3224. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3225. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3226. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3227. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3228. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3229. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3230. do { \
  3231. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3232. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3233. } while (0)
  3234. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3235. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3236. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3237. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3238. do { \
  3239. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3240. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3241. } while (0)
  3242. /**
  3243. * @brief HTT WDI_IPA Config Message
  3244. *
  3245. * @details
  3246. * The HTT WDI_IPA config message is created/sent by host at driver
  3247. * init time. It contains information about data structures used on
  3248. * WDI_IPA TX and RX path.
  3249. * TX CE ring is used for pushing packet metadata from IPA uC
  3250. * to WLAN FW
  3251. * TX Completion ring is used for generating TX completions from
  3252. * WLAN FW to IPA uC
  3253. * RX Indication ring is used for indicating RX packets from FW
  3254. * to IPA uC
  3255. * RX Ring2 is used as either completion ring or as second
  3256. * indication ring. when Ring2 is used as completion ring, IPA uC
  3257. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3258. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3259. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3260. * indicated in RX Indication ring. Please see WDI_IPA specification
  3261. * for more details.
  3262. * |31 24|23 16|15 8|7 0|
  3263. * |----------------+----------------+----------------+----------------|
  3264. * | tx pkt pool size | Rsvd | msg_type |
  3265. * |-------------------------------------------------------------------|
  3266. * | tx comp ring base (bits 31:0) |
  3267. #if HTT_PADDR64
  3268. * | tx comp ring base (bits 63:32) |
  3269. #endif
  3270. * |-------------------------------------------------------------------|
  3271. * | tx comp ring size |
  3272. * |-------------------------------------------------------------------|
  3273. * | tx comp WR_IDX physical address (bits 31:0) |
  3274. #if HTT_PADDR64
  3275. * | tx comp WR_IDX physical address (bits 63:32) |
  3276. #endif
  3277. * |-------------------------------------------------------------------|
  3278. * | tx CE WR_IDX physical address (bits 31:0) |
  3279. #if HTT_PADDR64
  3280. * | tx CE WR_IDX physical address (bits 63:32) |
  3281. #endif
  3282. * |-------------------------------------------------------------------|
  3283. * | rx indication ring base (bits 31:0) |
  3284. #if HTT_PADDR64
  3285. * | rx indication ring base (bits 63:32) |
  3286. #endif
  3287. * |-------------------------------------------------------------------|
  3288. * | rx indication ring size |
  3289. * |-------------------------------------------------------------------|
  3290. * | rx ind RD_IDX physical address (bits 31:0) |
  3291. #if HTT_PADDR64
  3292. * | rx ind RD_IDX physical address (bits 63:32) |
  3293. #endif
  3294. * |-------------------------------------------------------------------|
  3295. * | rx ind WR_IDX physical address (bits 31:0) |
  3296. #if HTT_PADDR64
  3297. * | rx ind WR_IDX physical address (bits 63:32) |
  3298. #endif
  3299. * |-------------------------------------------------------------------|
  3300. * |-------------------------------------------------------------------|
  3301. * | rx ring2 base (bits 31:0) |
  3302. #if HTT_PADDR64
  3303. * | rx ring2 base (bits 63:32) |
  3304. #endif
  3305. * |-------------------------------------------------------------------|
  3306. * | rx ring2 size |
  3307. * |-------------------------------------------------------------------|
  3308. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3309. #if HTT_PADDR64
  3310. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3311. #endif
  3312. * |-------------------------------------------------------------------|
  3313. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3314. #if HTT_PADDR64
  3315. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3316. #endif
  3317. * |-------------------------------------------------------------------|
  3318. *
  3319. * Header fields:
  3320. * Header fields:
  3321. * - MSG_TYPE
  3322. * Bits 7:0
  3323. * Purpose: Identifies this as WDI_IPA config message
  3324. * value: = 0x8
  3325. * - TX_PKT_POOL_SIZE
  3326. * Bits 15:0
  3327. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3328. * WDI_IPA TX path
  3329. * For systems using 32-bit format for bus addresses:
  3330. * - TX_COMP_RING_BASE_ADDR
  3331. * Bits 31:0
  3332. * Purpose: TX Completion Ring base address in DDR
  3333. * - TX_COMP_RING_SIZE
  3334. * Bits 31:0
  3335. * Purpose: TX Completion Ring size (must be power of 2)
  3336. * - TX_COMP_WR_IDX_ADDR
  3337. * Bits 31:0
  3338. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3339. * updates the Write Index for WDI_IPA TX completion ring
  3340. * - TX_CE_WR_IDX_ADDR
  3341. * Bits 31:0
  3342. * Purpose: DDR address where IPA uC
  3343. * updates the WR Index for TX CE ring
  3344. * (needed for fusion platforms)
  3345. * - RX_IND_RING_BASE_ADDR
  3346. * Bits 31:0
  3347. * Purpose: RX Indication Ring base address in DDR
  3348. * - RX_IND_RING_SIZE
  3349. * Bits 31:0
  3350. * Purpose: RX Indication Ring size
  3351. * - RX_IND_RD_IDX_ADDR
  3352. * Bits 31:0
  3353. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3354. * RX indication ring
  3355. * - RX_IND_WR_IDX_ADDR
  3356. * Bits 31:0
  3357. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3358. * updates the Write Index for WDI_IPA RX indication ring
  3359. * - RX_RING2_BASE_ADDR
  3360. * Bits 31:0
  3361. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3362. * - RX_RING2_SIZE
  3363. * Bits 31:0
  3364. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3365. * - RX_RING2_RD_IDX_ADDR
  3366. * Bits 31:0
  3367. * Purpose: If Second RX ring is Indication ring, DDR address where
  3368. * IPA uC updates the Read Index for Ring2.
  3369. * If Second RX ring is completion ring, this is NOT used
  3370. * - RX_RING2_WR_IDX_ADDR
  3371. * Bits 31:0
  3372. * Purpose: If Second RX ring is Indication ring, DDR address where
  3373. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3374. * If second RX ring is completion ring, DDR address where
  3375. * IPA uC updates the Write Index for Ring 2.
  3376. * For systems using 64-bit format for bus addresses:
  3377. * - TX_COMP_RING_BASE_ADDR_LO
  3378. * Bits 31:0
  3379. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3380. * - TX_COMP_RING_BASE_ADDR_HI
  3381. * Bits 31:0
  3382. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3383. * - TX_COMP_RING_SIZE
  3384. * Bits 31:0
  3385. * Purpose: TX Completion Ring size (must be power of 2)
  3386. * - TX_COMP_WR_IDX_ADDR_LO
  3387. * Bits 31:0
  3388. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3389. * Lower 4 bytes of DDR address where WIFI FW
  3390. * updates the Write Index for WDI_IPA TX completion ring
  3391. * - TX_COMP_WR_IDX_ADDR_HI
  3392. * Bits 31:0
  3393. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3394. * Higher 4 bytes of DDR address where WIFI FW
  3395. * updates the Write Index for WDI_IPA TX completion ring
  3396. * - TX_CE_WR_IDX_ADDR_LO
  3397. * Bits 31:0
  3398. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3399. * updates the WR Index for TX CE ring
  3400. * (needed for fusion platforms)
  3401. * - TX_CE_WR_IDX_ADDR_HI
  3402. * Bits 31:0
  3403. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3404. * updates the WR Index for TX CE ring
  3405. * (needed for fusion platforms)
  3406. * - RX_IND_RING_BASE_ADDR_LO
  3407. * Bits 31:0
  3408. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3409. * - RX_IND_RING_BASE_ADDR_HI
  3410. * Bits 31:0
  3411. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3412. * - RX_IND_RING_SIZE
  3413. * Bits 31:0
  3414. * Purpose: RX Indication Ring size
  3415. * - RX_IND_RD_IDX_ADDR_LO
  3416. * Bits 31:0
  3417. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3418. * for WDI_IPA RX indication ring
  3419. * - RX_IND_RD_IDX_ADDR_HI
  3420. * Bits 31:0
  3421. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3422. * for WDI_IPA RX indication ring
  3423. * - RX_IND_WR_IDX_ADDR_LO
  3424. * Bits 31:0
  3425. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3426. * Lower 4 bytes of DDR address where WIFI FW
  3427. * updates the Write Index for WDI_IPA RX indication ring
  3428. * - RX_IND_WR_IDX_ADDR_HI
  3429. * Bits 31:0
  3430. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3431. * Higher 4 bytes of DDR address where WIFI FW
  3432. * updates the Write Index for WDI_IPA RX indication ring
  3433. * - RX_RING2_BASE_ADDR_LO
  3434. * Bits 31:0
  3435. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3436. * - RX_RING2_BASE_ADDR_HI
  3437. * Bits 31:0
  3438. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3439. * - RX_RING2_SIZE
  3440. * Bits 31:0
  3441. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3442. * - RX_RING2_RD_IDX_ADDR_LO
  3443. * Bits 31:0
  3444. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3445. * DDR address where IPA uC updates the Read Index for Ring2.
  3446. * If Second RX ring is completion ring, this is NOT used
  3447. * - RX_RING2_RD_IDX_ADDR_HI
  3448. * Bits 31:0
  3449. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3450. * DDR address where IPA uC updates the Read Index for Ring2.
  3451. * If Second RX ring is completion ring, this is NOT used
  3452. * - RX_RING2_WR_IDX_ADDR_LO
  3453. * Bits 31:0
  3454. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3455. * DDR address where WIFI FW updates the Write Index
  3456. * for WDI_IPA RX ring2
  3457. * If second RX ring is completion ring, lower 4 bytes of
  3458. * DDR address where IPA uC updates the Write Index for Ring 2.
  3459. * - RX_RING2_WR_IDX_ADDR_HI
  3460. * Bits 31:0
  3461. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3462. * DDR address where WIFI FW updates the Write Index
  3463. * for WDI_IPA RX ring2
  3464. * If second RX ring is completion ring, higher 4 bytes of
  3465. * DDR address where IPA uC updates the Write Index for Ring 2.
  3466. */
  3467. #if HTT_PADDR64
  3468. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3469. #else
  3470. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3471. #endif
  3472. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3473. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3474. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3475. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3476. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3477. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3478. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3479. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3480. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3481. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3482. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3483. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3484. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3485. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3486. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3487. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3488. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3489. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3490. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3491. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3492. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3493. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3494. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3495. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3496. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3497. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3498. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3499. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3500. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3501. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3502. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3503. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3504. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3505. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3506. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3507. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3508. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3509. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3510. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3511. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3512. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3513. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3514. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3515. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3516. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3517. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3518. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3519. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3520. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3521. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3522. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3523. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3524. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3525. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3526. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3527. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3528. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3529. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3530. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3531. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3532. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3533. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3534. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3535. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3536. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3537. do { \
  3538. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3539. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3540. } while (0)
  3541. /* for systems using 32-bit format for bus addr */
  3542. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3543. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3544. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3545. do { \
  3546. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3547. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3548. } while (0)
  3549. /* for systems using 64-bit format for bus addr */
  3550. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3551. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3552. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3553. do { \
  3554. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3555. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3556. } while (0)
  3557. /* for systems using 64-bit format for bus addr */
  3558. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3559. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3560. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3561. do { \
  3562. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3563. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3564. } while (0)
  3565. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3566. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3567. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3568. do { \
  3569. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3570. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3571. } while (0)
  3572. /* for systems using 32-bit format for bus addr */
  3573. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3574. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3575. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3576. do { \
  3577. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3578. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3579. } while (0)
  3580. /* for systems using 64-bit format for bus addr */
  3581. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3582. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3583. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3584. do { \
  3585. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3586. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3587. } while (0)
  3588. /* for systems using 64-bit format for bus addr */
  3589. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3590. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3591. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3592. do { \
  3593. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3594. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3595. } while (0)
  3596. /* for systems using 32-bit format for bus addr */
  3597. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3598. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3599. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3600. do { \
  3601. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3602. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3603. } while (0)
  3604. /* for systems using 64-bit format for bus addr */
  3605. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3606. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3607. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3608. do { \
  3609. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3610. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3611. } while (0)
  3612. /* for systems using 64-bit format for bus addr */
  3613. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3614. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3615. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3616. do { \
  3617. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3618. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3619. } while (0)
  3620. /* for systems using 32-bit format for bus addr */
  3621. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3622. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3623. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3624. do { \
  3625. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3626. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3627. } while (0)
  3628. /* for systems using 64-bit format for bus addr */
  3629. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3630. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3631. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3632. do { \
  3633. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3634. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3635. } while (0)
  3636. /* for systems using 64-bit format for bus addr */
  3637. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3638. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3639. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3640. do { \
  3641. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3642. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3643. } while (0)
  3644. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3645. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3646. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3647. do { \
  3648. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3649. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3650. } while (0)
  3651. /* for systems using 32-bit format for bus addr */
  3652. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3653. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3654. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3655. do { \
  3656. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3657. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3658. } while (0)
  3659. /* for systems using 64-bit format for bus addr */
  3660. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3661. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3662. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3663. do { \
  3664. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3665. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3666. } while (0)
  3667. /* for systems using 64-bit format for bus addr */
  3668. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3669. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3670. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3671. do { \
  3672. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3673. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3674. } while (0)
  3675. /* for systems using 32-bit format for bus addr */
  3676. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3677. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3678. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3679. do { \
  3680. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3681. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3682. } while (0)
  3683. /* for systems using 64-bit format for bus addr */
  3684. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3685. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3686. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3687. do { \
  3688. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3689. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3690. } while (0)
  3691. /* for systems using 64-bit format for bus addr */
  3692. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3693. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3694. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3695. do { \
  3696. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3697. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3698. } while (0)
  3699. /* for systems using 32-bit format for bus addr */
  3700. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3701. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3702. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3703. do { \
  3704. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3705. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3706. } while (0)
  3707. /* for systems using 64-bit format for bus addr */
  3708. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3709. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3710. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3711. do { \
  3712. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3713. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3714. } while (0)
  3715. /* for systems using 64-bit format for bus addr */
  3716. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3717. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3718. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3719. do { \
  3720. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3721. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3722. } while (0)
  3723. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3724. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3725. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3726. do { \
  3727. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3728. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3729. } while (0)
  3730. /* for systems using 32-bit format for bus addr */
  3731. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3732. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3733. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3734. do { \
  3735. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3736. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3737. } while (0)
  3738. /* for systems using 64-bit format for bus addr */
  3739. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3740. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3741. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3742. do { \
  3743. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3744. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3745. } while (0)
  3746. /* for systems using 64-bit format for bus addr */
  3747. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3748. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3749. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3750. do { \
  3751. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3752. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3753. } while (0)
  3754. /* for systems using 32-bit format for bus addr */
  3755. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3756. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3757. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3758. do { \
  3759. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3760. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3761. } while (0)
  3762. /* for systems using 64-bit format for bus addr */
  3763. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3764. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3765. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3766. do { \
  3767. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3768. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3769. } while (0)
  3770. /* for systems using 64-bit format for bus addr */
  3771. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3772. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3773. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3774. do { \
  3775. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3776. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3777. } while (0)
  3778. /*
  3779. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3780. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3781. * addresses are stored in a XXX-bit field.
  3782. * This macro is used to define both htt_wdi_ipa_config32_t and
  3783. * htt_wdi_ipa_config64_t structs.
  3784. */
  3785. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3786. _paddr__tx_comp_ring_base_addr_, \
  3787. _paddr__tx_comp_wr_idx_addr_, \
  3788. _paddr__tx_ce_wr_idx_addr_, \
  3789. _paddr__rx_ind_ring_base_addr_, \
  3790. _paddr__rx_ind_rd_idx_addr_, \
  3791. _paddr__rx_ind_wr_idx_addr_, \
  3792. _paddr__rx_ring2_base_addr_,\
  3793. _paddr__rx_ring2_rd_idx_addr_,\
  3794. _paddr__rx_ring2_wr_idx_addr_) \
  3795. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3796. { \
  3797. /* DWORD 0: flags and meta-data */ \
  3798. A_UINT32 \
  3799. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3800. reserved: 8, \
  3801. tx_pkt_pool_size: 16;\
  3802. /* DWORD 1 */\
  3803. _paddr__tx_comp_ring_base_addr_;\
  3804. /* DWORD 2 (or 3)*/\
  3805. A_UINT32 tx_comp_ring_size;\
  3806. /* DWORD 3 (or 4)*/\
  3807. _paddr__tx_comp_wr_idx_addr_;\
  3808. /* DWORD 4 (or 6)*/\
  3809. _paddr__tx_ce_wr_idx_addr_;\
  3810. /* DWORD 5 (or 8)*/\
  3811. _paddr__rx_ind_ring_base_addr_;\
  3812. /* DWORD 6 (or 10)*/\
  3813. A_UINT32 rx_ind_ring_size;\
  3814. /* DWORD 7 (or 11)*/\
  3815. _paddr__rx_ind_rd_idx_addr_;\
  3816. /* DWORD 8 (or 13)*/\
  3817. _paddr__rx_ind_wr_idx_addr_;\
  3818. /* DWORD 9 (or 15)*/\
  3819. _paddr__rx_ring2_base_addr_;\
  3820. /* DWORD 10 (or 17) */\
  3821. A_UINT32 rx_ring2_size;\
  3822. /* DWORD 11 (or 18) */\
  3823. _paddr__rx_ring2_rd_idx_addr_;\
  3824. /* DWORD 12 (or 20) */\
  3825. _paddr__rx_ring2_wr_idx_addr_;\
  3826. } POSTPACK
  3827. /* define a htt_wdi_ipa_config32_t type */
  3828. 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));
  3829. /* define a htt_wdi_ipa_config64_t type */
  3830. 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));
  3831. #if HTT_PADDR64
  3832. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3833. #else
  3834. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3835. #endif
  3836. enum htt_wdi_ipa_op_code {
  3837. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3838. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3839. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3840. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3841. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3842. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3843. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3844. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3845. /* keep this last */
  3846. HTT_WDI_IPA_OPCODE_MAX
  3847. };
  3848. /**
  3849. * @brief HTT WDI_IPA Operation Request Message
  3850. *
  3851. * @details
  3852. * HTT WDI_IPA Operation Request message is sent by host
  3853. * to either suspend or resume WDI_IPA TX or RX path.
  3854. * |31 24|23 16|15 8|7 0|
  3855. * |----------------+----------------+----------------+----------------|
  3856. * | op_code | Rsvd | msg_type |
  3857. * |-------------------------------------------------------------------|
  3858. *
  3859. * Header fields:
  3860. * - MSG_TYPE
  3861. * Bits 7:0
  3862. * Purpose: Identifies this as WDI_IPA Operation Request message
  3863. * value: = 0x9
  3864. * - OP_CODE
  3865. * Bits 31:16
  3866. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3867. * value: = enum htt_wdi_ipa_op_code
  3868. */
  3869. PREPACK struct htt_wdi_ipa_op_request_t
  3870. {
  3871. /* DWORD 0: flags and meta-data */
  3872. A_UINT32
  3873. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3874. reserved: 8,
  3875. op_code: 16;
  3876. } POSTPACK;
  3877. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3878. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3879. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3880. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3881. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3882. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3883. do { \
  3884. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3885. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3886. } while (0)
  3887. /*
  3888. * @brief host -> target HTT_SRING_SETUP message
  3889. *
  3890. * @details
  3891. * After target is booted up, Host can send SRING setup message for
  3892. * each host facing LMAC SRING. Target setups up HW registers based
  3893. * on setup message and confirms back to Host if response_required is set.
  3894. * Host should wait for confirmation message before sending new SRING
  3895. * setup message
  3896. *
  3897. * The message would appear as follows:
  3898. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  3899. * |--------------- +-----------------+-----------------+-----------------|
  3900. * | ring_type | ring_id | pdev_id | msg_type |
  3901. * |----------------------------------------------------------------------|
  3902. * | ring_base_addr_lo |
  3903. * |----------------------------------------------------------------------|
  3904. * | ring_base_addr_hi |
  3905. * |----------------------------------------------------------------------|
  3906. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3907. * |----------------------------------------------------------------------|
  3908. * | ring_head_offset32_remote_addr_lo |
  3909. * |----------------------------------------------------------------------|
  3910. * | ring_head_offset32_remote_addr_hi |
  3911. * |----------------------------------------------------------------------|
  3912. * | ring_tail_offset32_remote_addr_lo |
  3913. * |----------------------------------------------------------------------|
  3914. * | ring_tail_offset32_remote_addr_hi |
  3915. * |----------------------------------------------------------------------|
  3916. * | ring_msi_addr_lo |
  3917. * |----------------------------------------------------------------------|
  3918. * | ring_msi_addr_hi |
  3919. * |----------------------------------------------------------------------|
  3920. * | ring_msi_data |
  3921. * |----------------------------------------------------------------------|
  3922. * | intr_timer_th |IM| intr_batch_counter_th |
  3923. * |----------------------------------------------------------------------|
  3924. * | reserved |ID|RR| PTCF| intr_low_threshold |
  3925. * |----------------------------------------------------------------------|
  3926. * | reserved |IPA drop thres hi|IPA drop thres lo|
  3927. * |----------------------------------------------------------------------|
  3928. * Where
  3929. * IM = sw_intr_mode
  3930. * RR = response_required
  3931. * PTCF = prefetch_timer_cfg
  3932. * IP = IPA drop flag
  3933. *
  3934. * The message is interpreted as follows:
  3935. * dword0 - b'0:7 - msg_type: This will be set to
  3936. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3937. * b'8:15 - pdev_id:
  3938. * 0 (for rings at SOC/UMAC level),
  3939. * 1/2/3 mac id (for rings at LMAC level)
  3940. * b'16:23 - ring_id: identify which ring is to setup,
  3941. * more details can be got from enum htt_srng_ring_id
  3942. * b'24:31 - ring_type: identify type of host rings,
  3943. * more details can be got from enum htt_srng_ring_type
  3944. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3945. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3946. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3947. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3948. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3949. * SW_TO_HW_RING.
  3950. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3951. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3952. * Lower 32 bits of memory address of the remote variable
  3953. * storing the 4-byte word offset that identifies the head
  3954. * element within the ring.
  3955. * (The head offset variable has type A_UINT32.)
  3956. * Valid for HW_TO_SW and SW_TO_SW rings.
  3957. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3958. * Upper 32 bits of memory address of the remote variable
  3959. * storing the 4-byte word offset that identifies the head
  3960. * element within the ring.
  3961. * (The head offset variable has type A_UINT32.)
  3962. * Valid for HW_TO_SW and SW_TO_SW rings.
  3963. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3964. * Lower 32 bits of memory address of the remote variable
  3965. * storing the 4-byte word offset that identifies the tail
  3966. * element within the ring.
  3967. * (The tail offset variable has type A_UINT32.)
  3968. * Valid for HW_TO_SW and SW_TO_SW rings.
  3969. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3970. * Upper 32 bits of memory address of the remote variable
  3971. * storing the 4-byte word offset that identifies the tail
  3972. * element within the ring.
  3973. * (The tail offset variable has type A_UINT32.)
  3974. * Valid for HW_TO_SW and SW_TO_SW rings.
  3975. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3976. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3977. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3978. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3979. * dword10 - b'0:31 - ring_msi_data: MSI data
  3980. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3981. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3982. * dword11 - b'0:14 - intr_batch_counter_th:
  3983. * batch counter threshold is in units of 4-byte words.
  3984. * HW internally maintains and increments batch count.
  3985. * (see SRING spec for detail description).
  3986. * When batch count reaches threshold value, an interrupt
  3987. * is generated by HW.
  3988. * b'15 - sw_intr_mode:
  3989. * This configuration shall be static.
  3990. * Only programmed at power up.
  3991. * 0: generate pulse style sw interrupts
  3992. * 1: generate level style sw interrupts
  3993. * b'16:31 - intr_timer_th:
  3994. * The timer init value when timer is idle or is
  3995. * initialized to start downcounting.
  3996. * In 8us units (to cover a range of 0 to 524 ms)
  3997. * dword12 - b'0:15 - intr_low_threshold:
  3998. * Used only by Consumer ring to generate ring_sw_int_p.
  3999. * Ring entries low threshold water mark, that is used
  4000. * in combination with the interrupt timer as well as
  4001. * the the clearing of the level interrupt.
  4002. * b'16:18 - prefetch_timer_cfg:
  4003. * Used only by Consumer ring to set timer mode to
  4004. * support Application prefetch handling.
  4005. * The external tail offset/pointer will be updated
  4006. * at following intervals:
  4007. * 3'b000: (Prefetch feature disabled; used only for debug)
  4008. * 3'b001: 1 usec
  4009. * 3'b010: 4 usec
  4010. * 3'b011: 8 usec (default)
  4011. * 3'b100: 16 usec
  4012. * Others: Reserverd
  4013. * b'19 - response_required:
  4014. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4015. * b'20 - ipa_drop_flag:
  4016. Indicates that host will config ipa drop threshold percentage
  4017. * b'21:31 - reserved: reserved for future use
  4018. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4019. * b'8:15 - ipa drop high threshold percentage:
  4020. * b'16:31 - Reserved
  4021. */
  4022. PREPACK struct htt_sring_setup_t {
  4023. A_UINT32 msg_type: 8,
  4024. pdev_id: 8,
  4025. ring_id: 8,
  4026. ring_type: 8;
  4027. A_UINT32 ring_base_addr_lo;
  4028. A_UINT32 ring_base_addr_hi;
  4029. A_UINT32 ring_size: 16,
  4030. ring_entry_size: 8,
  4031. ring_misc_cfg_flag: 8;
  4032. A_UINT32 ring_head_offset32_remote_addr_lo;
  4033. A_UINT32 ring_head_offset32_remote_addr_hi;
  4034. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4035. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4036. A_UINT32 ring_msi_addr_lo;
  4037. A_UINT32 ring_msi_addr_hi;
  4038. A_UINT32 ring_msi_data;
  4039. A_UINT32 intr_batch_counter_th: 15,
  4040. sw_intr_mode: 1,
  4041. intr_timer_th: 16;
  4042. A_UINT32 intr_low_threshold: 16,
  4043. prefetch_timer_cfg: 3,
  4044. response_required: 1,
  4045. ipa_drop_flag: 1,
  4046. reserved1: 11;
  4047. A_UINT32 ipa_drop_low_threshold: 8,
  4048. ipa_drop_high_threshold: 8,
  4049. reserved: 16;
  4050. } POSTPACK;
  4051. enum htt_srng_ring_type {
  4052. HTT_HW_TO_SW_RING = 0,
  4053. HTT_SW_TO_HW_RING,
  4054. HTT_SW_TO_SW_RING,
  4055. /* Insert new ring types above this line */
  4056. };
  4057. enum htt_srng_ring_id {
  4058. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4059. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4060. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4061. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4062. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4063. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4064. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4065. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4066. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4067. /* Add Other SRING which can't be directly configured by host software above this line */
  4068. };
  4069. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4070. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4071. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4072. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4073. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4074. HTT_SRING_SETUP_PDEV_ID_S)
  4075. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4076. do { \
  4077. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4078. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4079. } while (0)
  4080. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4081. #define HTT_SRING_SETUP_RING_ID_S 16
  4082. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4083. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4084. HTT_SRING_SETUP_RING_ID_S)
  4085. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4086. do { \
  4087. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4088. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4089. } while (0)
  4090. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4091. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4092. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4093. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4094. HTT_SRING_SETUP_RING_TYPE_S)
  4095. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4096. do { \
  4097. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4098. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4099. } while (0)
  4100. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4101. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4102. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4103. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4104. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4105. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4106. do { \
  4107. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4108. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4109. } while (0)
  4110. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4111. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4112. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4113. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4114. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4115. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4116. do { \
  4117. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4118. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4119. } while (0)
  4120. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4121. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4122. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4123. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4124. HTT_SRING_SETUP_RING_SIZE_S)
  4125. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4126. do { \
  4127. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4128. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4129. } while (0)
  4130. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4131. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4132. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4133. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4134. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4135. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4136. do { \
  4137. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4138. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4139. } while (0)
  4140. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4141. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4142. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4143. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4144. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4145. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4146. do { \
  4147. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4148. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4149. } while (0)
  4150. /* This control bit is applicable to only Producer, which updates Ring ID field
  4151. * of each descriptor before pushing into the ring.
  4152. * 0: updates ring_id(default)
  4153. * 1: ring_id updating disabled */
  4154. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4155. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4156. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4157. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4158. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4159. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4160. do { \
  4161. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4162. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4163. } while (0)
  4164. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4165. * of each descriptor before pushing into the ring.
  4166. * 0: updates Loopcnt(default)
  4167. * 1: Loopcnt updating disabled */
  4168. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4169. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4170. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4171. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4172. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4173. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4174. do { \
  4175. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4176. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4177. } while (0)
  4178. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4179. * into security_id port of GXI/AXI. */
  4180. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4181. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4182. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4183. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4184. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4185. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4186. do { \
  4187. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4188. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4189. } while (0)
  4190. /* During MSI write operation, SRNG drives value of this register bit into
  4191. * swap bit of GXI/AXI. */
  4192. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4193. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4194. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4195. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4196. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4197. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4198. do { \
  4199. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4200. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4201. } while (0)
  4202. /* During Pointer write operation, SRNG drives value of this register bit into
  4203. * swap bit of GXI/AXI. */
  4204. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4205. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4206. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4207. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4208. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4209. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4210. do { \
  4211. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4212. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4213. } while (0)
  4214. /* During any data or TLV write operation, SRNG drives value of this register
  4215. * bit into swap bit of GXI/AXI. */
  4216. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4217. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4218. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4219. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4220. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4221. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4222. do { \
  4223. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4224. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4225. } while (0)
  4226. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4227. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4228. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4229. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4230. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4231. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4232. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4233. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4234. do { \
  4235. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4236. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4237. } while (0)
  4238. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4239. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4240. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4241. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4242. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4243. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4244. do { \
  4245. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4246. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4247. } while (0)
  4248. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4249. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4250. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4251. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4252. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4253. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4254. do { \
  4255. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4256. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4257. } while (0)
  4258. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4259. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4260. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4261. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4262. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4263. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4264. do { \
  4265. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4266. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4267. } while (0)
  4268. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4269. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4270. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4271. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4272. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4273. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4274. do { \
  4275. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4276. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4277. } while (0)
  4278. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4279. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4280. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4281. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4282. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4283. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4284. do { \
  4285. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4286. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4287. } while (0)
  4288. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4289. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4290. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4291. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4292. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4293. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4294. do { \
  4295. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4296. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4297. } while (0)
  4298. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4299. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4300. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4301. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4302. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4303. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4304. do { \
  4305. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4306. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4307. } while (0)
  4308. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4309. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4310. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4311. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4312. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4313. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4314. do { \
  4315. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4316. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4317. } while (0)
  4318. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4319. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4320. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4321. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4322. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4323. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4324. do { \
  4325. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4326. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4327. } while (0)
  4328. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4329. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4330. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4331. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4332. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4333. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4334. do { \
  4335. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4336. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4337. } while (0)
  4338. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4339. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4340. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4341. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4342. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4343. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4344. do { \
  4345. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4346. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4347. } while (0)
  4348. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4349. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4350. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4351. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4352. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4353. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4354. do { \
  4355. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4356. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4357. } while (0)
  4358. /**
  4359. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4360. *
  4361. * @details
  4362. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4363. * configure RXDMA rings.
  4364. * The configuration is per ring based and includes both packet subtypes
  4365. * and PPDU/MPDU TLVs.
  4366. *
  4367. * The message would appear as follows:
  4368. *
  4369. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4370. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4371. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4372. * |-------------------------------------------------------------------|
  4373. * | rsvd2 | ring_buffer_size |
  4374. * |-------------------------------------------------------------------|
  4375. * | packet_type_enable_flags_0 |
  4376. * |-------------------------------------------------------------------|
  4377. * | packet_type_enable_flags_1 |
  4378. * |-------------------------------------------------------------------|
  4379. * | packet_type_enable_flags_2 |
  4380. * |-------------------------------------------------------------------|
  4381. * | packet_type_enable_flags_3 |
  4382. * |-------------------------------------------------------------------|
  4383. * | tlv_filter_in_flags |
  4384. * |-------------------------------------------------------------------|
  4385. * | rx_header_offset | rx_packet_offset |
  4386. * |-------------------------------------------------------------------|
  4387. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4388. * |-------------------------------------------------------------------|
  4389. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4390. * |-------------------------------------------------------------------|
  4391. * | rsvd3 | rx_attention_offset |
  4392. * |-------------------------------------------------------------------|
  4393. * | rsvd4 | mo| fp| rx_drop_threshold |
  4394. * | |ndp|ndp| |
  4395. * |-------------------------------------------------------------------|
  4396. * Where:
  4397. * PS = pkt_swap
  4398. * SS = status_swap
  4399. * OV = rx_offsets_valid
  4400. * DT = drop_thresh_valid
  4401. * The message is interpreted as follows:
  4402. * dword0 - b'0:7 - msg_type: This will be set to
  4403. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4404. * b'8:15 - pdev_id:
  4405. * 0 (for rings at SOC/UMAC level),
  4406. * 1/2/3 mac id (for rings at LMAC level)
  4407. * b'16:23 - ring_id : Identify the ring to configure.
  4408. * More details can be got from enum htt_srng_ring_id
  4409. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4410. * BUF_RING_CFG_0 defs within HW .h files,
  4411. * e.g. wmac_top_reg_seq_hwioreg.h
  4412. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4413. * BUF_RING_CFG_0 defs within HW .h files,
  4414. * e.g. wmac_top_reg_seq_hwioreg.h
  4415. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4416. * configuration fields are valid
  4417. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4418. * rx_drop_threshold field is valid
  4419. * b'28:31 - rsvd1: reserved for future use
  4420. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4421. * in byte units.
  4422. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4423. * - b'16:31 - rsvd2: Reserved for future use
  4424. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4425. * Enable MGMT packet from 0b0000 to 0b1001
  4426. * bits from low to high: FP, MD, MO - 3 bits
  4427. * FP: Filter_Pass
  4428. * MD: Monitor_Direct
  4429. * MO: Monitor_Other
  4430. * 10 mgmt subtypes * 3 bits -> 30 bits
  4431. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4432. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4433. * Enable MGMT packet from 0b1010 to 0b1111
  4434. * bits from low to high: FP, MD, MO - 3 bits
  4435. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4436. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4437. * Enable CTRL packet from 0b0000 to 0b1001
  4438. * bits from low to high: FP, MD, MO - 3 bits
  4439. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4440. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4441. * Enable CTRL packet from 0b1010 to 0b1111,
  4442. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4443. * bits from low to high: FP, MD, MO - 3 bits
  4444. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4445. * dword6 - b'0:31 - tlv_filter_in_flags:
  4446. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4447. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4448. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4449. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4450. * A value of 0 will be considered as ignore this config.
  4451. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4452. * e.g. wmac_top_reg_seq_hwioreg.h
  4453. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4454. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4455. * A value of 0 will be considered as ignore this config.
  4456. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4457. * e.g. wmac_top_reg_seq_hwioreg.h
  4458. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4459. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4460. * A value of 0 will be considered as ignore this config.
  4461. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4462. * e.g. wmac_top_reg_seq_hwioreg.h
  4463. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4464. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4465. * A value of 0 will be considered as ignore this config.
  4466. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4467. * e.g. wmac_top_reg_seq_hwioreg.h
  4468. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4469. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4470. * A value of 0 will be considered as ignore this config.
  4471. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4472. * e.g. wmac_top_reg_seq_hwioreg.h
  4473. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4474. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4475. * A value of 0 will be considered as ignore this config.
  4476. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4477. * e.g. wmac_top_reg_seq_hwioreg.h
  4478. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4479. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4480. * A value of 0 will be considered as ignore this config.
  4481. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4482. * e.g. wmac_top_reg_seq_hwioreg.h
  4483. * - b'16:31 - rsvd3 for future use
  4484. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4485. * to source rings. Consumer drops packets if the available
  4486. * words in the ring falls below the configured threshold
  4487. * value.
  4488. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4489. * by host. 1 -> subscribed
  4490. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4491. * by host. 1 -> subscribed
  4492. */
  4493. PREPACK struct htt_rx_ring_selection_cfg_t {
  4494. A_UINT32 msg_type: 8,
  4495. pdev_id: 8,
  4496. ring_id: 8,
  4497. status_swap: 1,
  4498. pkt_swap: 1,
  4499. rx_offsets_valid: 1,
  4500. drop_thresh_valid: 1,
  4501. rsvd1: 4;
  4502. A_UINT32 ring_buffer_size: 16,
  4503. rsvd2: 16;
  4504. A_UINT32 packet_type_enable_flags_0;
  4505. A_UINT32 packet_type_enable_flags_1;
  4506. A_UINT32 packet_type_enable_flags_2;
  4507. A_UINT32 packet_type_enable_flags_3;
  4508. A_UINT32 tlv_filter_in_flags;
  4509. A_UINT32 rx_packet_offset: 16,
  4510. rx_header_offset: 16;
  4511. A_UINT32 rx_mpdu_end_offset: 16,
  4512. rx_mpdu_start_offset: 16;
  4513. A_UINT32 rx_msdu_end_offset: 16,
  4514. rx_msdu_start_offset: 16;
  4515. A_UINT32 rx_attn_offset: 16,
  4516. rsvd3: 16;
  4517. A_UINT32 rx_drop_threshold: 10,
  4518. fp_ndp: 1,
  4519. mo_ndp: 1,
  4520. rsvd4: 20;
  4521. } POSTPACK;
  4522. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4523. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4524. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4525. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4526. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4527. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4528. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4529. do { \
  4530. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4531. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4532. } while (0)
  4533. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4534. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4535. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4536. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4537. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4538. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4539. do { \
  4540. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4541. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4542. } while (0)
  4543. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4544. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4545. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4546. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4547. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4548. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4549. do { \
  4550. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4551. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4552. } while (0)
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4554. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4555. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4556. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4557. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4558. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4559. do { \
  4560. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4561. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4562. } while (0)
  4563. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4564. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4565. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4566. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4567. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4568. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4569. do { \
  4570. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4571. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4572. } while (0)
  4573. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4574. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4575. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4576. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4577. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4578. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4579. do { \
  4580. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4581. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4582. } while (0)
  4583. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4584. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4585. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4586. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4587. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4588. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4589. do { \
  4590. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4591. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4592. } while (0)
  4593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4595. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4596. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4597. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4599. do { \
  4600. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4601. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4602. } while (0)
  4603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4606. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4607. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4609. do { \
  4610. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4611. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4612. } while (0)
  4613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4616. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4617. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4619. do { \
  4620. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4621. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4622. } while (0)
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4626. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4627. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4629. do { \
  4630. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4631. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4632. } while (0)
  4633. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4634. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4635. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4636. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4637. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4638. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4639. do { \
  4640. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4641. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4642. } while (0)
  4643. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4644. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4645. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4646. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4647. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4648. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4649. do { \
  4650. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4651. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4652. } while (0)
  4653. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4654. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4655. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4656. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4657. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4658. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4659. do { \
  4660. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4661. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4662. } while (0)
  4663. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4664. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4665. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4666. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4667. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4668. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4669. do { \
  4670. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4671. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4672. } while (0)
  4673. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4674. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4675. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4676. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4677. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4678. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4679. do { \
  4680. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4681. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4682. } while (0)
  4683. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4684. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4685. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4686. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4687. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4688. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4689. do { \
  4690. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4691. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4692. } while (0)
  4693. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4694. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4695. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4696. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4697. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4698. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4699. do { \
  4700. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4701. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4702. } while (0)
  4703. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4704. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4705. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4706. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4707. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4708. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4709. do { \
  4710. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4711. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4712. } while (0)
  4713. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4714. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4715. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4716. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4717. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4718. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4719. do { \
  4720. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4721. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4722. } while (0)
  4723. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4724. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4725. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4726. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4727. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4728. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4729. do { \
  4730. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4731. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4732. } while (0)
  4733. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4734. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4735. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4736. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4737. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4738. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4739. do { \
  4740. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4741. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4742. } while (0)
  4743. /*
  4744. * Subtype based MGMT frames enable bits.
  4745. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4746. */
  4747. /* association request */
  4748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4754. /* association response */
  4755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4761. /* Reassociation request */
  4762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4768. /* Reassociation response */
  4769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4775. /* Probe request */
  4776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4782. /* Probe response */
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4789. /* Timing Advertisement */
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4796. /* Reserved */
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4803. /* Beacon */
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4810. /* ATIM */
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4817. /* Disassociation */
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4824. /* Authentication */
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4831. /* Deauthentication */
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4838. /* Action */
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4845. /* Action No Ack */
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4852. /* Reserved */
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4859. /*
  4860. * Subtype based CTRL frames enable bits.
  4861. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4862. */
  4863. /* Reserved */
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4870. /* Reserved */
  4871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4877. /* Reserved */
  4878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4884. /* Reserved */
  4885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4891. /* Reserved */
  4892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4898. /* Reserved */
  4899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4905. /* Reserved */
  4906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4912. /* Control Wrapper */
  4913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4919. /* Block Ack Request */
  4920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4926. /* Block Ack*/
  4927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4933. /* PS-POLL */
  4934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4940. /* RTS */
  4941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4947. /* CTS */
  4948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4954. /* ACK */
  4955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4961. /* CF-END */
  4962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4968. /* CF-END + CF-ACK */
  4969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4975. /* Multicast data */
  4976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4982. /* Unicast data */
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4989. /* NULL data */
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4997. do { \
  4998. HTT_CHECK_SET_VAL(httsym, value); \
  4999. (word) |= (value) << httsym##_S; \
  5000. } while (0)
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5002. (((word) & httsym##_M) >> httsym##_S)
  5003. #define htt_rx_ring_pkt_enable_subtype_set( \
  5004. word, flag, mode, type, subtype, val) \
  5005. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5006. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5007. #define htt_rx_ring_pkt_enable_subtype_get( \
  5008. word, flag, mode, type, subtype) \
  5009. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5010. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5011. /* Definition to filter in TLVs */
  5012. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5013. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5014. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5015. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5016. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5017. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5018. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5019. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5020. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5021. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5022. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5023. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5024. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5025. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5026. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5027. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5028. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5029. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5030. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5031. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5032. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5033. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5034. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5035. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5036. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5037. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5038. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5039. do { \
  5040. HTT_CHECK_SET_VAL(httsym, enable); \
  5041. (word) |= (enable) << httsym##_S; \
  5042. } while (0)
  5043. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5044. (((word) & httsym##_M) >> httsym##_S)
  5045. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5046. HTT_RX_RING_TLV_ENABLE_SET( \
  5047. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5048. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5049. HTT_RX_RING_TLV_ENABLE_GET( \
  5050. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5051. /**
  5052. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  5053. * host --> target Receive Flow Steering configuration message definition.
  5054. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5055. * The reason for this is we want RFS to be configured and ready before MAC
  5056. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5057. *
  5058. * |31 24|23 16|15 9|8|7 0|
  5059. * |----------------+----------------+----------------+----------------|
  5060. * | reserved |E| msg type |
  5061. * |-------------------------------------------------------------------|
  5062. * Where E = RFS enable flag
  5063. *
  5064. * The RFS_CONFIG message consists of a single 4-byte word.
  5065. *
  5066. * Header fields:
  5067. * - MSG_TYPE
  5068. * Bits 7:0
  5069. * Purpose: identifies this as a RFS config msg
  5070. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5071. * - RFS_CONFIG
  5072. * Bit 8
  5073. * Purpose: Tells target whether to enable (1) or disable (0)
  5074. * flow steering feature when sending rx indication messages to host
  5075. */
  5076. #define HTT_H2T_RFS_CONFIG_M 0x100
  5077. #define HTT_H2T_RFS_CONFIG_S 8
  5078. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5079. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5080. HTT_H2T_RFS_CONFIG_S)
  5081. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5082. do { \
  5083. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5084. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5085. } while (0)
  5086. #define HTT_RFS_CFG_REQ_BYTES 4
  5087. /**
  5088. * @brief host -> target FW extended statistics retrieve
  5089. *
  5090. * @details
  5091. * The following field definitions describe the format of the HTT host
  5092. * to target FW extended stats retrieve message.
  5093. * The message specifies the type of stats the host wants to retrieve.
  5094. *
  5095. * |31 24|23 16|15 8|7 0|
  5096. * |-----------------------------------------------------------|
  5097. * | reserved | stats type | pdev_mask | msg type |
  5098. * |-----------------------------------------------------------|
  5099. * | config param [0] |
  5100. * |-----------------------------------------------------------|
  5101. * | config param [1] |
  5102. * |-----------------------------------------------------------|
  5103. * | config param [2] |
  5104. * |-----------------------------------------------------------|
  5105. * | config param [3] |
  5106. * |-----------------------------------------------------------|
  5107. * | reserved |
  5108. * |-----------------------------------------------------------|
  5109. * | cookie LSBs |
  5110. * |-----------------------------------------------------------|
  5111. * | cookie MSBs |
  5112. * |-----------------------------------------------------------|
  5113. * Header fields:
  5114. * - MSG_TYPE
  5115. * Bits 7:0
  5116. * Purpose: identifies this is a extended stats upload request message
  5117. * Value: 0x10
  5118. * - PDEV_MASK
  5119. * Bits 8:15
  5120. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5121. * Value: This is a overloaded field, refer to usage and interpretation of
  5122. * PDEV in interface document.
  5123. * Bit 8 : Reserved for SOC stats
  5124. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5125. * Indicates MACID_MASK in DBS
  5126. * - STATS_TYPE
  5127. * Bits 23:16
  5128. * Purpose: identifies which FW statistics to upload
  5129. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5130. * - Reserved
  5131. * Bits 31:24
  5132. * - CONFIG_PARAM [0]
  5133. * Bits 31:0
  5134. * Purpose: give an opaque configuration value to the specified stats type
  5135. * Value: stats-type specific configuration value
  5136. * Refer to htt_stats.h for interpretation for each stats sub_type
  5137. * - CONFIG_PARAM [1]
  5138. * Bits 31:0
  5139. * Purpose: give an opaque configuration value to the specified stats type
  5140. * Value: stats-type specific configuration value
  5141. * Refer to htt_stats.h for interpretation for each stats sub_type
  5142. * - CONFIG_PARAM [2]
  5143. * Bits 31:0
  5144. * Purpose: give an opaque configuration value to the specified stats type
  5145. * Value: stats-type specific configuration value
  5146. * Refer to htt_stats.h for interpretation for each stats sub_type
  5147. * - CONFIG_PARAM [3]
  5148. * Bits 31:0
  5149. * Purpose: give an opaque configuration value to the specified stats type
  5150. * Value: stats-type specific configuration value
  5151. * Refer to htt_stats.h for interpretation for each stats sub_type
  5152. * - Reserved [31:0] for future use.
  5153. * - COOKIE_LSBS
  5154. * Bits 31:0
  5155. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5156. * message with its preceding host->target stats request message.
  5157. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5158. * - COOKIE_MSBS
  5159. * Bits 31:0
  5160. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5161. * message with its preceding host->target stats request message.
  5162. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5163. */
  5164. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5165. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5166. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5167. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5168. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5169. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5170. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5171. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5172. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5173. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5174. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5175. do { \
  5176. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5177. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5178. } while (0)
  5179. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5180. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5181. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5182. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5183. do { \
  5184. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5185. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5186. } while (0)
  5187. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5188. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5189. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5190. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5191. do { \
  5192. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5193. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5194. } while (0)
  5195. /**
  5196. * @brief host -> target FW PPDU_STATS request message
  5197. *
  5198. * @details
  5199. * The following field definitions describe the format of the HTT host
  5200. * to target FW for PPDU_STATS_CFG msg.
  5201. * The message allows the host to configure the PPDU_STATS_IND messages
  5202. * produced by the target.
  5203. *
  5204. * |31 24|23 16|15 8|7 0|
  5205. * |-----------------------------------------------------------|
  5206. * | REQ bit mask | pdev_mask | msg type |
  5207. * |-----------------------------------------------------------|
  5208. * Header fields:
  5209. * - MSG_TYPE
  5210. * Bits 7:0
  5211. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5212. * Value: 0x11
  5213. * - PDEV_MASK
  5214. * Bits 8:15
  5215. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5216. * Value: This is a overloaded field, refer to usage and interpretation of
  5217. * PDEV in interface document.
  5218. * Bit 8 : Reserved for SOC stats
  5219. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5220. * Indicates MACID_MASK in DBS
  5221. * - REQ_TLV_BIT_MASK
  5222. * Bits 16:31
  5223. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5224. * needs to be included in the target's PPDU_STATS_IND messages.
  5225. * Value: refer htt_ppdu_stats_tlv_tag_t
  5226. *
  5227. */
  5228. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5229. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5230. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5231. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5232. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5233. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5234. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5235. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5236. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5237. do { \
  5238. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5239. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5240. } while (0)
  5241. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5242. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5243. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5244. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5245. do { \
  5246. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5247. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5248. } while (0)
  5249. /**
  5250. * @brief Host-->target HTT RX FSE setup message
  5251. * @details
  5252. * Through this message, the host will provide details of the flow tables
  5253. * in host DDR along with hash keys.
  5254. * This message can be sent per SOC or per PDEV, which is differentiated
  5255. * by pdev id values.
  5256. * The host will allocate flow search table and sends table size,
  5257. * physical DMA address of flow table, and hash keys to firmware to
  5258. * program into the RXOLE FSE HW block.
  5259. *
  5260. * The following field definitions describe the format of the RX FSE setup
  5261. * message sent from the host to target
  5262. *
  5263. * Header fields:
  5264. * dword0 - b'7:0 - msg_type: This will be set to
  5265. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  5266. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5267. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5268. * pdev's LMAC ring.
  5269. * b'31:16 - reserved : Reserved for future use
  5270. * dword1 - b'19:0 - number of records: This field indicates the number of
  5271. * entries in the flow table. For example: 8k number of
  5272. * records is equivalent to
  5273. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  5274. * b'27:20 - max search: This field specifies the skid length to FSE
  5275. * parser HW module whenever match is not found at the
  5276. * exact index pointed by hash.
  5277. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  5278. * Refer htt_ip_da_sa_prefix below for more details.
  5279. * b'31:30 - reserved: Reserved for future use
  5280. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  5281. * table allocated by host in DDR
  5282. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  5283. * table allocated by host in DDR
  5284. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  5285. * entry hashing
  5286. *
  5287. *
  5288. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  5289. * |---------------------------------------------------------------|
  5290. * | reserved | pdev_id | MSG_TYPE |
  5291. * |---------------------------------------------------------------|
  5292. * |resvd|IPDSA| max_search | Number of records |
  5293. * |---------------------------------------------------------------|
  5294. * | base address lo |
  5295. * |---------------------------------------------------------------|
  5296. * | base address high |
  5297. * |---------------------------------------------------------------|
  5298. * | toeplitz key 31_0 |
  5299. * |---------------------------------------------------------------|
  5300. * | toeplitz key 63_32 |
  5301. * |---------------------------------------------------------------|
  5302. * | toeplitz key 95_64 |
  5303. * |---------------------------------------------------------------|
  5304. * | toeplitz key 127_96 |
  5305. * |---------------------------------------------------------------|
  5306. * | toeplitz key 159_128 |
  5307. * |---------------------------------------------------------------|
  5308. * | toeplitz key 191_160 |
  5309. * |---------------------------------------------------------------|
  5310. * | toeplitz key 223_192 |
  5311. * |---------------------------------------------------------------|
  5312. * | toeplitz key 255_224 |
  5313. * |---------------------------------------------------------------|
  5314. * | toeplitz key 287_256 |
  5315. * |---------------------------------------------------------------|
  5316. * | reserved | toeplitz key 314_288(26:0 bits) |
  5317. * |---------------------------------------------------------------|
  5318. * where:
  5319. * IPDSA = ip_da_sa
  5320. */
  5321. /**
  5322. * @brief: htt_ip_da_sa_prefix
  5323. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  5324. * IPv6 addresses beginning with 0x20010db8 are reserved for
  5325. * documentation per RFC3849
  5326. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  5327. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  5328. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  5329. */
  5330. enum htt_ip_da_sa_prefix {
  5331. HTT_RX_IPV6_20010db8,
  5332. HTT_RX_IPV4_MAPPED_IPV6,
  5333. HTT_RX_IPV4_COMPATIBLE_IPV6,
  5334. HTT_RX_IPV6_64FF9B,
  5335. };
  5336. /**
  5337. * @brief Host-->target HTT RX FISA configure and enable
  5338. * @details
  5339. * The host will send this command down to configure and enable the FISA
  5340. * operational params.
  5341. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  5342. * register.
  5343. * Should configure both the MACs.
  5344. *
  5345. * dword0 - b'7:0 - msg_type: This will be set to HTT_H2T_MSG_TYPE_RX_FISA_CFG
  5346. *
  5347. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5348. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5349. * pdev's LMAC ring.
  5350. * b'31:16 - reserved : Reserved for future use
  5351. *
  5352. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  5353. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  5354. * packets. 1 flow search will be skipped
  5355. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  5356. * tcp,udp packets
  5357. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  5358. * calculation
  5359. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  5360. * calculation
  5361. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  5362. * calculation
  5363. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  5364. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  5365. * length
  5366. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  5367. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  5368. * length
  5369. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  5370. * num jump
  5371. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  5372. * num jump
  5373. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  5374. * data type switch has happend for MPDU Sequence num jump
  5375. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  5376. * for MPDU Sequence num jump
  5377. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  5378. * for decrypt errors
  5379. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  5380. * while aggregating a msdu
  5381. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  5382. * The aggregation is done until (number of MSDUs aggregated
  5383. * < LIMIT + 1)
  5384. * b'31:18 - Reserved
  5385. *
  5386. * fisa_control_value - 32bit value FW can write to register
  5387. *
  5388. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  5389. * Threshold value for FISA timeout (units are microseconds).
  5390. * When the global timestamp exceeds this threshold, FISA
  5391. * aggregation will be restarted.
  5392. * A value of 0 means timeout is disabled.
  5393. * Compare the threshold register with timestamp field in
  5394. * flow entry to generate timeout for the flow.
  5395. *
  5396. * |31 18 |17 16|15 8|7 0|
  5397. * |-------------------------------------------------------------|
  5398. * | reserved | pdev_mask | msg type |
  5399. * |-------------------------------------------------------------|
  5400. * | reserved | FISA_CTRL |
  5401. * |-------------------------------------------------------------|
  5402. * | FISA_TIMEOUT_THRESH |
  5403. * |-------------------------------------------------------------|
  5404. */
  5405. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  5406. A_UINT32 msg_type:8,
  5407. pdev_id:8,
  5408. reserved0:16;
  5409. /**
  5410. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  5411. * [17:0]
  5412. */
  5413. union {
  5414. /*
  5415. * fisa_control_bits structure is deprecated.
  5416. * Please use fisa_control_bits_v2 going forward.
  5417. */
  5418. struct {
  5419. A_UINT32 fisa_enable: 1,
  5420. ipsec_skip_search: 1,
  5421. nontcp_skip_search: 1,
  5422. add_ipv4_fixed_hdr_len: 1,
  5423. add_ipv6_fixed_hdr_len: 1,
  5424. add_tcp_fixed_hdr_len: 1,
  5425. add_udp_hdr_len: 1,
  5426. chksum_cum_ip_len_en: 1,
  5427. disable_tid_check: 1,
  5428. disable_ta_check: 1,
  5429. disable_qos_check: 1,
  5430. disable_raw_check: 1,
  5431. disable_decrypt_err_check: 1,
  5432. disable_msdu_drop_check: 1,
  5433. fisa_aggr_limit: 4,
  5434. reserved: 14;
  5435. } fisa_control_bits;
  5436. struct {
  5437. A_UINT32 fisa_enable: 1,
  5438. fisa_aggr_limit: 4,
  5439. reserved: 27;
  5440. } fisa_control_bits_v2;
  5441. A_UINT32 fisa_control_value;
  5442. } u_fisa_control;
  5443. /**
  5444. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  5445. * timeout threshold for aggregation. Unit in usec.
  5446. * [31:0]
  5447. */
  5448. A_UINT32 fisa_timeout_threshold;
  5449. } POSTPACK;
  5450. /* DWord 0: pdev-ID */
  5451. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  5452. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  5453. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  5454. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  5455. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  5456. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  5457. do { \
  5458. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  5459. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  5460. } while (0)
  5461. /* Dword 1: fisa_control_value fisa config */
  5462. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  5463. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  5464. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  5465. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  5466. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  5467. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  5468. do { \
  5469. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  5470. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  5471. } while (0)
  5472. /* Dword 1: fisa_control_value ipsec_skip_search */
  5473. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  5474. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  5475. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  5476. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  5477. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  5478. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  5479. do { \
  5480. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  5481. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  5482. } while (0)
  5483. /* Dword 1: fisa_control_value non_tcp_skip_search */
  5484. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  5485. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  5486. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  5487. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  5488. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  5489. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  5490. do { \
  5491. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  5492. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  5493. } while (0)
  5494. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  5495. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  5496. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  5497. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  5498. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  5499. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  5500. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  5501. do { \
  5502. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  5503. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  5504. } while (0)
  5505. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  5506. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  5507. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  5508. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  5509. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  5510. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  5511. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  5512. do { \
  5513. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  5514. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  5515. } while (0)
  5516. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  5517. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  5518. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  5519. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  5520. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  5521. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  5522. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  5523. do { \
  5524. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  5525. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  5526. } while (0)
  5527. /* Dword 1: fisa_control_value add_udp_hdr_len */
  5528. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  5529. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  5530. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  5531. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  5532. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  5533. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  5534. do { \
  5535. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  5536. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  5537. } while (0)
  5538. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  5539. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  5540. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  5541. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  5542. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  5543. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  5544. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  5545. do { \
  5546. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  5547. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  5548. } while (0)
  5549. /* Dword 1: fisa_control_value disable_tid_check */
  5550. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  5551. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  5552. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  5553. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  5554. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  5555. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  5556. do { \
  5557. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  5558. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  5559. } while (0)
  5560. /* Dword 1: fisa_control_value disable_ta_check */
  5561. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  5562. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  5563. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  5564. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  5565. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  5566. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  5567. do { \
  5568. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  5569. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  5570. } while (0)
  5571. /* Dword 1: fisa_control_value disable_qos_check */
  5572. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  5573. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  5574. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  5575. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  5576. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  5577. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  5578. do { \
  5579. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  5580. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  5581. } while (0)
  5582. /* Dword 1: fisa_control_value disable_raw_check */
  5583. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  5584. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  5585. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  5586. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  5587. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  5588. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  5589. do { \
  5590. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  5591. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  5592. } while (0)
  5593. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  5594. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  5595. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  5596. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  5597. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  5598. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  5599. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  5600. do { \
  5601. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  5602. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  5603. } while (0)
  5604. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  5605. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  5606. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  5607. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  5608. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  5609. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  5610. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  5611. do { \
  5612. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  5613. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  5614. } while (0)
  5615. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5616. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  5617. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  5618. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  5619. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  5620. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  5621. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  5622. do { \
  5623. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  5624. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  5625. } while (0)
  5626. /* Dword 1: fisa_control_value fisa config */
  5627. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  5628. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  5629. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  5630. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  5631. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  5632. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  5633. do { \
  5634. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  5635. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  5636. } while (0)
  5637. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5638. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  5639. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  5640. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  5641. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  5642. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  5643. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  5644. do { \
  5645. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  5646. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  5647. } while (0)
  5648. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  5649. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  5650. pdev_id:8,
  5651. reserved0:16;
  5652. A_UINT32 num_records:20,
  5653. max_search:8,
  5654. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  5655. reserved1:2;
  5656. A_UINT32 base_addr_lo;
  5657. A_UINT32 base_addr_hi;
  5658. A_UINT32 toeplitz31_0;
  5659. A_UINT32 toeplitz63_32;
  5660. A_UINT32 toeplitz95_64;
  5661. A_UINT32 toeplitz127_96;
  5662. A_UINT32 toeplitz159_128;
  5663. A_UINT32 toeplitz191_160;
  5664. A_UINT32 toeplitz223_192;
  5665. A_UINT32 toeplitz255_224;
  5666. A_UINT32 toeplitz287_256;
  5667. A_UINT32 toeplitz314_288:27,
  5668. reserved2:5;
  5669. } POSTPACK;
  5670. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  5671. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  5672. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  5673. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  5674. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  5675. /* DWORD 0: Pdev ID */
  5676. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  5677. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  5678. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  5679. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  5680. HTT_RX_FSE_SETUP_PDEV_ID_S)
  5681. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  5682. do { \
  5683. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  5684. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  5685. } while (0)
  5686. /* DWORD 1:num of records */
  5687. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  5688. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  5689. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  5690. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  5691. HTT_RX_FSE_SETUP_NUM_REC_S)
  5692. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  5693. do { \
  5694. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  5695. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  5696. } while (0)
  5697. /* DWORD 1:max_search */
  5698. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  5699. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  5700. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  5701. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  5702. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  5703. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  5704. do { \
  5705. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  5706. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  5707. } while (0)
  5708. /* DWORD 1:ip_da_sa prefix */
  5709. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  5710. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  5711. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  5712. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  5713. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  5714. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  5715. do { \
  5716. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  5717. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  5718. } while (0)
  5719. /* DWORD 2: Base Address LO */
  5720. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  5721. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  5722. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  5723. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  5724. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  5725. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  5726. do { \
  5727. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  5728. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  5729. } while (0)
  5730. /* DWORD 3: Base Address High */
  5731. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  5732. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  5733. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  5734. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  5735. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  5736. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  5737. do { \
  5738. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  5739. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  5740. } while (0)
  5741. /* DWORD 4-12: Hash Value */
  5742. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  5743. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  5744. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  5745. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  5746. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  5747. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  5748. do { \
  5749. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  5750. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  5751. } while (0)
  5752. /* DWORD 13: Hash Value 314:288 bits */
  5753. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  5754. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  5755. HTT_RX_FSE_SETUP_HASH_314_288_S)
  5756. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  5757. do { \
  5758. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  5759. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  5760. } while (0)
  5761. /**
  5762. * @brief Host-->target HTT RX FSE operation message
  5763. * @details
  5764. * The host will send this Flow Search Engine (FSE) operation message for
  5765. * every flow add/delete operation.
  5766. * The FSE operation includes FSE full cache invalidation or individual entry
  5767. * invalidation.
  5768. * This message can be sent per SOC or per PDEV which is differentiated
  5769. * by pdev id values.
  5770. *
  5771. * |31 16|15 8|7 1|0|
  5772. * |-------------------------------------------------------------|
  5773. * | reserved | pdev_id | MSG_TYPE |
  5774. * |-------------------------------------------------------------|
  5775. * | reserved | operation |I|
  5776. * |-------------------------------------------------------------|
  5777. * | ip_src_addr_31_0 |
  5778. * |-------------------------------------------------------------|
  5779. * | ip_src_addr_63_32 |
  5780. * |-------------------------------------------------------------|
  5781. * | ip_src_addr_95_64 |
  5782. * |-------------------------------------------------------------|
  5783. * | ip_src_addr_127_96 |
  5784. * |-------------------------------------------------------------|
  5785. * | ip_dst_addr_31_0 |
  5786. * |-------------------------------------------------------------|
  5787. * | ip_dst_addr_63_32 |
  5788. * |-------------------------------------------------------------|
  5789. * | ip_dst_addr_95_64 |
  5790. * |-------------------------------------------------------------|
  5791. * | ip_dst_addr_127_96 |
  5792. * |-------------------------------------------------------------|
  5793. * | l4_dst_port | l4_src_port |
  5794. * | (32-bit SPI incase of IPsec) |
  5795. * |-------------------------------------------------------------|
  5796. * | reserved | l4_proto |
  5797. * |-------------------------------------------------------------|
  5798. *
  5799. * where I is 1-bit ipsec_valid.
  5800. *
  5801. * The following field definitions describe the format of the RX FSE operation
  5802. * message sent from the host to target for every add/delete flow entry to flow
  5803. * table.
  5804. *
  5805. * Header fields:
  5806. * dword0 - b'7:0 - msg_type: This will be set to
  5807. * HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  5808. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5809. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5810. * specified pdev's LMAC ring.
  5811. * b'31:16 - reserved : Reserved for future use
  5812. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  5813. * (Internet Protocol Security).
  5814. * IPsec describes the framework for providing security at
  5815. * IP layer. IPsec is defined for both versions of IP:
  5816. * IPV4 and IPV6.
  5817. * Please refer to htt_rx_flow_proto enumeration below for
  5818. * more info.
  5819. * ipsec_valid = 1 for IPSEC packets
  5820. * ipsec_valid = 0 for IP Packets
  5821. * b'7:1 - operation: This indicates types of FSE operation.
  5822. * Refer to htt_rx_fse_operation enumeration:
  5823. * 0 - No Cache Invalidation required
  5824. * 1 - Cache invalidate only one entry given by IP
  5825. * src/dest address at DWORD[2:9]
  5826. * 2 - Complete FSE Cache Invalidation
  5827. * 3 - FSE Disable
  5828. * 4 - FSE Enable
  5829. * b'31:8 - reserved: Reserved for future use
  5830. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  5831. * for per flow addition/deletion
  5832. * For IPV4 src/dest addresses, the first A_UINT32 is used
  5833. * and the subsequent 3 A_UINT32 will be padding bytes.
  5834. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  5835. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  5836. * from 0 to 65535 but only 0 to 1023 are designated as
  5837. * well-known ports. Refer to [RFC1700] for more details.
  5838. * This field is valid only if
  5839. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5840. * - L4 dest port (31:16): 16-bit Destination Port numbers
  5841. * range from 0 to 65535 but only 0 to 1023 are designated
  5842. * as well-known ports. Refer to [RFC1700] for more details.
  5843. * This field is valid only if
  5844. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5845. * - SPI (31:0): Security Parameters Index is an
  5846. * identification tag added to the header while using IPsec
  5847. * for tunneling the IP traffici.
  5848. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  5849. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  5850. * Assigned Internet Protocol Numbers.
  5851. * l4_proto numbers for standard protocol like UDP/TCP
  5852. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  5853. * l4_proto = 17 for UDP etc.
  5854. * b'31:8 - reserved: Reserved for future use.
  5855. *
  5856. */
  5857. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  5858. A_UINT32 msg_type:8,
  5859. pdev_id:8,
  5860. reserved0:16;
  5861. A_UINT32 ipsec_valid:1,
  5862. operation:7,
  5863. reserved1:24;
  5864. A_UINT32 ip_src_addr_31_0;
  5865. A_UINT32 ip_src_addr_63_32;
  5866. A_UINT32 ip_src_addr_95_64;
  5867. A_UINT32 ip_src_addr_127_96;
  5868. A_UINT32 ip_dest_addr_31_0;
  5869. A_UINT32 ip_dest_addr_63_32;
  5870. A_UINT32 ip_dest_addr_95_64;
  5871. A_UINT32 ip_dest_addr_127_96;
  5872. union {
  5873. A_UINT32 spi;
  5874. struct {
  5875. A_UINT32 l4_src_port:16,
  5876. l4_dest_port:16;
  5877. } ip;
  5878. } u;
  5879. A_UINT32 l4_proto:8,
  5880. reserved:24;
  5881. } POSTPACK;
  5882. /**
  5883. * @brief Host-->target HTT RX Full monitor mode register configuration message
  5884. * @details
  5885. * The host will send this Full monitor mode register configuration message.
  5886. * This message can be sent per SOC or per PDEV which is differentiated
  5887. * by pdev id values.
  5888. *
  5889. * |31 16|15 11|10 8|7 3|2|1|0|
  5890. * |-------------------------------------------------------------|
  5891. * | reserved | pdev_id | MSG_TYPE |
  5892. * |-------------------------------------------------------------|
  5893. * | reserved |Release Ring |N|Z|E|
  5894. * |-------------------------------------------------------------|
  5895. *
  5896. * where E is 1-bit full monitor mode enable/disable.
  5897. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  5898. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  5899. *
  5900. * The following field definitions describe the format of the full monitor
  5901. * mode configuration message sent from the host to target for each pdev.
  5902. *
  5903. * Header fields:
  5904. * dword0 - b'7:0 - msg_type: This will be set to
  5905. * HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE.
  5906. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5907. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5908. * specified pdev's LMAC ring.
  5909. * b'31:16 - reserved : Reserved for future use.
  5910. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  5911. * monitor mode rxdma register is to be enabled or disabled.
  5912. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  5913. * additional descriptors at ppdu end for zero mpdus
  5914. * enabled or disabled.
  5915. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  5916. * additional descriptors at ppdu end for non zero mpdus
  5917. * enabled or disabled.
  5918. * b'10:3 - release_ring: This indicates the destination ring
  5919. * selection for the descriptor at the end of PPDU
  5920. * 0 - REO ring select
  5921. * 1 - FW ring select
  5922. * 2 - SW ring select
  5923. * 3 - Release ring select
  5924. * Refer to htt_rx_full_mon_release_ring.
  5925. * b'31:11 - reserved for future use
  5926. */
  5927. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  5928. A_UINT32 msg_type:8,
  5929. pdev_id:8,
  5930. reserved0:16;
  5931. A_UINT32 full_monitor_mode_enable:1,
  5932. addnl_descs_zero_mpdus_end:1,
  5933. addnl_descs_non_zero_mpdus_end:1,
  5934. release_ring:8,
  5935. reserved1:21;
  5936. } POSTPACK;
  5937. /**
  5938. * Enumeration for full monitor mode destination ring select
  5939. * 0 - REO destination ring select
  5940. * 1 - FW destination ring select
  5941. * 2 - SW destination ring select
  5942. * 3 - Release destination ring select
  5943. */
  5944. enum htt_rx_full_mon_release_ring {
  5945. HTT_RX_MON_RING_REO,
  5946. HTT_RX_MON_RING_FW,
  5947. HTT_RX_MON_RING_SW,
  5948. HTT_RX_MON_RING_RELEASE,
  5949. };
  5950. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  5951. /* DWORD 0: Pdev ID */
  5952. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  5953. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  5954. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  5955. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  5956. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  5957. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  5958. do { \
  5959. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  5960. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  5961. } while (0)
  5962. /* DWORD 1:ENABLE */
  5963. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  5964. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  5965. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  5966. do { \
  5967. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  5968. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  5969. } while (0)
  5970. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  5971. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  5972. /* DWORD 1:ZERO_MPDU */
  5973. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  5974. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  5975. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  5976. do { \
  5977. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  5978. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  5979. } while (0)
  5980. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  5981. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  5982. /* DWORD 1:NON_ZERO_MPDU */
  5983. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  5984. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  5985. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  5986. do { \
  5987. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  5988. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  5989. } while (0)
  5990. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  5991. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  5992. /* DWORD 1:RELEASE_RINGS */
  5993. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  5994. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  5995. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  5996. do { \
  5997. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  5998. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  5999. } while (0)
  6000. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  6001. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  6002. /**
  6003. * Enumeration for IP Protocol or IPSEC Protocol
  6004. * IPsec describes the framework for providing security at IP layer.
  6005. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  6006. */
  6007. enum htt_rx_flow_proto {
  6008. HTT_RX_FLOW_IP_PROTO,
  6009. HTT_RX_FLOW_IPSEC_PROTO,
  6010. };
  6011. /**
  6012. * Enumeration for FSE Cache Invalidation
  6013. * 0 - No Cache Invalidation required
  6014. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6015. * 2 - Complete FSE Cache Invalidation
  6016. * 3 - FSE Disable
  6017. * 4 - FSE Enable
  6018. */
  6019. enum htt_rx_fse_operation {
  6020. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6021. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6022. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6023. HTT_RX_FSE_DISABLE,
  6024. HTT_RX_FSE_ENABLE,
  6025. };
  6026. /* DWORD 0: Pdev ID */
  6027. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6028. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6029. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6030. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6031. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6032. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6033. do { \
  6034. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6035. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6036. } while (0)
  6037. /* DWORD 1:IP PROTO or IPSEC */
  6038. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6039. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6040. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6041. do { \
  6042. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6043. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6044. } while (0)
  6045. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6046. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6047. /* DWORD 1:FSE Operation */
  6048. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6049. #define HTT_RX_FSE_OPERATION_S 1
  6050. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6051. do { \
  6052. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6053. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6054. } while (0)
  6055. #define HTT_RX_FSE_OPERATION_GET(word) \
  6056. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6057. /* DWORD 2-9:IP Address */
  6058. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6059. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6060. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6061. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6062. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6063. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6064. do { \
  6065. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6066. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6067. } while (0)
  6068. /* DWORD 10:Source Port Number */
  6069. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6070. #define HTT_RX_FSE_SOURCEPORT_S 0
  6071. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6072. do { \
  6073. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6074. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6075. } while (0)
  6076. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6077. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6078. /* DWORD 11:Destination Port Number */
  6079. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6080. #define HTT_RX_FSE_DESTPORT_S 16
  6081. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  6082. do { \
  6083. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  6084. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  6085. } while (0)
  6086. #define HTT_RX_FSE_DESTPORT_GET(word) \
  6087. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  6088. /* DWORD 10-11:SPI (In case of IPSEC) */
  6089. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  6090. #define HTT_RX_FSE_OPERATION_SPI_S 0
  6091. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  6092. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  6093. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  6094. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  6095. do { \
  6096. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  6097. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  6098. } while (0)
  6099. /* DWORD 12:L4 PROTO */
  6100. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  6101. #define HTT_RX_FSE_L4_PROTO_S 0
  6102. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  6103. do { \
  6104. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  6105. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  6106. } while (0)
  6107. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  6108. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  6109. /**
  6110. * @brief HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6111. * host --> target Receive to configure the RxOLE 3-tuple Hash
  6112. *
  6113. * |31 24|23 |15 8|7 2|1|0|
  6114. * |----------------+----------------+----------------+----------------|
  6115. * | reserved | pdev_id | msg_type |
  6116. * |---------------------------------+----------------+----------------|
  6117. * | reserved |E|F|
  6118. * |---------------------------------+----------------+----------------|
  6119. * Where E = Configure the target to provide the 3-tuple hash value in
  6120. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  6121. * F = Configure the target to provide the 3-tuple hash value in
  6122. * flow_id_toeplitz field of rx_msdu_start tlv
  6123. *
  6124. * The following field definitions describe the format of the 3 tuple hash value
  6125. * message sent from the host to target as part of initialization sequence.
  6126. *
  6127. * Header fields:
  6128. * dword0 - b'7:0 - msg_type: This will be set to
  6129. * HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6130. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6131. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6132. * specified pdev's LMAC ring.
  6133. * b'31:16 - reserved : Reserved for future use
  6134. * dword1 - b'0 - flow_id_toeplitz_field_enable
  6135. * b'1 - toeplitz_hash_2_or_4_field_enable
  6136. * b'31:2 - reserved : Reserved for future use
  6137. * ---------+------+----------------------------------------------------------
  6138. * bit1 | bit0 | Functionality
  6139. * ---------+------+----------------------------------------------------------
  6140. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  6141. * | | in flow_id_toeplitz field
  6142. * ---------+------+----------------------------------------------------------
  6143. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  6144. * | | in toeplitz_hash_2_or_4 field
  6145. * ---------+------+----------------------------------------------------------
  6146. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  6147. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  6148. * ---------+------+----------------------------------------------------------
  6149. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  6150. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  6151. * | | toeplitz_hash_2_or_4 field
  6152. *----------------------------------------------------------------------------
  6153. */
  6154. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  6155. A_UINT32 msg_type :8,
  6156. pdev_id :8,
  6157. reserved0 :16;
  6158. A_UINT32 flow_id_toeplitz_field_enable :1,
  6159. toeplitz_hash_2_or_4_field_enable :1,
  6160. reserved1 :30;
  6161. } POSTPACK;
  6162. /* DWORD0 : pdev_id configuration Macros */
  6163. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  6164. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  6165. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  6166. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  6167. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  6168. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  6169. do { \
  6170. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  6171. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  6172. } while (0)
  6173. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  6174. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  6175. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  6176. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  6177. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  6178. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  6179. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  6180. do { \
  6181. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  6182. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  6183. } while (0)
  6184. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  6185. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  6186. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  6187. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  6188. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  6189. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  6190. do { \
  6191. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  6192. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  6193. } while (0)
  6194. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  6195. /*=== target -> host messages ===============================================*/
  6196. enum htt_t2h_msg_type {
  6197. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  6198. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  6199. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  6200. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  6201. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  6202. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  6203. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  6204. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  6205. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  6206. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  6207. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  6208. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  6209. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  6210. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  6211. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  6212. /* only used for HL, add HTT MSG for HTT CREDIT update */
  6213. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  6214. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  6215. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  6216. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  6217. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  6218. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  6219. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  6220. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  6221. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  6222. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  6223. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  6224. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  6225. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  6226. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  6227. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  6228. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  6229. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  6230. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  6231. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  6232. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  6233. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  6234. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  6235. /* TX_OFFLOAD_DELIVER_IND:
  6236. * Forward the target's locally-generated packets to the host,
  6237. * to provide to the monitor mode interface.
  6238. */
  6239. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  6240. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  6241. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  6242. HTT_T2H_MSG_TYPE_TEST,
  6243. /* keep this last */
  6244. HTT_T2H_NUM_MSGS
  6245. };
  6246. /*
  6247. * HTT target to host message type -
  6248. * stored in bits 7:0 of the first word of the message
  6249. */
  6250. #define HTT_T2H_MSG_TYPE_M 0xff
  6251. #define HTT_T2H_MSG_TYPE_S 0
  6252. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  6253. do { \
  6254. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  6255. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  6256. } while (0)
  6257. #define HTT_T2H_MSG_TYPE_GET(word) \
  6258. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  6259. /**
  6260. * @brief target -> host version number confirmation message definition
  6261. *
  6262. * |31 24|23 16|15 8|7 0|
  6263. * |----------------+----------------+----------------+----------------|
  6264. * | reserved | major number | minor number | msg type |
  6265. * |-------------------------------------------------------------------|
  6266. * : option request TLV (optional) |
  6267. * :...................................................................:
  6268. *
  6269. * The VER_CONF message may consist of a single 4-byte word, or may be
  6270. * extended with TLVs that specify HTT options selected by the target.
  6271. * The following option TLVs may be appended to the VER_CONF message:
  6272. * - LL_BUS_ADDR_SIZE
  6273. * - HL_SUPPRESS_TX_COMPL_IND
  6274. * - MAX_TX_QUEUE_GROUPS
  6275. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  6276. * may be appended to the VER_CONF message (but only one TLV of each type).
  6277. *
  6278. * Header fields:
  6279. * - MSG_TYPE
  6280. * Bits 7:0
  6281. * Purpose: identifies this as a version number confirmation message
  6282. * Value: 0x0
  6283. * - VER_MINOR
  6284. * Bits 15:8
  6285. * Purpose: Specify the minor number of the HTT message library version
  6286. * in use by the target firmware.
  6287. * The minor number specifies the specific revision within a range
  6288. * of fundamentally compatible HTT message definition revisions.
  6289. * Compatible revisions involve adding new messages or perhaps
  6290. * adding new fields to existing messages, in a backwards-compatible
  6291. * manner.
  6292. * Incompatible revisions involve changing the message type values,
  6293. * or redefining existing messages.
  6294. * Value: minor number
  6295. * - VER_MAJOR
  6296. * Bits 15:8
  6297. * Purpose: Specify the major number of the HTT message library version
  6298. * in use by the target firmware.
  6299. * The major number specifies the family of minor revisions that are
  6300. * fundamentally compatible with each other, but not with prior or
  6301. * later families.
  6302. * Value: major number
  6303. */
  6304. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  6305. #define HTT_VER_CONF_MINOR_S 8
  6306. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  6307. #define HTT_VER_CONF_MAJOR_S 16
  6308. #define HTT_VER_CONF_MINOR_SET(word, value) \
  6309. do { \
  6310. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  6311. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  6312. } while (0)
  6313. #define HTT_VER_CONF_MINOR_GET(word) \
  6314. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  6315. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  6316. do { \
  6317. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  6318. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  6319. } while (0)
  6320. #define HTT_VER_CONF_MAJOR_GET(word) \
  6321. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  6322. #define HTT_VER_CONF_BYTES 4
  6323. /**
  6324. * @brief - target -> host HTT Rx In order indication message
  6325. *
  6326. * @details
  6327. *
  6328. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  6329. * |----------------+-------------------+---------------------+---------------|
  6330. * | peer ID | P| F| O| ext TID | msg type |
  6331. * |--------------------------------------------------------------------------|
  6332. * | MSDU count | Reserved | vdev id |
  6333. * |--------------------------------------------------------------------------|
  6334. * | MSDU 0 bus address (bits 31:0) |
  6335. #if HTT_PADDR64
  6336. * | MSDU 0 bus address (bits 63:32) |
  6337. #endif
  6338. * |--------------------------------------------------------------------------|
  6339. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  6340. * |--------------------------------------------------------------------------|
  6341. * | MSDU 1 bus address (bits 31:0) |
  6342. #if HTT_PADDR64
  6343. * | MSDU 1 bus address (bits 63:32) |
  6344. #endif
  6345. * |--------------------------------------------------------------------------|
  6346. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  6347. * |--------------------------------------------------------------------------|
  6348. */
  6349. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  6350. *
  6351. * @details
  6352. * bits
  6353. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  6354. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6355. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  6356. * | | frag | | | | fail |chksum fail|
  6357. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6358. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  6359. */
  6360. struct htt_rx_in_ord_paddr_ind_hdr_t
  6361. {
  6362. A_UINT32 /* word 0 */
  6363. msg_type: 8,
  6364. ext_tid: 5,
  6365. offload: 1,
  6366. frag: 1,
  6367. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  6368. peer_id: 16;
  6369. A_UINT32 /* word 1 */
  6370. vap_id: 8,
  6371. /* NOTE:
  6372. * This reserved_1 field is not truly reserved - certain targets use
  6373. * this field internally to store debug information, and do not zero
  6374. * out the contents of the field before uploading the message to the
  6375. * host. Thus, any host-target communication supported by this field
  6376. * is limited to using values that are never used by the debug
  6377. * information stored by certain targets in the reserved_1 field.
  6378. * In particular, the targets in question don't use the value 0x3
  6379. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  6380. * so this previously-unused value within these bits is available to
  6381. * use as the host / target PKT_CAPTURE_MODE flag.
  6382. */
  6383. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  6384. /* if pkt_capture_mode == 0x3, host should
  6385. * send rx frames to monitor mode interface
  6386. */
  6387. msdu_cnt: 16;
  6388. };
  6389. struct htt_rx_in_ord_paddr_ind_msdu32_t
  6390. {
  6391. A_UINT32 dma_addr;
  6392. A_UINT32
  6393. length: 16,
  6394. fw_desc: 8,
  6395. msdu_info:8;
  6396. };
  6397. struct htt_rx_in_ord_paddr_ind_msdu64_t
  6398. {
  6399. A_UINT32 dma_addr_lo;
  6400. A_UINT32 dma_addr_hi;
  6401. A_UINT32
  6402. length: 16,
  6403. fw_desc: 8,
  6404. msdu_info:8;
  6405. };
  6406. #if HTT_PADDR64
  6407. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  6408. #else
  6409. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  6410. #endif
  6411. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  6412. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  6413. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  6414. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  6415. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  6416. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  6417. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  6418. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  6419. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  6420. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  6421. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  6422. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  6423. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  6424. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  6425. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  6426. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  6427. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  6428. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  6429. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  6430. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  6431. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  6432. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  6433. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  6434. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  6435. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  6436. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  6437. /* for systems using 64-bit format for bus addresses */
  6438. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  6439. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  6440. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  6441. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  6442. /* for systems using 32-bit format for bus addresses */
  6443. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  6444. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  6445. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  6446. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  6447. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  6448. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  6449. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  6450. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  6451. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  6452. do { \
  6453. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  6454. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  6455. } while (0)
  6456. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  6457. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  6458. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  6459. do { \
  6460. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  6461. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  6462. } while (0)
  6463. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  6464. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  6465. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  6466. do { \
  6467. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  6468. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  6469. } while (0)
  6470. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  6471. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  6472. /*
  6473. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  6474. * deliver the rx frames to the monitor mode interface.
  6475. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  6476. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  6477. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  6478. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  6479. */
  6480. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  6481. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  6482. do { \
  6483. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  6484. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  6485. } while (0)
  6486. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  6487. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  6488. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  6489. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  6490. do { \
  6491. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  6492. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  6493. } while (0)
  6494. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  6495. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  6496. /* for systems using 64-bit format for bus addresses */
  6497. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  6498. do { \
  6499. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  6500. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  6501. } while (0)
  6502. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  6503. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  6504. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  6505. do { \
  6506. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  6507. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  6508. } while (0)
  6509. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  6510. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  6511. /* for systems using 32-bit format for bus addresses */
  6512. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  6513. do { \
  6514. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  6515. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  6516. } while (0)
  6517. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  6518. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  6519. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  6520. do { \
  6521. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  6522. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  6523. } while (0)
  6524. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  6525. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  6526. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  6527. do { \
  6528. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  6529. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  6530. } while (0)
  6531. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  6532. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  6533. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  6534. do { \
  6535. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  6536. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  6537. } while (0)
  6538. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  6539. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  6540. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  6541. do { \
  6542. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  6543. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  6544. } while (0)
  6545. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  6546. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  6547. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  6548. do { \
  6549. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  6550. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  6551. } while (0)
  6552. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  6553. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  6554. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  6555. do { \
  6556. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  6557. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  6558. } while (0)
  6559. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  6560. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  6561. /* definitions used within target -> host rx indication message */
  6562. PREPACK struct htt_rx_ind_hdr_prefix_t
  6563. {
  6564. A_UINT32 /* word 0 */
  6565. msg_type: 8,
  6566. ext_tid: 5,
  6567. release_valid: 1,
  6568. flush_valid: 1,
  6569. reserved0: 1,
  6570. peer_id: 16;
  6571. A_UINT32 /* word 1 */
  6572. flush_start_seq_num: 6,
  6573. flush_end_seq_num: 6,
  6574. release_start_seq_num: 6,
  6575. release_end_seq_num: 6,
  6576. num_mpdu_ranges: 8;
  6577. } POSTPACK;
  6578. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  6579. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  6580. #define HTT_TGT_RSSI_INVALID 0x80
  6581. PREPACK struct htt_rx_ppdu_desc_t
  6582. {
  6583. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  6584. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  6585. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  6586. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  6587. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  6588. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  6589. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  6590. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  6591. A_UINT32 /* word 0 */
  6592. rssi_cmb: 8,
  6593. timestamp_submicrosec: 8,
  6594. phy_err_code: 8,
  6595. phy_err: 1,
  6596. legacy_rate: 4,
  6597. legacy_rate_sel: 1,
  6598. end_valid: 1,
  6599. start_valid: 1;
  6600. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  6601. union {
  6602. A_UINT32 /* word 1 */
  6603. rssi0_pri20: 8,
  6604. rssi0_ext20: 8,
  6605. rssi0_ext40: 8,
  6606. rssi0_ext80: 8;
  6607. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  6608. } u0;
  6609. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  6610. union {
  6611. A_UINT32 /* word 2 */
  6612. rssi1_pri20: 8,
  6613. rssi1_ext20: 8,
  6614. rssi1_ext40: 8,
  6615. rssi1_ext80: 8;
  6616. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  6617. } u1;
  6618. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  6619. union {
  6620. A_UINT32 /* word 3 */
  6621. rssi2_pri20: 8,
  6622. rssi2_ext20: 8,
  6623. rssi2_ext40: 8,
  6624. rssi2_ext80: 8;
  6625. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  6626. } u2;
  6627. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  6628. union {
  6629. A_UINT32 /* word 4 */
  6630. rssi3_pri20: 8,
  6631. rssi3_ext20: 8,
  6632. rssi3_ext40: 8,
  6633. rssi3_ext80: 8;
  6634. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  6635. } u3;
  6636. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  6637. A_UINT32 tsf32; /* word 5 */
  6638. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  6639. A_UINT32 timestamp_microsec; /* word 6 */
  6640. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  6641. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  6642. A_UINT32 /* word 7 */
  6643. vht_sig_a1: 24,
  6644. preamble_type: 8;
  6645. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  6646. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  6647. A_UINT32 /* word 8 */
  6648. vht_sig_a2: 24,
  6649. /* sa_ant_matrix
  6650. * For cases where a single rx chain has options to be connected to
  6651. * different rx antennas, show which rx antennas were in use during
  6652. * receipt of a given PPDU.
  6653. * This sa_ant_matrix provides a bitmask of the antennas used while
  6654. * receiving this frame.
  6655. */
  6656. sa_ant_matrix: 8;
  6657. } POSTPACK;
  6658. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  6659. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  6660. PREPACK struct htt_rx_ind_hdr_suffix_t
  6661. {
  6662. A_UINT32 /* word 0 */
  6663. fw_rx_desc_bytes: 16,
  6664. reserved0: 16;
  6665. } POSTPACK;
  6666. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  6667. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  6668. PREPACK struct htt_rx_ind_hdr_t
  6669. {
  6670. struct htt_rx_ind_hdr_prefix_t prefix;
  6671. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  6672. struct htt_rx_ind_hdr_suffix_t suffix;
  6673. } POSTPACK;
  6674. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  6675. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  6676. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  6677. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  6678. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  6679. /*
  6680. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  6681. * the offset into the HTT rx indication message at which the
  6682. * FW rx PPDU descriptor resides
  6683. */
  6684. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  6685. /*
  6686. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  6687. * the offset into the HTT rx indication message at which the
  6688. * header suffix (FW rx MSDU byte count) resides
  6689. */
  6690. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  6691. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  6692. /*
  6693. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  6694. * the offset into the HTT rx indication message at which the per-MSDU
  6695. * information starts
  6696. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  6697. * per-MSDU information portion of the message. The per-MSDU info itself
  6698. * starts at byte 12.
  6699. */
  6700. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  6701. /**
  6702. * @brief target -> host rx indication message definition
  6703. *
  6704. * @details
  6705. * The following field definitions describe the format of the rx indication
  6706. * message sent from the target to the host.
  6707. * The message consists of three major sections:
  6708. * 1. a fixed-length header
  6709. * 2. a variable-length list of firmware rx MSDU descriptors
  6710. * 3. one or more 4-octet MPDU range information elements
  6711. * The fixed length header itself has two sub-sections
  6712. * 1. the message meta-information, including identification of the
  6713. * sender and type of the received data, and a 4-octet flush/release IE
  6714. * 2. the firmware rx PPDU descriptor
  6715. *
  6716. * The format of the message is depicted below.
  6717. * in this depiction, the following abbreviations are used for information
  6718. * elements within the message:
  6719. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  6720. * elements associated with the PPDU start are valid.
  6721. * Specifically, the following fields are valid only if SV is set:
  6722. * RSSI (all variants), L, legacy rate, preamble type, service,
  6723. * VHT-SIG-A
  6724. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  6725. * elements associated with the PPDU end are valid.
  6726. * Specifically, the following fields are valid only if EV is set:
  6727. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  6728. * - L - Legacy rate selector - if legacy rates are used, this flag
  6729. * indicates whether the rate is from a CCK (L == 1) or OFDM
  6730. * (L == 0) PHY.
  6731. * - P - PHY error flag - boolean indication of whether the rx frame had
  6732. * a PHY error
  6733. *
  6734. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  6735. * |----------------+-------------------+---------------------+---------------|
  6736. * | peer ID | |RV|FV| ext TID | msg type |
  6737. * |--------------------------------------------------------------------------|
  6738. * | num | release | release | flush | flush |
  6739. * | MPDU | end | start | end | start |
  6740. * | ranges | seq num | seq num | seq num | seq num |
  6741. * |==========================================================================|
  6742. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  6743. * |V|V| | rate | | | timestamp | RSSI |
  6744. * |--------------------------------------------------------------------------|
  6745. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  6746. * |--------------------------------------------------------------------------|
  6747. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  6748. * |--------------------------------------------------------------------------|
  6749. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  6750. * |--------------------------------------------------------------------------|
  6751. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  6752. * |--------------------------------------------------------------------------|
  6753. * | TSF LSBs |
  6754. * |--------------------------------------------------------------------------|
  6755. * | microsec timestamp |
  6756. * |--------------------------------------------------------------------------|
  6757. * | preamble type | HT-SIG / VHT-SIG-A1 |
  6758. * |--------------------------------------------------------------------------|
  6759. * | service | HT-SIG / VHT-SIG-A2 |
  6760. * |==========================================================================|
  6761. * | reserved | FW rx desc bytes |
  6762. * |--------------------------------------------------------------------------|
  6763. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  6764. * | desc B3 | desc B2 | desc B1 | desc B0 |
  6765. * |--------------------------------------------------------------------------|
  6766. * : : :
  6767. * |--------------------------------------------------------------------------|
  6768. * | alignment | MSDU Rx |
  6769. * | padding | desc Bn |
  6770. * |--------------------------------------------------------------------------|
  6771. * | reserved | MPDU range status | MPDU count |
  6772. * |--------------------------------------------------------------------------|
  6773. * : reserved : MPDU range status : MPDU count :
  6774. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  6775. *
  6776. * Header fields:
  6777. * - MSG_TYPE
  6778. * Bits 7:0
  6779. * Purpose: identifies this as an rx indication message
  6780. * Value: 0x1
  6781. * - EXT_TID
  6782. * Bits 12:8
  6783. * Purpose: identify the traffic ID of the rx data, including
  6784. * special "extended" TID values for multicast, broadcast, and
  6785. * non-QoS data frames
  6786. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  6787. * - FLUSH_VALID (FV)
  6788. * Bit 13
  6789. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  6790. * is valid
  6791. * Value:
  6792. * 1 -> flush IE is valid and needs to be processed
  6793. * 0 -> flush IE is not valid and should be ignored
  6794. * - REL_VALID (RV)
  6795. * Bit 13
  6796. * Purpose: indicate whether the release IE (start/end sequence numbers)
  6797. * is valid
  6798. * Value:
  6799. * 1 -> release IE is valid and needs to be processed
  6800. * 0 -> release IE is not valid and should be ignored
  6801. * - PEER_ID
  6802. * Bits 31:16
  6803. * Purpose: Identify, by ID, which peer sent the rx data
  6804. * Value: ID of the peer who sent the rx data
  6805. * - FLUSH_SEQ_NUM_START
  6806. * Bits 5:0
  6807. * Purpose: Indicate the start of a series of MPDUs to flush
  6808. * Not all MPDUs within this series are necessarily valid - the host
  6809. * must check each sequence number within this range to see if the
  6810. * corresponding MPDU is actually present.
  6811. * This field is only valid if the FV bit is set.
  6812. * Value:
  6813. * The sequence number for the first MPDUs to check to flush.
  6814. * The sequence number is masked by 0x3f.
  6815. * - FLUSH_SEQ_NUM_END
  6816. * Bits 11:6
  6817. * Purpose: Indicate the end of a series of MPDUs to flush
  6818. * Value:
  6819. * The sequence number one larger than the sequence number of the
  6820. * last MPDU to check to flush.
  6821. * The sequence number is masked by 0x3f.
  6822. * Not all MPDUs within this series are necessarily valid - the host
  6823. * must check each sequence number within this range to see if the
  6824. * corresponding MPDU is actually present.
  6825. * This field is only valid if the FV bit is set.
  6826. * - REL_SEQ_NUM_START
  6827. * Bits 17:12
  6828. * Purpose: Indicate the start of a series of MPDUs to release.
  6829. * All MPDUs within this series are present and valid - the host
  6830. * need not check each sequence number within this range to see if
  6831. * the corresponding MPDU is actually present.
  6832. * This field is only valid if the RV bit is set.
  6833. * Value:
  6834. * The sequence number for the first MPDUs to check to release.
  6835. * The sequence number is masked by 0x3f.
  6836. * - REL_SEQ_NUM_END
  6837. * Bits 23:18
  6838. * Purpose: Indicate the end of a series of MPDUs to release.
  6839. * Value:
  6840. * The sequence number one larger than the sequence number of the
  6841. * last MPDU to check to release.
  6842. * The sequence number is masked by 0x3f.
  6843. * All MPDUs within this series are present and valid - the host
  6844. * need not check each sequence number within this range to see if
  6845. * the corresponding MPDU is actually present.
  6846. * This field is only valid if the RV bit is set.
  6847. * - NUM_MPDU_RANGES
  6848. * Bits 31:24
  6849. * Purpose: Indicate how many ranges of MPDUs are present.
  6850. * Each MPDU range consists of a series of contiguous MPDUs within the
  6851. * rx frame sequence which all have the same MPDU status.
  6852. * Value: 1-63 (typically a small number, like 1-3)
  6853. *
  6854. * Rx PPDU descriptor fields:
  6855. * - RSSI_CMB
  6856. * Bits 7:0
  6857. * Purpose: Combined RSSI from all active rx chains, across the active
  6858. * bandwidth.
  6859. * Value: RSSI dB units w.r.t. noise floor
  6860. * - TIMESTAMP_SUBMICROSEC
  6861. * Bits 15:8
  6862. * Purpose: high-resolution timestamp
  6863. * Value:
  6864. * Sub-microsecond time of PPDU reception.
  6865. * This timestamp ranges from [0,MAC clock MHz).
  6866. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  6867. * to form a high-resolution, large range rx timestamp.
  6868. * - PHY_ERR_CODE
  6869. * Bits 23:16
  6870. * Purpose:
  6871. * If the rx frame processing resulted in a PHY error, indicate what
  6872. * type of rx PHY error occurred.
  6873. * Value:
  6874. * This field is valid if the "P" (PHY_ERR) flag is set.
  6875. * TBD: document/specify the values for this field
  6876. * - PHY_ERR
  6877. * Bit 24
  6878. * Purpose: indicate whether the rx PPDU had a PHY error
  6879. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  6880. * - LEGACY_RATE
  6881. * Bits 28:25
  6882. * Purpose:
  6883. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  6884. * specify which rate was used.
  6885. * Value:
  6886. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  6887. * flag.
  6888. * If LEGACY_RATE_SEL is 0:
  6889. * 0x8: OFDM 48 Mbps
  6890. * 0x9: OFDM 24 Mbps
  6891. * 0xA: OFDM 12 Mbps
  6892. * 0xB: OFDM 6 Mbps
  6893. * 0xC: OFDM 54 Mbps
  6894. * 0xD: OFDM 36 Mbps
  6895. * 0xE: OFDM 18 Mbps
  6896. * 0xF: OFDM 9 Mbps
  6897. * If LEGACY_RATE_SEL is 1:
  6898. * 0x8: CCK 11 Mbps long preamble
  6899. * 0x9: CCK 5.5 Mbps long preamble
  6900. * 0xA: CCK 2 Mbps long preamble
  6901. * 0xB: CCK 1 Mbps long preamble
  6902. * 0xC: CCK 11 Mbps short preamble
  6903. * 0xD: CCK 5.5 Mbps short preamble
  6904. * 0xE: CCK 2 Mbps short preamble
  6905. * - LEGACY_RATE_SEL
  6906. * Bit 29
  6907. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  6908. * Value:
  6909. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  6910. * used a legacy rate.
  6911. * 0 -> OFDM, 1 -> CCK
  6912. * - END_VALID
  6913. * Bit 30
  6914. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6915. * the start of the PPDU are valid. Specifically, the following
  6916. * fields are only valid if END_VALID is set:
  6917. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  6918. * TIMESTAMP_SUBMICROSEC
  6919. * Value:
  6920. * 0 -> rx PPDU desc end fields are not valid
  6921. * 1 -> rx PPDU desc end fields are valid
  6922. * - START_VALID
  6923. * Bit 31
  6924. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6925. * the end of the PPDU are valid. Specifically, the following
  6926. * fields are only valid if START_VALID is set:
  6927. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  6928. * VHT-SIG-A
  6929. * Value:
  6930. * 0 -> rx PPDU desc start fields are not valid
  6931. * 1 -> rx PPDU desc start fields are valid
  6932. * - RSSI0_PRI20
  6933. * Bits 7:0
  6934. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  6935. * Value: RSSI dB units w.r.t. noise floor
  6936. *
  6937. * - RSSI0_EXT20
  6938. * Bits 7:0
  6939. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  6940. * (if the rx bandwidth was >= 40 MHz)
  6941. * Value: RSSI dB units w.r.t. noise floor
  6942. * - RSSI0_EXT40
  6943. * Bits 7:0
  6944. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  6945. * (if the rx bandwidth was >= 80 MHz)
  6946. * Value: RSSI dB units w.r.t. noise floor
  6947. * - RSSI0_EXT80
  6948. * Bits 7:0
  6949. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  6950. * (if the rx bandwidth was >= 160 MHz)
  6951. * Value: RSSI dB units w.r.t. noise floor
  6952. *
  6953. * - RSSI1_PRI20
  6954. * Bits 7:0
  6955. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  6956. * Value: RSSI dB units w.r.t. noise floor
  6957. * - RSSI1_EXT20
  6958. * Bits 7:0
  6959. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  6960. * (if the rx bandwidth was >= 40 MHz)
  6961. * Value: RSSI dB units w.r.t. noise floor
  6962. * - RSSI1_EXT40
  6963. * Bits 7:0
  6964. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  6965. * (if the rx bandwidth was >= 80 MHz)
  6966. * Value: RSSI dB units w.r.t. noise floor
  6967. * - RSSI1_EXT80
  6968. * Bits 7:0
  6969. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  6970. * (if the rx bandwidth was >= 160 MHz)
  6971. * Value: RSSI dB units w.r.t. noise floor
  6972. *
  6973. * - RSSI2_PRI20
  6974. * Bits 7:0
  6975. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  6976. * Value: RSSI dB units w.r.t. noise floor
  6977. * - RSSI2_EXT20
  6978. * Bits 7:0
  6979. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  6980. * (if the rx bandwidth was >= 40 MHz)
  6981. * Value: RSSI dB units w.r.t. noise floor
  6982. * - RSSI2_EXT40
  6983. * Bits 7:0
  6984. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  6985. * (if the rx bandwidth was >= 80 MHz)
  6986. * Value: RSSI dB units w.r.t. noise floor
  6987. * - RSSI2_EXT80
  6988. * Bits 7:0
  6989. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  6990. * (if the rx bandwidth was >= 160 MHz)
  6991. * Value: RSSI dB units w.r.t. noise floor
  6992. *
  6993. * - RSSI3_PRI20
  6994. * Bits 7:0
  6995. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  6996. * Value: RSSI dB units w.r.t. noise floor
  6997. * - RSSI3_EXT20
  6998. * Bits 7:0
  6999. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  7000. * (if the rx bandwidth was >= 40 MHz)
  7001. * Value: RSSI dB units w.r.t. noise floor
  7002. * - RSSI3_EXT40
  7003. * Bits 7:0
  7004. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  7005. * (if the rx bandwidth was >= 80 MHz)
  7006. * Value: RSSI dB units w.r.t. noise floor
  7007. * - RSSI3_EXT80
  7008. * Bits 7:0
  7009. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  7010. * (if the rx bandwidth was >= 160 MHz)
  7011. * Value: RSSI dB units w.r.t. noise floor
  7012. *
  7013. * - TSF32
  7014. * Bits 31:0
  7015. * Purpose: specify the time the rx PPDU was received, in TSF units
  7016. * Value: 32 LSBs of the TSF
  7017. * - TIMESTAMP_MICROSEC
  7018. * Bits 31:0
  7019. * Purpose: specify the time the rx PPDU was received, in microsecond units
  7020. * Value: PPDU rx time, in microseconds
  7021. * - VHT_SIG_A1
  7022. * Bits 23:0
  7023. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  7024. * from the rx PPDU
  7025. * Value:
  7026. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7027. * VHT-SIG-A1 data.
  7028. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7029. * first 24 bits of the HT-SIG data.
  7030. * Otherwise, this field is invalid.
  7031. * Refer to the the 802.11 protocol for the definition of the
  7032. * HT-SIG and VHT-SIG-A1 fields
  7033. * - VHT_SIG_A2
  7034. * Bits 23:0
  7035. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  7036. * from the rx PPDU
  7037. * Value:
  7038. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7039. * VHT-SIG-A2 data.
  7040. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7041. * last 24 bits of the HT-SIG data.
  7042. * Otherwise, this field is invalid.
  7043. * Refer to the the 802.11 protocol for the definition of the
  7044. * HT-SIG and VHT-SIG-A2 fields
  7045. * - PREAMBLE_TYPE
  7046. * Bits 31:24
  7047. * Purpose: indicate the PHY format of the received burst
  7048. * Value:
  7049. * 0x4: Legacy (OFDM/CCK)
  7050. * 0x8: HT
  7051. * 0x9: HT with TxBF
  7052. * 0xC: VHT
  7053. * 0xD: VHT with TxBF
  7054. * - SERVICE
  7055. * Bits 31:24
  7056. * Purpose: TBD
  7057. * Value: TBD
  7058. *
  7059. * Rx MSDU descriptor fields:
  7060. * - FW_RX_DESC_BYTES
  7061. * Bits 15:0
  7062. * Purpose: Indicate how many bytes in the Rx indication are used for
  7063. * FW Rx descriptors
  7064. *
  7065. * Payload fields:
  7066. * - MPDU_COUNT
  7067. * Bits 7:0
  7068. * Purpose: Indicate how many sequential MPDUs share the same status.
  7069. * All MPDUs within the indicated list are from the same RA-TA-TID.
  7070. * - MPDU_STATUS
  7071. * Bits 15:8
  7072. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  7073. * received successfully.
  7074. * Value:
  7075. * 0x1: success
  7076. * 0x2: FCS error
  7077. * 0x3: duplicate error
  7078. * 0x4: replay error
  7079. * 0x5: invalid peer
  7080. */
  7081. /* header fields */
  7082. #define HTT_RX_IND_EXT_TID_M 0x1f00
  7083. #define HTT_RX_IND_EXT_TID_S 8
  7084. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  7085. #define HTT_RX_IND_FLUSH_VALID_S 13
  7086. #define HTT_RX_IND_REL_VALID_M 0x4000
  7087. #define HTT_RX_IND_REL_VALID_S 14
  7088. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  7089. #define HTT_RX_IND_PEER_ID_S 16
  7090. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  7091. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  7092. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  7093. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  7094. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  7095. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  7096. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  7097. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  7098. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  7099. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  7100. /* rx PPDU descriptor fields */
  7101. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  7102. #define HTT_RX_IND_RSSI_CMB_S 0
  7103. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  7104. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  7105. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  7106. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  7107. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  7108. #define HTT_RX_IND_PHY_ERR_S 24
  7109. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  7110. #define HTT_RX_IND_LEGACY_RATE_S 25
  7111. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  7112. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  7113. #define HTT_RX_IND_END_VALID_M 0x40000000
  7114. #define HTT_RX_IND_END_VALID_S 30
  7115. #define HTT_RX_IND_START_VALID_M 0x80000000
  7116. #define HTT_RX_IND_START_VALID_S 31
  7117. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  7118. #define HTT_RX_IND_RSSI_PRI20_S 0
  7119. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  7120. #define HTT_RX_IND_RSSI_EXT20_S 8
  7121. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  7122. #define HTT_RX_IND_RSSI_EXT40_S 16
  7123. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  7124. #define HTT_RX_IND_RSSI_EXT80_S 24
  7125. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  7126. #define HTT_RX_IND_VHT_SIG_A1_S 0
  7127. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  7128. #define HTT_RX_IND_VHT_SIG_A2_S 0
  7129. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  7130. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  7131. #define HTT_RX_IND_SERVICE_M 0xff000000
  7132. #define HTT_RX_IND_SERVICE_S 24
  7133. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  7134. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  7135. /* rx MSDU descriptor fields */
  7136. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  7137. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  7138. /* payload fields */
  7139. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  7140. #define HTT_RX_IND_MPDU_COUNT_S 0
  7141. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  7142. #define HTT_RX_IND_MPDU_STATUS_S 8
  7143. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  7144. do { \
  7145. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  7146. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  7147. } while (0)
  7148. #define HTT_RX_IND_EXT_TID_GET(word) \
  7149. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  7150. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  7151. do { \
  7152. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  7153. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  7154. } while (0)
  7155. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  7156. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  7157. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  7158. do { \
  7159. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  7160. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  7161. } while (0)
  7162. #define HTT_RX_IND_REL_VALID_GET(word) \
  7163. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  7164. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  7165. do { \
  7166. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  7167. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  7168. } while (0)
  7169. #define HTT_RX_IND_PEER_ID_GET(word) \
  7170. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  7171. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  7172. do { \
  7173. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  7174. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  7175. } while (0)
  7176. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  7177. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  7178. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  7179. do { \
  7180. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  7181. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  7182. } while (0)
  7183. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  7184. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  7185. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  7186. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  7187. do { \
  7188. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  7189. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  7190. } while (0)
  7191. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  7192. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  7193. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  7194. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  7195. do { \
  7196. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  7197. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  7198. } while (0)
  7199. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  7200. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  7201. HTT_RX_IND_REL_SEQ_NUM_START_S)
  7202. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  7203. do { \
  7204. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  7205. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  7206. } while (0)
  7207. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  7208. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  7209. HTT_RX_IND_REL_SEQ_NUM_END_S)
  7210. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  7211. do { \
  7212. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  7213. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  7214. } while (0)
  7215. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  7216. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  7217. HTT_RX_IND_NUM_MPDU_RANGES_S)
  7218. /* FW rx PPDU descriptor fields */
  7219. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  7220. do { \
  7221. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  7222. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  7223. } while (0)
  7224. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  7225. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  7226. HTT_RX_IND_RSSI_CMB_S)
  7227. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  7228. do { \
  7229. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  7230. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  7231. } while (0)
  7232. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  7233. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  7234. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  7235. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  7236. do { \
  7237. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  7238. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  7239. } while (0)
  7240. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  7241. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  7242. HTT_RX_IND_PHY_ERR_CODE_S)
  7243. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  7244. do { \
  7245. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  7246. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  7247. } while (0)
  7248. #define HTT_RX_IND_PHY_ERR_GET(word) \
  7249. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  7250. HTT_RX_IND_PHY_ERR_S)
  7251. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  7252. do { \
  7253. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  7254. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  7255. } while (0)
  7256. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  7257. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  7258. HTT_RX_IND_LEGACY_RATE_S)
  7259. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  7260. do { \
  7261. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  7262. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  7263. } while (0)
  7264. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  7265. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  7266. HTT_RX_IND_LEGACY_RATE_SEL_S)
  7267. #define HTT_RX_IND_END_VALID_SET(word, value) \
  7268. do { \
  7269. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  7270. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  7271. } while (0)
  7272. #define HTT_RX_IND_END_VALID_GET(word) \
  7273. (((word) & HTT_RX_IND_END_VALID_M) >> \
  7274. HTT_RX_IND_END_VALID_S)
  7275. #define HTT_RX_IND_START_VALID_SET(word, value) \
  7276. do { \
  7277. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  7278. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  7279. } while (0)
  7280. #define HTT_RX_IND_START_VALID_GET(word) \
  7281. (((word) & HTT_RX_IND_START_VALID_M) >> \
  7282. HTT_RX_IND_START_VALID_S)
  7283. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  7284. do { \
  7285. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  7286. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  7287. } while (0)
  7288. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  7289. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  7290. HTT_RX_IND_RSSI_PRI20_S)
  7291. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  7292. do { \
  7293. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  7294. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  7295. } while (0)
  7296. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  7297. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  7298. HTT_RX_IND_RSSI_EXT20_S)
  7299. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  7300. do { \
  7301. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  7302. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  7303. } while (0)
  7304. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  7305. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  7306. HTT_RX_IND_RSSI_EXT40_S)
  7307. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  7308. do { \
  7309. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  7310. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  7311. } while (0)
  7312. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  7313. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  7314. HTT_RX_IND_RSSI_EXT80_S)
  7315. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  7316. do { \
  7317. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  7318. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  7319. } while (0)
  7320. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  7321. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  7322. HTT_RX_IND_VHT_SIG_A1_S)
  7323. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  7324. do { \
  7325. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  7326. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  7327. } while (0)
  7328. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  7329. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  7330. HTT_RX_IND_VHT_SIG_A2_S)
  7331. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  7332. do { \
  7333. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  7334. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  7335. } while (0)
  7336. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  7337. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  7338. HTT_RX_IND_PREAMBLE_TYPE_S)
  7339. #define HTT_RX_IND_SERVICE_SET(word, value) \
  7340. do { \
  7341. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  7342. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  7343. } while (0)
  7344. #define HTT_RX_IND_SERVICE_GET(word) \
  7345. (((word) & HTT_RX_IND_SERVICE_M) >> \
  7346. HTT_RX_IND_SERVICE_S)
  7347. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  7348. do { \
  7349. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  7350. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  7351. } while (0)
  7352. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  7353. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  7354. HTT_RX_IND_SA_ANT_MATRIX_S)
  7355. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  7356. do { \
  7357. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  7358. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  7359. } while (0)
  7360. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  7361. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  7362. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  7363. do { \
  7364. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  7365. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  7366. } while (0)
  7367. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  7368. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  7369. #define HTT_RX_IND_HL_BYTES \
  7370. (HTT_RX_IND_HDR_BYTES + \
  7371. 4 /* single FW rx MSDU descriptor */ + \
  7372. 4 /* single MPDU range information element */)
  7373. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  7374. /* Could we use one macro entry? */
  7375. #define HTT_WORD_SET(word, field, value) \
  7376. do { \
  7377. HTT_CHECK_SET_VAL(field, value); \
  7378. (word) |= ((value) << field ## _S); \
  7379. } while (0)
  7380. #define HTT_WORD_GET(word, field) \
  7381. (((word) & field ## _M) >> field ## _S)
  7382. PREPACK struct hl_htt_rx_ind_base {
  7383. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  7384. } POSTPACK;
  7385. /*
  7386. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  7387. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  7388. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  7389. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  7390. * htt_rx_ind_hl_rx_desc_t.
  7391. */
  7392. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  7393. struct htt_rx_ind_hl_rx_desc_t {
  7394. A_UINT8 ver;
  7395. A_UINT8 len;
  7396. struct {
  7397. A_UINT8
  7398. first_msdu: 1,
  7399. last_msdu: 1,
  7400. c3_failed: 1,
  7401. c4_failed: 1,
  7402. ipv6: 1,
  7403. tcp: 1,
  7404. udp: 1,
  7405. reserved: 1;
  7406. } flags;
  7407. /* NOTE: no reserved space - don't append any new fields here */
  7408. };
  7409. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  7410. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7411. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  7412. #define HTT_RX_IND_HL_RX_DESC_VER 0
  7413. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  7414. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7415. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  7416. #define HTT_RX_IND_HL_FLAG_OFFSET \
  7417. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7418. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  7419. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  7420. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  7421. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  7422. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  7423. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  7424. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  7425. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  7426. /* This structure is used in HL, the basic descriptor information
  7427. * used by host. the structure is translated by FW from HW desc
  7428. * or generated by FW. But in HL monitor mode, the host would use
  7429. * the same structure with LL.
  7430. */
  7431. PREPACK struct hl_htt_rx_desc_base {
  7432. A_UINT32
  7433. seq_num:12,
  7434. encrypted:1,
  7435. chan_info_present:1,
  7436. resv0:2,
  7437. mcast_bcast:1,
  7438. fragment:1,
  7439. key_id_oct:8,
  7440. resv1:6;
  7441. A_UINT32
  7442. pn_31_0;
  7443. union {
  7444. struct {
  7445. A_UINT16 pn_47_32;
  7446. A_UINT16 pn_63_48;
  7447. } pn16;
  7448. A_UINT32 pn_63_32;
  7449. } u0;
  7450. A_UINT32
  7451. pn_95_64;
  7452. A_UINT32
  7453. pn_127_96;
  7454. } POSTPACK;
  7455. /*
  7456. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  7457. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  7458. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  7459. * Please see htt_chan_change_t for description of the fields.
  7460. */
  7461. PREPACK struct htt_chan_info_t
  7462. {
  7463. A_UINT32 primary_chan_center_freq_mhz: 16,
  7464. contig_chan1_center_freq_mhz: 16;
  7465. A_UINT32 contig_chan2_center_freq_mhz: 16,
  7466. phy_mode: 8,
  7467. reserved: 8;
  7468. } POSTPACK;
  7469. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  7470. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  7471. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  7472. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  7473. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  7474. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  7475. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  7476. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  7477. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  7478. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  7479. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  7480. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  7481. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  7482. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  7483. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  7484. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  7485. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  7486. /* Channel information */
  7487. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  7488. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  7489. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  7490. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  7491. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  7492. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  7493. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  7494. #define HTT_CHAN_INFO_PHY_MODE_S 16
  7495. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  7496. do { \
  7497. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  7498. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  7499. } while (0)
  7500. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  7501. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  7502. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  7503. do { \
  7504. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  7505. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  7506. } while (0)
  7507. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  7508. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  7509. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  7510. do { \
  7511. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  7512. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  7513. } while (0)
  7514. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  7515. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  7516. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  7517. do { \
  7518. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  7519. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  7520. } while (0)
  7521. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  7522. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  7523. /*
  7524. * HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  7525. * @brief target -> host message definition for FW offloaded pkts
  7526. *
  7527. * @details
  7528. * The following field definitions describe the format of the firmware
  7529. * offload deliver message sent from the target to the host.
  7530. *
  7531. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  7532. *
  7533. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  7534. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  7535. * | reserved_1 | msg type |
  7536. * |--------------------------------------------------------------------------|
  7537. * | phy_timestamp_l32 |
  7538. * |--------------------------------------------------------------------------|
  7539. * | WORD2 (see below) |
  7540. * |--------------------------------------------------------------------------|
  7541. * | seqno | framectrl |
  7542. * |--------------------------------------------------------------------------|
  7543. * | reserved_3 | vdev_id | tid_num|
  7544. * |--------------------------------------------------------------------------|
  7545. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  7546. * |--------------------------------------------------------------------------|
  7547. *
  7548. * where:
  7549. * STAT = status
  7550. * F = format (802.3 vs. 802.11)
  7551. *
  7552. * definition for word 2
  7553. *
  7554. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  7555. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  7556. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  7557. * |--------------------------------------------------------------------------|
  7558. *
  7559. * where:
  7560. * PR = preamble
  7561. * BF = beamformed
  7562. */
  7563. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  7564. {
  7565. A_UINT32 /* word 0 */
  7566. msg_type:8, /* [ 7: 0] */
  7567. reserved_1:24; /* [31: 8] */
  7568. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  7569. A_UINT32 /* word 2 */
  7570. /* preamble:
  7571. * 0-OFDM,
  7572. * 1-CCk,
  7573. * 2-HT,
  7574. * 3-VHT
  7575. */
  7576. preamble: 2, /* [1:0] */
  7577. /* mcs:
  7578. * In case of HT preamble interpret
  7579. * MCS along with NSS.
  7580. * Valid values for HT are 0 to 7.
  7581. * HT mcs 0 with NSS 2 is mcs 8.
  7582. * Valid values for VHT are 0 to 9.
  7583. */
  7584. mcs: 4, /* [5:2] */
  7585. /* rate:
  7586. * This is applicable only for
  7587. * CCK and OFDM preamble type
  7588. * rate 0: OFDM 48 Mbps,
  7589. * 1: OFDM 24 Mbps,
  7590. * 2: OFDM 12 Mbps
  7591. * 3: OFDM 6 Mbps
  7592. * 4: OFDM 54 Mbps
  7593. * 5: OFDM 36 Mbps
  7594. * 6: OFDM 18 Mbps
  7595. * 7: OFDM 9 Mbps
  7596. * rate 0: CCK 11 Mbps Long
  7597. * 1: CCK 5.5 Mbps Long
  7598. * 2: CCK 2 Mbps Long
  7599. * 3: CCK 1 Mbps Long
  7600. * 4: CCK 11 Mbps Short
  7601. * 5: CCK 5.5 Mbps Short
  7602. * 6: CCK 2 Mbps Short
  7603. */
  7604. rate : 3, /* [ 8: 6] */
  7605. rssi : 8, /* [16: 9] units=dBm */
  7606. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  7607. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  7608. stbc : 1, /* [22] */
  7609. sgi : 1, /* [23] */
  7610. ldpc : 1, /* [24] */
  7611. beamformed: 1, /* [25] */
  7612. reserved_2: 6; /* [31:26] */
  7613. A_UINT32 /* word 3 */
  7614. framectrl:16, /* [15: 0] */
  7615. seqno:16; /* [31:16] */
  7616. A_UINT32 /* word 4 */
  7617. tid_num:5, /* [ 4: 0] actual TID number */
  7618. vdev_id:8, /* [12: 5] */
  7619. reserved_3:19; /* [31:13] */
  7620. A_UINT32 /* word 5 */
  7621. /* status:
  7622. * 0: tx_ok
  7623. * 1: retry
  7624. * 2: drop
  7625. * 3: filtered
  7626. * 4: abort
  7627. * 5: tid delete
  7628. * 6: sw abort
  7629. * 7: dropped by peer migration
  7630. */
  7631. status:3, /* [2:0] */
  7632. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  7633. tx_mpdu_bytes:16, /* [19:4] */
  7634. /* Indicates retry count of offloaded/local generated Data tx frames */
  7635. tx_retry_cnt:6, /* [25:20] */
  7636. reserved_4:6; /* [31:26] */
  7637. } POSTPACK;
  7638. /* FW offload deliver ind message header fields */
  7639. /* DWORD one */
  7640. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  7641. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  7642. /* DWORD two */
  7643. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  7644. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  7645. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  7646. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  7647. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  7648. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  7649. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  7650. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  7651. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  7652. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  7653. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  7654. #define HTT_FW_OFFLOAD_IND_BW_S 19
  7655. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  7656. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  7657. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  7658. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  7659. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  7660. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  7661. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  7662. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  7663. /* DWORD three*/
  7664. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  7665. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  7666. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  7667. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  7668. /* DWORD four */
  7669. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  7670. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  7671. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  7672. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  7673. /* DWORD five */
  7674. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  7675. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  7676. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  7677. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  7678. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  7679. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  7680. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  7681. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  7682. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  7683. do { \
  7684. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  7685. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  7686. } while (0)
  7687. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  7688. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  7689. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  7690. do { \
  7691. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  7692. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  7693. } while (0)
  7694. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  7695. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  7696. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  7697. do { \
  7698. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  7699. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  7700. } while (0)
  7701. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  7702. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  7703. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  7704. do { \
  7705. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  7706. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  7707. } while (0)
  7708. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  7709. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  7710. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  7711. do { \
  7712. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  7713. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  7714. } while (0)
  7715. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  7716. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  7717. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  7718. do { \
  7719. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  7720. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  7721. } while (0)
  7722. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  7723. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  7724. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  7725. do { \
  7726. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  7727. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  7728. } while (0)
  7729. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  7730. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  7731. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  7732. do { \
  7733. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  7734. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  7735. } while (0)
  7736. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  7737. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  7738. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  7739. do { \
  7740. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  7741. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  7742. } while (0)
  7743. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  7744. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  7745. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  7746. do { \
  7747. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  7748. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  7749. } while (0)
  7750. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  7751. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  7752. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  7753. do { \
  7754. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  7755. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  7756. } while (0)
  7757. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  7758. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  7759. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  7760. do { \
  7761. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  7762. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  7763. } while (0)
  7764. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  7765. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  7766. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  7767. do { \
  7768. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  7769. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  7770. } while (0)
  7771. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  7772. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  7773. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  7774. do { \
  7775. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  7776. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  7777. } while (0)
  7778. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  7779. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  7780. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  7781. do { \
  7782. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  7783. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  7784. } while (0)
  7785. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  7786. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  7787. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  7788. do { \
  7789. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  7790. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  7791. } while (0)
  7792. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  7793. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  7794. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  7795. do { \
  7796. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  7797. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  7798. } while (0)
  7799. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  7800. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  7801. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  7802. do { \
  7803. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  7804. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  7805. } while (0)
  7806. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  7807. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  7808. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  7809. do { \
  7810. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  7811. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  7812. } while (0)
  7813. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  7814. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  7815. /*
  7816. * @brief target -> host rx reorder flush message definition
  7817. *
  7818. * @details
  7819. * The following field definitions describe the format of the rx flush
  7820. * message sent from the target to the host.
  7821. * The message consists of a 4-octet header, followed by one or more
  7822. * 4-octet payload information elements.
  7823. *
  7824. * |31 24|23 8|7 0|
  7825. * |--------------------------------------------------------------|
  7826. * | TID | peer ID | msg type |
  7827. * |--------------------------------------------------------------|
  7828. * | seq num end | seq num start | MPDU status | reserved |
  7829. * |--------------------------------------------------------------|
  7830. * First DWORD:
  7831. * - MSG_TYPE
  7832. * Bits 7:0
  7833. * Purpose: identifies this as an rx flush message
  7834. * Value: 0x2
  7835. * - PEER_ID
  7836. * Bits 23:8 (only bits 18:8 actually used)
  7837. * Purpose: identify which peer's rx data is being flushed
  7838. * Value: (rx) peer ID
  7839. * - TID
  7840. * Bits 31:24 (only bits 27:24 actually used)
  7841. * Purpose: Specifies which traffic identifier's rx data is being flushed
  7842. * Value: traffic identifier
  7843. * Second DWORD:
  7844. * - MPDU_STATUS
  7845. * Bits 15:8
  7846. * Purpose:
  7847. * Indicate whether the flushed MPDUs should be discarded or processed.
  7848. * Value:
  7849. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  7850. * stages of rx processing
  7851. * other: discard the MPDUs
  7852. * It is anticipated that flush messages will always have
  7853. * MPDU status == 1, but the status flag is included for
  7854. * flexibility.
  7855. * - SEQ_NUM_START
  7856. * Bits 23:16
  7857. * Purpose:
  7858. * Indicate the start of a series of consecutive MPDUs being flushed.
  7859. * Not all MPDUs within this range are necessarily valid - the host
  7860. * must check each sequence number within this range to see if the
  7861. * corresponding MPDU is actually present.
  7862. * Value:
  7863. * The sequence number for the first MPDU in the sequence.
  7864. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7865. * - SEQ_NUM_END
  7866. * Bits 30:24
  7867. * Purpose:
  7868. * Indicate the end of a series of consecutive MPDUs being flushed.
  7869. * Value:
  7870. * The sequence number one larger than the sequence number of the
  7871. * last MPDU being flushed.
  7872. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7873. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  7874. * are to be released for further rx processing.
  7875. * Not all MPDUs within this range are necessarily valid - the host
  7876. * must check each sequence number within this range to see if the
  7877. * corresponding MPDU is actually present.
  7878. */
  7879. /* first DWORD */
  7880. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  7881. #define HTT_RX_FLUSH_PEER_ID_S 8
  7882. #define HTT_RX_FLUSH_TID_M 0xff000000
  7883. #define HTT_RX_FLUSH_TID_S 24
  7884. /* second DWORD */
  7885. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  7886. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  7887. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  7888. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  7889. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  7890. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  7891. #define HTT_RX_FLUSH_BYTES 8
  7892. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  7893. do { \
  7894. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  7895. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  7896. } while (0)
  7897. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  7898. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  7899. #define HTT_RX_FLUSH_TID_SET(word, value) \
  7900. do { \
  7901. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  7902. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  7903. } while (0)
  7904. #define HTT_RX_FLUSH_TID_GET(word) \
  7905. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  7906. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  7907. do { \
  7908. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  7909. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  7910. } while (0)
  7911. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  7912. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  7913. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  7914. do { \
  7915. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  7916. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  7917. } while (0)
  7918. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  7919. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  7920. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  7921. do { \
  7922. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  7923. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  7924. } while (0)
  7925. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  7926. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  7927. /*
  7928. * @brief target -> host rx pn check indication message
  7929. *
  7930. * @details
  7931. * The following field definitions describe the format of the Rx PN check
  7932. * indication message sent from the target to the host.
  7933. * The message consists of a 4-octet header, followed by the start and
  7934. * end sequence numbers to be released, followed by the PN IEs. Each PN
  7935. * IE is one octet containing the sequence number that failed the PN
  7936. * check.
  7937. *
  7938. * |31 24|23 8|7 0|
  7939. * |--------------------------------------------------------------|
  7940. * | TID | peer ID | msg type |
  7941. * |--------------------------------------------------------------|
  7942. * | Reserved | PN IE count | seq num end | seq num start|
  7943. * |--------------------------------------------------------------|
  7944. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  7945. * |--------------------------------------------------------------|
  7946. * First DWORD:
  7947. * - MSG_TYPE
  7948. * Bits 7:0
  7949. * Purpose: Identifies this as an rx pn check indication message
  7950. * Value: 0x2
  7951. * - PEER_ID
  7952. * Bits 23:8 (only bits 18:8 actually used)
  7953. * Purpose: identify which peer
  7954. * Value: (rx) peer ID
  7955. * - TID
  7956. * Bits 31:24 (only bits 27:24 actually used)
  7957. * Purpose: identify traffic identifier
  7958. * Value: traffic identifier
  7959. * Second DWORD:
  7960. * - SEQ_NUM_START
  7961. * Bits 7:0
  7962. * Purpose:
  7963. * Indicates the starting sequence number of the MPDU in this
  7964. * series of MPDUs that went though PN check.
  7965. * Value:
  7966. * The sequence number for the first MPDU in the sequence.
  7967. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7968. * - SEQ_NUM_END
  7969. * Bits 15:8
  7970. * Purpose:
  7971. * Indicates the ending sequence number of the MPDU in this
  7972. * series of MPDUs that went though PN check.
  7973. * Value:
  7974. * The sequence number one larger then the sequence number of the last
  7975. * MPDU being flushed.
  7976. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7977. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  7978. * for invalid PN numbers and are ready to be released for further processing.
  7979. * Not all MPDUs within this range are necessarily valid - the host
  7980. * must check each sequence number within this range to see if the
  7981. * corresponding MPDU is actually present.
  7982. * - PN_IE_COUNT
  7983. * Bits 23:16
  7984. * Purpose:
  7985. * Used to determine the variable number of PN information elements in this
  7986. * message
  7987. *
  7988. * PN information elements:
  7989. * - PN_IE_x-
  7990. * Purpose:
  7991. * Each PN information element contains the sequence number of the MPDU that
  7992. * has failed the target PN check.
  7993. * Value:
  7994. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  7995. * that failed the PN check.
  7996. */
  7997. /* first DWORD */
  7998. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  7999. #define HTT_RX_PN_IND_PEER_ID_S 8
  8000. #define HTT_RX_PN_IND_TID_M 0xff000000
  8001. #define HTT_RX_PN_IND_TID_S 24
  8002. /* second DWORD */
  8003. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  8004. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  8005. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  8006. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  8007. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  8008. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  8009. #define HTT_RX_PN_IND_BYTES 8
  8010. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  8011. do { \
  8012. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  8013. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  8014. } while (0)
  8015. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  8016. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  8017. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  8018. do { \
  8019. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  8020. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  8021. } while (0)
  8022. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  8023. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  8024. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  8025. do { \
  8026. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  8027. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  8028. } while (0)
  8029. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  8030. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  8031. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  8032. do { \
  8033. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  8034. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  8035. } while (0)
  8036. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  8037. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  8038. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  8039. do { \
  8040. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  8041. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  8042. } while (0)
  8043. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  8044. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  8045. /*
  8046. * @brief target -> host rx offload deliver message for LL system
  8047. *
  8048. * @details
  8049. * In a low latency system this message is sent whenever the offload
  8050. * manager flushes out the packets it has coalesced in its coalescing buffer.
  8051. * The DMA of the actual packets into host memory is done before sending out
  8052. * this message. This message indicates only how many MSDUs to reap. The
  8053. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  8054. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  8055. * DMA'd by the MAC directly into host memory these packets do not contain
  8056. * the MAC descriptors in the header portion of the packet. Instead they contain
  8057. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  8058. * message, the packets are delivered directly to the NW stack without going
  8059. * through the regular reorder buffering and PN checking path since it has
  8060. * already been done in target.
  8061. *
  8062. * |31 24|23 16|15 8|7 0|
  8063. * |-----------------------------------------------------------------------|
  8064. * | Total MSDU count | reserved | msg type |
  8065. * |-----------------------------------------------------------------------|
  8066. *
  8067. * @brief target -> host rx offload deliver message for HL system
  8068. *
  8069. * @details
  8070. * In a high latency system this message is sent whenever the offload manager
  8071. * flushes out the packets it has coalesced in its coalescing buffer. The
  8072. * actual packets are also carried along with this message. When the host
  8073. * receives this message, it is expected to deliver these packets to the NW
  8074. * stack directly instead of routing them through the reorder buffering and
  8075. * PN checking path since it has already been done in target.
  8076. *
  8077. * |31 24|23 16|15 8|7 0|
  8078. * |-----------------------------------------------------------------------|
  8079. * | Total MSDU count | reserved | msg type |
  8080. * |-----------------------------------------------------------------------|
  8081. * | peer ID | MSDU length |
  8082. * |-----------------------------------------------------------------------|
  8083. * | MSDU payload | FW Desc | tid | vdev ID |
  8084. * |-----------------------------------------------------------------------|
  8085. * | MSDU payload contd. |
  8086. * |-----------------------------------------------------------------------|
  8087. * | peer ID | MSDU length |
  8088. * |-----------------------------------------------------------------------|
  8089. * | MSDU payload | FW Desc | tid | vdev ID |
  8090. * |-----------------------------------------------------------------------|
  8091. * | MSDU payload contd. |
  8092. * |-----------------------------------------------------------------------|
  8093. *
  8094. */
  8095. /* first DWORD */
  8096. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  8097. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  8098. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  8099. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  8100. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  8101. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  8102. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  8103. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  8104. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  8105. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  8106. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  8107. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  8108. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  8109. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  8110. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  8111. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  8112. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  8113. do { \
  8114. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  8115. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  8116. } while (0)
  8117. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  8118. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  8119. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  8120. do { \
  8121. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  8122. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  8123. } while (0)
  8124. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  8125. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  8126. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  8127. do { \
  8128. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  8129. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  8130. } while (0)
  8131. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  8132. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  8133. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  8134. do { \
  8135. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  8136. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  8137. } while (0)
  8138. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  8139. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  8140. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  8141. do { \
  8142. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  8143. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  8144. } while (0)
  8145. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  8146. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  8147. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  8148. do { \
  8149. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  8150. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  8151. } while (0)
  8152. /**
  8153. * @brief target -> host rx peer map/unmap message definition
  8154. *
  8155. * @details
  8156. * The following diagram shows the format of the rx peer map message sent
  8157. * from the target to the host. This layout assumes the target operates
  8158. * as little-endian.
  8159. *
  8160. * This message always contains a SW peer ID. The main purpose of the
  8161. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8162. * with, so that the host can use that peer ID to determine which peer
  8163. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8164. * other purposes, such as identifying during tx completions which peer
  8165. * the tx frames in question were transmitted to.
  8166. *
  8167. * In certain generations of chips, the peer map message also contains
  8168. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  8169. * to identify which peer the frame needs to be forwarded to (i.e. the
  8170. * peer assocated with the Destination MAC Address within the packet),
  8171. * and particularly which vdev needs to transmit the frame (for cases
  8172. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  8173. * meaning as AST_INDEX_0.
  8174. * This DA-based peer ID that is provided for certain rx frames
  8175. * (the rx frames that need to be re-transmitted as tx frames)
  8176. * is the ID that the HW uses for referring to the peer in question,
  8177. * rather than the peer ID that the SW+FW use to refer to the peer.
  8178. *
  8179. *
  8180. * |31 24|23 16|15 8|7 0|
  8181. * |-----------------------------------------------------------------------|
  8182. * | SW peer ID | VDEV ID | msg type |
  8183. * |-----------------------------------------------------------------------|
  8184. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8185. * |-----------------------------------------------------------------------|
  8186. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8187. * |-----------------------------------------------------------------------|
  8188. *
  8189. *
  8190. * The following diagram shows the format of the rx peer unmap message sent
  8191. * from the target to the host.
  8192. *
  8193. * |31 24|23 16|15 8|7 0|
  8194. * |-----------------------------------------------------------------------|
  8195. * | SW peer ID | VDEV ID | msg type |
  8196. * |-----------------------------------------------------------------------|
  8197. *
  8198. * The following field definitions describe the format of the rx peer map
  8199. * and peer unmap messages sent from the target to the host.
  8200. * - MSG_TYPE
  8201. * Bits 7:0
  8202. * Purpose: identifies this as an rx peer map or peer unmap message
  8203. * Value: peer map -> 0x3, peer unmap -> 0x4
  8204. * - VDEV_ID
  8205. * Bits 15:8
  8206. * Purpose: Indicates which virtual device the peer is associated
  8207. * with.
  8208. * Value: vdev ID (used in the host to look up the vdev object)
  8209. * - PEER_ID (a.k.a. SW_PEER_ID)
  8210. * Bits 31:16
  8211. * Purpose: The peer ID (index) that WAL is allocating (map) or
  8212. * freeing (unmap)
  8213. * Value: (rx) peer ID
  8214. * - MAC_ADDR_L32 (peer map only)
  8215. * Bits 31:0
  8216. * Purpose: Identifies which peer node the peer ID is for.
  8217. * Value: lower 4 bytes of peer node's MAC address
  8218. * - MAC_ADDR_U16 (peer map only)
  8219. * Bits 15:0
  8220. * Purpose: Identifies which peer node the peer ID is for.
  8221. * Value: upper 2 bytes of peer node's MAC address
  8222. * - HW_PEER_ID
  8223. * Bits 31:16
  8224. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8225. * address, so for rx frames marked for rx --> tx forwarding, the
  8226. * host can determine from the HW peer ID provided as meta-data with
  8227. * the rx frame which peer the frame is supposed to be forwarded to.
  8228. * Value: ID used by the MAC HW to identify the peer
  8229. */
  8230. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  8231. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  8232. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  8233. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  8234. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  8235. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  8236. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  8237. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  8238. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  8239. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  8240. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  8241. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  8242. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  8243. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  8244. do { \
  8245. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  8246. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  8247. } while (0)
  8248. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  8249. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  8250. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  8251. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  8252. do { \
  8253. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  8254. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  8255. } while (0)
  8256. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  8257. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  8258. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  8259. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  8260. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  8261. do { \
  8262. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  8263. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  8264. } while (0)
  8265. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  8266. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  8267. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  8268. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  8269. #define HTT_RX_PEER_MAP_BYTES 12
  8270. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  8271. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  8272. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  8273. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  8274. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  8275. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  8276. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  8277. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  8278. #define HTT_RX_PEER_UNMAP_BYTES 4
  8279. /**
  8280. * @brief target -> host rx peer map V2 message definition
  8281. *
  8282. * @details
  8283. * The following diagram shows the format of the rx peer map v2 message sent
  8284. * from the target to the host. This layout assumes the target operates
  8285. * as little-endian.
  8286. *
  8287. * This message always contains a SW peer ID. The main purpose of the
  8288. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8289. * with, so that the host can use that peer ID to determine which peer
  8290. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8291. * other purposes, such as identifying during tx completions which peer
  8292. * the tx frames in question were transmitted to.
  8293. *
  8294. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  8295. * is used during rx --> tx frame forwarding to identify which peer the
  8296. * frame needs to be forwarded to (i.e. the peer assocated with the
  8297. * Destination MAC Address within the packet), and particularly which vdev
  8298. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  8299. * This DA-based peer ID that is provided for certain rx frames
  8300. * (the rx frames that need to be re-transmitted as tx frames)
  8301. * is the ID that the HW uses for referring to the peer in question,
  8302. * rather than the peer ID that the SW+FW use to refer to the peer.
  8303. *
  8304. * The HW peer id here is the same meaning as AST_INDEX_0.
  8305. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  8306. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  8307. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  8308. * AST is valid.
  8309. *
  8310. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  8311. * |-------------------------------------------------------------------------|
  8312. * | SW peer ID | VDEV ID | msg type |
  8313. * |-------------------------------------------------------------------------|
  8314. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8315. * |-------------------------------------------------------------------------|
  8316. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8317. * |-------------------------------------------------------------------------|
  8318. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  8319. * |-------------------------------------------------------------------------|
  8320. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  8321. * |-------------------------------------------------------------------------|
  8322. * |TID valid low pri| TID valid hi pri | AST index 2 |
  8323. * |-------------------------------------------------------------------------|
  8324. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  8325. * |-------------------------------------------------------------------------|
  8326. * | Reserved_2 |
  8327. * |-------------------------------------------------------------------------|
  8328. * Where:
  8329. * NH = Next Hop
  8330. * ASTVM = AST valid mask
  8331. * OA = on-chip AST valid bit
  8332. * ASTFM = AST flow mask
  8333. *
  8334. * The following field definitions describe the format of the rx peer map v2
  8335. * messages sent from the target to the host.
  8336. * - MSG_TYPE
  8337. * Bits 7:0
  8338. * Purpose: identifies this as an rx peer map v2 message
  8339. * Value: peer map v2 -> 0x1e
  8340. * - VDEV_ID
  8341. * Bits 15:8
  8342. * Purpose: Indicates which virtual device the peer is associated with.
  8343. * Value: vdev ID (used in the host to look up the vdev object)
  8344. * - SW_PEER_ID
  8345. * Bits 31:16
  8346. * Purpose: The peer ID (index) that WAL is allocating
  8347. * Value: (rx) peer ID
  8348. * - MAC_ADDR_L32
  8349. * Bits 31:0
  8350. * Purpose: Identifies which peer node the peer ID is for.
  8351. * Value: lower 4 bytes of peer node's MAC address
  8352. * - MAC_ADDR_U16
  8353. * Bits 15:0
  8354. * Purpose: Identifies which peer node the peer ID is for.
  8355. * Value: upper 2 bytes of peer node's MAC address
  8356. * - HW_PEER_ID / AST_INDEX_0
  8357. * Bits 31:16
  8358. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8359. * address, so for rx frames marked for rx --> tx forwarding, the
  8360. * host can determine from the HW peer ID provided as meta-data with
  8361. * the rx frame which peer the frame is supposed to be forwarded to.
  8362. * Value: ID used by the MAC HW to identify the peer
  8363. * - AST_HASH_VALUE
  8364. * Bits 15:0
  8365. * Purpose: Indicates AST Hash value is required for the TCL AST index
  8366. * override feature.
  8367. * - NEXT_HOP
  8368. * Bit 16
  8369. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  8370. * (Wireless Distribution System).
  8371. * - AST_VALID_MASK
  8372. * Bits 19:17
  8373. * Purpose: Indicate if the AST 1 through AST 3 are valid
  8374. * - ONCHIP_AST_VALID_FLAG
  8375. * Bit 20
  8376. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  8377. * is valid.
  8378. * - AST_INDEX_1
  8379. * Bits 15:0
  8380. * Purpose: indicate the second AST index for this peer
  8381. * - AST_0_FLOW_MASK
  8382. * Bits 19:16
  8383. * Purpose: identify the which flow the AST 0 entry corresponds to.
  8384. * - AST_1_FLOW_MASK
  8385. * Bits 23:20
  8386. * Purpose: identify the which flow the AST 1 entry corresponds to.
  8387. * - AST_2_FLOW_MASK
  8388. * Bits 27:24
  8389. * Purpose: identify the which flow the AST 2 entry corresponds to.
  8390. * - AST_3_FLOW_MASK
  8391. * Bits 31:28
  8392. * Purpose: identify the which flow the AST 3 entry corresponds to.
  8393. * - AST_INDEX_2
  8394. * Bits 15:0
  8395. * Purpose: indicate the third AST index for this peer
  8396. * - TID_VALID_HI_PRI
  8397. * Bits 23:16
  8398. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  8399. * - TID_VALID_LOW_PRI
  8400. * Bits 31:24
  8401. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  8402. * - AST_INDEX_3
  8403. * Bits 15:0
  8404. * Purpose: indicate the fourth AST index for this peer
  8405. * - ONCHIP_AST_IDX / RESERVED
  8406. * Bits 31:16
  8407. * Purpose: This field is valid only when split AST feature is enabled.
  8408. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  8409. * If valid, identifies the HW peer ID corresponding to the peer MAC
  8410. * address, this ast_idx is used for LMAC modules for RXPCU.
  8411. * Value: ID used by the LMAC HW to identify the peer
  8412. */
  8413. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  8414. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  8415. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  8416. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  8417. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  8418. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  8419. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  8420. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  8421. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  8422. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  8423. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  8424. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  8425. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  8426. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  8427. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  8428. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  8429. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  8430. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  8431. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  8432. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  8433. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  8434. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  8435. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  8436. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  8437. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  8438. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  8439. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  8440. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  8441. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  8442. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  8443. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  8444. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  8445. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  8446. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  8447. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  8448. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  8449. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  8450. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  8451. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  8452. do { \
  8453. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  8454. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  8455. } while (0)
  8456. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  8457. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  8458. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  8459. do { \
  8460. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  8461. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  8462. } while (0)
  8463. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  8464. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  8465. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  8466. do { \
  8467. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  8468. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  8469. } while (0)
  8470. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  8471. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  8472. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  8473. do { \
  8474. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  8475. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  8476. } while (0)
  8477. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  8478. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  8479. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  8480. do { \
  8481. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  8482. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  8483. } while (0)
  8484. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  8485. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  8486. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  8487. do { \
  8488. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  8489. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  8490. } while (0)
  8491. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  8492. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  8493. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  8494. do { \
  8495. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  8496. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  8497. } while (0)
  8498. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  8499. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  8500. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  8501. do { \
  8502. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  8503. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  8504. } while (0)
  8505. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  8506. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  8507. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  8508. do { \
  8509. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  8510. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  8511. } while (0)
  8512. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  8513. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  8514. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  8515. do { \
  8516. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  8517. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  8518. } while (0)
  8519. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  8520. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  8521. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  8522. do { \
  8523. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  8524. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  8525. } while (0)
  8526. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  8527. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  8528. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  8529. do { \
  8530. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  8531. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  8532. } while (0)
  8533. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  8534. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  8535. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  8536. do { \
  8537. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  8538. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  8539. } while (0)
  8540. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  8541. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  8542. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  8543. do { \
  8544. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  8545. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  8546. } while (0)
  8547. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  8548. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  8549. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  8550. do { \
  8551. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  8552. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  8553. } while (0)
  8554. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  8555. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  8556. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  8557. do { \
  8558. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  8559. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  8560. } while (0)
  8561. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  8562. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  8563. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  8564. do { \
  8565. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  8566. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  8567. } while (0)
  8568. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  8569. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  8570. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8571. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  8572. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  8573. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  8574. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  8575. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  8576. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  8577. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  8578. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  8579. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  8580. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  8581. #define HTT_RX_PEER_MAP_V2_BYTES 32
  8582. /**
  8583. * @brief target -> host rx peer unmap V2 message definition
  8584. *
  8585. *
  8586. * The following diagram shows the format of the rx peer unmap message sent
  8587. * from the target to the host.
  8588. *
  8589. * |31 24|23 16|15 8|7 0|
  8590. * |-----------------------------------------------------------------------|
  8591. * | SW peer ID | VDEV ID | msg type |
  8592. * |-----------------------------------------------------------------------|
  8593. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8594. * |-----------------------------------------------------------------------|
  8595. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  8596. * |-----------------------------------------------------------------------|
  8597. * | Peer Delete Duration |
  8598. * |-----------------------------------------------------------------------|
  8599. * | Reserved_0 | WDS Free Count |
  8600. * |-----------------------------------------------------------------------|
  8601. * | Reserved_1 |
  8602. * |-----------------------------------------------------------------------|
  8603. * | Reserved_2 |
  8604. * |-----------------------------------------------------------------------|
  8605. *
  8606. *
  8607. * The following field definitions describe the format of the rx peer unmap
  8608. * messages sent from the target to the host.
  8609. * - MSG_TYPE
  8610. * Bits 7:0
  8611. * Purpose: identifies this as an rx peer unmap v2 message
  8612. * Value: peer unmap v2 -> 0x1f
  8613. * - VDEV_ID
  8614. * Bits 15:8
  8615. * Purpose: Indicates which virtual device the peer is associated
  8616. * with.
  8617. * Value: vdev ID (used in the host to look up the vdev object)
  8618. * - SW_PEER_ID
  8619. * Bits 31:16
  8620. * Purpose: The peer ID (index) that WAL is freeing
  8621. * Value: (rx) peer ID
  8622. * - MAC_ADDR_L32
  8623. * Bits 31:0
  8624. * Purpose: Identifies which peer node the peer ID is for.
  8625. * Value: lower 4 bytes of peer node's MAC address
  8626. * - MAC_ADDR_U16
  8627. * Bits 15:0
  8628. * Purpose: Identifies which peer node the peer ID is for.
  8629. * Value: upper 2 bytes of peer node's MAC address
  8630. * - NEXT_HOP
  8631. * Bits 16
  8632. * Purpose: Bit indicates next_hop AST entry used for WDS
  8633. * (Wireless Distribution System).
  8634. * - PEER_DELETE_DURATION
  8635. * Bits 31:0
  8636. * Purpose: Time taken to delete peer, in msec,
  8637. * Used for monitoring / debugging PEER delete response delay
  8638. * - PEER_WDS_FREE_COUNT
  8639. * Bits 15:0
  8640. * Purpose: Count of WDS entries deleted associated to peer deleted
  8641. */
  8642. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  8643. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  8644. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  8645. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  8646. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  8647. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  8648. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  8649. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  8650. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  8651. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  8652. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  8653. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  8654. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  8655. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  8656. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  8657. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  8658. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  8659. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  8660. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  8661. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  8662. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  8663. do { \
  8664. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  8665. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  8666. } while (0)
  8667. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  8668. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  8669. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  8670. do { \
  8671. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  8672. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  8673. } while (0)
  8674. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  8675. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  8676. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8677. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  8678. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  8679. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  8680. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  8681. /**
  8682. * @brief target -> host message specifying security parameters
  8683. *
  8684. * @details
  8685. * The following diagram shows the format of the security specification
  8686. * message sent from the target to the host.
  8687. * This security specification message tells the host whether a PN check is
  8688. * necessary on rx data frames, and if so, how large the PN counter is.
  8689. * This message also tells the host about the security processing to apply
  8690. * to defragmented rx frames - specifically, whether a Message Integrity
  8691. * Check is required, and the Michael key to use.
  8692. *
  8693. * |31 24|23 16|15|14 8|7 0|
  8694. * |-----------------------------------------------------------------------|
  8695. * | peer ID | U| security type | msg type |
  8696. * |-----------------------------------------------------------------------|
  8697. * | Michael Key K0 |
  8698. * |-----------------------------------------------------------------------|
  8699. * | Michael Key K1 |
  8700. * |-----------------------------------------------------------------------|
  8701. * | WAPI RSC Low0 |
  8702. * |-----------------------------------------------------------------------|
  8703. * | WAPI RSC Low1 |
  8704. * |-----------------------------------------------------------------------|
  8705. * | WAPI RSC Hi0 |
  8706. * |-----------------------------------------------------------------------|
  8707. * | WAPI RSC Hi1 |
  8708. * |-----------------------------------------------------------------------|
  8709. *
  8710. * The following field definitions describe the format of the security
  8711. * indication message sent from the target to the host.
  8712. * - MSG_TYPE
  8713. * Bits 7:0
  8714. * Purpose: identifies this as a security specification message
  8715. * Value: 0xb
  8716. * - SEC_TYPE
  8717. * Bits 14:8
  8718. * Purpose: specifies which type of security applies to the peer
  8719. * Value: htt_sec_type enum value
  8720. * - UNICAST
  8721. * Bit 15
  8722. * Purpose: whether this security is applied to unicast or multicast data
  8723. * Value: 1 -> unicast, 0 -> multicast
  8724. * - PEER_ID
  8725. * Bits 31:16
  8726. * Purpose: The ID number for the peer the security specification is for
  8727. * Value: peer ID
  8728. * - MICHAEL_KEY_K0
  8729. * Bits 31:0
  8730. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  8731. * Value: Michael Key K0 (if security type is TKIP)
  8732. * - MICHAEL_KEY_K1
  8733. * Bits 31:0
  8734. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  8735. * Value: Michael Key K1 (if security type is TKIP)
  8736. * - WAPI_RSC_LOW0
  8737. * Bits 31:0
  8738. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  8739. * Value: WAPI RSC Low0 (if security type is WAPI)
  8740. * - WAPI_RSC_LOW1
  8741. * Bits 31:0
  8742. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  8743. * Value: WAPI RSC Low1 (if security type is WAPI)
  8744. * - WAPI_RSC_HI0
  8745. * Bits 31:0
  8746. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  8747. * Value: WAPI RSC Hi0 (if security type is WAPI)
  8748. * - WAPI_RSC_HI1
  8749. * Bits 31:0
  8750. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  8751. * Value: WAPI RSC Hi1 (if security type is WAPI)
  8752. */
  8753. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  8754. #define HTT_SEC_IND_SEC_TYPE_S 8
  8755. #define HTT_SEC_IND_UNICAST_M 0x00008000
  8756. #define HTT_SEC_IND_UNICAST_S 15
  8757. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  8758. #define HTT_SEC_IND_PEER_ID_S 16
  8759. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  8760. do { \
  8761. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  8762. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  8763. } while (0)
  8764. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  8765. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  8766. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  8767. do { \
  8768. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  8769. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  8770. } while (0)
  8771. #define HTT_SEC_IND_UNICAST_GET(word) \
  8772. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  8773. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  8774. do { \
  8775. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  8776. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  8777. } while (0)
  8778. #define HTT_SEC_IND_PEER_ID_GET(word) \
  8779. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  8780. #define HTT_SEC_IND_BYTES 28
  8781. /**
  8782. * @brief target -> host rx ADDBA / DELBA message definitions
  8783. *
  8784. * @details
  8785. * The following diagram shows the format of the rx ADDBA message sent
  8786. * from the target to the host:
  8787. *
  8788. * |31 20|19 16|15 8|7 0|
  8789. * |---------------------------------------------------------------------|
  8790. * | peer ID | TID | window size | msg type |
  8791. * |---------------------------------------------------------------------|
  8792. *
  8793. * The following diagram shows the format of the rx DELBA message sent
  8794. * from the target to the host:
  8795. *
  8796. * |31 20|19 16|15 10|9 8|7 0|
  8797. * |---------------------------------------------------------------------|
  8798. * | peer ID | TID | window size | IR| msg type |
  8799. * |---------------------------------------------------------------------|
  8800. *
  8801. * The following field definitions describe the format of the rx ADDBA
  8802. * and DELBA messages sent from the target to the host.
  8803. * - MSG_TYPE
  8804. * Bits 7:0
  8805. * Purpose: identifies this as an rx ADDBA or DELBA message
  8806. * Value: ADDBA -> 0x5, DELBA -> 0x6
  8807. * - IR (initiator / recipient)
  8808. * Bits 9:8 (DELBA only)
  8809. * Purpose: specify whether the DELBA handshake was initiated by the
  8810. * local STA/AP, or by the peer STA/AP
  8811. * Value:
  8812. * 0 - unspecified
  8813. * 1 - initiator (a.k.a. originator)
  8814. * 2 - recipient (a.k.a. responder)
  8815. * 3 - unused / reserved
  8816. * - WIN_SIZE
  8817. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  8818. * Purpose: Specifies the length of the block ack window (max = 64).
  8819. * Value:
  8820. * block ack window length specified by the received ADDBA/DELBA
  8821. * management message.
  8822. * - TID
  8823. * Bits 19:16
  8824. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  8825. * Value:
  8826. * TID specified by the received ADDBA or DELBA management message.
  8827. * - PEER_ID
  8828. * Bits 31:20
  8829. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  8830. * Value:
  8831. * ID (hash value) used by the host for fast, direct lookup of
  8832. * host SW peer info, including rx reorder states.
  8833. */
  8834. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  8835. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  8836. #define HTT_RX_ADDBA_TID_M 0xf0000
  8837. #define HTT_RX_ADDBA_TID_S 16
  8838. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  8839. #define HTT_RX_ADDBA_PEER_ID_S 20
  8840. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  8841. do { \
  8842. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  8843. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  8844. } while (0)
  8845. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  8846. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  8847. #define HTT_RX_ADDBA_TID_SET(word, value) \
  8848. do { \
  8849. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  8850. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  8851. } while (0)
  8852. #define HTT_RX_ADDBA_TID_GET(word) \
  8853. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  8854. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  8855. do { \
  8856. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  8857. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  8858. } while (0)
  8859. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  8860. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  8861. #define HTT_RX_ADDBA_BYTES 4
  8862. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  8863. #define HTT_RX_DELBA_INITIATOR_S 8
  8864. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  8865. #define HTT_RX_DELBA_WIN_SIZE_S 10
  8866. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  8867. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  8868. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  8869. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  8870. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  8871. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  8872. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  8873. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  8874. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  8875. do { \
  8876. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  8877. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  8878. } while (0)
  8879. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  8880. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  8881. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  8882. do { \
  8883. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  8884. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  8885. } while (0)
  8886. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  8887. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  8888. #define HTT_RX_DELBA_BYTES 4
  8889. /**
  8890. * @brief tx queue group information element definition
  8891. *
  8892. * @details
  8893. * The following diagram shows the format of the tx queue group
  8894. * information element, which can be included in target --> host
  8895. * messages to specify the number of tx "credits" (tx descriptors
  8896. * for LL, or tx buffers for HL) available to a particular group
  8897. * of host-side tx queues, and which host-side tx queues belong to
  8898. * the group.
  8899. *
  8900. * |31|30 24|23 16|15|14|13 0|
  8901. * |------------------------------------------------------------------------|
  8902. * | X| reserved | tx queue grp ID | A| S| credit count |
  8903. * |------------------------------------------------------------------------|
  8904. * | vdev ID mask | AC mask |
  8905. * |------------------------------------------------------------------------|
  8906. *
  8907. * The following definitions describe the fields within the tx queue group
  8908. * information element:
  8909. * - credit_count
  8910. * Bits 13:1
  8911. * Purpose: specify how many tx credits are available to the tx queue group
  8912. * Value: An absolute or relative, positive or negative credit value
  8913. * The 'A' bit specifies whether the value is absolute or relative.
  8914. * The 'S' bit specifies whether the value is positive or negative.
  8915. * A negative value can only be relative, not absolute.
  8916. * An absolute value replaces any prior credit value the host has for
  8917. * the tx queue group in question.
  8918. * A relative value is added to the prior credit value the host has for
  8919. * the tx queue group in question.
  8920. * - sign
  8921. * Bit 14
  8922. * Purpose: specify whether the credit count is positive or negative
  8923. * Value: 0 -> positive, 1 -> negative
  8924. * - absolute
  8925. * Bit 15
  8926. * Purpose: specify whether the credit count is absolute or relative
  8927. * Value: 0 -> relative, 1 -> absolute
  8928. * - txq_group_id
  8929. * Bits 23:16
  8930. * Purpose: indicate which tx queue group's credit and/or membership are
  8931. * being specified
  8932. * Value: 0 to max_tx_queue_groups-1
  8933. * - reserved
  8934. * Bits 30:16
  8935. * Value: 0x0
  8936. * - eXtension
  8937. * Bit 31
  8938. * Purpose: specify whether another tx queue group info element follows
  8939. * Value: 0 -> no more tx queue group information elements
  8940. * 1 -> another tx queue group information element immediately follows
  8941. * - ac_mask
  8942. * Bits 15:0
  8943. * Purpose: specify which Access Categories belong to the tx queue group
  8944. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  8945. * the tx queue group.
  8946. * The AC bit-mask values are obtained by left-shifting by the
  8947. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  8948. * - vdev_id_mask
  8949. * Bits 31:16
  8950. * Purpose: specify which vdev's tx queues belong to the tx queue group
  8951. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  8952. * belong to the tx queue group.
  8953. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  8954. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  8955. */
  8956. PREPACK struct htt_txq_group {
  8957. A_UINT32
  8958. credit_count: 14,
  8959. sign: 1,
  8960. absolute: 1,
  8961. tx_queue_group_id: 8,
  8962. reserved0: 7,
  8963. extension: 1;
  8964. A_UINT32
  8965. ac_mask: 16,
  8966. vdev_id_mask: 16;
  8967. } POSTPACK;
  8968. /* first word */
  8969. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  8970. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  8971. #define HTT_TXQ_GROUP_SIGN_S 14
  8972. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  8973. #define HTT_TXQ_GROUP_ABS_S 15
  8974. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  8975. #define HTT_TXQ_GROUP_ID_S 16
  8976. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  8977. #define HTT_TXQ_GROUP_EXT_S 31
  8978. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  8979. /* second word */
  8980. #define HTT_TXQ_GROUP_AC_MASK_S 0
  8981. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  8982. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  8983. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  8984. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  8985. do { \
  8986. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  8987. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  8988. } while (0)
  8989. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  8990. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  8991. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  8992. do { \
  8993. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  8994. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  8995. } while (0)
  8996. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  8997. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  8998. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  8999. do { \
  9000. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  9001. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  9002. } while (0)
  9003. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  9004. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  9005. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  9006. do { \
  9007. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  9008. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  9009. } while (0)
  9010. #define HTT_TXQ_GROUP_ID_GET(_info) \
  9011. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  9012. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  9013. do { \
  9014. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  9015. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  9016. } while (0)
  9017. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  9018. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  9019. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  9020. do { \
  9021. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  9022. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  9023. } while (0)
  9024. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  9025. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  9026. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  9027. do { \
  9028. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  9029. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  9030. } while (0)
  9031. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  9032. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  9033. /**
  9034. * @brief target -> host TX completion indication message definition
  9035. *
  9036. * @details
  9037. * The following diagram shows the format of the TX completion indication sent
  9038. * from the target to the host
  9039. *
  9040. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  9041. * |-------------------------------------------------------------------|
  9042. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  9043. * |-------------------------------------------------------------------|
  9044. * payload:| MSDU1 ID | MSDU0 ID |
  9045. * |-------------------------------------------------------------------|
  9046. * : MSDU3 ID | MSDU2 ID :
  9047. * |-------------------------------------------------------------------|
  9048. * | struct htt_tx_compl_ind_append_retries |
  9049. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9050. * | struct htt_tx_compl_ind_append_tx_tstamp |
  9051. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9052. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  9053. * |-------------------------------------------------------------------|
  9054. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  9055. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9056. * | MSDU0 tx_tsf64_low |
  9057. * |-------------------------------------------------------------------|
  9058. * | MSDU0 tx_tsf64_high |
  9059. * |-------------------------------------------------------------------|
  9060. * | MSDU1 tx_tsf64_low |
  9061. * |-------------------------------------------------------------------|
  9062. * | MSDU1 tx_tsf64_high |
  9063. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9064. * | phy_timestamp |
  9065. * |-------------------------------------------------------------------|
  9066. * | rate specs (see below) |
  9067. * |-------------------------------------------------------------------|
  9068. * | seqctrl | framectrl |
  9069. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9070. * Where:
  9071. * A0 = append (a.k.a. append0)
  9072. * A1 = append1
  9073. * TP = MSDU tx power presence
  9074. * A2 = append2
  9075. * A3 = append3
  9076. * A4 = append4
  9077. *
  9078. * The following field definitions describe the format of the TX completion
  9079. * indication sent from the target to the host
  9080. * Header fields:
  9081. * - msg_type
  9082. * Bits 7:0
  9083. * Purpose: identifies this as HTT TX completion indication
  9084. * Value: 0x7
  9085. * - status
  9086. * Bits 10:8
  9087. * Purpose: the TX completion status of payload fragmentations descriptors
  9088. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  9089. * - tid
  9090. * Bits 14:11
  9091. * Purpose: the tid associated with those fragmentation descriptors. It is
  9092. * valid or not, depending on the tid_invalid bit.
  9093. * Value: 0 to 15
  9094. * - tid_invalid
  9095. * Bits 15:15
  9096. * Purpose: this bit indicates whether the tid field is valid or not
  9097. * Value: 0 indicates valid; 1 indicates invalid
  9098. * - num
  9099. * Bits 23:16
  9100. * Purpose: the number of payload in this indication
  9101. * Value: 1 to 255
  9102. * - append (a.k.a. append0)
  9103. * Bits 24:24
  9104. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  9105. * the number of tx retries for one MSDU at the end of this message
  9106. * Value: 0 indicates no appending; 1 indicates appending
  9107. * - append1
  9108. * Bits 25:25
  9109. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  9110. * contains the timestamp info for each TX msdu id in payload.
  9111. * The order of the timestamps matches the order of the MSDU IDs.
  9112. * Note that a big-endian host needs to account for the reordering
  9113. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9114. * conversion) when determining which tx timestamp corresponds to
  9115. * which MSDU ID.
  9116. * Value: 0 indicates no appending; 1 indicates appending
  9117. * - msdu_tx_power_presence
  9118. * Bits 26:26
  9119. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  9120. * for each MSDU referenced by the TX_COMPL_IND message.
  9121. * The tx power is reported in 0.5 dBm units.
  9122. * The order of the per-MSDU tx power reports matches the order
  9123. * of the MSDU IDs.
  9124. * Note that a big-endian host needs to account for the reordering
  9125. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9126. * conversion) when determining which Tx Power corresponds to
  9127. * which MSDU ID.
  9128. * Value: 0 indicates MSDU tx power reports are not appended,
  9129. * 1 indicates MSDU tx power reports are appended
  9130. * - append2
  9131. * Bits 27:27
  9132. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  9133. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  9134. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  9135. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  9136. * for each MSDU, for convenience.
  9137. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  9138. * this append2 bit is set).
  9139. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  9140. * dB above the noise floor.
  9141. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  9142. * 1 indicates MSDU ACK RSSI values are appended.
  9143. * - append3
  9144. * Bits 28:28
  9145. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  9146. * contains the tx tsf info based on wlan global TSF for
  9147. * each TX msdu id in payload.
  9148. * The order of the tx tsf matches the order of the MSDU IDs.
  9149. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  9150. * values to indicate the the lower 32 bits and higher 32 bits of
  9151. * the tx tsf.
  9152. * The tx_tsf64 here represents the time MSDU was acked and the
  9153. * tx_tsf64 has microseconds units.
  9154. * Value: 0 indicates no appending; 1 indicates appending
  9155. * - append4
  9156. * Bits 29:29
  9157. * Purpose: Indicate whether data frame control fields and fields required
  9158. * for radio tap header are appended for each MSDU in TX_COMP_IND
  9159. * message. The order of the this message matches the order of
  9160. * the MSDU IDs.
  9161. * Value: 0 indicates frame control fields and fields required for
  9162. * radio tap header values are not appended,
  9163. * 1 indicates frame control fields and fields required for
  9164. * radio tap header values are appended.
  9165. * Payload fields:
  9166. * - hmsdu_id
  9167. * Bits 15:0
  9168. * Purpose: this ID is used to track the Tx buffer in host
  9169. * Value: 0 to "size of host MSDU descriptor pool - 1"
  9170. */
  9171. PREPACK struct htt_tx_data_hdr_information {
  9172. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  9173. A_UINT32 /* word 1 */
  9174. /* preamble:
  9175. * 0-OFDM,
  9176. * 1-CCk,
  9177. * 2-HT,
  9178. * 3-VHT
  9179. */
  9180. preamble: 2, /* [1:0] */
  9181. /* mcs:
  9182. * In case of HT preamble interpret
  9183. * MCS along with NSS.
  9184. * Valid values for HT are 0 to 7.
  9185. * HT mcs 0 with NSS 2 is mcs 8.
  9186. * Valid values for VHT are 0 to 9.
  9187. */
  9188. mcs: 4, /* [5:2] */
  9189. /* rate:
  9190. * This is applicable only for
  9191. * CCK and OFDM preamble type
  9192. * rate 0: OFDM 48 Mbps,
  9193. * 1: OFDM 24 Mbps,
  9194. * 2: OFDM 12 Mbps
  9195. * 3: OFDM 6 Mbps
  9196. * 4: OFDM 54 Mbps
  9197. * 5: OFDM 36 Mbps
  9198. * 6: OFDM 18 Mbps
  9199. * 7: OFDM 9 Mbps
  9200. * rate 0: CCK 11 Mbps Long
  9201. * 1: CCK 5.5 Mbps Long
  9202. * 2: CCK 2 Mbps Long
  9203. * 3: CCK 1 Mbps Long
  9204. * 4: CCK 11 Mbps Short
  9205. * 5: CCK 5.5 Mbps Short
  9206. * 6: CCK 2 Mbps Short
  9207. */
  9208. rate : 3, /* [ 8: 6] */
  9209. rssi : 8, /* [16: 9] units=dBm */
  9210. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9211. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9212. stbc : 1, /* [22] */
  9213. sgi : 1, /* [23] */
  9214. ldpc : 1, /* [24] */
  9215. beamformed: 1, /* [25] */
  9216. /* tx_retry_cnt:
  9217. * Indicates retry count of data tx frames provided by the host.
  9218. */
  9219. tx_retry_cnt: 6; /* [31:26] */
  9220. A_UINT32 /* word 2 */
  9221. framectrl:16, /* [15: 0] */
  9222. seqno:16; /* [31:16] */
  9223. } POSTPACK;
  9224. #define HTT_TX_COMPL_IND_STATUS_S 8
  9225. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  9226. #define HTT_TX_COMPL_IND_TID_S 11
  9227. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  9228. #define HTT_TX_COMPL_IND_TID_INV_S 15
  9229. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  9230. #define HTT_TX_COMPL_IND_NUM_S 16
  9231. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  9232. #define HTT_TX_COMPL_IND_APPEND_S 24
  9233. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  9234. #define HTT_TX_COMPL_IND_APPEND1_S 25
  9235. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  9236. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  9237. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  9238. #define HTT_TX_COMPL_IND_APPEND2_S 27
  9239. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  9240. #define HTT_TX_COMPL_IND_APPEND3_S 28
  9241. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  9242. #define HTT_TX_COMPL_IND_APPEND4_S 29
  9243. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  9244. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  9245. do { \
  9246. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  9247. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  9248. } while (0)
  9249. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  9250. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  9251. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  9252. do { \
  9253. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  9254. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  9255. } while (0)
  9256. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  9257. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  9258. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  9259. do { \
  9260. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  9261. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  9262. } while (0)
  9263. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  9264. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  9265. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  9266. do { \
  9267. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  9268. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  9269. } while (0)
  9270. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  9271. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  9272. HTT_TX_COMPL_IND_TID_INV_S)
  9273. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  9274. do { \
  9275. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  9276. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  9277. } while (0)
  9278. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  9279. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  9280. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  9281. do { \
  9282. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  9283. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  9284. } while (0)
  9285. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  9286. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  9287. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  9288. do { \
  9289. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  9290. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  9291. } while (0)
  9292. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  9293. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  9294. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  9295. do { \
  9296. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  9297. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  9298. } while (0)
  9299. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  9300. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  9301. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  9302. do { \
  9303. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  9304. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  9305. } while (0)
  9306. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  9307. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  9308. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  9309. do { \
  9310. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  9311. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  9312. } while (0)
  9313. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  9314. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  9315. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  9316. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  9317. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  9318. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  9319. #define HTT_TX_COMPL_IND_STAT_OK 0
  9320. /* DISCARD:
  9321. * current meaning:
  9322. * MSDUs were queued for transmission but filtered by HW or SW
  9323. * without any over the air attempts
  9324. * legacy meaning (HL Rome):
  9325. * MSDUs were discarded by the target FW without any over the air
  9326. * attempts due to lack of space
  9327. */
  9328. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  9329. /* NO_ACK:
  9330. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  9331. */
  9332. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  9333. /* POSTPONE:
  9334. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  9335. * be downloaded again later (in the appropriate order), when they are
  9336. * deliverable.
  9337. */
  9338. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  9339. /*
  9340. * The PEER_DEL tx completion status is used for HL cases
  9341. * where the peer the frame is for has been deleted.
  9342. * The host has already discarded its copy of the frame, but
  9343. * it still needs the tx completion to restore its credit.
  9344. */
  9345. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  9346. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  9347. #define HTT_TX_COMPL_IND_STAT_DROP 5
  9348. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  9349. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  9350. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  9351. PREPACK struct htt_tx_compl_ind_base {
  9352. A_UINT32 hdr;
  9353. A_UINT16 payload[1/*or more*/];
  9354. } POSTPACK;
  9355. PREPACK struct htt_tx_compl_ind_append_retries {
  9356. A_UINT16 msdu_id;
  9357. A_UINT8 tx_retries;
  9358. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  9359. 0: this is the last append_retries struct */
  9360. } POSTPACK;
  9361. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  9362. A_UINT32 timestamp[1/*or more*/];
  9363. } POSTPACK;
  9364. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  9365. A_UINT32 tx_tsf64_low;
  9366. A_UINT32 tx_tsf64_high;
  9367. } POSTPACK;
  9368. /* htt_tx_data_hdr_information payload extension fields: */
  9369. /* DWORD zero */
  9370. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  9371. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  9372. /* DWORD one */
  9373. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  9374. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  9375. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  9376. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  9377. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  9378. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  9379. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  9380. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  9381. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  9382. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  9383. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  9384. #define HTT_FW_TX_DATA_HDR_BW_S 19
  9385. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  9386. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  9387. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  9388. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  9389. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  9390. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  9391. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  9392. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  9393. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  9394. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  9395. /* DWORD two */
  9396. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  9397. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  9398. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  9399. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  9400. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  9401. do { \
  9402. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  9403. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  9404. } while (0)
  9405. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  9406. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  9407. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  9408. do { \
  9409. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  9410. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  9411. } while (0)
  9412. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  9413. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  9414. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  9415. do { \
  9416. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  9417. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  9418. } while (0)
  9419. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  9420. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  9421. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  9422. do { \
  9423. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  9424. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  9425. } while (0)
  9426. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  9427. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  9428. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  9429. do { \
  9430. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  9431. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  9432. } while (0)
  9433. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  9434. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  9435. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  9436. do { \
  9437. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  9438. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  9439. } while (0)
  9440. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  9441. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  9442. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  9443. do { \
  9444. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  9445. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  9446. } while (0)
  9447. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  9448. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  9449. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  9450. do { \
  9451. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  9452. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  9453. } while (0)
  9454. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  9455. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  9456. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  9457. do { \
  9458. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  9459. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  9460. } while (0)
  9461. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  9462. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  9463. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  9464. do { \
  9465. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  9466. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  9467. } while (0)
  9468. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  9469. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  9470. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  9471. do { \
  9472. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  9473. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  9474. } while (0)
  9475. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  9476. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  9477. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  9478. do { \
  9479. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  9480. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  9481. } while (0)
  9482. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  9483. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  9484. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  9485. do { \
  9486. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  9487. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  9488. } while (0)
  9489. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  9490. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  9491. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  9492. do { \
  9493. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  9494. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  9495. } while (0)
  9496. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  9497. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  9498. /**
  9499. * @brief target -> host rate-control update indication message
  9500. *
  9501. * @details
  9502. * The following diagram shows the format of the RC Update message
  9503. * sent from the target to the host, while processing the tx-completion
  9504. * of a transmitted PPDU.
  9505. *
  9506. * |31 24|23 16|15 8|7 0|
  9507. * |-------------------------------------------------------------|
  9508. * | peer ID | vdev ID | msg_type |
  9509. * |-------------------------------------------------------------|
  9510. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9511. * |-------------------------------------------------------------|
  9512. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  9513. * |-------------------------------------------------------------|
  9514. * | : |
  9515. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9516. * | : |
  9517. * |-------------------------------------------------------------|
  9518. * | : |
  9519. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9520. * | : |
  9521. * |-------------------------------------------------------------|
  9522. * : :
  9523. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9524. *
  9525. */
  9526. typedef struct {
  9527. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  9528. A_UINT32 rate_code_flags;
  9529. A_UINT32 flags; /* Encodes information such as excessive
  9530. retransmission, aggregate, some info
  9531. from .11 frame control,
  9532. STBC, LDPC, (SGI and Tx Chain Mask
  9533. are encoded in ptx_rc->flags field),
  9534. AMPDU truncation (BT/time based etc.),
  9535. RTS/CTS attempt */
  9536. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  9537. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  9538. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  9539. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  9540. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  9541. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  9542. } HTT_RC_TX_DONE_PARAMS;
  9543. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  9544. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  9545. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  9546. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  9547. #define HTT_RC_UPDATE_VDEVID_S 8
  9548. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  9549. #define HTT_RC_UPDATE_PEERID_S 16
  9550. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  9551. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  9552. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  9553. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  9554. do { \
  9555. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  9556. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  9557. } while (0)
  9558. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  9559. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  9560. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  9561. do { \
  9562. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  9563. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  9564. } while (0)
  9565. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  9566. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  9567. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  9568. do { \
  9569. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  9570. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  9571. } while (0)
  9572. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  9573. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  9574. /**
  9575. * @brief target -> host rx fragment indication message definition
  9576. *
  9577. * @details
  9578. * The following field definitions describe the format of the rx fragment
  9579. * indication message sent from the target to the host.
  9580. * The rx fragment indication message shares the format of the
  9581. * rx indication message, but not all fields from the rx indication message
  9582. * are relevant to the rx fragment indication message.
  9583. *
  9584. *
  9585. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9586. * |-----------+-------------------+---------------------+-------------|
  9587. * | peer ID | |FV| ext TID | msg type |
  9588. * |-------------------------------------------------------------------|
  9589. * | | flush | flush |
  9590. * | | end | start |
  9591. * | | seq num | seq num |
  9592. * |-------------------------------------------------------------------|
  9593. * | reserved | FW rx desc bytes |
  9594. * |-------------------------------------------------------------------|
  9595. * | | FW MSDU Rx |
  9596. * | | desc B0 |
  9597. * |-------------------------------------------------------------------|
  9598. * Header fields:
  9599. * - MSG_TYPE
  9600. * Bits 7:0
  9601. * Purpose: identifies this as an rx fragment indication message
  9602. * Value: 0xa
  9603. * - EXT_TID
  9604. * Bits 12:8
  9605. * Purpose: identify the traffic ID of the rx data, including
  9606. * special "extended" TID values for multicast, broadcast, and
  9607. * non-QoS data frames
  9608. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9609. * - FLUSH_VALID (FV)
  9610. * Bit 13
  9611. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9612. * is valid
  9613. * Value:
  9614. * 1 -> flush IE is valid and needs to be processed
  9615. * 0 -> flush IE is not valid and should be ignored
  9616. * - PEER_ID
  9617. * Bits 31:16
  9618. * Purpose: Identify, by ID, which peer sent the rx data
  9619. * Value: ID of the peer who sent the rx data
  9620. * - FLUSH_SEQ_NUM_START
  9621. * Bits 5:0
  9622. * Purpose: Indicate the start of a series of MPDUs to flush
  9623. * Not all MPDUs within this series are necessarily valid - the host
  9624. * must check each sequence number within this range to see if the
  9625. * corresponding MPDU is actually present.
  9626. * This field is only valid if the FV bit is set.
  9627. * Value:
  9628. * The sequence number for the first MPDUs to check to flush.
  9629. * The sequence number is masked by 0x3f.
  9630. * - FLUSH_SEQ_NUM_END
  9631. * Bits 11:6
  9632. * Purpose: Indicate the end of a series of MPDUs to flush
  9633. * Value:
  9634. * The sequence number one larger than the sequence number of the
  9635. * last MPDU to check to flush.
  9636. * The sequence number is masked by 0x3f.
  9637. * Not all MPDUs within this series are necessarily valid - the host
  9638. * must check each sequence number within this range to see if the
  9639. * corresponding MPDU is actually present.
  9640. * This field is only valid if the FV bit is set.
  9641. * Rx descriptor fields:
  9642. * - FW_RX_DESC_BYTES
  9643. * Bits 15:0
  9644. * Purpose: Indicate how many bytes in the Rx indication are used for
  9645. * FW Rx descriptors
  9646. * Value: 1
  9647. */
  9648. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  9649. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  9650. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  9651. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  9652. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  9653. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  9654. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  9655. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  9656. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  9657. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  9658. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  9659. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  9660. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  9661. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  9662. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  9663. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  9664. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  9665. #define HTT_RX_FRAG_IND_BYTES \
  9666. (4 /* msg hdr */ + \
  9667. 4 /* flush spec */ + \
  9668. 4 /* (unused) FW rx desc bytes spec */ + \
  9669. 4 /* FW rx desc */)
  9670. /**
  9671. * @brief target -> host test message definition
  9672. *
  9673. * @details
  9674. * The following field definitions describe the format of the test
  9675. * message sent from the target to the host.
  9676. * The message consists of a 4-octet header, followed by a variable
  9677. * number of 32-bit integer values, followed by a variable number
  9678. * of 8-bit character values.
  9679. *
  9680. * |31 16|15 8|7 0|
  9681. * |-----------------------------------------------------------|
  9682. * | num chars | num ints | msg type |
  9683. * |-----------------------------------------------------------|
  9684. * | int 0 |
  9685. * |-----------------------------------------------------------|
  9686. * | int 1 |
  9687. * |-----------------------------------------------------------|
  9688. * | ... |
  9689. * |-----------------------------------------------------------|
  9690. * | char 3 | char 2 | char 1 | char 0 |
  9691. * |-----------------------------------------------------------|
  9692. * | | | ... | char 4 |
  9693. * |-----------------------------------------------------------|
  9694. * - MSG_TYPE
  9695. * Bits 7:0
  9696. * Purpose: identifies this as a test message
  9697. * Value: HTT_MSG_TYPE_TEST
  9698. * - NUM_INTS
  9699. * Bits 15:8
  9700. * Purpose: indicate how many 32-bit integers follow the message header
  9701. * - NUM_CHARS
  9702. * Bits 31:16
  9703. * Purpose: indicate how many 8-bit charaters follow the series of integers
  9704. */
  9705. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  9706. #define HTT_RX_TEST_NUM_INTS_S 8
  9707. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  9708. #define HTT_RX_TEST_NUM_CHARS_S 16
  9709. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  9710. do { \
  9711. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  9712. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  9713. } while (0)
  9714. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  9715. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  9716. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  9717. do { \
  9718. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  9719. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  9720. } while (0)
  9721. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  9722. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  9723. /**
  9724. * @brief target -> host packet log message
  9725. *
  9726. * @details
  9727. * The following field definitions describe the format of the packet log
  9728. * message sent from the target to the host.
  9729. * The message consists of a 4-octet header,followed by a variable number
  9730. * of 32-bit character values.
  9731. *
  9732. * |31 16|15 12|11 10|9 8|7 0|
  9733. * |------------------------------------------------------------------|
  9734. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  9735. * |------------------------------------------------------------------|
  9736. * | payload |
  9737. * |------------------------------------------------------------------|
  9738. * - MSG_TYPE
  9739. * Bits 7:0
  9740. * Purpose: identifies this as a pktlog message
  9741. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  9742. * - mac_id
  9743. * Bits 9:8
  9744. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  9745. * Value: 0-3
  9746. * - pdev_id
  9747. * Bits 11:10
  9748. * Purpose: pdev_id
  9749. * Value: 0-3
  9750. * 0 (for rings at SOC level),
  9751. * 1/2/3 PDEV -> 0/1/2
  9752. * - payload_size
  9753. * Bits 31:16
  9754. * Purpose: explicitly specify the payload size
  9755. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  9756. */
  9757. PREPACK struct htt_pktlog_msg {
  9758. A_UINT32 header;
  9759. A_UINT32 payload[1/* or more */];
  9760. } POSTPACK;
  9761. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  9762. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  9763. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  9764. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  9765. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  9766. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  9767. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  9768. do { \
  9769. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  9770. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  9771. } while (0)
  9772. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  9773. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  9774. HTT_T2H_PKTLOG_MAC_ID_S)
  9775. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  9776. do { \
  9777. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  9778. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  9779. } while (0)
  9780. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  9781. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  9782. HTT_T2H_PKTLOG_PDEV_ID_S)
  9783. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  9784. do { \
  9785. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  9786. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  9787. } while (0)
  9788. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  9789. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  9790. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  9791. /*
  9792. * Rx reorder statistics
  9793. * NB: all the fields must be defined in 4 octets size.
  9794. */
  9795. struct rx_reorder_stats {
  9796. /* Non QoS MPDUs received */
  9797. A_UINT32 deliver_non_qos;
  9798. /* MPDUs received in-order */
  9799. A_UINT32 deliver_in_order;
  9800. /* Flush due to reorder timer expired */
  9801. A_UINT32 deliver_flush_timeout;
  9802. /* Flush due to move out of window */
  9803. A_UINT32 deliver_flush_oow;
  9804. /* Flush due to DELBA */
  9805. A_UINT32 deliver_flush_delba;
  9806. /* MPDUs dropped due to FCS error */
  9807. A_UINT32 fcs_error;
  9808. /* MPDUs dropped due to monitor mode non-data packet */
  9809. A_UINT32 mgmt_ctrl;
  9810. /* Unicast-data MPDUs dropped due to invalid peer */
  9811. A_UINT32 invalid_peer;
  9812. /* MPDUs dropped due to duplication (non aggregation) */
  9813. A_UINT32 dup_non_aggr;
  9814. /* MPDUs dropped due to processed before */
  9815. A_UINT32 dup_past;
  9816. /* MPDUs dropped due to duplicate in reorder queue */
  9817. A_UINT32 dup_in_reorder;
  9818. /* Reorder timeout happened */
  9819. A_UINT32 reorder_timeout;
  9820. /* invalid bar ssn */
  9821. A_UINT32 invalid_bar_ssn;
  9822. /* reorder reset due to bar ssn */
  9823. A_UINT32 ssn_reset;
  9824. /* Flush due to delete peer */
  9825. A_UINT32 deliver_flush_delpeer;
  9826. /* Flush due to offload*/
  9827. A_UINT32 deliver_flush_offload;
  9828. /* Flush due to out of buffer*/
  9829. A_UINT32 deliver_flush_oob;
  9830. /* MPDUs dropped due to PN check fail */
  9831. A_UINT32 pn_fail;
  9832. /* MPDUs dropped due to unable to allocate memory */
  9833. A_UINT32 store_fail;
  9834. /* Number of times the tid pool alloc succeeded */
  9835. A_UINT32 tid_pool_alloc_succ;
  9836. /* Number of times the MPDU pool alloc succeeded */
  9837. A_UINT32 mpdu_pool_alloc_succ;
  9838. /* Number of times the MSDU pool alloc succeeded */
  9839. A_UINT32 msdu_pool_alloc_succ;
  9840. /* Number of times the tid pool alloc failed */
  9841. A_UINT32 tid_pool_alloc_fail;
  9842. /* Number of times the MPDU pool alloc failed */
  9843. A_UINT32 mpdu_pool_alloc_fail;
  9844. /* Number of times the MSDU pool alloc failed */
  9845. A_UINT32 msdu_pool_alloc_fail;
  9846. /* Number of times the tid pool freed */
  9847. A_UINT32 tid_pool_free;
  9848. /* Number of times the MPDU pool freed */
  9849. A_UINT32 mpdu_pool_free;
  9850. /* Number of times the MSDU pool freed */
  9851. A_UINT32 msdu_pool_free;
  9852. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  9853. A_UINT32 msdu_queued;
  9854. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  9855. A_UINT32 msdu_recycled;
  9856. /* Number of MPDUs with invalid peer but A2 found in AST */
  9857. A_UINT32 invalid_peer_a2_in_ast;
  9858. /* Number of MPDUs with invalid peer but A3 found in AST */
  9859. A_UINT32 invalid_peer_a3_in_ast;
  9860. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  9861. A_UINT32 invalid_peer_bmc_mpdus;
  9862. /* Number of MSDUs with err attention word */
  9863. A_UINT32 rxdesc_err_att;
  9864. /* Number of MSDUs with flag of peer_idx_invalid */
  9865. A_UINT32 rxdesc_err_peer_idx_inv;
  9866. /* Number of MSDUs with flag of peer_idx_timeout */
  9867. A_UINT32 rxdesc_err_peer_idx_to;
  9868. /* Number of MSDUs with flag of overflow */
  9869. A_UINT32 rxdesc_err_ov;
  9870. /* Number of MSDUs with flag of msdu_length_err */
  9871. A_UINT32 rxdesc_err_msdu_len;
  9872. /* Number of MSDUs with flag of mpdu_length_err */
  9873. A_UINT32 rxdesc_err_mpdu_len;
  9874. /* Number of MSDUs with flag of tkip_mic_err */
  9875. A_UINT32 rxdesc_err_tkip_mic;
  9876. /* Number of MSDUs with flag of decrypt_err */
  9877. A_UINT32 rxdesc_err_decrypt;
  9878. /* Number of MSDUs with flag of fcs_err */
  9879. A_UINT32 rxdesc_err_fcs;
  9880. /* Number of Unicast (bc_mc bit is not set in attention word)
  9881. * frames with invalid peer handler
  9882. */
  9883. A_UINT32 rxdesc_uc_msdus_inv_peer;
  9884. /* Number of unicast frame directly (direct bit is set in attention word)
  9885. * to DUT with invalid peer handler
  9886. */
  9887. A_UINT32 rxdesc_direct_msdus_inv_peer;
  9888. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  9889. * frames with invalid peer handler
  9890. */
  9891. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  9892. /* Number of MSDUs dropped due to no first MSDU flag */
  9893. A_UINT32 rxdesc_no_1st_msdu;
  9894. /* Number of MSDUs droped due to ring overflow */
  9895. A_UINT32 msdu_drop_ring_ov;
  9896. /* Number of MSDUs dropped due to FC mismatch */
  9897. A_UINT32 msdu_drop_fc_mismatch;
  9898. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  9899. A_UINT32 msdu_drop_mgmt_remote_ring;
  9900. /* Number of MSDUs dropped due to errors not reported in attention word */
  9901. A_UINT32 msdu_drop_misc;
  9902. /* Number of MSDUs go to offload before reorder */
  9903. A_UINT32 offload_msdu_wal;
  9904. /* Number of data frame dropped by offload after reorder */
  9905. A_UINT32 offload_msdu_reorder;
  9906. /* Number of MPDUs with sequence number in the past and within the BA window */
  9907. A_UINT32 dup_past_within_window;
  9908. /* Number of MPDUs with sequence number in the past and outside the BA window */
  9909. A_UINT32 dup_past_outside_window;
  9910. /* Number of MSDUs with decrypt/MIC error */
  9911. A_UINT32 rxdesc_err_decrypt_mic;
  9912. /* Number of data MSDUs received on both local and remote rings */
  9913. A_UINT32 data_msdus_on_both_rings;
  9914. /* MPDUs never filled */
  9915. A_UINT32 holes_not_filled;
  9916. };
  9917. /*
  9918. * Rx Remote buffer statistics
  9919. * NB: all the fields must be defined in 4 octets size.
  9920. */
  9921. struct rx_remote_buffer_mgmt_stats {
  9922. /* Total number of MSDUs reaped for Rx processing */
  9923. A_UINT32 remote_reaped;
  9924. /* MSDUs recycled within firmware */
  9925. A_UINT32 remote_recycled;
  9926. /* MSDUs stored by Data Rx */
  9927. A_UINT32 data_rx_msdus_stored;
  9928. /* Number of HTT indications from WAL Rx MSDU */
  9929. A_UINT32 wal_rx_ind;
  9930. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  9931. A_UINT32 wal_rx_ind_unconsumed;
  9932. /* Number of HTT indications from Data Rx MSDU */
  9933. A_UINT32 data_rx_ind;
  9934. /* Number of unconsumed HTT indications from Data Rx MSDU */
  9935. A_UINT32 data_rx_ind_unconsumed;
  9936. /* Number of HTT indications from ATHBUF */
  9937. A_UINT32 athbuf_rx_ind;
  9938. /* Number of remote buffers requested for refill */
  9939. A_UINT32 refill_buf_req;
  9940. /* Number of remote buffers filled by the host */
  9941. A_UINT32 refill_buf_rsp;
  9942. /* Number of times MAC hw_index = f/w write_index */
  9943. A_INT32 mac_no_bufs;
  9944. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  9945. A_INT32 fw_indices_equal;
  9946. /* Number of times f/w finds no buffers to post */
  9947. A_INT32 host_no_bufs;
  9948. };
  9949. /*
  9950. * TXBF MU/SU packets and NDPA statistics
  9951. * NB: all the fields must be defined in 4 octets size.
  9952. */
  9953. struct rx_txbf_musu_ndpa_pkts_stats {
  9954. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  9955. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  9956. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  9957. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  9958. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  9959. A_UINT32 reserved[3]; /* must be set to 0x0 */
  9960. };
  9961. /*
  9962. * htt_dbg_stats_status -
  9963. * present - The requested stats have been delivered in full.
  9964. * This indicates that either the stats information was contained
  9965. * in its entirety within this message, or else this message
  9966. * completes the delivery of the requested stats info that was
  9967. * partially delivered through earlier STATS_CONF messages.
  9968. * partial - The requested stats have been delivered in part.
  9969. * One or more subsequent STATS_CONF messages with the same
  9970. * cookie value will be sent to deliver the remainder of the
  9971. * information.
  9972. * error - The requested stats could not be delivered, for example due
  9973. * to a shortage of memory to construct a message holding the
  9974. * requested stats.
  9975. * invalid - The requested stat type is either not recognized, or the
  9976. * target is configured to not gather the stats type in question.
  9977. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9978. * series_done - This special value indicates that no further stats info
  9979. * elements are present within a series of stats info elems
  9980. * (within a stats upload confirmation message).
  9981. */
  9982. enum htt_dbg_stats_status {
  9983. HTT_DBG_STATS_STATUS_PRESENT = 0,
  9984. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  9985. HTT_DBG_STATS_STATUS_ERROR = 2,
  9986. HTT_DBG_STATS_STATUS_INVALID = 3,
  9987. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  9988. };
  9989. /**
  9990. * @brief target -> host statistics upload
  9991. *
  9992. * @details
  9993. * The following field definitions describe the format of the HTT target
  9994. * to host stats upload confirmation message.
  9995. * The message contains a cookie echoed from the HTT host->target stats
  9996. * upload request, which identifies which request the confirmation is
  9997. * for, and a series of tag-length-value stats information elements.
  9998. * The tag-length header for each stats info element also includes a
  9999. * status field, to indicate whether the request for the stat type in
  10000. * question was fully met, partially met, unable to be met, or invalid
  10001. * (if the stat type in question is disabled in the target).
  10002. * A special value of all 1's in this status field is used to indicate
  10003. * the end of the series of stats info elements.
  10004. *
  10005. *
  10006. * |31 16|15 8|7 5|4 0|
  10007. * |------------------------------------------------------------|
  10008. * | reserved | msg type |
  10009. * |------------------------------------------------------------|
  10010. * | cookie LSBs |
  10011. * |------------------------------------------------------------|
  10012. * | cookie MSBs |
  10013. * |------------------------------------------------------------|
  10014. * | stats entry length | reserved | S |stat type|
  10015. * |------------------------------------------------------------|
  10016. * | |
  10017. * | type-specific stats info |
  10018. * | |
  10019. * |------------------------------------------------------------|
  10020. * | stats entry length | reserved | S |stat type|
  10021. * |------------------------------------------------------------|
  10022. * | |
  10023. * | type-specific stats info |
  10024. * | |
  10025. * |------------------------------------------------------------|
  10026. * | n/a | reserved | 111 | n/a |
  10027. * |------------------------------------------------------------|
  10028. * Header fields:
  10029. * - MSG_TYPE
  10030. * Bits 7:0
  10031. * Purpose: identifies this is a statistics upload confirmation message
  10032. * Value: 0x9
  10033. * - COOKIE_LSBS
  10034. * Bits 31:0
  10035. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10036. * message with its preceding host->target stats request message.
  10037. * Value: LSBs of the opaque cookie specified by the host-side requestor
  10038. * - COOKIE_MSBS
  10039. * Bits 31:0
  10040. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10041. * message with its preceding host->target stats request message.
  10042. * Value: MSBs of the opaque cookie specified by the host-side requestor
  10043. *
  10044. * Stats Information Element tag-length header fields:
  10045. * - STAT_TYPE
  10046. * Bits 4:0
  10047. * Purpose: identifies the type of statistics info held in the
  10048. * following information element
  10049. * Value: htt_dbg_stats_type
  10050. * - STATUS
  10051. * Bits 7:5
  10052. * Purpose: indicate whether the requested stats are present
  10053. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  10054. * the completion of the stats entry series
  10055. * - LENGTH
  10056. * Bits 31:16
  10057. * Purpose: indicate the stats information size
  10058. * Value: This field specifies the number of bytes of stats information
  10059. * that follows the element tag-length header.
  10060. * It is expected but not required that this length is a multiple of
  10061. * 4 bytes. Even if the length is not an integer multiple of 4, the
  10062. * subsequent stats entry header will begin on a 4-byte aligned
  10063. * boundary.
  10064. */
  10065. #define HTT_T2H_STATS_COOKIE_SIZE 8
  10066. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  10067. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  10068. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  10069. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  10070. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  10071. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  10072. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  10073. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  10074. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  10075. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  10076. do { \
  10077. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  10078. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  10079. } while (0)
  10080. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  10081. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  10082. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  10083. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  10084. do { \
  10085. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  10086. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  10087. } while (0)
  10088. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  10089. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  10090. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  10091. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  10092. do { \
  10093. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  10094. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  10095. } while (0)
  10096. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  10097. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  10098. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  10099. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  10100. #define HTT_MAX_AGGR 64
  10101. #define HTT_HL_MAX_AGGR 18
  10102. /**
  10103. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  10104. *
  10105. * @details
  10106. * The following field definitions describe the format of the HTT host
  10107. * to target frag_desc/msdu_ext bank configuration message.
  10108. * The message contains the based address and the min and max id of the
  10109. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  10110. * MSDU_EXT/FRAG_DESC.
  10111. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  10112. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  10113. * the hardware does the mapping/translation.
  10114. *
  10115. * Total banks that can be configured is configured to 16.
  10116. *
  10117. * This should be called before any TX has be initiated by the HTT
  10118. *
  10119. * |31 16|15 8|7 5|4 0|
  10120. * |------------------------------------------------------------|
  10121. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  10122. * |------------------------------------------------------------|
  10123. * | BANK0_BASE_ADDRESS (bits 31:0) |
  10124. #if HTT_PADDR64
  10125. * | BANK0_BASE_ADDRESS (bits 63:32) |
  10126. #endif
  10127. * |------------------------------------------------------------|
  10128. * | ... |
  10129. * |------------------------------------------------------------|
  10130. * | BANK15_BASE_ADDRESS (bits 31:0) |
  10131. #if HTT_PADDR64
  10132. * | BANK15_BASE_ADDRESS (bits 63:32) |
  10133. #endif
  10134. * |------------------------------------------------------------|
  10135. * | BANK0_MAX_ID | BANK0_MIN_ID |
  10136. * |------------------------------------------------------------|
  10137. * | ... |
  10138. * |------------------------------------------------------------|
  10139. * | BANK15_MAX_ID | BANK15_MIN_ID |
  10140. * |------------------------------------------------------------|
  10141. * Header fields:
  10142. * - MSG_TYPE
  10143. * Bits 7:0
  10144. * Value: 0x6
  10145. * for systems with 64-bit format for bus addresses:
  10146. * - BANKx_BASE_ADDRESS_LO
  10147. * Bits 31:0
  10148. * Purpose: Provide a mechanism to specify the base address of the
  10149. * MSDU_EXT bank physical/bus address.
  10150. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  10151. * - BANKx_BASE_ADDRESS_HI
  10152. * Bits 31:0
  10153. * Purpose: Provide a mechanism to specify the base address of the
  10154. * MSDU_EXT bank physical/bus address.
  10155. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  10156. * for systems with 32-bit format for bus addresses:
  10157. * - BANKx_BASE_ADDRESS
  10158. * Bits 31:0
  10159. * Purpose: Provide a mechanism to specify the base address of the
  10160. * MSDU_EXT bank physical/bus address.
  10161. * Value: MSDU_EXT bank physical / bus address
  10162. * - BANKx_MIN_ID
  10163. * Bits 15:0
  10164. * Purpose: Provide a mechanism to specify the min index that needs to
  10165. * mapped.
  10166. * - BANKx_MAX_ID
  10167. * Bits 31:16
  10168. * Purpose: Provide a mechanism to specify the max index that needs to
  10169. * mapped.
  10170. *
  10171. */
  10172. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  10173. * safe value.
  10174. * @note MAX supported banks is 16.
  10175. */
  10176. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  10177. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  10178. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  10179. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  10180. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  10181. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  10182. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  10183. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  10184. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  10185. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  10186. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  10187. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  10188. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  10189. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  10190. do { \
  10191. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  10192. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  10193. } while (0)
  10194. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  10195. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  10196. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  10197. do { \
  10198. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  10199. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  10200. } while (0)
  10201. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  10202. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  10203. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  10204. do { \
  10205. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  10206. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  10207. } while (0)
  10208. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  10209. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  10210. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  10211. do { \
  10212. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  10213. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  10214. } while (0)
  10215. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  10216. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  10217. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  10218. do { \
  10219. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  10220. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  10221. } while (0)
  10222. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  10223. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  10224. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  10225. do { \
  10226. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  10227. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  10228. } while (0)
  10229. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  10230. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  10231. /*
  10232. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  10233. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  10234. * addresses are stored in a XXX-bit field.
  10235. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  10236. * htt_tx_frag_desc64_bank_cfg_t structs.
  10237. */
  10238. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  10239. _paddr_bits_, \
  10240. _paddr__bank_base_address_) \
  10241. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  10242. /** word 0 \
  10243. * msg_type: 8, \
  10244. * pdev_id: 2, \
  10245. * swap: 1, \
  10246. * reserved0: 5, \
  10247. * num_banks: 8, \
  10248. * desc_size: 8; \
  10249. */ \
  10250. A_UINT32 word0; \
  10251. /* \
  10252. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  10253. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  10254. * the second A_UINT32). \
  10255. */ \
  10256. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10257. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10258. } POSTPACK
  10259. /* define htt_tx_frag_desc32_bank_cfg_t */
  10260. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  10261. /* define htt_tx_frag_desc64_bank_cfg_t */
  10262. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  10263. /*
  10264. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  10265. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  10266. */
  10267. #if HTT_PADDR64
  10268. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  10269. #else
  10270. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  10271. #endif
  10272. /**
  10273. * @brief target -> host HTT TX Credit total count update message definition
  10274. *
  10275. *|31 16|15|14 9| 8 |7 0 |
  10276. *|---------------------+--+----------+-------+----------|
  10277. *|cur htt credit delta | Q| reserved | sign | msg type |
  10278. *|------------------------------------------------------|
  10279. *
  10280. * Header fields:
  10281. * - MSG_TYPE
  10282. * Bits 7:0
  10283. * Purpose: identifies this as a htt tx credit delta update message
  10284. * Value: 0xe
  10285. * - SIGN
  10286. * Bits 8
  10287. * identifies whether credit delta is positive or negative
  10288. * Value:
  10289. * - 0x0: credit delta is positive, rebalance in some buffers
  10290. * - 0x1: credit delta is negative, rebalance out some buffers
  10291. * - reserved
  10292. * Bits 14:9
  10293. * Value: 0x0
  10294. * - TXQ_GRP
  10295. * Bit 15
  10296. * Purpose: indicates whether any tx queue group information elements
  10297. * are appended to the tx credit update message
  10298. * Value: 0 -> no tx queue group information element is present
  10299. * 1 -> a tx queue group information element immediately follows
  10300. * - DELTA_COUNT
  10301. * Bits 31:16
  10302. * Purpose: Specify current htt credit delta absolute count
  10303. */
  10304. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  10305. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  10306. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  10307. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  10308. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  10309. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  10310. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  10311. do { \
  10312. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  10313. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  10314. } while (0)
  10315. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  10316. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  10317. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  10318. do { \
  10319. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  10320. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  10321. } while (0)
  10322. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  10323. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  10324. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  10325. do { \
  10326. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  10327. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  10328. } while (0)
  10329. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  10330. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  10331. #define HTT_TX_CREDIT_MSG_BYTES 4
  10332. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  10333. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  10334. /**
  10335. * @brief HTT WDI_IPA Operation Response Message
  10336. *
  10337. * @details
  10338. * HTT WDI_IPA Operation Response message is sent by target
  10339. * to host confirming suspend or resume operation.
  10340. * |31 24|23 16|15 8|7 0|
  10341. * |----------------+----------------+----------------+----------------|
  10342. * | op_code | Rsvd | msg_type |
  10343. * |-------------------------------------------------------------------|
  10344. * | Rsvd | Response len |
  10345. * |-------------------------------------------------------------------|
  10346. * | |
  10347. * | Response-type specific info |
  10348. * | |
  10349. * | |
  10350. * |-------------------------------------------------------------------|
  10351. * Header fields:
  10352. * - MSG_TYPE
  10353. * Bits 7:0
  10354. * Purpose: Identifies this as WDI_IPA Operation Response message
  10355. * value: = 0x13
  10356. * - OP_CODE
  10357. * Bits 31:16
  10358. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  10359. * value: = enum htt_wdi_ipa_op_code
  10360. * - RSP_LEN
  10361. * Bits 16:0
  10362. * Purpose: length for the response-type specific info
  10363. * value: = length in bytes for response-type specific info
  10364. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  10365. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  10366. */
  10367. PREPACK struct htt_wdi_ipa_op_response_t
  10368. {
  10369. /* DWORD 0: flags and meta-data */
  10370. A_UINT32
  10371. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10372. reserved1: 8,
  10373. op_code: 16;
  10374. A_UINT32
  10375. rsp_len: 16,
  10376. reserved2: 16;
  10377. } POSTPACK;
  10378. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  10379. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  10380. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  10381. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  10382. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  10383. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  10384. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  10385. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  10386. do { \
  10387. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  10388. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  10389. } while (0)
  10390. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  10391. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  10392. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  10393. do { \
  10394. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  10395. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  10396. } while (0)
  10397. enum htt_phy_mode {
  10398. htt_phy_mode_11a = 0,
  10399. htt_phy_mode_11g = 1,
  10400. htt_phy_mode_11b = 2,
  10401. htt_phy_mode_11g_only = 3,
  10402. htt_phy_mode_11na_ht20 = 4,
  10403. htt_phy_mode_11ng_ht20 = 5,
  10404. htt_phy_mode_11na_ht40 = 6,
  10405. htt_phy_mode_11ng_ht40 = 7,
  10406. htt_phy_mode_11ac_vht20 = 8,
  10407. htt_phy_mode_11ac_vht40 = 9,
  10408. htt_phy_mode_11ac_vht80 = 10,
  10409. htt_phy_mode_11ac_vht20_2g = 11,
  10410. htt_phy_mode_11ac_vht40_2g = 12,
  10411. htt_phy_mode_11ac_vht80_2g = 13,
  10412. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  10413. htt_phy_mode_11ac_vht160 = 15,
  10414. htt_phy_mode_max,
  10415. };
  10416. /**
  10417. * @brief target -> host HTT channel change indication
  10418. * @details
  10419. * Specify when a channel change occurs.
  10420. * This allows the host to precisely determine which rx frames arrived
  10421. * on the old channel and which rx frames arrived on the new channel.
  10422. *
  10423. *|31 |7 0 |
  10424. *|-------------------------------------------+----------|
  10425. *| reserved | msg type |
  10426. *|------------------------------------------------------|
  10427. *| primary_chan_center_freq_mhz |
  10428. *|------------------------------------------------------|
  10429. *| contiguous_chan1_center_freq_mhz |
  10430. *|------------------------------------------------------|
  10431. *| contiguous_chan2_center_freq_mhz |
  10432. *|------------------------------------------------------|
  10433. *| phy_mode |
  10434. *|------------------------------------------------------|
  10435. *
  10436. * Header fields:
  10437. * - MSG_TYPE
  10438. * Bits 7:0
  10439. * Purpose: identifies this as a htt channel change indication message
  10440. * Value: 0x15
  10441. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  10442. * Bits 31:0
  10443. * Purpose: identify the (center of the) new 20 MHz primary channel
  10444. * Value: center frequency of the 20 MHz primary channel, in MHz units
  10445. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  10446. * Bits 31:0
  10447. * Purpose: identify the (center of the) contiguous frequency range
  10448. * comprising the new channel.
  10449. * For example, if the new channel is a 80 MHz channel extending
  10450. * 60 MHz beyond the primary channel, this field would be 30 larger
  10451. * than the primary channel center frequency field.
  10452. * Value: center frequency of the contiguous frequency range comprising
  10453. * the full channel in MHz units
  10454. * (80+80 channels also use the CONTIG_CHAN2 field)
  10455. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  10456. * Bits 31:0
  10457. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  10458. * within a VHT 80+80 channel.
  10459. * This field is only relevant for VHT 80+80 channels.
  10460. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  10461. * channel (arbitrary value for cases besides VHT 80+80)
  10462. * - PHY_MODE
  10463. * Bits 31:0
  10464. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  10465. * and band
  10466. * Value: htt_phy_mode enum value
  10467. */
  10468. PREPACK struct htt_chan_change_t
  10469. {
  10470. /* DWORD 0: flags and meta-data */
  10471. A_UINT32
  10472. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10473. reserved1: 24;
  10474. A_UINT32 primary_chan_center_freq_mhz;
  10475. A_UINT32 contig_chan1_center_freq_mhz;
  10476. A_UINT32 contig_chan2_center_freq_mhz;
  10477. A_UINT32 phy_mode;
  10478. } POSTPACK;
  10479. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  10480. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  10481. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  10482. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  10483. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  10484. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  10485. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  10486. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  10487. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  10488. do { \
  10489. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  10490. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  10491. } while (0)
  10492. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  10493. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  10494. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  10495. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  10496. do { \
  10497. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  10498. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  10499. } while (0)
  10500. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  10501. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  10502. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  10503. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  10504. do { \
  10505. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  10506. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  10507. } while (0)
  10508. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  10509. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  10510. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  10511. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  10512. do { \
  10513. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  10514. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  10515. } while (0)
  10516. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  10517. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  10518. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  10519. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  10520. /**
  10521. * @brief rx offload packet error message
  10522. *
  10523. * @details
  10524. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  10525. * of target payload like mic err.
  10526. *
  10527. * |31 24|23 16|15 8|7 0|
  10528. * |----------------+----------------+----------------+----------------|
  10529. * | tid | vdev_id | msg_sub_type | msg_type |
  10530. * |-------------------------------------------------------------------|
  10531. * : (sub-type dependent content) :
  10532. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10533. * Header fields:
  10534. * - msg_type
  10535. * Bits 7:0
  10536. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  10537. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  10538. * - msg_sub_type
  10539. * Bits 15:8
  10540. * Purpose: Identifies which type of rx error is reported by this message
  10541. * value: htt_rx_ofld_pkt_err_type
  10542. * - vdev_id
  10543. * Bits 23:16
  10544. * Purpose: Identifies which vdev received the erroneous rx frame
  10545. * value:
  10546. * - tid
  10547. * Bits 31:24
  10548. * Purpose: Identifies the traffic type of the rx frame
  10549. * value:
  10550. *
  10551. * - The payload fields used if the sub-type == MIC error are shown below.
  10552. * Note - MIC err is per MSDU, while PN is per MPDU.
  10553. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  10554. * with MIC err in A-MSDU case, so FW will send only one HTT message
  10555. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  10556. * instead of sending separate HTT messages for each wrong MSDU within
  10557. * the MPDU.
  10558. *
  10559. * |31 24|23 16|15 8|7 0|
  10560. * |----------------+----------------+----------------+----------------|
  10561. * | Rsvd | key_id | peer_id |
  10562. * |-------------------------------------------------------------------|
  10563. * | receiver MAC addr 31:0 |
  10564. * |-------------------------------------------------------------------|
  10565. * | Rsvd | receiver MAC addr 47:32 |
  10566. * |-------------------------------------------------------------------|
  10567. * | transmitter MAC addr 31:0 |
  10568. * |-------------------------------------------------------------------|
  10569. * | Rsvd | transmitter MAC addr 47:32 |
  10570. * |-------------------------------------------------------------------|
  10571. * | PN 31:0 |
  10572. * |-------------------------------------------------------------------|
  10573. * | Rsvd | PN 47:32 |
  10574. * |-------------------------------------------------------------------|
  10575. * - peer_id
  10576. * Bits 15:0
  10577. * Purpose: identifies which peer is frame is from
  10578. * value:
  10579. * - key_id
  10580. * Bits 23:16
  10581. * Purpose: identifies key_id of rx frame
  10582. * value:
  10583. * - RA_31_0 (receiver MAC addr 31:0)
  10584. * Bits 31:0
  10585. * Purpose: identifies by MAC address which vdev received the frame
  10586. * value: MAC address lower 4 bytes
  10587. * - RA_47_32 (receiver MAC addr 47:32)
  10588. * Bits 15:0
  10589. * Purpose: identifies by MAC address which vdev received the frame
  10590. * value: MAC address upper 2 bytes
  10591. * - TA_31_0 (transmitter MAC addr 31:0)
  10592. * Bits 31:0
  10593. * Purpose: identifies by MAC address which peer transmitted the frame
  10594. * value: MAC address lower 4 bytes
  10595. * - TA_47_32 (transmitter MAC addr 47:32)
  10596. * Bits 15:0
  10597. * Purpose: identifies by MAC address which peer transmitted the frame
  10598. * value: MAC address upper 2 bytes
  10599. * - PN_31_0
  10600. * Bits 31:0
  10601. * Purpose: Identifies pn of rx frame
  10602. * value: PN lower 4 bytes
  10603. * - PN_47_32
  10604. * Bits 15:0
  10605. * Purpose: Identifies pn of rx frame
  10606. * value:
  10607. * TKIP or CCMP: PN upper 2 bytes
  10608. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  10609. */
  10610. enum htt_rx_ofld_pkt_err_type {
  10611. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  10612. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  10613. };
  10614. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  10615. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  10616. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  10617. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  10618. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  10619. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  10620. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  10621. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  10622. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  10623. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  10624. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  10625. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  10626. do { \
  10627. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  10628. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  10629. } while (0)
  10630. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  10631. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  10632. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  10633. do { \
  10634. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  10635. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  10636. } while (0)
  10637. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  10638. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  10639. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  10640. do { \
  10641. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  10642. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  10643. } while (0)
  10644. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  10645. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  10646. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  10647. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  10648. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  10649. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  10650. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  10651. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  10652. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  10653. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  10654. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  10655. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  10656. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  10657. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  10658. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  10659. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  10660. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  10661. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  10662. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  10663. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  10664. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  10665. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  10666. do { \
  10667. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  10668. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  10669. } while (0)
  10670. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  10671. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  10672. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  10673. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  10674. do { \
  10675. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  10676. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  10677. } while (0)
  10678. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  10679. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  10680. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  10681. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  10682. do { \
  10683. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  10684. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  10685. } while (0)
  10686. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  10687. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  10688. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  10689. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  10690. do { \
  10691. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  10692. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  10693. } while (0)
  10694. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  10695. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  10696. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  10697. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  10698. do { \
  10699. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  10700. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  10701. } while (0)
  10702. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  10703. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  10704. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  10705. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  10706. do { \
  10707. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  10708. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  10709. } while (0)
  10710. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  10711. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  10712. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  10713. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  10714. do { \
  10715. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  10716. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  10717. } while (0)
  10718. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  10719. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  10720. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  10721. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  10722. do { \
  10723. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  10724. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  10725. } while (0)
  10726. /**
  10727. * @brief peer rate report message
  10728. *
  10729. * @details
  10730. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  10731. * justified rate of all the peers.
  10732. *
  10733. * |31 24|23 16|15 8|7 0|
  10734. * |----------------+----------------+----------------+----------------|
  10735. * | peer_count | | msg_type |
  10736. * |-------------------------------------------------------------------|
  10737. * : Payload (variant number of peer rate report) :
  10738. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10739. * Header fields:
  10740. * - msg_type
  10741. * Bits 7:0
  10742. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  10743. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  10744. * - reserved
  10745. * Bits 15:8
  10746. * Purpose:
  10747. * value:
  10748. * - peer_count
  10749. * Bits 31:16
  10750. * Purpose: Specify how many peer rate report elements are present in the payload.
  10751. * value:
  10752. *
  10753. * Payload:
  10754. * There are variant number of peer rate report follow the first 32 bits.
  10755. * The peer rate report is defined as follows.
  10756. *
  10757. * |31 20|19 16|15 0|
  10758. * |-----------------------+---------+---------------------------------|-
  10759. * | reserved | phy | peer_id | \
  10760. * |-------------------------------------------------------------------| -> report #0
  10761. * | rate | /
  10762. * |-----------------------+---------+---------------------------------|-
  10763. * | reserved | phy | peer_id | \
  10764. * |-------------------------------------------------------------------| -> report #1
  10765. * | rate | /
  10766. * |-----------------------+---------+---------------------------------|-
  10767. * | reserved | phy | peer_id | \
  10768. * |-------------------------------------------------------------------| -> report #2
  10769. * | rate | /
  10770. * |-------------------------------------------------------------------|-
  10771. * : :
  10772. * : :
  10773. * : :
  10774. * :-------------------------------------------------------------------:
  10775. *
  10776. * - peer_id
  10777. * Bits 15:0
  10778. * Purpose: identify the peer
  10779. * value:
  10780. * - phy
  10781. * Bits 19:16
  10782. * Purpose: identify which phy is in use
  10783. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  10784. * Please see enum htt_peer_report_phy_type for detail.
  10785. * - reserved
  10786. * Bits 31:20
  10787. * Purpose:
  10788. * value:
  10789. * - rate
  10790. * Bits 31:0
  10791. * Purpose: represent the justified rate of the peer specified by peer_id
  10792. * value:
  10793. */
  10794. enum htt_peer_rate_report_phy_type {
  10795. HTT_PEER_RATE_REPORT_11B = 0,
  10796. HTT_PEER_RATE_REPORT_11A_G,
  10797. HTT_PEER_RATE_REPORT_11N,
  10798. HTT_PEER_RATE_REPORT_11AC,
  10799. };
  10800. #define HTT_PEER_RATE_REPORT_SIZE 8
  10801. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  10802. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  10803. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  10804. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  10805. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  10806. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  10807. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  10808. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  10809. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  10810. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  10811. do { \
  10812. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  10813. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  10814. } while (0)
  10815. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  10816. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  10817. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  10818. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  10819. do { \
  10820. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  10821. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  10822. } while (0)
  10823. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  10824. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  10825. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  10826. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  10827. do { \
  10828. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  10829. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  10830. } while (0)
  10831. /**
  10832. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  10833. *
  10834. * @details
  10835. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  10836. * a flow of descriptors.
  10837. *
  10838. * This message is in TLV format and indicates the parameters to be setup a
  10839. * flow in the host. Each entry indicates that a particular flow ID is ready to
  10840. * receive descriptors from a specified pool.
  10841. *
  10842. * The message would appear as follows:
  10843. *
  10844. * |31 24|23 16|15 8|7 0|
  10845. * |----------------+----------------+----------------+----------------|
  10846. * header | reserved | num_flows | msg_type |
  10847. * |-------------------------------------------------------------------|
  10848. * | |
  10849. * : payload :
  10850. * | |
  10851. * |-------------------------------------------------------------------|
  10852. *
  10853. * The header field is one DWORD long and is interpreted as follows:
  10854. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  10855. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  10856. * this message
  10857. * b'16-31 - reserved: These bits are reserved for future use
  10858. *
  10859. * Payload:
  10860. * The payload would contain multiple objects of the following structure. Each
  10861. * object represents a flow.
  10862. *
  10863. * |31 24|23 16|15 8|7 0|
  10864. * |----------------+----------------+----------------+----------------|
  10865. * header | reserved | num_flows | msg_type |
  10866. * |-------------------------------------------------------------------|
  10867. * payload0| flow_type |
  10868. * |-------------------------------------------------------------------|
  10869. * | flow_id |
  10870. * |-------------------------------------------------------------------|
  10871. * | reserved0 | flow_pool_id |
  10872. * |-------------------------------------------------------------------|
  10873. * | reserved1 | flow_pool_size |
  10874. * |-------------------------------------------------------------------|
  10875. * | reserved2 |
  10876. * |-------------------------------------------------------------------|
  10877. * payload1| flow_type |
  10878. * |-------------------------------------------------------------------|
  10879. * | flow_id |
  10880. * |-------------------------------------------------------------------|
  10881. * | reserved0 | flow_pool_id |
  10882. * |-------------------------------------------------------------------|
  10883. * | reserved1 | flow_pool_size |
  10884. * |-------------------------------------------------------------------|
  10885. * | reserved2 |
  10886. * |-------------------------------------------------------------------|
  10887. * | . |
  10888. * | . |
  10889. * | . |
  10890. * |-------------------------------------------------------------------|
  10891. *
  10892. * Each payload is 5 DWORDS long and is interpreted as follows:
  10893. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  10894. * this flow is associated. It can be VDEV, peer,
  10895. * or tid (AC). Based on enum htt_flow_type.
  10896. *
  10897. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  10898. * object. For flow_type vdev it is set to the
  10899. * vdevid, for peer it is peerid and for tid, it is
  10900. * tid_num.
  10901. *
  10902. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  10903. * in the host for this flow
  10904. * b'16:31 - reserved0: This field in reserved for the future. In case
  10905. * we have a hierarchical implementation (HCM) of
  10906. * pools, it can be used to indicate the ID of the
  10907. * parent-pool.
  10908. *
  10909. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  10910. * Descriptors for this flow will be
  10911. * allocated from this pool in the host.
  10912. * b'16:31 - reserved1: This field in reserved for the future. In case
  10913. * we have a hierarchical implementation of pools,
  10914. * it can be used to indicate the max number of
  10915. * descriptors in the pool. The b'0:15 can be used
  10916. * to indicate min number of descriptors in the
  10917. * HCM scheme.
  10918. *
  10919. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  10920. * we have a hierarchical implementation of pools,
  10921. * b'0:15 can be used to indicate the
  10922. * priority-based borrowing (PBB) threshold of
  10923. * the flow's pool. The b'16:31 are still left
  10924. * reserved.
  10925. */
  10926. enum htt_flow_type {
  10927. FLOW_TYPE_VDEV = 0,
  10928. /* Insert new flow types above this line */
  10929. };
  10930. PREPACK struct htt_flow_pool_map_payload_t {
  10931. A_UINT32 flow_type;
  10932. A_UINT32 flow_id;
  10933. A_UINT32 flow_pool_id:16,
  10934. reserved0:16;
  10935. A_UINT32 flow_pool_size:16,
  10936. reserved1:16;
  10937. A_UINT32 reserved2;
  10938. } POSTPACK;
  10939. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  10940. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  10941. (sizeof(struct htt_flow_pool_map_payload_t))
  10942. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  10943. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  10944. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  10945. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  10946. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  10947. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  10948. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  10949. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  10950. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  10951. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  10952. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  10953. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  10954. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  10955. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  10956. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  10957. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  10958. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  10959. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  10960. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  10961. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  10962. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  10963. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  10964. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  10965. do { \
  10966. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  10967. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  10968. } while (0)
  10969. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  10970. do { \
  10971. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  10972. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  10973. } while (0)
  10974. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  10975. do { \
  10976. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  10977. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  10978. } while (0)
  10979. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  10980. do { \
  10981. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  10982. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  10983. } while (0)
  10984. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  10985. do { \
  10986. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  10987. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  10988. } while (0)
  10989. /**
  10990. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  10991. *
  10992. * @details
  10993. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  10994. * down a flow of descriptors.
  10995. * This message indicates that for the flow (whose ID is provided) is wanting
  10996. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  10997. * pool of descriptors from where descriptors are being allocated for this
  10998. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  10999. * be unmapped by the host.
  11000. *
  11001. * The message would appear as follows:
  11002. *
  11003. * |31 24|23 16|15 8|7 0|
  11004. * |----------------+----------------+----------------+----------------|
  11005. * | reserved0 | msg_type |
  11006. * |-------------------------------------------------------------------|
  11007. * | flow_type |
  11008. * |-------------------------------------------------------------------|
  11009. * | flow_id |
  11010. * |-------------------------------------------------------------------|
  11011. * | reserved1 | flow_pool_id |
  11012. * |-------------------------------------------------------------------|
  11013. *
  11014. * The message is interpreted as follows:
  11015. * dword0 - b'0:7 - msg_type: This will be set to
  11016. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  11017. * b'8:31 - reserved0: Reserved for future use
  11018. *
  11019. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  11020. * this flow is associated. It can be VDEV, peer,
  11021. * or tid (AC). Based on enum htt_flow_type.
  11022. *
  11023. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  11024. * object. For flow_type vdev it is set to the
  11025. * vdevid, for peer it is peerid and for tid, it is
  11026. * tid_num.
  11027. *
  11028. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  11029. * used in the host for this flow
  11030. * b'16:31 - reserved0: This field in reserved for the future.
  11031. *
  11032. */
  11033. PREPACK struct htt_flow_pool_unmap_t {
  11034. A_UINT32 msg_type:8,
  11035. reserved0:24;
  11036. A_UINT32 flow_type;
  11037. A_UINT32 flow_id;
  11038. A_UINT32 flow_pool_id:16,
  11039. reserved1:16;
  11040. } POSTPACK;
  11041. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  11042. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  11043. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  11044. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  11045. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  11046. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  11047. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  11048. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  11049. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  11050. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  11051. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  11052. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  11053. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  11054. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  11055. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  11056. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  11057. do { \
  11058. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  11059. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  11060. } while (0)
  11061. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  11062. do { \
  11063. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  11064. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  11065. } while (0)
  11066. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  11067. do { \
  11068. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  11069. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  11070. } while (0)
  11071. /**
  11072. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  11073. *
  11074. * @details
  11075. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  11076. * SRNG ring setup is done
  11077. *
  11078. * This message indicates whether the last setup operation is successful.
  11079. * It will be sent to host when host set respose_required bit in
  11080. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  11081. * The message would appear as follows:
  11082. *
  11083. * |31 24|23 16|15 8|7 0|
  11084. * |--------------- +----------------+----------------+----------------|
  11085. * | setup_status | ring_id | pdev_id | msg_type |
  11086. * |-------------------------------------------------------------------|
  11087. *
  11088. * The message is interpreted as follows:
  11089. * dword0 - b'0:7 - msg_type: This will be set to
  11090. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  11091. * b'8:15 - pdev_id:
  11092. * 0 (for rings at SOC/UMAC level),
  11093. * 1/2/3 mac id (for rings at LMAC level)
  11094. * b'16:23 - ring_id: Identify the ring which is set up
  11095. * More details can be got from enum htt_srng_ring_id
  11096. * b'24:31 - setup_status: Indicate status of setup operation
  11097. * Refer to htt_ring_setup_status
  11098. */
  11099. PREPACK struct htt_sring_setup_done_t {
  11100. A_UINT32 msg_type: 8,
  11101. pdev_id: 8,
  11102. ring_id: 8,
  11103. setup_status: 8;
  11104. } POSTPACK;
  11105. enum htt_ring_setup_status {
  11106. htt_ring_setup_status_ok = 0,
  11107. htt_ring_setup_status_error,
  11108. };
  11109. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  11110. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  11111. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  11112. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  11113. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  11114. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  11115. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  11116. do { \
  11117. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  11118. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  11119. } while (0)
  11120. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  11121. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  11122. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  11123. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  11124. HTT_SRING_SETUP_DONE_RING_ID_S)
  11125. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  11126. do { \
  11127. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  11128. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  11129. } while (0)
  11130. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  11131. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  11132. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  11133. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  11134. HTT_SRING_SETUP_DONE_STATUS_S)
  11135. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  11136. do { \
  11137. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  11138. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  11139. } while (0)
  11140. /**
  11141. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  11142. *
  11143. * @details
  11144. * HTT TX map flow entry with tqm flow pointer
  11145. * Sent from firmware to host to add tqm flow pointer in corresponding
  11146. * flow search entry. Flow metadata is replayed back to host as part of this
  11147. * struct to enable host to find the specific flow search entry
  11148. *
  11149. * The message would appear as follows:
  11150. *
  11151. * |31 28|27 18|17 14|13 8|7 0|
  11152. * |-------+------------------------------------------+----------------|
  11153. * | rsvd0 | fse_hsh_idx | msg_type |
  11154. * |-------------------------------------------------------------------|
  11155. * | rsvd1 | tid | peer_id |
  11156. * |-------------------------------------------------------------------|
  11157. * | tqm_flow_pntr_lo |
  11158. * |-------------------------------------------------------------------|
  11159. * | tqm_flow_pntr_hi |
  11160. * |-------------------------------------------------------------------|
  11161. * | fse_meta_data |
  11162. * |-------------------------------------------------------------------|
  11163. *
  11164. * The message is interpreted as follows:
  11165. *
  11166. * dword0 - b'0:7 - msg_type: This will be set to
  11167. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  11168. *
  11169. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  11170. * for this flow entry
  11171. *
  11172. * dword0 - b'28:31 - rsvd0: Reserved for future use
  11173. *
  11174. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  11175. *
  11176. * dword1 - b'14:17 - tid
  11177. *
  11178. * dword1 - b'18:31 - rsvd1: Reserved for future use
  11179. *
  11180. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  11181. *
  11182. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  11183. *
  11184. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  11185. * given by host
  11186. */
  11187. PREPACK struct htt_tx_map_flow_info {
  11188. A_UINT32
  11189. msg_type: 8,
  11190. fse_hsh_idx: 20,
  11191. rsvd0: 4;
  11192. A_UINT32
  11193. peer_id: 14,
  11194. tid: 4,
  11195. rsvd1: 14;
  11196. A_UINT32 tqm_flow_pntr_lo;
  11197. A_UINT32 tqm_flow_pntr_hi;
  11198. struct htt_tx_flow_metadata fse_meta_data;
  11199. } POSTPACK;
  11200. /* DWORD 0 */
  11201. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  11202. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  11203. /* DWORD 1 */
  11204. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  11205. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  11206. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  11207. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  11208. /* DWORD 0 */
  11209. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  11210. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  11211. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  11212. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  11213. do { \
  11214. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  11215. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  11216. } while (0)
  11217. /* DWORD 1 */
  11218. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  11219. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  11220. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  11221. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  11222. do { \
  11223. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  11224. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  11225. } while (0)
  11226. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  11227. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  11228. HTT_TX_MAP_FLOW_INFO_TID_S)
  11229. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  11230. do { \
  11231. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  11232. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  11233. } while (0)
  11234. /*
  11235. * htt_dbg_ext_stats_status -
  11236. * present - The requested stats have been delivered in full.
  11237. * This indicates that either the stats information was contained
  11238. * in its entirety within this message, or else this message
  11239. * completes the delivery of the requested stats info that was
  11240. * partially delivered through earlier STATS_CONF messages.
  11241. * partial - The requested stats have been delivered in part.
  11242. * One or more subsequent STATS_CONF messages with the same
  11243. * cookie value will be sent to deliver the remainder of the
  11244. * information.
  11245. * error - The requested stats could not be delivered, for example due
  11246. * to a shortage of memory to construct a message holding the
  11247. * requested stats.
  11248. * invalid - The requested stat type is either not recognized, or the
  11249. * target is configured to not gather the stats type in question.
  11250. */
  11251. enum htt_dbg_ext_stats_status {
  11252. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  11253. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  11254. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  11255. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  11256. };
  11257. /**
  11258. * @brief target -> host ppdu stats upload
  11259. *
  11260. * @details
  11261. * The following field definitions describe the format of the HTT target
  11262. * to host ppdu stats indication message.
  11263. *
  11264. *
  11265. * |31 16|15 12|11 10|9 8|7 0 |
  11266. * |----------------------------------------------------------------------|
  11267. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  11268. * |----------------------------------------------------------------------|
  11269. * | ppdu_id |
  11270. * |----------------------------------------------------------------------|
  11271. * | Timestamp in us |
  11272. * |----------------------------------------------------------------------|
  11273. * | reserved |
  11274. * |----------------------------------------------------------------------|
  11275. * | type-specific stats info |
  11276. * | (see htt_ppdu_stats.h) |
  11277. * |----------------------------------------------------------------------|
  11278. * Header fields:
  11279. * - MSG_TYPE
  11280. * Bits 7:0
  11281. * Purpose: Identifies this is a PPDU STATS indication
  11282. * message.
  11283. * Value: 0x1d
  11284. * - mac_id
  11285. * Bits 9:8
  11286. * Purpose: mac_id of this ppdu_id
  11287. * Value: 0-3
  11288. * - pdev_id
  11289. * Bits 11:10
  11290. * Purpose: pdev_id of this ppdu_id
  11291. * Value: 0-3
  11292. * 0 (for rings at SOC level),
  11293. * 1/2/3 PDEV -> 0/1/2
  11294. * - payload_size
  11295. * Bits 31:16
  11296. * Purpose: total tlv size
  11297. * Value: payload_size in bytes
  11298. */
  11299. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  11300. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  11301. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  11302. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  11303. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  11304. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  11305. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  11306. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  11307. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  11308. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  11309. do { \
  11310. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  11311. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  11312. } while (0)
  11313. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  11314. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  11315. HTT_T2H_PPDU_STATS_MAC_ID_S)
  11316. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  11317. do { \
  11318. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  11319. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  11320. } while (0)
  11321. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  11322. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  11323. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  11324. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  11325. do { \
  11326. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  11327. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  11328. } while (0)
  11329. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  11330. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  11331. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  11332. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  11333. do { \
  11334. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  11335. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  11336. } while (0)
  11337. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  11338. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  11339. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  11340. /* htt_t2h_ppdu_stats_ind_hdr_t
  11341. * This struct contains the fields within the header of the
  11342. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  11343. * stats info.
  11344. * This struct assumes little-endian layout, and thus is only
  11345. * suitable for use within processors known to be little-endian
  11346. * (such as the target).
  11347. * In contrast, the above macros provide endian-portable methods
  11348. * to get and set the bitfields within this PPDU_STATS_IND header.
  11349. */
  11350. typedef struct {
  11351. A_UINT32 msg_type: 8, /* bits 7:0 */
  11352. mac_id: 2, /* bits 9:8 */
  11353. pdev_id: 2, /* bits 11:10 */
  11354. reserved1: 4, /* bits 15:12 */
  11355. payload_size: 16; /* bits 31:16 */
  11356. A_UINT32 ppdu_id;
  11357. A_UINT32 timestamp_us;
  11358. A_UINT32 reserved2;
  11359. } htt_t2h_ppdu_stats_ind_hdr_t;
  11360. /**
  11361. * @brief target -> host extended statistics upload
  11362. *
  11363. * @details
  11364. * The following field definitions describe the format of the HTT target
  11365. * to host stats upload confirmation message.
  11366. * The message contains a cookie echoed from the HTT host->target stats
  11367. * upload request, which identifies which request the confirmation is
  11368. * for, and a single stats can span over multiple HTT stats indication
  11369. * due to the HTT message size limitation so every HTT ext stats indication
  11370. * will have tag-length-value stats information elements.
  11371. * The tag-length header for each HTT stats IND message also includes a
  11372. * status field, to indicate whether the request for the stat type in
  11373. * question was fully met, partially met, unable to be met, or invalid
  11374. * (if the stat type in question is disabled in the target).
  11375. * A Done bit 1's indicate the end of the of stats info elements.
  11376. *
  11377. *
  11378. * |31 16|15 12|11|10 8|7 5|4 0|
  11379. * |--------------------------------------------------------------|
  11380. * | reserved | msg type |
  11381. * |--------------------------------------------------------------|
  11382. * | cookie LSBs |
  11383. * |--------------------------------------------------------------|
  11384. * | cookie MSBs |
  11385. * |--------------------------------------------------------------|
  11386. * | stats entry length | rsvd | D| S | stat type |
  11387. * |--------------------------------------------------------------|
  11388. * | type-specific stats info |
  11389. * | (see htt_stats.h) |
  11390. * |--------------------------------------------------------------|
  11391. * Header fields:
  11392. * - MSG_TYPE
  11393. * Bits 7:0
  11394. * Purpose: Identifies this is a extended statistics upload confirmation
  11395. * message.
  11396. * Value: 0x1c
  11397. * - COOKIE_LSBS
  11398. * Bits 31:0
  11399. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11400. * message with its preceding host->target stats request message.
  11401. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11402. * - COOKIE_MSBS
  11403. * Bits 31:0
  11404. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11405. * message with its preceding host->target stats request message.
  11406. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11407. *
  11408. * Stats Information Element tag-length header fields:
  11409. * - STAT_TYPE
  11410. * Bits 7:0
  11411. * Purpose: identifies the type of statistics info held in the
  11412. * following information element
  11413. * Value: htt_dbg_ext_stats_type
  11414. * - STATUS
  11415. * Bits 10:8
  11416. * Purpose: indicate whether the requested stats are present
  11417. * Value: htt_dbg_ext_stats_status
  11418. * - DONE
  11419. * Bits 11
  11420. * Purpose:
  11421. * Indicates the completion of the stats entry, this will be the last
  11422. * stats conf HTT segment for the requested stats type.
  11423. * Value:
  11424. * 0 -> the stats retrieval is ongoing
  11425. * 1 -> the stats retrieval is complete
  11426. * - LENGTH
  11427. * Bits 31:16
  11428. * Purpose: indicate the stats information size
  11429. * Value: This field specifies the number of bytes of stats information
  11430. * that follows the element tag-length header.
  11431. * It is expected but not required that this length is a multiple of
  11432. * 4 bytes.
  11433. */
  11434. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  11435. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  11436. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  11437. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  11438. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  11439. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  11440. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  11441. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  11442. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  11443. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11444. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  11445. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  11446. do { \
  11447. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  11448. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  11449. } while (0)
  11450. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  11451. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  11452. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  11453. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  11454. do { \
  11455. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  11456. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  11457. } while (0)
  11458. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  11459. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  11460. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  11461. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  11462. do { \
  11463. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  11464. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  11465. } while (0)
  11466. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  11467. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  11468. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  11469. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11470. do { \
  11471. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  11472. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  11473. } while (0)
  11474. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  11475. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  11476. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  11477. typedef enum {
  11478. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  11479. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  11480. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  11481. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  11482. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  11483. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  11484. /* Reserved from 128 - 255 for target internal use.*/
  11485. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  11486. } HTT_PEER_TYPE;
  11487. /** macro to convert MAC address from char array to HTT word format */
  11488. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  11489. (phtt_mac_addr)->mac_addr31to0 = \
  11490. (((c_macaddr)[0] << 0) | \
  11491. ((c_macaddr)[1] << 8) | \
  11492. ((c_macaddr)[2] << 16) | \
  11493. ((c_macaddr)[3] << 24)); \
  11494. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  11495. } while (0)
  11496. /**
  11497. * @brief target -> host monitor mac header indication message
  11498. *
  11499. * @details
  11500. * The following diagram shows the format of the monitor mac header message
  11501. * sent from the target to the host.
  11502. * This message is primarily sent when promiscuous rx mode is enabled.
  11503. * One message is sent per rx PPDU.
  11504. *
  11505. * |31 24|23 16|15 8|7 0|
  11506. * |-------------------------------------------------------------|
  11507. * | peer_id | reserved0 | msg_type |
  11508. * |-------------------------------------------------------------|
  11509. * | reserved1 | num_mpdu |
  11510. * |-------------------------------------------------------------|
  11511. * | struct hw_rx_desc |
  11512. * | (see wal_rx_desc.h) |
  11513. * |-------------------------------------------------------------|
  11514. * | struct ieee80211_frame_addr4 |
  11515. * | (see ieee80211_defs.h) |
  11516. * |-------------------------------------------------------------|
  11517. * | struct ieee80211_frame_addr4 |
  11518. * | (see ieee80211_defs.h) |
  11519. * |-------------------------------------------------------------|
  11520. * | ...... |
  11521. * |-------------------------------------------------------------|
  11522. *
  11523. * Header fields:
  11524. * - msg_type
  11525. * Bits 7:0
  11526. * Purpose: Identifies this is a monitor mac header indication message.
  11527. * Value: 0x20
  11528. * - peer_id
  11529. * Bits 31:16
  11530. * Purpose: Software peer id given by host during association,
  11531. * During promiscuous mode, the peer ID will be invalid (0xFF)
  11532. * for rx PPDUs received from unassociated peers.
  11533. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  11534. * - num_mpdu
  11535. * Bits 15:0
  11536. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  11537. * delivered within the message.
  11538. * Value: 1 to 32
  11539. * num_mpdu is limited to a maximum value of 32, due to buffer
  11540. * size limits. For PPDUs with more than 32 MPDUs, only the
  11541. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  11542. * the PPDU will be provided.
  11543. */
  11544. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  11545. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  11546. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  11547. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  11548. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  11549. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  11550. do { \
  11551. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  11552. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  11553. } while (0)
  11554. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  11555. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  11556. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  11557. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  11558. do { \
  11559. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  11560. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  11561. } while (0)
  11562. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  11563. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  11564. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  11565. /**
  11566. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  11567. *
  11568. * @details
  11569. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  11570. * the flow pool associated with the specified ID is resized
  11571. *
  11572. * The message would appear as follows:
  11573. *
  11574. * |31 16|15 8|7 0|
  11575. * |---------------------------------+----------------+----------------|
  11576. * | reserved0 | Msg type |
  11577. * |-------------------------------------------------------------------|
  11578. * | flow pool new size | flow pool ID |
  11579. * |-------------------------------------------------------------------|
  11580. *
  11581. * The message is interpreted as follows:
  11582. * b'0:7 - msg_type: This will be set to
  11583. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  11584. *
  11585. * b'0:15 - flow pool ID: Existing flow pool ID
  11586. *
  11587. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  11588. *
  11589. */
  11590. PREPACK struct htt_flow_pool_resize_t {
  11591. A_UINT32 msg_type:8,
  11592. reserved0:24;
  11593. A_UINT32 flow_pool_id:16,
  11594. flow_pool_new_size:16;
  11595. } POSTPACK;
  11596. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  11597. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  11598. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  11599. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  11600. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  11601. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  11602. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  11603. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  11604. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  11605. do { \
  11606. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  11607. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  11608. } while (0)
  11609. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  11610. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  11611. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  11612. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  11613. do { \
  11614. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  11615. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  11616. } while (0)
  11617. /**
  11618. * @brief host -> target channel change message
  11619. *
  11620. * @details
  11621. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  11622. * to associate RX frames to correct channel they were received on.
  11623. * The following field definitions describe the format of the HTT target
  11624. * to host channel change message.
  11625. * |31 16|15 8|7 5|4 0|
  11626. * |------------------------------------------------------------|
  11627. * | reserved | MSG_TYPE |
  11628. * |------------------------------------------------------------|
  11629. * | CHAN_MHZ |
  11630. * |------------------------------------------------------------|
  11631. * | BAND_CENTER_FREQ1 |
  11632. * |------------------------------------------------------------|
  11633. * | BAND_CENTER_FREQ2 |
  11634. * |------------------------------------------------------------|
  11635. * | CHAN_PHY_MODE |
  11636. * |------------------------------------------------------------|
  11637. * Header fields:
  11638. * - MSG_TYPE
  11639. * Bits 7:0
  11640. * Value: 0xf
  11641. * - CHAN_MHZ
  11642. * Bits 31:0
  11643. * Purpose: frequency of the primary 20mhz channel.
  11644. * - BAND_CENTER_FREQ1
  11645. * Bits 31:0
  11646. * Purpose: centre frequency of the full channel.
  11647. * - BAND_CENTER_FREQ2
  11648. * Bits 31:0
  11649. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  11650. * - CHAN_PHY_MODE
  11651. * Bits 31:0
  11652. * Purpose: phy mode of the channel.
  11653. */
  11654. PREPACK struct htt_chan_change_msg {
  11655. A_UINT32 chan_mhz; /* frequency in mhz */
  11656. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  11657. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  11658. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  11659. } POSTPACK;
  11660. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  11661. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  11662. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  11663. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  11664. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  11665. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  11666. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  11667. /*
  11668. * The read and write indices point to the data within the host buffer.
  11669. * Because the first 4 bytes of the host buffer is used for the read index and
  11670. * the next 4 bytes for the write index, the data itself starts at offset 8.
  11671. * The read index and write index are the byte offsets from the base of the
  11672. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  11673. * Refer the ASCII text picture below.
  11674. */
  11675. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  11676. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  11677. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  11678. /*
  11679. ***************************************************************************
  11680. *
  11681. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11682. *
  11683. ***************************************************************************
  11684. *
  11685. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  11686. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  11687. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  11688. * written into the Host memory region mentioned below.
  11689. *
  11690. * Read index is updated by the Host. At any point of time, the read index will
  11691. * indicate the index that will next be read by the Host. The read index is
  11692. * in units of bytes offset from the base of the meta-data buffer.
  11693. *
  11694. * Write index is updated by the FW. At any point of time, the write index will
  11695. * indicate from where the FW can start writing any new data. The write index is
  11696. * in units of bytes offset from the base of the meta-data buffer.
  11697. *
  11698. * If the Host is not fast enough in reading the CFR data, any new capture data
  11699. * would be dropped if there is no space left to write the new captures.
  11700. *
  11701. * The last 4 bytes of the memory region will have the magic pattern
  11702. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  11703. * not overrun the host buffer.
  11704. *
  11705. * ,--------------------. read and write indices store the
  11706. * | | byte offset from the base of the
  11707. * | ,--------+--------. meta-data buffer to the next
  11708. * | | | | location within the data buffer
  11709. * | | v v that will be read / written
  11710. * ************************************************************************
  11711. * * Read * Write * * Magic *
  11712. * * index * index * CFR data1 ...... CFR data N * pattern *
  11713. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  11714. * ************************************************************************
  11715. * |<---------- data buffer ---------->|
  11716. *
  11717. * |<----------------- meta-data buffer allocated in Host ----------------|
  11718. *
  11719. * Note:
  11720. * - Considering the 4 bytes needed to store the Read index (R) and the
  11721. * Write index (W), the initial value is as follows:
  11722. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  11723. * - Buffer empty condition:
  11724. * R = W
  11725. *
  11726. * Regarding CFR data format:
  11727. * --------------------------
  11728. *
  11729. * Each CFR tone is stored in HW as 16-bits with the following format:
  11730. * {bits[15:12], bits[11:6], bits[5:0]} =
  11731. * {unsigned exponent (4 bits),
  11732. * signed mantissa_real (6 bits),
  11733. * signed mantissa_imag (6 bits)}
  11734. *
  11735. * CFR_real = mantissa_real * 2^(exponent-5)
  11736. * CFR_imag = mantissa_imag * 2^(exponent-5)
  11737. *
  11738. *
  11739. * The CFR data is written to the 16-bit unsigned output array (buff) in
  11740. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  11741. *
  11742. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  11743. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  11744. * .
  11745. * .
  11746. * .
  11747. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  11748. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  11749. */
  11750. /* Bandwidth of peer CFR captures */
  11751. typedef enum {
  11752. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  11753. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  11754. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  11755. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  11756. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  11757. HTT_PEER_CFR_CAPTURE_BW_MAX,
  11758. } HTT_PEER_CFR_CAPTURE_BW;
  11759. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  11760. * was captured
  11761. */
  11762. typedef enum {
  11763. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  11764. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  11765. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  11766. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  11767. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  11768. } HTT_PEER_CFR_CAPTURE_MODE;
  11769. typedef enum {
  11770. /* This message type is currently used for the below purpose:
  11771. *
  11772. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  11773. * wmi_peer_cfr_capture_cmd.
  11774. * If payload_present bit is set to 0 then the associated memory region
  11775. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  11776. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  11777. * message; the CFR dump will be present at the end of the message,
  11778. * after the chan_phy_mode.
  11779. */
  11780. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  11781. /* Always keep this last */
  11782. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  11783. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  11784. /**
  11785. * @brief target -> host CFR dump completion indication message definition
  11786. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  11787. *
  11788. * @details
  11789. * The following diagram shows the format of the Channel Frequency Response
  11790. * (CFR) dump completion indication. This inidcation is sent to the Host when
  11791. * the channel capture of a peer is copied by Firmware into the Host memory
  11792. *
  11793. * **************************************************************************
  11794. *
  11795. * Message format when the CFR capture message type is
  11796. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11797. *
  11798. * **************************************************************************
  11799. *
  11800. * |31 16|15 |8|7 0|
  11801. * |----------------------------------------------------------------|
  11802. * header: | reserved |P| msg_type |
  11803. * word 0 | | | |
  11804. * |----------------------------------------------------------------|
  11805. * payload: | cfr_capture_msg_type |
  11806. * word 1 | |
  11807. * |----------------------------------------------------------------|
  11808. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  11809. * word 2 | | | | | | | | |
  11810. * |----------------------------------------------------------------|
  11811. * | mac_addr31to0 |
  11812. * word 3 | |
  11813. * |----------------------------------------------------------------|
  11814. * | unused / reserved | mac_addr47to32 |
  11815. * word 4 | | |
  11816. * |----------------------------------------------------------------|
  11817. * | index |
  11818. * word 5 | |
  11819. * |----------------------------------------------------------------|
  11820. * | length |
  11821. * word 6 | |
  11822. * |----------------------------------------------------------------|
  11823. * | timestamp |
  11824. * word 7 | |
  11825. * |----------------------------------------------------------------|
  11826. * | counter |
  11827. * word 8 | |
  11828. * |----------------------------------------------------------------|
  11829. * | chan_mhz |
  11830. * word 9 | |
  11831. * |----------------------------------------------------------------|
  11832. * | band_center_freq1 |
  11833. * word 10 | |
  11834. * |----------------------------------------------------------------|
  11835. * | band_center_freq2 |
  11836. * word 11 | |
  11837. * |----------------------------------------------------------------|
  11838. * | chan_phy_mode |
  11839. * word 12 | |
  11840. * |----------------------------------------------------------------|
  11841. * where,
  11842. * P - payload present bit (payload_present explained below)
  11843. * req_id - memory request id (mem_req_id explained below)
  11844. * S - status field (status explained below)
  11845. * capbw - capture bandwidth (capture_bw explained below)
  11846. * mode - mode of capture (mode explained below)
  11847. * sts - space time streams (sts_count explained below)
  11848. * chbw - channel bandwidth (channel_bw explained below)
  11849. * captype - capture type (cap_type explained below)
  11850. *
  11851. * The following field definitions describe the format of the CFR dump
  11852. * completion indication sent from the target to the host
  11853. *
  11854. * Header fields:
  11855. *
  11856. * Word 0
  11857. * - msg_type
  11858. * Bits 7:0
  11859. * Purpose: Identifies this as CFR TX completion indication
  11860. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  11861. * - payload_present
  11862. * Bit 8
  11863. * Purpose: Identifies how CFR data is sent to host
  11864. * Value: 0 - If CFR Payload is written to host memory
  11865. * 1 - If CFR Payload is sent as part of HTT message
  11866. * (This is the requirement for SDIO/USB where it is
  11867. * not possible to write CFR data to host memory)
  11868. * - reserved
  11869. * Bits 31:9
  11870. * Purpose: Reserved
  11871. * Value: 0
  11872. *
  11873. * Payload fields:
  11874. *
  11875. * Word 1
  11876. * - cfr_capture_msg_type
  11877. * Bits 31:0
  11878. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  11879. * to specify the format used for the remainder of the message
  11880. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11881. * (currently only MSG_TYPE_1 is defined)
  11882. *
  11883. * Word 2
  11884. * - mem_req_id
  11885. * Bits 6:0
  11886. * Purpose: Contain the mem request id of the region where the CFR capture
  11887. * has been stored - of type WMI_HOST_MEM_REQ_ID
  11888. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  11889. this value is invalid)
  11890. * - status
  11891. * Bit 7
  11892. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  11893. * Value: 1 (True) - Successful; 0 (False) - Not successful
  11894. * - capture_bw
  11895. * Bits 10:8
  11896. * Purpose: Carry the bandwidth of the CFR capture
  11897. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  11898. * - mode
  11899. * Bits 13:11
  11900. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  11901. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  11902. * - sts_count
  11903. * Bits 16:14
  11904. * Purpose: Carry the number of space time streams
  11905. * Value: Number of space time streams
  11906. * - channel_bw
  11907. * Bits 19:17
  11908. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  11909. * measurement
  11910. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  11911. * - cap_type
  11912. * Bits 23:20
  11913. * Purpose: Carry the type of the capture
  11914. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  11915. * - vdev_id
  11916. * Bits 31:24
  11917. * Purpose: Carry the virtual device id
  11918. * Value: vdev ID
  11919. *
  11920. * Word 3
  11921. * - mac_addr31to0
  11922. * Bits 31:0
  11923. * Purpose: Contain the bits 31:0 of the peer MAC address
  11924. * Value: Bits 31:0 of the peer MAC address
  11925. *
  11926. * Word 4
  11927. * - mac_addr47to32
  11928. * Bits 15:0
  11929. * Purpose: Contain the bits 47:32 of the peer MAC address
  11930. * Value: Bits 47:32 of the peer MAC address
  11931. *
  11932. * Word 5
  11933. * - index
  11934. * Bits 31:0
  11935. * Purpose: Contain the index at which this CFR dump was written in the Host
  11936. * allocated memory. This index is the number of bytes from the base address.
  11937. * Value: Index position
  11938. *
  11939. * Word 6
  11940. * - length
  11941. * Bits 31:0
  11942. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  11943. * Value: Length of the CFR capture of the peer
  11944. *
  11945. * Word 7
  11946. * - timestamp
  11947. * Bits 31:0
  11948. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  11949. * clock used for this timestamp is private to the target and not visible to
  11950. * the host i.e., Host can interpret only the relative timestamp deltas from
  11951. * one message to the next, but can't interpret the absolute timestamp from a
  11952. * single message.
  11953. * Value: Timestamp in microseconds
  11954. *
  11955. * Word 8
  11956. * - counter
  11957. * Bits 31:0
  11958. * Purpose: Carry the count of the current CFR capture from FW. This is
  11959. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  11960. * in host memory)
  11961. * Value: Count of the current CFR capture
  11962. *
  11963. * Word 9
  11964. * - chan_mhz
  11965. * Bits 31:0
  11966. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  11967. * Value: Primary 20 channel frequency
  11968. *
  11969. * Word 10
  11970. * - band_center_freq1
  11971. * Bits 31:0
  11972. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  11973. * Value: Center frequency 1 in MHz
  11974. *
  11975. * Word 11
  11976. * - band_center_freq2
  11977. * Bits 31:0
  11978. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  11979. * the VDEV
  11980. * 80plus80 mode
  11981. * Value: Center frequency 2 in MHz
  11982. *
  11983. * Word 12
  11984. * - chan_phy_mode
  11985. * Bits 31:0
  11986. * Purpose: Carry the phy mode of the channel, of the VDEV
  11987. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  11988. */
  11989. PREPACK struct htt_cfr_dump_ind_type_1 {
  11990. A_UINT32 mem_req_id:7,
  11991. status:1,
  11992. capture_bw:3,
  11993. mode:3,
  11994. sts_count:3,
  11995. channel_bw:3,
  11996. cap_type:4,
  11997. vdev_id:8;
  11998. htt_mac_addr addr;
  11999. A_UINT32 index;
  12000. A_UINT32 length;
  12001. A_UINT32 timestamp;
  12002. A_UINT32 counter;
  12003. struct htt_chan_change_msg chan;
  12004. } POSTPACK;
  12005. PREPACK struct htt_cfr_dump_compl_ind {
  12006. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  12007. union {
  12008. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  12009. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  12010. /* If there is a need to change the memory layout and its associated
  12011. * HTT indication format, a new CFR capture message type can be
  12012. * introduced and added into this union.
  12013. */
  12014. };
  12015. } POSTPACK;
  12016. /*
  12017. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  12018. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12019. */
  12020. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  12021. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  12022. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  12023. do { \
  12024. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  12025. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  12026. } while(0)
  12027. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  12028. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  12029. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  12030. /*
  12031. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  12032. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12033. */
  12034. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  12035. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  12036. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  12037. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  12038. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  12039. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  12040. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  12041. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  12042. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  12043. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  12044. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  12045. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  12046. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  12047. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  12048. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  12049. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  12050. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  12051. do { \
  12052. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  12053. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  12054. } while (0)
  12055. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  12056. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  12057. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  12058. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  12059. do { \
  12060. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  12061. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  12062. } while (0)
  12063. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  12064. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  12065. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  12066. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  12067. do { \
  12068. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  12069. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  12070. } while (0)
  12071. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  12072. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  12073. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  12074. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  12075. do { \
  12076. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  12077. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  12078. } while (0)
  12079. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  12080. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  12081. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  12082. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  12083. do { \
  12084. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  12085. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  12086. } while (0)
  12087. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  12088. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  12089. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  12090. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  12091. do { \
  12092. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  12093. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  12094. } while (0)
  12095. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  12096. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  12097. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  12098. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  12099. do { \
  12100. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  12101. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  12102. } while (0)
  12103. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  12104. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  12105. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  12106. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  12107. do { \
  12108. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  12109. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  12110. } while (0)
  12111. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  12112. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  12113. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  12114. /**
  12115. * @brief target -> host peer (PPDU) stats message
  12116. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  12117. * @details
  12118. * This message is generated by FW when FW is sending stats to host
  12119. * about one or more PPDUs that the FW has transmitted to one or more peers.
  12120. * This message is sent autonomously by the target rather than upon request
  12121. * by the host.
  12122. * The following field definitions describe the format of the HTT target
  12123. * to host peer stats indication message.
  12124. *
  12125. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  12126. * or more PPDU stats records.
  12127. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  12128. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  12129. * then the message would start with the
  12130. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  12131. * below.
  12132. *
  12133. * |31 16|15|14|13 11|10 9|8|7 0|
  12134. * |-------------------------------------------------------------|
  12135. * | reserved |MSG_TYPE |
  12136. * |-------------------------------------------------------------|
  12137. * rec 0 | TLV header |
  12138. * rec 0 |-------------------------------------------------------------|
  12139. * rec 0 | ppdu successful bytes |
  12140. * rec 0 |-------------------------------------------------------------|
  12141. * rec 0 | ppdu retry bytes |
  12142. * rec 0 |-------------------------------------------------------------|
  12143. * rec 0 | ppdu failed bytes |
  12144. * rec 0 |-------------------------------------------------------------|
  12145. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  12146. * rec 0 |-------------------------------------------------------------|
  12147. * rec 0 | retried MSDUs | successful MSDUs |
  12148. * rec 0 |-------------------------------------------------------------|
  12149. * rec 0 | TX duration | failed MSDUs |
  12150. * rec 0 |-------------------------------------------------------------|
  12151. * ...
  12152. * |-------------------------------------------------------------|
  12153. * rec N | TLV header |
  12154. * rec N |-------------------------------------------------------------|
  12155. * rec N | ppdu successful bytes |
  12156. * rec N |-------------------------------------------------------------|
  12157. * rec N | ppdu retry bytes |
  12158. * rec N |-------------------------------------------------------------|
  12159. * rec N | ppdu failed bytes |
  12160. * rec N |-------------------------------------------------------------|
  12161. * rec N | peer id | S|SG| BW | BA |A|rate code|
  12162. * rec N |-------------------------------------------------------------|
  12163. * rec N | retried MSDUs | successful MSDUs |
  12164. * rec N |-------------------------------------------------------------|
  12165. * rec N | TX duration | failed MSDUs |
  12166. * rec N |-------------------------------------------------------------|
  12167. *
  12168. * where:
  12169. * A = is A-MPDU flag
  12170. * BA = block-ack failure flags
  12171. * BW = bandwidth spec
  12172. * SG = SGI enabled spec
  12173. * S = skipped rate ctrl
  12174. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  12175. *
  12176. * Header
  12177. * ------
  12178. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  12179. * dword0 - b'8:31 - reserved : Reserved for future use
  12180. *
  12181. * payload include below peer_stats information
  12182. * --------------------------------------------
  12183. * @TLV : HTT_PPDU_STATS_INFO_TLV
  12184. * @tx_success_bytes : total successful bytes in the PPDU.
  12185. * @tx_retry_bytes : total retried bytes in the PPDU.
  12186. * @tx_failed_bytes : total failed bytes in the PPDU.
  12187. * @tx_ratecode : rate code used for the PPDU.
  12188. * @is_ampdu : Indicates PPDU is AMPDU or not.
  12189. * @ba_ack_failed : BA/ACK failed for this PPDU
  12190. * b00 -> BA received
  12191. * b01 -> BA failed once
  12192. * b10 -> BA failed twice, when HW retry is enabled.
  12193. * @bw : BW
  12194. * b00 -> 20 MHz
  12195. * b01 -> 40 MHz
  12196. * b10 -> 80 MHz
  12197. * b11 -> 160 MHz (or 80+80)
  12198. * @sg : SGI enabled
  12199. * @s : skipped ratectrl
  12200. * @peer_id : peer id
  12201. * @tx_success_msdus : successful MSDUs
  12202. * @tx_retry_msdus : retried MSDUs
  12203. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  12204. * @tx_duration : Tx duration for the PPDU (microsecond units)
  12205. */
  12206. /**
  12207. * @brief HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID Message
  12208. *
  12209. * @details
  12210. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  12211. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  12212. * This message will only be sent if the backpressure condition has existed
  12213. * continuously for an initial period (100 ms).
  12214. * Repeat messages with updated information will be sent after each
  12215. * subsequent period (100 ms) as long as the backpressure remains unabated.
  12216. * This message indicates the ring id along with current head and tail index
  12217. * locations (i.e. write and read indices).
  12218. * The backpressure time indicates the time in ms for which continous
  12219. * backpressure has been observed in the ring.
  12220. *
  12221. * The message format is as follows:
  12222. *
  12223. * |31 24|23 16|15 8|7 0|
  12224. * |----------------+----------------+----------------+----------------|
  12225. * | ring_id | ring_type | pdev_id | msg_type |
  12226. * |-------------------------------------------------------------------|
  12227. * | tail_idx | head_idx |
  12228. * |-------------------------------------------------------------------|
  12229. * | backpressure_time_ms |
  12230. * |-------------------------------------------------------------------|
  12231. *
  12232. * The message is interpreted as follows:
  12233. * dword0 - b'0:7 - msg_type: This will be set to
  12234. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  12235. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  12236. * 1, 2, 3 indicates pdev_id 0,1,2 and
  12237. the msg is for LMAC ring.
  12238. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  12239. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  12240. * htt_backpressure_lmac_ring_id. This represents
  12241. * the ring id for which continous backpressure is seen
  12242. *
  12243. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  12244. * the ring indicated by the ring_id
  12245. *
  12246. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  12247. * the ring indicated by the ring id
  12248. *
  12249. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  12250. * backpressure has been seen in the ring
  12251. * indicated by the ring_id.
  12252. * Units = milliseconds
  12253. */
  12254. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  12255. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  12256. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  12257. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  12258. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  12259. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  12260. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  12261. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  12262. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  12263. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  12264. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  12265. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  12266. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  12267. do { \
  12268. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  12269. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  12270. } while (0)
  12271. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  12272. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  12273. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  12274. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  12275. do { \
  12276. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  12277. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  12278. } while (0)
  12279. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  12280. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  12281. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  12282. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  12283. do { \
  12284. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  12285. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  12286. } while (0)
  12287. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  12288. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  12289. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  12290. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  12291. do { \
  12292. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  12293. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  12294. } while (0)
  12295. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  12296. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  12297. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  12298. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  12299. do { \
  12300. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  12301. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  12302. } while (0)
  12303. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  12304. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  12305. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  12306. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  12307. do { \
  12308. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  12309. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  12310. } while (0)
  12311. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  12312. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  12313. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  12314. enum htt_backpressure_ring_type {
  12315. HTT_SW_RING_TYPE_UMAC,
  12316. HTT_SW_RING_TYPE_LMAC,
  12317. HTT_SW_RING_TYPE_MAX,
  12318. };
  12319. /* Ring id for which the message is sent to host */
  12320. enum htt_backpressure_umac_ringid {
  12321. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  12322. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  12323. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  12324. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  12325. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  12326. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  12327. HTT_SW_RING_IDX_REO_REO2FW_RING,
  12328. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  12329. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  12330. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  12331. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  12332. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  12333. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  12334. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  12335. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  12336. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  12337. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  12338. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  12339. HTT_SW_UMAC_RING_IDX_MAX,
  12340. };
  12341. enum htt_backpressure_lmac_ringid {
  12342. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  12343. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  12344. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  12345. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  12346. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  12347. HTT_SW_RING_IDX_RXDMA2FW_RING,
  12348. HTT_SW_RING_IDX_RXDMA2SW_RING,
  12349. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  12350. HTT_SW_RING_IDX_RXDMA2REO_RING,
  12351. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  12352. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  12353. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  12354. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  12355. HTT_SW_LMAC_RING_IDX_MAX,
  12356. };
  12357. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  12358. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  12359. pdev_id: 8,
  12360. ring_type: 8, /* htt_backpressure_ring_type */
  12361. /*
  12362. * ring_id holds an enum value from either
  12363. * htt_backpressure_umac_ringid or
  12364. * htt_backpressure_lmac_ringid, based on
  12365. * the ring_type setting.
  12366. */
  12367. ring_id: 8;
  12368. A_UINT16 head_idx;
  12369. A_UINT16 tail_idx;
  12370. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  12371. } POSTPACK;
  12372. /*
  12373. * Defines two 32 bit words that can be used by the target to indicate a per
  12374. * user RU allocation and rate information.
  12375. *
  12376. * This information is currently provided in the "sw_response_reference_ptr"
  12377. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  12378. * "rx_ppdu_end_user_stats" TLV.
  12379. *
  12380. * VALID:
  12381. * The consumer of these words must explicitly check the valid bit,
  12382. * and only attempt interpretation of any of the remaining fields if
  12383. * the valid bit is set to 1.
  12384. *
  12385. * VERSION:
  12386. * The consumer of these words must also explicitly check the version bit,
  12387. * and only use the V0 definition if the VERSION field is set to 0.
  12388. *
  12389. * Version 1 is currently undefined, with the exception of the VALID and
  12390. * VERSION fields.
  12391. *
  12392. * Version 0:
  12393. *
  12394. * The fields below are duplicated per BW.
  12395. *
  12396. * The consumer must determine which BW field to use, based on the UL OFDMA
  12397. * PPDU BW indicated by HW.
  12398. *
  12399. * RU_START: RU26 start index for the user.
  12400. * Note that this is always using the RU26 index, regardless
  12401. * of the actual RU assigned to the user
  12402. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  12403. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  12404. *
  12405. * For example, 20MHz (the value in the top row is RU_START)
  12406. *
  12407. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  12408. * RU Size 1 (52): | | | | | |
  12409. * RU Size 2 (106): | | | |
  12410. * RU Size 3 (242): | |
  12411. *
  12412. * RU_SIZE: Indicates the RU size, as defined by enum
  12413. * htt_ul_ofdma_user_info_ru_size.
  12414. *
  12415. * LDPC: LDPC enabled (if 0, BCC is used)
  12416. *
  12417. * DCM: DCM enabled
  12418. *
  12419. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  12420. * |---------------------------------+--------------------------------|
  12421. * |Ver|Valid| FW internal |
  12422. * |---------------------------------+--------------------------------|
  12423. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  12424. * |---------------------------------+--------------------------------|
  12425. */
  12426. enum htt_ul_ofdma_user_info_ru_size {
  12427. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  12428. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  12429. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  12430. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  12431. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  12432. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  12433. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  12434. };
  12435. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  12436. struct htt_ul_ofdma_user_info_v0 {
  12437. A_UINT32 word0;
  12438. A_UINT32 word1;
  12439. };
  12440. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  12441. A_UINT32 w0_fw_rsvd:30; \
  12442. A_UINT32 w0_valid:1; \
  12443. A_UINT32 w0_version:1;
  12444. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  12445. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12446. };
  12447. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  12448. A_UINT32 w1_nss:3; \
  12449. A_UINT32 w1_mcs:4; \
  12450. A_UINT32 w1_ldpc:1; \
  12451. A_UINT32 w1_dcm:1; \
  12452. A_UINT32 w1_ru_start:7; \
  12453. A_UINT32 w1_ru_size:3; \
  12454. A_UINT32 w1_trig_type:4; \
  12455. A_UINT32 w1_unused:9;
  12456. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  12457. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12458. };
  12459. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  12460. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  12461. union {
  12462. A_UINT32 word0;
  12463. struct {
  12464. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12465. };
  12466. };
  12467. union {
  12468. A_UINT32 word1;
  12469. struct {
  12470. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12471. };
  12472. };
  12473. } POSTPACK;
  12474. enum HTT_UL_OFDMA_TRIG_TYPE {
  12475. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  12476. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  12477. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  12478. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  12479. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  12480. };
  12481. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  12482. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  12483. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  12484. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  12485. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  12486. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  12487. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  12488. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  12489. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  12490. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  12491. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  12492. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  12493. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  12494. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  12495. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  12496. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  12497. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  12498. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  12499. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  12500. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  12501. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  12502. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  12503. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  12504. /*--- word 0 ---*/
  12505. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  12506. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  12507. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  12508. do { \
  12509. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  12510. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  12511. } while (0)
  12512. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  12513. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  12514. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  12515. do { \
  12516. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  12517. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  12518. } while (0)
  12519. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  12520. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  12521. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  12522. do { \
  12523. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  12524. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  12525. } while (0)
  12526. /*--- word 1 ---*/
  12527. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  12528. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  12529. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  12530. do { \
  12531. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  12532. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  12533. } while (0)
  12534. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  12535. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  12536. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  12537. do { \
  12538. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  12539. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  12540. } while (0)
  12541. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  12542. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  12543. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  12544. do { \
  12545. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  12546. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  12547. } while (0)
  12548. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  12549. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  12550. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  12551. do { \
  12552. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  12553. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  12554. } while (0)
  12555. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  12556. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  12557. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  12558. do { \
  12559. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  12560. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  12561. } while (0)
  12562. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  12563. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  12564. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  12565. do { \
  12566. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  12567. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  12568. } while (0)
  12569. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  12570. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  12571. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  12572. do { \
  12573. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  12574. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  12575. } while (0)
  12576. /**
  12577. * @brief target -> host channel calibration data message
  12578. * @brief host -> target channel calibration data message
  12579. *
  12580. * @details
  12581. * The following field definitions describe the format of the channel
  12582. * calibration data message sent from the target to the host when
  12583. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  12584. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  12585. * The message is defined as htt_chan_caldata_msg followed by a variable
  12586. * number of 32-bit character values.
  12587. *
  12588. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  12589. * |------------------------------------------------------------------|
  12590. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  12591. * |------------------------------------------------------------------|
  12592. * | payload size | mhz |
  12593. * |------------------------------------------------------------------|
  12594. * | center frequency 2 | center frequency 1 |
  12595. * |------------------------------------------------------------------|
  12596. * | check sum |
  12597. * |------------------------------------------------------------------|
  12598. * | payload |
  12599. * |------------------------------------------------------------------|
  12600. * message info field:
  12601. * - MSG_TYPE
  12602. * Bits 7:0
  12603. * Purpose: identifies this as a channel calibration data message
  12604. * Value: HTT_T2H_MSG_TYPE_CHAN_CALDATA (0x15) or
  12605. * HTT_H2T_MSG_TYPE_CHAN_CALDATA (0xb)
  12606. * - SUB_TYPE
  12607. * Bits 11:8
  12608. * Purpose: T2H: indicates whether target is providing chan cal data
  12609. * to the host to store, or requesting that the host
  12610. * download previously-stored data.
  12611. * H2T: indicates whether the host is providing the requested
  12612. * channel cal data, or if it is rejecting the data
  12613. * request because it does not have the requested data.
  12614. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  12615. * - CHKSUM_VALID
  12616. * Bit 12
  12617. * Purpose: indicates if the checksum field is valid
  12618. * value:
  12619. * - FRAG
  12620. * Bit 19:16
  12621. * Purpose: indicates the fragment index for message
  12622. * value: 0 for first fragment, 1 for second fragment, ...
  12623. * - APPEND
  12624. * Bit 20
  12625. * Purpose: indicates if this is the last fragment
  12626. * value: 0 = final fragment, 1 = more fragments will be appended
  12627. *
  12628. * channel and payload size field
  12629. * - MHZ
  12630. * Bits 15:0
  12631. * Purpose: indicates the channel primary frequency
  12632. * Value:
  12633. * - PAYLOAD_SIZE
  12634. * Bits 31:16
  12635. * Purpose: indicates the bytes of calibration data in payload
  12636. * Value:
  12637. *
  12638. * center frequency field
  12639. * - CENTER FREQUENCY 1
  12640. * Bits 15:0
  12641. * Purpose: indicates the channel center frequency
  12642. * Value: channel center frequency, in MHz units
  12643. * - CENTER FREQUENCY 2
  12644. * Bits 31:16
  12645. * Purpose: indicates the secondary channel center frequency,
  12646. * only for 11acvht 80plus80 mode
  12647. * Value: secondary channel center frequeny, in MHz units, if applicable
  12648. *
  12649. * checksum field
  12650. * - CHECK_SUM
  12651. * Bits 31:0
  12652. * Purpose: check the payload data, it is just for this fragment.
  12653. * This is intended for the target to check that the channel
  12654. * calibration data returned by the host is the unmodified data
  12655. * that was previously provided to the host by the target.
  12656. * value: checksum of fragment payload
  12657. */
  12658. PREPACK struct htt_chan_caldata_msg {
  12659. /* DWORD 0: message info */
  12660. A_UINT32
  12661. msg_type: 8,
  12662. sub_type: 4 ,
  12663. chksum_valid: 1, /** 1:valid, 0:invalid */
  12664. reserved1: 3,
  12665. frag_idx: 4, /** fragment index for calibration data */
  12666. appending: 1, /** 0: no fragment appending,
  12667. * 1: extra fragment appending */
  12668. reserved2: 11;
  12669. /* DWORD 1: channel and payload size */
  12670. A_UINT32
  12671. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  12672. payload_size: 16; /** unit: bytes */
  12673. /* DWORD 2: center frequency */
  12674. A_UINT32
  12675. band_center_freq1: 16, /** Center frequency 1 in MHz */
  12676. band_center_freq2: 16; /** Center frequency 2 in MHz,
  12677. * valid only for 11acvht 80plus80 mode */
  12678. /* DWORD 3: check sum */
  12679. A_UINT32 chksum;
  12680. /* variable length for calibration data */
  12681. A_UINT32 payload[1/* or more */];
  12682. } POSTPACK;
  12683. /* T2H SUBTYPE */
  12684. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  12685. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  12686. /* H2T SUBTYPE */
  12687. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  12688. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  12689. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  12690. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  12691. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  12692. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  12693. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  12694. do { \
  12695. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  12696. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  12697. } while (0)
  12698. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  12699. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  12700. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  12701. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  12702. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  12703. do { \
  12704. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  12705. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  12706. } while (0)
  12707. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  12708. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  12709. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  12710. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  12711. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  12712. do { \
  12713. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  12714. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  12715. } while (0)
  12716. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  12717. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  12718. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  12719. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  12720. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  12721. do { \
  12722. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  12723. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  12724. } while (0)
  12725. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  12726. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  12727. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  12728. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  12729. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  12730. do { \
  12731. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  12732. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  12733. } while (0)
  12734. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  12735. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  12736. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  12737. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  12738. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  12739. do { \
  12740. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  12741. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  12742. } while (0)
  12743. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  12744. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  12745. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  12746. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  12747. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  12748. do { \
  12749. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  12750. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  12751. } while (0)
  12752. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  12753. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  12754. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  12755. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  12756. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  12757. do { \
  12758. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  12759. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  12760. } while (0)
  12761. /**
  12762. * @brief HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND Message
  12763. *
  12764. * @details
  12765. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  12766. * FSE placement in CMEM is enabled.
  12767. *
  12768. * This message sends the non-secure CMEM base address.
  12769. * It will be sent to host in response to message
  12770. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  12771. * The message would appear as follows:
  12772. *
  12773. * |31 24|23 16|15 8|7 0|
  12774. * |----------------+----------------+----------------+----------------|
  12775. * | reserved | num_entries | msg_type |
  12776. * |----------------+----------------+----------------+----------------|
  12777. * | base_address_lo |
  12778. * |----------------+----------------+----------------+----------------|
  12779. * | base_address_hi |
  12780. * |-------------------------------------------------------------------|
  12781. *
  12782. * The message is interpreted as follows:
  12783. * dword0 - b'0:7 - msg_type: This will be set to
  12784. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  12785. * b'8:15 - number_entries: Indicated the number of entries
  12786. * programmed.
  12787. * b'16:31 - reserved.
  12788. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  12789. * CMEM base address
  12790. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  12791. * CMEM base address
  12792. */
  12793. PREPACK struct htt_cmem_base_send_t {
  12794. A_UINT32 msg_type: 8,
  12795. num_entries: 8,
  12796. reserved: 16;
  12797. A_UINT32 base_address_lo;
  12798. A_UINT32 base_address_hi;
  12799. } POSTPACK;
  12800. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  12801. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  12802. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  12803. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  12804. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  12805. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  12806. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  12807. do { \
  12808. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  12809. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  12810. } while (0)
  12811. /**
  12812. * @brief - HTT PPDU ID format
  12813. *
  12814. * @details
  12815. * The following field definitions describe the format of the PPDU ID.
  12816. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  12817. *
  12818. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  12819. * +--------------------------------------------------------------------------
  12820. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  12821. * +--------------------------------------------------------------------------
  12822. *
  12823. * sch id :Schedule command id
  12824. * Bits [11 : 0] : monotonically increasing counter to track the
  12825. * PPDU posted to a specific transmit queue.
  12826. *
  12827. * hwq_id: Hardware Queue ID.
  12828. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  12829. *
  12830. * mac_id: MAC ID
  12831. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  12832. *
  12833. * seq_idx: Sequence index.
  12834. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  12835. * a particular TXOP.
  12836. *
  12837. * tqm_cmd: HWSCH/TQM flag.
  12838. * Bit [23] : Always set to 0.
  12839. *
  12840. * seq_cmd_type: Sequence command type.
  12841. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  12842. * Refer to enum HTT_STATS_FTYPE for values.
  12843. */
  12844. PREPACK struct htt_ppdu_id {
  12845. A_UINT32
  12846. sch_id: 12,
  12847. hwq_id: 5,
  12848. mac_id: 2,
  12849. seq_idx: 2,
  12850. reserved1: 2,
  12851. tqm_cmd: 1,
  12852. seq_cmd_type: 6,
  12853. reserved2: 2;
  12854. } POSTPACK;
  12855. #define HTT_PPDU_ID_SCH_ID_S 0
  12856. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  12857. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  12858. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  12859. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  12860. do { \
  12861. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  12862. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  12863. } while (0)
  12864. #define HTT_PPDU_ID_HWQ_ID_S 12
  12865. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  12866. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  12867. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  12868. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  12869. do { \
  12870. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  12871. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  12872. } while (0)
  12873. #define HTT_PPDU_ID_MAC_ID_S 17
  12874. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  12875. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  12876. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  12877. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  12878. do { \
  12879. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  12880. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  12881. } while (0)
  12882. #define HTT_PPDU_ID_SEQ_IDX_S 19
  12883. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  12884. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  12885. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  12886. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  12887. do { \
  12888. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  12889. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  12890. } while (0)
  12891. #define HTT_PPDU_ID_TQM_CMD_S 23
  12892. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  12893. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  12894. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  12895. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  12896. do { \
  12897. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  12898. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  12899. } while (0)
  12900. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  12901. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  12902. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  12903. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  12904. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  12905. do { \
  12906. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  12907. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  12908. } while (0)
  12909. /**
  12910. * @brief target -> RX PEER METADATA V0 format
  12911. * Host will know the peer metadata version from the wmi_service_ready_ext2
  12912. * message from target, and will confirm to the target which peer metadata
  12913. * version to use in the wmi_init message.
  12914. *
  12915. * The following diagram shows the format of the RX PEER METADATA.
  12916. *
  12917. * |31 24|23 16|15 8|7 0|
  12918. * |-----------------------------------------------------------------------|
  12919. * | Reserved | VDEV ID | PEER ID |
  12920. * |-----------------------------------------------------------------------|
  12921. */
  12922. PREPACK struct htt_rx_peer_metadata_v0 {
  12923. A_UINT32
  12924. peer_id: 16,
  12925. vdev_id: 8,
  12926. reserved1: 8;
  12927. } POSTPACK;
  12928. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  12929. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  12930. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  12931. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  12932. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  12933. do { \
  12934. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  12935. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  12936. } while (0)
  12937. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  12938. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  12939. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  12940. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  12941. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  12942. do { \
  12943. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  12944. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  12945. } while (0)
  12946. /**
  12947. * @brief target -> RX PEER METADATA V1 format
  12948. * Host will know the peer metadata version from the wmi_service_ready_ext2
  12949. * message from target, and will confirm to the target which peer metadata
  12950. * version to use in the wmi_init message.
  12951. *
  12952. * The following diagram shows the format of the RX PEER METADATA V1 format.
  12953. *
  12954. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  12955. * |-----------------------------------------------------------------------|
  12956. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  12957. * |-----------------------------------------------------------------------|
  12958. */
  12959. PREPACK struct htt_rx_peer_metadata_v1 {
  12960. A_UINT32
  12961. peer_id: 13,
  12962. ml_peer_valid: 1,
  12963. reserved1: 2,
  12964. vdev_id: 8,
  12965. lmac_id: 2,
  12966. chip_id: 3,
  12967. reserved2: 3;
  12968. } POSTPACK;
  12969. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  12970. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  12971. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  12972. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  12973. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  12974. do { \
  12975. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  12976. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  12977. } while (0)
  12978. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  12979. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  12980. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  12981. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  12982. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  12983. do { \
  12984. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  12985. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  12986. } while (0)
  12987. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  12988. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  12989. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  12990. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  12991. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  12992. do { \
  12993. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  12994. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  12995. } while (0)
  12996. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  12997. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  12998. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  12999. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  13000. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  13001. do { \
  13002. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  13003. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  13004. } while (0)
  13005. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  13006. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  13007. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  13008. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  13009. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  13010. do { \
  13011. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  13012. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  13013. } while (0)
  13014. #endif