htt.h 619 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779
  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. */
  194. #define HTT_CURRENT_VERSION_MAJOR 3
  195. #define HTT_CURRENT_VERSION_MINOR 75
  196. #define HTT_NUM_TX_FRAG_DESC 1024
  197. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  198. #define HTT_CHECK_SET_VAL(field, val) \
  199. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  200. /* macros to assist in sign-extending fields from HTT messages */
  201. #define HTT_SIGN_BIT_MASK(field) \
  202. ((field ## _M + (1 << field ## _S)) >> 1)
  203. #define HTT_SIGN_BIT(_val, field) \
  204. (_val & HTT_SIGN_BIT_MASK(field))
  205. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  206. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  207. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  208. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  209. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  210. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  211. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  212. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  213. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  214. /*
  215. * TEMPORARY:
  216. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  217. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  218. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  219. * updated.
  220. */
  221. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  222. /*
  223. * TEMPORARY:
  224. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  225. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  226. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  227. * updated.
  228. */
  229. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  230. /* HTT Access Category values */
  231. enum HTT_AC_WMM {
  232. /* WMM Access Categories */
  233. HTT_AC_WMM_BE = 0x0,
  234. HTT_AC_WMM_BK = 0x1,
  235. HTT_AC_WMM_VI = 0x2,
  236. HTT_AC_WMM_VO = 0x3,
  237. /* extension Access Categories */
  238. HTT_AC_EXT_NON_QOS = 0x4,
  239. HTT_AC_EXT_UCAST_MGMT = 0x5,
  240. HTT_AC_EXT_MCAST_DATA = 0x6,
  241. HTT_AC_EXT_MCAST_MGMT = 0x7,
  242. };
  243. enum HTT_AC_WMM_MASK {
  244. /* WMM Access Categories */
  245. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  246. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  247. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  248. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  249. /* extension Access Categories */
  250. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  251. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  252. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  253. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  254. };
  255. #define HTT_AC_MASK_WMM \
  256. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  257. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  258. #define HTT_AC_MASK_EXT \
  259. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  260. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  261. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  262. /*
  263. * htt_dbg_stats_type -
  264. * bit positions for each stats type within a stats type bitmask
  265. * The bitmask contains 24 bits.
  266. */
  267. enum htt_dbg_stats_type {
  268. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  269. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  270. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  271. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  272. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  273. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  274. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  275. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  276. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  277. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  278. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  279. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  280. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  281. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  282. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  283. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  284. /* bits 16-23 currently reserved */
  285. /* keep this last */
  286. HTT_DBG_NUM_STATS
  287. };
  288. /*=== HTT option selection TLVs ===
  289. * Certain HTT messages have alternatives or options.
  290. * For such cases, the host and target need to agree on which option to use.
  291. * Option specification TLVs can be appended to the VERSION_REQ and
  292. * VERSION_CONF messages to select options other than the default.
  293. * These TLVs are entirely optional - if they are not provided, there is a
  294. * well-defined default for each option. If they are provided, they can be
  295. * provided in any order. Each TLV can be present or absent independent of
  296. * the presence / absence of other TLVs.
  297. *
  298. * The HTT option selection TLVs use the following format:
  299. * |31 16|15 8|7 0|
  300. * |---------------------------------+----------------+----------------|
  301. * | value (payload) | length | tag |
  302. * |-------------------------------------------------------------------|
  303. * The value portion need not be only 2 bytes; it can be extended by any
  304. * integer number of 4-byte units. The total length of the TLV, including
  305. * the tag and length fields, must be a multiple of 4 bytes. The length
  306. * field specifies the total TLV size in 4-byte units. Thus, the typical
  307. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  308. * field, would store 0x1 in its length field, to show that the TLV occupies
  309. * a single 4-byte unit.
  310. */
  311. /*--- TLV header format - applies to all HTT option TLVs ---*/
  312. enum HTT_OPTION_TLV_TAGS {
  313. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  314. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  315. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  316. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  317. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  318. };
  319. PREPACK struct htt_option_tlv_header_t {
  320. A_UINT8 tag;
  321. A_UINT8 length;
  322. } POSTPACK;
  323. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  324. #define HTT_OPTION_TLV_TAG_S 0
  325. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  326. #define HTT_OPTION_TLV_LENGTH_S 8
  327. /*
  328. * value0 - 16 bit value field stored in word0
  329. * The TLV's value field may be longer than 2 bytes, in which case
  330. * the remainder of the value is stored in word1, word2, etc.
  331. */
  332. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  333. #define HTT_OPTION_TLV_VALUE0_S 16
  334. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  335. do { \
  336. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  337. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  338. } while (0)
  339. #define HTT_OPTION_TLV_TAG_GET(word) \
  340. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  341. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  342. do { \
  343. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  344. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  345. } while (0)
  346. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  347. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  348. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  349. do { \
  350. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  351. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  352. } while (0)
  353. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  354. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  355. /*--- format of specific HTT option TLVs ---*/
  356. /*
  357. * HTT option TLV for specifying LL bus address size
  358. * Some chips require bus addresses used by the target to access buffers
  359. * within the host's memory to be 32 bits; others require bus addresses
  360. * used by the target to access buffers within the host's memory to be
  361. * 64 bits.
  362. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  363. * a suffix to the VERSION_CONF message to specify which bus address format
  364. * the target requires.
  365. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  366. * default to providing bus addresses to the target in 32-bit format.
  367. */
  368. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  369. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  370. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  371. };
  372. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  373. struct htt_option_tlv_header_t hdr;
  374. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  375. } POSTPACK;
  376. /*
  377. * HTT option TLV for specifying whether HL systems should indicate
  378. * over-the-air tx completion for individual frames, or should instead
  379. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  380. * requests an OTA tx completion for a particular tx frame.
  381. * This option does not apply to LL systems, where the TX_COMPL_IND
  382. * is mandatory.
  383. * This option is primarily intended for HL systems in which the tx frame
  384. * downloads over the host --> target bus are as slow as or slower than
  385. * the transmissions over the WLAN PHY. For cases where the bus is faster
  386. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  387. * and consquently will send one TX_COMPL_IND message that covers several
  388. * tx frames. For cases where the WLAN PHY is faster than the bus,
  389. * the target will end up transmitting very short A-MPDUs, and consequently
  390. * sending many TX_COMPL_IND messages, which each cover a very small number
  391. * of tx frames.
  392. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  393. * a suffix to the VERSION_REQ message to request whether the host desires to
  394. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  395. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  396. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  397. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  398. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  399. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  400. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  401. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  402. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  403. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  404. * TLV.
  405. */
  406. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  407. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  408. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  409. };
  410. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  411. struct htt_option_tlv_header_t hdr;
  412. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  413. } POSTPACK;
  414. /*
  415. * HTT option TLV for specifying how many tx queue groups the target
  416. * may establish.
  417. * This TLV specifies the maximum value the target may send in the
  418. * txq_group_id field of any TXQ_GROUP information elements sent by
  419. * the target to the host. This allows the host to pre-allocate an
  420. * appropriate number of tx queue group structs.
  421. *
  422. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  423. * a suffix to the VERSION_REQ message to specify whether the host supports
  424. * tx queue groups at all, and if so if there is any limit on the number of
  425. * tx queue groups that the host supports.
  426. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  427. * a suffix to the VERSION_CONF message. If the host has specified in the
  428. * VER_REQ message a limit on the number of tx queue groups the host can
  429. * supprt, the target shall limit its specification of the maximum tx groups
  430. * to be no larger than this host-specified limit.
  431. *
  432. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  433. * shall preallocate 4 tx queue group structs, and the target shall not
  434. * specify a txq_group_id larger than 3.
  435. */
  436. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  437. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  438. /*
  439. * values 1 through N specify the max number of tx queue groups
  440. * the sender supports
  441. */
  442. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  443. };
  444. /* TEMPORARY backwards-compatibility alias for a typo fix -
  445. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  446. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  447. * to support the old name (with the typo) until all references to the
  448. * old name are replaced with the new name.
  449. */
  450. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  451. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  452. struct htt_option_tlv_header_t hdr;
  453. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  454. } POSTPACK;
  455. /*
  456. * HTT option TLV for specifying whether the target supports an extended
  457. * version of the HTT tx descriptor. If the target provides this TLV
  458. * and specifies in the TLV that the target supports an extended version
  459. * of the HTT tx descriptor, the target must check the "extension" bit in
  460. * the HTT tx descriptor, and if the extension bit is set, to expect a
  461. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  462. * descriptor. Furthermore, the target must provide room for the HTT
  463. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  464. * This option is intended for systems where the host needs to explicitly
  465. * control the transmission parameters such as tx power for individual
  466. * tx frames.
  467. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  468. * as a suffix to the VERSION_CONF message to explicitly specify whether
  469. * the target supports the HTT tx MSDU extension descriptor.
  470. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  471. * by the host as lack of target support for the HTT tx MSDU extension
  472. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  473. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  474. * the HTT tx MSDU extension descriptor.
  475. * The host is not required to provide the HTT tx MSDU extension descriptor
  476. * just because the target supports it; the target must check the
  477. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  478. * extension descriptor is present.
  479. */
  480. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  481. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  482. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  483. };
  484. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  485. struct htt_option_tlv_header_t hdr;
  486. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  487. } POSTPACK;
  488. /*=== host -> target messages ===============================================*/
  489. enum htt_h2t_msg_type {
  490. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  491. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  492. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  493. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  494. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  495. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  496. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  497. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  498. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  499. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  500. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  501. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  502. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  503. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  504. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  505. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  506. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  507. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  508. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  509. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  510. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  511. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  512. /* keep this last */
  513. HTT_H2T_NUM_MSGS
  514. };
  515. /*
  516. * HTT host to target message type -
  517. * stored in bits 7:0 of the first word of the message
  518. */
  519. #define HTT_H2T_MSG_TYPE_M 0xff
  520. #define HTT_H2T_MSG_TYPE_S 0
  521. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  522. do { \
  523. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  524. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  525. } while (0)
  526. #define HTT_H2T_MSG_TYPE_GET(word) \
  527. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  528. /**
  529. * @brief host -> target version number request message definition
  530. *
  531. * |31 24|23 16|15 8|7 0|
  532. * |----------------+----------------+----------------+----------------|
  533. * | reserved | msg type |
  534. * |-------------------------------------------------------------------|
  535. * : option request TLV (optional) |
  536. * :...................................................................:
  537. *
  538. * The VER_REQ message may consist of a single 4-byte word, or may be
  539. * extended with TLVs that specify which HTT options the host is requesting
  540. * from the target.
  541. * The following option TLVs may be appended to the VER_REQ message:
  542. * - HL_SUPPRESS_TX_COMPL_IND
  543. * - HL_MAX_TX_QUEUE_GROUPS
  544. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  545. * may be appended to the VER_REQ message (but only one TLV of each type).
  546. *
  547. * Header fields:
  548. * - MSG_TYPE
  549. * Bits 7:0
  550. * Purpose: identifies this as a version number request message
  551. * Value: 0x0
  552. */
  553. #define HTT_VER_REQ_BYTES 4
  554. /* TBDXXX: figure out a reasonable number */
  555. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  556. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  557. /**
  558. * @brief HTT tx MSDU descriptor
  559. *
  560. * @details
  561. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  562. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  563. * the target firmware needs for the FW's tx processing, particularly
  564. * for creating the HW msdu descriptor.
  565. * The same HTT tx descriptor is used for HL and LL systems, though
  566. * a few fields within the tx descriptor are used only by LL or
  567. * only by HL.
  568. * The HTT tx descriptor is defined in two manners: by a struct with
  569. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  570. * definitions.
  571. * The target should use the struct def, for simplicitly and clarity,
  572. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  573. * neutral. Specifically, the host shall use the get/set macros built
  574. * around the mask + shift defs.
  575. */
  576. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  577. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  578. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  579. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  580. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  581. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  582. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  583. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  584. #define HTT_TX_VDEV_ID_WORD 0
  585. #define HTT_TX_VDEV_ID_MASK 0x3f
  586. #define HTT_TX_VDEV_ID_SHIFT 16
  587. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  588. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  589. #define HTT_TX_MSDU_LEN_DWORD 1
  590. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  591. /*
  592. * HTT_VAR_PADDR macros
  593. * Allow physical / bus addresses to be either a single 32-bit value,
  594. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  595. */
  596. #define HTT_VAR_PADDR32(var_name) \
  597. A_UINT32 var_name
  598. #define HTT_VAR_PADDR64_LE(var_name) \
  599. struct { \
  600. /* little-endian: lo precedes hi */ \
  601. A_UINT32 lo; \
  602. A_UINT32 hi; \
  603. } var_name
  604. /*
  605. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  606. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  607. * addresses are stored in a XXX-bit field.
  608. * This macro is used to define both htt_tx_msdu_desc32_t and
  609. * htt_tx_msdu_desc64_t structs.
  610. */
  611. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  612. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  613. { \
  614. /* DWORD 0: flags and meta-data */ \
  615. A_UINT32 \
  616. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  617. \
  618. /* pkt_subtype - \
  619. * Detailed specification of the tx frame contents, extending the \
  620. * general specification provided by pkt_type. \
  621. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  622. * pkt_type | pkt_subtype \
  623. * ============================================================== \
  624. * 802.3 | bit 0:3 - Reserved \
  625. * | bit 4: 0x0 - Copy-Engine Classification Results \
  626. * | not appended to the HTT message \
  627. * | 0x1 - Copy-Engine Classification Results \
  628. * | appended to the HTT message in the \
  629. * | format: \
  630. * | [HTT tx desc, frame header, \
  631. * | CE classification results] \
  632. * | The CE classification results begin \
  633. * | at the next 4-byte boundary after \
  634. * | the frame header. \
  635. * ------------+------------------------------------------------- \
  636. * Eth2 | bit 0:3 - Reserved \
  637. * | bit 4: 0x0 - Copy-Engine Classification Results \
  638. * | not appended to the HTT message \
  639. * | 0x1 - Copy-Engine Classification Results \
  640. * | appended to the HTT message. \
  641. * | See the above specification of the \
  642. * | CE classification results location. \
  643. * ------------+------------------------------------------------- \
  644. * native WiFi | bit 0:3 - Reserved \
  645. * | bit 4: 0x0 - Copy-Engine Classification Results \
  646. * | not appended to the HTT message \
  647. * | 0x1 - Copy-Engine Classification Results \
  648. * | appended to the HTT message. \
  649. * | See the above specification of the \
  650. * | CE classification results location. \
  651. * ------------+------------------------------------------------- \
  652. * mgmt | 0x0 - 802.11 MAC header absent \
  653. * | 0x1 - 802.11 MAC header present \
  654. * ------------+------------------------------------------------- \
  655. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  656. * | 0x1 - 802.11 MAC header present \
  657. * | bit 1: 0x0 - allow aggregation \
  658. * | 0x1 - don't allow aggregation \
  659. * | bit 2: 0x0 - perform encryption \
  660. * | 0x1 - don't perform encryption \
  661. * | bit 3: 0x0 - perform tx classification / queuing \
  662. * | 0x1 - don't perform tx classification; \
  663. * | insert the frame into the "misc" \
  664. * | tx queue \
  665. * | bit 4: 0x0 - Copy-Engine Classification Results \
  666. * | not appended to the HTT message \
  667. * | 0x1 - Copy-Engine Classification Results \
  668. * | appended to the HTT message. \
  669. * | See the above specification of the \
  670. * | CE classification results location. \
  671. */ \
  672. pkt_subtype: 5, \
  673. \
  674. /* pkt_type - \
  675. * General specification of the tx frame contents. \
  676. * The htt_pkt_type enum should be used to specify and check the \
  677. * value of this field. \
  678. */ \
  679. pkt_type: 3, \
  680. \
  681. /* vdev_id - \
  682. * ID for the vdev that is sending this tx frame. \
  683. * For certain non-standard packet types, e.g. pkt_type == raw \
  684. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  685. * This field is used primarily for determining where to queue \
  686. * broadcast and multicast frames. \
  687. */ \
  688. vdev_id: 6, \
  689. /* ext_tid - \
  690. * The extended traffic ID. \
  691. * If the TID is unknown, the extended TID is set to \
  692. * HTT_TX_EXT_TID_INVALID. \
  693. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  694. * value of the QoS TID. \
  695. * If the tx frame is non-QoS data, then the extended TID is set to \
  696. * HTT_TX_EXT_TID_NON_QOS. \
  697. * If the tx frame is multicast or broadcast, then the extended TID \
  698. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  699. */ \
  700. ext_tid: 5, \
  701. \
  702. /* postponed - \
  703. * This flag indicates whether the tx frame has been downloaded to \
  704. * the target before but discarded by the target, and now is being \
  705. * downloaded again; or if this is a new frame that is being \
  706. * downloaded for the first time. \
  707. * This flag allows the target to determine the correct order for \
  708. * transmitting new vs. old frames. \
  709. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  710. * This flag only applies to HL systems, since in LL systems, \
  711. * the tx flow control is handled entirely within the target. \
  712. */ \
  713. postponed: 1, \
  714. \
  715. /* extension - \
  716. * This flag indicates whether a HTT tx MSDU extension descriptor \
  717. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  718. * \
  719. * 0x0 - no extension MSDU descriptor is present \
  720. * 0x1 - an extension MSDU descriptor immediately follows the \
  721. * regular MSDU descriptor \
  722. */ \
  723. extension: 1, \
  724. \
  725. /* cksum_offload - \
  726. * This flag indicates whether checksum offload is enabled or not \
  727. * for this frame. Target FW use this flag to turn on HW checksumming \
  728. * 0x0 - No checksum offload \
  729. * 0x1 - L3 header checksum only \
  730. * 0x2 - L4 checksum only \
  731. * 0x3 - L3 header checksum + L4 checksum \
  732. */ \
  733. cksum_offload: 2, \
  734. \
  735. /* tx_comp_req - \
  736. * This flag indicates whether Tx Completion \
  737. * from fw is required or not. \
  738. * This flag is only relevant if tx completion is not \
  739. * universally enabled. \
  740. * For all LL systems, tx completion is mandatory, \
  741. * so this flag will be irrelevant. \
  742. * For HL systems tx completion is optional, but HL systems in which \
  743. * the bus throughput exceeds the WLAN throughput will \
  744. * probably want to always use tx completion, and thus \
  745. * would not check this flag. \
  746. * This flag is required when tx completions are not used universally, \
  747. * but are still required for certain tx frames for which \
  748. * an OTA delivery acknowledgment is needed by the host. \
  749. * In practice, this would be for HL systems in which the \
  750. * bus throughput is less than the WLAN throughput. \
  751. * \
  752. * 0x0 - Tx Completion Indication from Fw not required \
  753. * 0x1 - Tx Completion Indication from Fw is required \
  754. */ \
  755. tx_compl_req: 1; \
  756. \
  757. \
  758. /* DWORD 1: MSDU length and ID */ \
  759. A_UINT32 \
  760. len: 16, /* MSDU length, in bytes */ \
  761. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  762. * and this id is used to calculate fragmentation \
  763. * descriptor pointer inside the target based on \
  764. * the base address, configured inside the target. \
  765. */ \
  766. \
  767. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  768. /* frags_desc_ptr - \
  769. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  770. * where the tx frame's fragments reside in memory. \
  771. * This field only applies to LL systems, since in HL systems the \
  772. * (degenerate single-fragment) fragmentation descriptor is created \
  773. * within the target. \
  774. */ \
  775. _paddr__frags_desc_ptr_; \
  776. \
  777. /* DWORD 3 (or 4): peerid, chanfreq */ \
  778. /* \
  779. * Peer ID : Target can use this value to know which peer-id packet \
  780. * destined to. \
  781. * It's intended to be specified by host in case of NAWDS. \
  782. */ \
  783. A_UINT16 peerid; \
  784. \
  785. /* \
  786. * Channel frequency: This identifies the desired channel \
  787. * frequency (in mhz) for tx frames. This is used by FW to help \
  788. * determine when it is safe to transmit or drop frames for \
  789. * off-channel operation. \
  790. * The default value of zero indicates to FW that the corresponding \
  791. * VDEV's home channel (if there is one) is the desired channel \
  792. * frequency. \
  793. */ \
  794. A_UINT16 chanfreq; \
  795. \
  796. /* Reason reserved is commented is increasing the htt structure size \
  797. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  798. * A_UINT32 reserved_dword3_bits0_31; \
  799. */ \
  800. } POSTPACK
  801. /* define a htt_tx_msdu_desc32_t type */
  802. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  803. /* define a htt_tx_msdu_desc64_t type */
  804. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  805. /*
  806. * Make htt_tx_msdu_desc_t be an alias for either
  807. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  808. */
  809. #if HTT_PADDR64
  810. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  811. #else
  812. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  813. #endif
  814. /* decriptor information for Management frame*/
  815. /*
  816. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  817. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  818. */
  819. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  820. extern A_UINT32 mgmt_hdr_len;
  821. PREPACK struct htt_mgmt_tx_desc_t {
  822. A_UINT32 msg_type;
  823. #if HTT_PADDR64
  824. A_UINT64 frag_paddr; /* DMAble address of the data */
  825. #else
  826. A_UINT32 frag_paddr; /* DMAble address of the data */
  827. #endif
  828. A_UINT32 desc_id; /* returned to host during completion
  829. * to free the meory*/
  830. A_UINT32 len; /* Fragment length */
  831. A_UINT32 vdev_id; /* virtual device ID*/
  832. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  833. } POSTPACK;
  834. PREPACK struct htt_mgmt_tx_compl_ind {
  835. A_UINT32 desc_id;
  836. A_UINT32 status;
  837. } POSTPACK;
  838. /*
  839. * This SDU header size comes from the summation of the following:
  840. * 1. Max of:
  841. * a. Native WiFi header, for native WiFi frames: 24 bytes
  842. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  843. * b. 802.11 header, for raw frames: 36 bytes
  844. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  845. * QoS header, HT header)
  846. * c. 802.3 header, for ethernet frames: 14 bytes
  847. * (destination address, source address, ethertype / length)
  848. * 2. Max of:
  849. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  850. * b. IPv6 header, up through the Traffic Class: 2 bytes
  851. * 3. 802.1Q VLAN header: 4 bytes
  852. * 4. LLC/SNAP header: 8 bytes
  853. */
  854. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  855. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  856. #define HTT_TX_HDR_SIZE_ETHERNET 14
  857. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  858. A_COMPILE_TIME_ASSERT(
  859. htt_encap_hdr_size_max_check_nwifi,
  860. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  861. A_COMPILE_TIME_ASSERT(
  862. htt_encap_hdr_size_max_check_enet,
  863. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  864. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  865. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  866. #define HTT_TX_HDR_SIZE_802_1Q 4
  867. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  868. #define HTT_COMMON_TX_FRM_HDR_LEN \
  869. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  870. HTT_TX_HDR_SIZE_802_1Q + \
  871. HTT_TX_HDR_SIZE_LLC_SNAP)
  872. #define HTT_HL_TX_FRM_HDR_LEN \
  873. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  874. #define HTT_LL_TX_FRM_HDR_LEN \
  875. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  876. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  877. /* dword 0 */
  878. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  879. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  880. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  881. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  882. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  883. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  884. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  885. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  886. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  887. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  888. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  889. #define HTT_TX_DESC_PKT_TYPE_S 13
  890. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  891. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  892. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  893. #define HTT_TX_DESC_VDEV_ID_S 16
  894. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  895. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  896. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  897. #define HTT_TX_DESC_EXT_TID_S 22
  898. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  899. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  900. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  901. #define HTT_TX_DESC_POSTPONED_S 27
  902. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  903. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  904. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  905. #define HTT_TX_DESC_EXTENSION_S 28
  906. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  907. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  908. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  909. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  910. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  911. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  912. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  913. #define HTT_TX_DESC_TX_COMP_S 31
  914. /* dword 1 */
  915. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  916. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  917. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  918. #define HTT_TX_DESC_FRM_LEN_S 0
  919. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  920. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  921. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  922. #define HTT_TX_DESC_FRM_ID_S 16
  923. /* dword 2 */
  924. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  925. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  926. /* for systems using 64-bit format for bus addresses */
  927. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  928. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  929. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  930. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  931. /* for systems using 32-bit format for bus addresses */
  932. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  933. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  934. /* dword 3 */
  935. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  936. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  937. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  938. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  939. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  940. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  941. #if HTT_PADDR64
  942. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  943. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  944. #else
  945. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  946. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  947. #endif
  948. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  949. #define HTT_TX_DESC_PEER_ID_S 0
  950. /*
  951. * TEMPORARY:
  952. * The original definitions for the PEER_ID fields contained typos
  953. * (with _DESC_PADDR appended to this PEER_ID field name).
  954. * Retain deprecated original names for PEER_ID fields until all code that
  955. * refers to them has been updated.
  956. */
  957. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  958. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  959. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  960. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  961. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  962. HTT_TX_DESC_PEER_ID_M
  963. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  964. HTT_TX_DESC_PEER_ID_S
  965. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  966. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  967. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  968. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  969. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  970. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  971. #if HTT_PADDR64
  972. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  973. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  974. #else
  975. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  976. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  977. #endif
  978. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  979. #define HTT_TX_DESC_CHAN_FREQ_S 16
  980. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  981. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  982. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  983. do { \
  984. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  985. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  986. } while (0)
  987. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  988. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  989. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  990. do { \
  991. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  992. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  993. } while (0)
  994. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  995. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  996. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  997. do { \
  998. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  999. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1000. } while (0)
  1001. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1002. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1003. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1004. do { \
  1005. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1006. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1007. } while (0)
  1008. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1009. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1010. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1011. do { \
  1012. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1013. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1014. } while (0)
  1015. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1016. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1017. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1018. do { \
  1019. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1020. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1021. } while (0)
  1022. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1023. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1024. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1025. do { \
  1026. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1027. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1028. } while (0)
  1029. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1030. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1031. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1032. do { \
  1033. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1034. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1035. } while (0)
  1036. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1037. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1038. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1039. do { \
  1040. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1041. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1042. } while (0)
  1043. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1044. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1045. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1046. do { \
  1047. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1048. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1049. } while (0)
  1050. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1051. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1052. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1053. do { \
  1054. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1055. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1056. } while (0)
  1057. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1058. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1059. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1060. do { \
  1061. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1062. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1063. } while (0)
  1064. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1065. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1066. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1067. do { \
  1068. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1069. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1070. } while (0)
  1071. /* enums used in the HTT tx MSDU extension descriptor */
  1072. enum {
  1073. htt_tx_guard_interval_regular = 0,
  1074. htt_tx_guard_interval_short = 1,
  1075. };
  1076. enum {
  1077. htt_tx_preamble_type_ofdm = 0,
  1078. htt_tx_preamble_type_cck = 1,
  1079. htt_tx_preamble_type_ht = 2,
  1080. htt_tx_preamble_type_vht = 3,
  1081. };
  1082. enum {
  1083. htt_tx_bandwidth_5MHz = 0,
  1084. htt_tx_bandwidth_10MHz = 1,
  1085. htt_tx_bandwidth_20MHz = 2,
  1086. htt_tx_bandwidth_40MHz = 3,
  1087. htt_tx_bandwidth_80MHz = 4,
  1088. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1089. };
  1090. /**
  1091. * @brief HTT tx MSDU extension descriptor
  1092. * @details
  1093. * If the target supports HTT tx MSDU extension descriptors, the host has
  1094. * the option of appending the following struct following the regular
  1095. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1096. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1097. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1098. * tx specs for each frame.
  1099. */
  1100. PREPACK struct htt_tx_msdu_desc_ext_t {
  1101. /* DWORD 0: flags */
  1102. A_UINT32
  1103. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1104. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1105. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1106. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1107. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1108. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1109. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1110. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1111. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1112. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1113. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1114. /* DWORD 1: tx power, tx rate, tx BW */
  1115. A_UINT32
  1116. /* pwr -
  1117. * Specify what power the tx frame needs to be transmitted at.
  1118. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1119. * The value needs to be appropriately sign-extended when extracting
  1120. * the value from the message and storing it in a variable that is
  1121. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1122. * automatically handles this sign-extension.)
  1123. * If the transmission uses multiple tx chains, this power spec is
  1124. * the total transmit power, assuming incoherent combination of
  1125. * per-chain power to produce the total power.
  1126. */
  1127. pwr: 8,
  1128. /* mcs_mask -
  1129. * Specify the allowable values for MCS index (modulation and coding)
  1130. * to use for transmitting the frame.
  1131. *
  1132. * For HT / VHT preamble types, this mask directly corresponds to
  1133. * the HT or VHT MCS indices that are allowed. For each bit N set
  1134. * within the mask, MCS index N is allowed for transmitting the frame.
  1135. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1136. * rates versus OFDM rates, so the host has the option of specifying
  1137. * that the target must transmit the frame with CCK or OFDM rates
  1138. * (not HT or VHT), but leaving the decision to the target whether
  1139. * to use CCK or OFDM.
  1140. *
  1141. * For CCK and OFDM, the bits within this mask are interpreted as
  1142. * follows:
  1143. * bit 0 -> CCK 1 Mbps rate is allowed
  1144. * bit 1 -> CCK 2 Mbps rate is allowed
  1145. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1146. * bit 3 -> CCK 11 Mbps rate is allowed
  1147. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1148. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1149. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1150. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1151. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1152. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1153. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1154. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1155. *
  1156. * The MCS index specification needs to be compatible with the
  1157. * bandwidth mask specification. For example, a MCS index == 9
  1158. * specification is inconsistent with a preamble type == VHT,
  1159. * Nss == 1, and channel bandwidth == 20 MHz.
  1160. *
  1161. * Furthermore, the host has only a limited ability to specify to
  1162. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1163. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1164. */
  1165. mcs_mask: 12,
  1166. /* nss_mask -
  1167. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1168. * Each bit in this mask corresponds to a Nss value:
  1169. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1170. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1171. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1172. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1173. * The values in the Nss mask must be suitable for the recipient, e.g.
  1174. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1175. * recipient which only supports 2x2 MIMO.
  1176. */
  1177. nss_mask: 4,
  1178. /* guard_interval -
  1179. * Specify a htt_tx_guard_interval enum value to indicate whether
  1180. * the transmission should use a regular guard interval or a
  1181. * short guard interval.
  1182. */
  1183. guard_interval: 1,
  1184. /* preamble_type_mask -
  1185. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1186. * may choose from for transmitting this frame.
  1187. * The bits in this mask correspond to the values in the
  1188. * htt_tx_preamble_type enum. For example, to allow the target
  1189. * to transmit the frame as either CCK or OFDM, this field would
  1190. * be set to
  1191. * (1 << htt_tx_preamble_type_ofdm) |
  1192. * (1 << htt_tx_preamble_type_cck)
  1193. */
  1194. preamble_type_mask: 4,
  1195. reserved1_31_29: 3; /* unused, set to 0x0 */
  1196. /* DWORD 2: tx chain mask, tx retries */
  1197. A_UINT32
  1198. /* chain_mask - specify which chains to transmit from */
  1199. chain_mask: 4,
  1200. /* retry_limit -
  1201. * Specify the maximum number of transmissions, including the
  1202. * initial transmission, to attempt before giving up if no ack
  1203. * is received.
  1204. * If the tx rate is specified, then all retries shall use the
  1205. * same rate as the initial transmission.
  1206. * If no tx rate is specified, the target can choose whether to
  1207. * retain the original rate during the retransmissions, or to
  1208. * fall back to a more robust rate.
  1209. */
  1210. retry_limit: 4,
  1211. /* bandwidth_mask -
  1212. * Specify what channel widths may be used for the transmission.
  1213. * A value of zero indicates "don't care" - the target may choose
  1214. * the transmission bandwidth.
  1215. * The bits within this mask correspond to the htt_tx_bandwidth
  1216. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1217. * The bandwidth_mask must be consistent with the preamble_type_mask
  1218. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1219. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1220. */
  1221. bandwidth_mask: 6,
  1222. reserved2_31_14: 18; /* unused, set to 0x0 */
  1223. /* DWORD 3: tx expiry time (TSF) LSBs */
  1224. A_UINT32 expire_tsf_lo;
  1225. /* DWORD 4: tx expiry time (TSF) MSBs */
  1226. A_UINT32 expire_tsf_hi;
  1227. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1228. } POSTPACK;
  1229. /* DWORD 0 */
  1230. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1231. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1232. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1233. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1234. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1235. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1236. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1237. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1238. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1239. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1240. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1241. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1242. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1243. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1244. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1245. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1246. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1247. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1248. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1249. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1250. /* DWORD 1 */
  1251. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1252. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1253. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1254. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1255. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1256. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1257. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1258. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1259. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1260. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1261. /* DWORD 2 */
  1262. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1263. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1264. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1265. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1266. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1267. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1268. /* DWORD 0 */
  1269. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1270. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1271. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1272. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1273. do { \
  1274. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1275. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1276. } while (0)
  1277. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1278. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1279. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1280. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1281. do { \
  1282. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1283. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1284. } while (0)
  1285. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1286. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1287. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1288. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1289. do { \
  1290. HTT_CHECK_SET_VAL( \
  1291. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1292. ((_var) |= ((_val) \
  1293. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1294. } while (0)
  1295. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1296. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1297. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1298. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1299. do { \
  1300. HTT_CHECK_SET_VAL( \
  1301. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1302. ((_var) |= ((_val) \
  1303. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1304. } while (0)
  1305. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1306. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1307. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1308. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1309. do { \
  1310. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1311. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1312. } while (0)
  1313. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1314. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1315. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1316. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1317. do { \
  1318. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1319. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1320. } while (0)
  1321. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1322. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1323. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1324. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1325. do { \
  1326. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1327. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1328. } while (0)
  1329. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1330. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1331. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1332. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1333. do { \
  1334. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1335. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1336. } while (0)
  1337. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1338. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1339. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1340. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1341. do { \
  1342. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1343. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1344. } while (0)
  1345. /* DWORD 1 */
  1346. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1347. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1348. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1349. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1350. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1351. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1352. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1353. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1354. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1355. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1356. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1357. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1358. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1359. do { \
  1360. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1361. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1362. } while (0)
  1363. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1364. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1365. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1366. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1367. do { \
  1368. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1369. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1370. } while (0)
  1371. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1372. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1373. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1374. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1375. do { \
  1376. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1377. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1378. } while (0)
  1379. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1380. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1381. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1382. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1383. do { \
  1384. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1385. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1386. } while (0)
  1387. /* DWORD 2 */
  1388. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1389. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1390. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1391. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1392. do { \
  1393. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1394. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1395. } while (0)
  1396. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1397. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1398. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1399. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1400. do { \
  1401. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1402. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1403. } while (0)
  1404. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1405. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1406. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1407. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1408. do { \
  1409. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1410. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1411. } while (0)
  1412. typedef enum {
  1413. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1414. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1415. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1416. } htt_11ax_ltf_subtype_t;
  1417. typedef enum {
  1418. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1419. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1420. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1421. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1422. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1423. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1424. } htt_tx_ext2_preamble_type_t;
  1425. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1426. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1427. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1428. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1429. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1430. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1431. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1432. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1433. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1434. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1435. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1436. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1437. /**
  1438. * @brief HTT tx MSDU extension descriptor v2
  1439. * @details
  1440. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1441. * is received as tcl_exit_base->host_meta_info in firmware.
  1442. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1443. * are already part of tcl_exit_base.
  1444. */
  1445. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1446. /* DWORD 0: flags */
  1447. A_UINT32
  1448. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1449. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1450. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1451. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1452. valid_retries : 1, /* if set, tx retries spec is valid */
  1453. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1454. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1455. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1456. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1457. valid_key_flags : 1, /* if set, key flags is valid */
  1458. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1459. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1460. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1461. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1462. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1463. 1 = ENCRYPT,
  1464. 2 ~ 3 - Reserved */
  1465. /* retry_limit -
  1466. * Specify the maximum number of transmissions, including the
  1467. * initial transmission, to attempt before giving up if no ack
  1468. * is received.
  1469. * If the tx rate is specified, then all retries shall use the
  1470. * same rate as the initial transmission.
  1471. * If no tx rate is specified, the target can choose whether to
  1472. * retain the original rate during the retransmissions, or to
  1473. * fall back to a more robust rate.
  1474. */
  1475. retry_limit : 4,
  1476. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1477. * Valid only for 11ax preamble types HE_SU
  1478. * and HE_EXT_SU
  1479. */
  1480. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1481. * Valid only for 11ax preamble types HE_SU
  1482. * and HE_EXT_SU
  1483. */
  1484. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1485. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1486. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1487. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1488. */
  1489. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1490. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1491. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1492. * Use cases:
  1493. * Any time firmware uses TQM-BYPASS for Data
  1494. * TID, firmware expect host to set this bit.
  1495. */
  1496. /* DWORD 1: tx power, tx rate */
  1497. A_UINT32
  1498. power : 8, /* unit of the power field is 0.5 dbm
  1499. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1500. * signed value ranging from -64dbm to 63.5 dbm
  1501. */
  1502. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1503. * Setting more than one MCS isn't currently
  1504. * supported by the target (but is supported
  1505. * in the interface in case in the future
  1506. * the target supports specifications of
  1507. * a limited set of MCS values.
  1508. */
  1509. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1510. * Setting more than one Nss isn't currently
  1511. * supported by the target (but is supported
  1512. * in the interface in case in the future
  1513. * the target supports specifications of
  1514. * a limited set of Nss values.
  1515. */
  1516. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1517. update_peer_cache : 1; /* When set these custom values will be
  1518. * used for all packets, until the next
  1519. * update via this ext header.
  1520. * This is to make sure not all packets
  1521. * need to include this header.
  1522. */
  1523. /* DWORD 2: tx chain mask, tx retries */
  1524. A_UINT32
  1525. /* chain_mask - specify which chains to transmit from */
  1526. chain_mask : 8,
  1527. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1528. * TODO: Update Enum values for key_flags
  1529. */
  1530. /*
  1531. * Channel frequency: This identifies the desired channel
  1532. * frequency (in MHz) for tx frames. This is used by FW to help
  1533. * determine when it is safe to transmit or drop frames for
  1534. * off-channel operation.
  1535. * The default value of zero indicates to FW that the corresponding
  1536. * VDEV's home channel (if there is one) is the desired channel
  1537. * frequency.
  1538. */
  1539. chanfreq : 16;
  1540. /* DWORD 3: tx expiry time (TSF) LSBs */
  1541. A_UINT32 expire_tsf_lo;
  1542. /* DWORD 4: tx expiry time (TSF) MSBs */
  1543. A_UINT32 expire_tsf_hi;
  1544. /* DWORD 5: flags to control routing / processing of the MSDU */
  1545. A_UINT32
  1546. /* learning_frame
  1547. * When this flag is set, this frame will be dropped by FW
  1548. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1549. */
  1550. learning_frame : 1,
  1551. /* send_as_standalone
  1552. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1553. * i.e. with no A-MSDU or A-MPDU aggregation.
  1554. * The scope is extended to other use-cases.
  1555. */
  1556. send_as_standalone : 1,
  1557. /* is_host_opaque_valid
  1558. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1559. * with valid information.
  1560. */
  1561. is_host_opaque_valid : 1,
  1562. rsvd0 : 29;
  1563. /* DWORD 6 : Host opaque cookie for special frames */
  1564. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1565. rsvd1 : 16;
  1566. /*
  1567. * This structure can be expanded further up to 40 bytes
  1568. * by adding further DWORDs as needed.
  1569. */
  1570. } POSTPACK;
  1571. /* DWORD 0 */
  1572. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1573. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1574. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1575. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1576. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1577. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1578. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1579. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1580. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1582. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1583. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1585. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1586. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1587. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1588. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1589. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1590. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1591. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1592. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1593. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1594. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1595. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1596. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1597. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1598. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1599. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1600. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1601. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1602. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1603. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1604. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1605. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1606. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1607. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1608. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1609. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1610. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1611. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1612. /* DWORD 1 */
  1613. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1614. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1615. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1616. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1617. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1618. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1619. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1620. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1621. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1622. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1623. /* DWORD 2 */
  1624. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1625. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1626. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1627. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1628. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1629. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1630. /* DWORD 5 */
  1631. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1632. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1633. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1634. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1635. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1636. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1637. /* DWORD 6 */
  1638. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1639. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1640. /* DWORD 0 */
  1641. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1642. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1643. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1644. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1645. do { \
  1646. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1647. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1648. } while (0)
  1649. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1650. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1651. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1652. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1653. do { \
  1654. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1655. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1656. } while (0)
  1657. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1658. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1659. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1660. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1661. do { \
  1662. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1663. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1664. } while (0)
  1665. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1666. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1667. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1668. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1669. do { \
  1670. HTT_CHECK_SET_VAL( \
  1671. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1672. ((_var) |= ((_val) \
  1673. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1674. } while (0)
  1675. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1676. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1677. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1678. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1679. do { \
  1680. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1681. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1682. } while (0)
  1683. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1684. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1685. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1686. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1687. do { \
  1688. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1689. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1690. } while (0)
  1691. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1692. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1693. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1694. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1695. do { \
  1696. HTT_CHECK_SET_VAL( \
  1697. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1698. ((_var) |= ((_val) \
  1699. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1700. } while (0)
  1701. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1702. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1703. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1704. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1705. do { \
  1706. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1707. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1708. } while (0)
  1709. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1710. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1711. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1712. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1713. do { \
  1714. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1715. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1716. } while (0)
  1717. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1718. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1719. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1720. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1721. do { \
  1722. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1723. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1724. } while (0)
  1725. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1726. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1727. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1728. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1729. do { \
  1730. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1731. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1732. } while (0)
  1733. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1734. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1735. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1736. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1737. do { \
  1738. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1739. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1740. } while (0)
  1741. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1742. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1743. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1744. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1745. do { \
  1746. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1747. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1748. } while (0)
  1749. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1750. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1751. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1752. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1753. do { \
  1754. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1755. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1756. } while (0)
  1757. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1758. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1759. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1760. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1761. do { \
  1762. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1763. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1764. } while (0)
  1765. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1766. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1767. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1768. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1769. do { \
  1770. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1771. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1772. } while (0)
  1773. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1774. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1775. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1776. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1777. do { \
  1778. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1779. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1780. } while (0)
  1781. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1782. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1783. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1784. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1785. do { \
  1786. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1787. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1788. } while (0)
  1789. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1790. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1791. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1792. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1793. do { \
  1794. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1795. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1796. } while (0)
  1797. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1798. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1799. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1800. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1801. do { \
  1802. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1803. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1804. } while (0)
  1805. /* DWORD 1 */
  1806. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1807. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1808. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1809. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1810. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1811. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1812. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1813. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1814. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1815. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1816. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1817. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1818. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1819. do { \
  1820. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1821. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1822. } while (0)
  1823. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1824. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1825. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1826. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1827. do { \
  1828. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1829. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1830. } while (0)
  1831. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1832. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1833. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1834. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1835. do { \
  1836. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1837. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1838. } while (0)
  1839. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1840. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1841. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1842. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1843. do { \
  1844. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1845. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1846. } while (0)
  1847. /* DWORD 2 */
  1848. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1849. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1850. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1851. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1852. do { \
  1853. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1854. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1855. } while (0)
  1856. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1857. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1858. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1859. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1860. do { \
  1861. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1862. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1863. } while (0)
  1864. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1865. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1866. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1867. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1868. do { \
  1869. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1870. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1871. } while (0)
  1872. /* DWORD 5 */
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1874. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1875. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1877. do { \
  1878. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1879. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1880. } while (0)
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  1882. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  1883. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  1884. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  1885. do { \
  1886. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  1887. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  1888. } while (0)
  1889. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  1890. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  1891. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  1892. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  1893. do { \
  1894. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  1895. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  1896. } while (0)
  1897. /* DWORD 6 */
  1898. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  1899. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  1900. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  1901. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1902. do { \
  1903. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  1904. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  1905. } while (0)
  1906. typedef enum {
  1907. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1908. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1909. } htt_tcl_metadata_type;
  1910. /**
  1911. * @brief HTT TCL command number format
  1912. * @details
  1913. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1914. * available to firmware as tcl_exit_base->tcl_status_number.
  1915. * For regular / multicast packets host will send vdev and mac id and for
  1916. * NAWDS packets, host will send peer id.
  1917. * A_UINT32 is used to avoid endianness conversion problems.
  1918. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1919. */
  1920. typedef struct {
  1921. A_UINT32
  1922. type: 1, /* vdev_id based or peer_id based */
  1923. rsvd: 31;
  1924. } htt_tx_tcl_vdev_or_peer_t;
  1925. typedef struct {
  1926. A_UINT32
  1927. type: 1, /* vdev_id based or peer_id based */
  1928. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1929. vdev_id: 8,
  1930. pdev_id: 2,
  1931. host_inspected:1,
  1932. rsvd: 19;
  1933. } htt_tx_tcl_vdev_metadata;
  1934. typedef struct {
  1935. A_UINT32
  1936. type: 1, /* vdev_id based or peer_id based */
  1937. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1938. peer_id: 14,
  1939. rsvd: 16;
  1940. } htt_tx_tcl_peer_metadata;
  1941. PREPACK struct htt_tx_tcl_metadata {
  1942. union {
  1943. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1944. htt_tx_tcl_vdev_metadata vdev_meta;
  1945. htt_tx_tcl_peer_metadata peer_meta;
  1946. };
  1947. } POSTPACK;
  1948. /* DWORD 0 */
  1949. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1950. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1951. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1952. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1953. /* VDEV metadata */
  1954. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1955. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1956. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1957. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1958. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1959. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1960. /* PEER metadata */
  1961. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1962. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1963. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1964. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1965. HTT_TX_TCL_METADATA_TYPE_S)
  1966. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1967. do { \
  1968. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1969. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1970. } while (0)
  1971. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1972. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1973. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1974. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1975. do { \
  1976. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1977. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1978. } while (0)
  1979. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1980. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1981. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1982. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1983. do { \
  1984. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1985. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1986. } while (0)
  1987. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1988. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1989. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1990. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1991. do { \
  1992. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1993. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1994. } while (0)
  1995. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1996. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1997. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1998. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1999. do { \
  2000. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2001. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2002. } while (0)
  2003. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2004. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2005. HTT_TX_TCL_METADATA_PEER_ID_S)
  2006. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2007. do { \
  2008. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2009. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2010. } while (0)
  2011. typedef enum {
  2012. HTT_TX_FW2WBM_TX_STATUS_OK,
  2013. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2014. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2015. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2016. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2017. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2018. HTT_TX_FW2WBM_TX_STATUS_MAX
  2019. } htt_tx_fw2wbm_tx_status_t;
  2020. typedef enum {
  2021. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2022. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2023. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2024. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2025. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2026. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2027. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2028. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2029. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2030. } htt_tx_fw2wbm_reinject_reason_t;
  2031. /**
  2032. * @brief HTT TX WBM Completion from firmware to host
  2033. * @details
  2034. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2035. * DWORD 3 and 4 for software based completions (Exception frames and
  2036. * TQM bypass frames)
  2037. * For software based completions, wbm_release_ring->release_source_module will
  2038. * be set to release_source_fw
  2039. */
  2040. PREPACK struct htt_tx_wbm_completion {
  2041. A_UINT32
  2042. sch_cmd_id: 24,
  2043. exception_frame: 1, /* If set, this packet was queued via exception path */
  2044. rsvd0_31_25: 7;
  2045. A_UINT32
  2046. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2047. * reception of an ACK or BA, this field indicates
  2048. * the RSSI of the received ACK or BA frame.
  2049. * When the frame is removed as result of a direct
  2050. * remove command from the SW, this field is set
  2051. * to 0x0 (which is never a valid value when real
  2052. * RSSI is available).
  2053. * Units: dB w.r.t noise floor
  2054. */
  2055. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2056. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2057. rsvd1_31_16: 16;
  2058. } POSTPACK;
  2059. /* DWORD 0 */
  2060. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2061. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2062. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2063. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2064. /* DWORD 1 */
  2065. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2066. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2067. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2068. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2069. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2070. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2071. /* DWORD 0 */
  2072. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2073. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2074. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2075. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2076. do { \
  2077. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2078. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2079. } while (0)
  2080. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2081. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2082. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2083. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2084. do { \
  2085. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2086. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2087. } while (0)
  2088. /* DWORD 1 */
  2089. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2090. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2091. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2092. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2093. do { \
  2094. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2095. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2096. } while (0)
  2097. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2098. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2099. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2100. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2101. do { \
  2102. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2103. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2104. } while (0)
  2105. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2106. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2107. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2108. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2109. do { \
  2110. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2111. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2112. } while (0)
  2113. /**
  2114. * @brief HTT TX WBM Completion from firmware to host
  2115. * @details
  2116. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2117. * (WBM) offload HW.
  2118. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2119. * For software based completions, release_source_module will
  2120. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2121. * struct wbm_release_ring and then switch to this after looking at
  2122. * release_source_module.
  2123. */
  2124. PREPACK struct htt_tx_wbm_completion_v2 {
  2125. A_UINT32
  2126. used_by_hw0; /* Refer to struct wbm_release_ring */
  2127. A_UINT32
  2128. used_by_hw1; /* Refer to struct wbm_release_ring */
  2129. A_UINT32
  2130. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2131. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2132. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2133. exception_frame: 1,
  2134. rsvd0: 12, /* For future use */
  2135. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2136. rsvd1: 1; /* For future use */
  2137. A_UINT32
  2138. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2139. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2140. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2141. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2142. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2143. */
  2144. A_UINT32
  2145. data1: 32;
  2146. A_UINT32
  2147. data2: 32;
  2148. A_UINT32
  2149. used_by_hw3; /* Refer to struct wbm_release_ring */
  2150. } POSTPACK;
  2151. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2152. /* DWORD 3 */
  2153. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2154. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2155. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2156. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2157. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2158. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2159. /* DWORD 3 */
  2160. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2161. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2162. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2163. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2164. do { \
  2165. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2166. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2167. } while (0)
  2168. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2169. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2170. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2171. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2172. do { \
  2173. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2174. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2175. } while (0)
  2176. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2177. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2178. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2179. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2180. do { \
  2181. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2182. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2183. } while (0)
  2184. /**
  2185. * @brief HTT TX WBM transmit status from firmware to host
  2186. * @details
  2187. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2188. * (WBM) offload HW.
  2189. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2190. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2191. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2192. */
  2193. PREPACK struct htt_tx_wbm_transmit_status {
  2194. A_UINT32
  2195. sch_cmd_id: 24,
  2196. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2197. * reception of an ACK or BA, this field indicates
  2198. * the RSSI of the received ACK or BA frame.
  2199. * When the frame is removed as result of a direct
  2200. * remove command from the SW, this field is set
  2201. * to 0x0 (which is never a valid value when real
  2202. * RSSI is available).
  2203. * Units: dB w.r.t noise floor
  2204. */
  2205. A_UINT32
  2206. sw_peer_id: 16,
  2207. tid_num: 5,
  2208. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2209. * and tid_num fields contain valid data.
  2210. * If this "valid" flag is not set, the
  2211. * sw_peer_id and tid_num fields must be ignored.
  2212. */
  2213. mcast: 1,
  2214. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2215. * contains valid data.
  2216. */
  2217. reserved0: 8;
  2218. A_UINT32
  2219. reserved1: 32;
  2220. } POSTPACK;
  2221. /* DWORD 4 */
  2222. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2223. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2224. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2225. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2226. /* DWORD 5 */
  2227. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2228. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2229. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2230. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2231. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2232. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2233. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2234. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2235. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2236. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2237. /* DWORD 4 */
  2238. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2239. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2240. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2241. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2242. do { \
  2243. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2244. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2245. } while (0)
  2246. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2247. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2248. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2249. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2250. do { \
  2251. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2252. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2253. } while (0)
  2254. /* DWORD 5 */
  2255. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2256. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2257. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2258. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2259. do { \
  2260. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2261. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2262. } while (0)
  2263. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2264. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2265. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2266. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2267. do { \
  2268. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2269. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2270. } while (0)
  2271. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2272. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2273. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2274. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2275. do { \
  2276. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2277. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2278. } while (0)
  2279. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2280. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2281. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2282. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2283. do { \
  2284. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2285. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2286. } while (0)
  2287. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2288. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2289. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2290. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2291. do { \
  2292. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2293. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2294. } while (0)
  2295. /**
  2296. * @brief HTT TX WBM reinject status 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_REINJECT.
  2302. */
  2303. PREPACK struct htt_tx_wbm_reinject_status {
  2304. A_UINT32
  2305. reserved0: 32;
  2306. A_UINT32
  2307. reserved1: 32;
  2308. A_UINT32
  2309. reserved2: 32;
  2310. } POSTPACK;
  2311. /**
  2312. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2313. * @details
  2314. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2315. * (WBM) offload HW.
  2316. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2317. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2318. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2319. * STA side.
  2320. */
  2321. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2322. A_UINT32
  2323. mec_sa_addr_31_0;
  2324. A_UINT32
  2325. mec_sa_addr_47_32: 16,
  2326. sa_ast_index: 16;
  2327. A_UINT32
  2328. vdev_id: 8,
  2329. reserved0: 24;
  2330. } POSTPACK;
  2331. /* DWORD 4 - mec_sa_addr_31_0 */
  2332. /* DWORD 5 */
  2333. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2334. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2335. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2336. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2337. /* DWORD 6 */
  2338. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2339. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2340. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2341. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2342. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2343. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2344. do { \
  2345. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2346. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2347. } while (0)
  2348. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2349. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2350. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2351. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2352. do { \
  2353. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2354. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2355. } while (0)
  2356. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2357. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2358. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2359. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2360. do { \
  2361. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2362. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2363. } while (0)
  2364. typedef enum {
  2365. TX_FLOW_PRIORITY_BE,
  2366. TX_FLOW_PRIORITY_HIGH,
  2367. TX_FLOW_PRIORITY_LOW,
  2368. } htt_tx_flow_priority_t;
  2369. typedef enum {
  2370. TX_FLOW_LATENCY_SENSITIVE,
  2371. TX_FLOW_LATENCY_INSENSITIVE,
  2372. } htt_tx_flow_latency_t;
  2373. typedef enum {
  2374. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2375. TX_FLOW_INTERACTIVE_TRAFFIC,
  2376. TX_FLOW_PERIODIC_TRAFFIC,
  2377. TX_FLOW_BURSTY_TRAFFIC,
  2378. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2379. } htt_tx_flow_traffic_pattern_t;
  2380. /**
  2381. * @brief HTT TX Flow search metadata format
  2382. * @details
  2383. * Host will set this metadata in flow table's flow search entry along with
  2384. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2385. * firmware and TQM ring if the flow search entry wins.
  2386. * This metadata is available to firmware in that first MSDU's
  2387. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2388. * to one of the available flows for specific tid and returns the tqm flow
  2389. * pointer as part of htt_tx_map_flow_info message.
  2390. */
  2391. PREPACK struct htt_tx_flow_metadata {
  2392. A_UINT32
  2393. rsvd0_1_0: 2,
  2394. tid: 4,
  2395. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2396. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2397. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2398. * Else choose final tid based on latency, priority.
  2399. */
  2400. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2401. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2402. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2403. } POSTPACK;
  2404. /* DWORD 0 */
  2405. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2406. #define HTT_TX_FLOW_METADATA_TID_S 2
  2407. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2408. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2409. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2410. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2411. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2412. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2413. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2414. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2415. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2416. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2417. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2418. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2419. /* DWORD 0 */
  2420. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2421. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2422. HTT_TX_FLOW_METADATA_TID_S)
  2423. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2424. do { \
  2425. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2426. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2427. } while (0)
  2428. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2429. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2430. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2431. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2432. do { \
  2433. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2434. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2435. } while (0)
  2436. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2437. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2438. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2439. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2440. do { \
  2441. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2442. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2443. } while (0)
  2444. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2445. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2446. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2447. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2448. do { \
  2449. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2450. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2451. } while (0)
  2452. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2453. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2454. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2455. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2456. do { \
  2457. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2458. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2459. } while (0)
  2460. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2461. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2462. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2463. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2464. do { \
  2465. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2466. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2467. } while (0)
  2468. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2469. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2470. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2471. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2472. do { \
  2473. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2474. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2475. } while (0)
  2476. /**
  2477. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2478. *
  2479. * @details
  2480. * HTT wds entry from source port learning
  2481. * Host will learn wds entries from rx and send this message to firmware
  2482. * to enable firmware to configure/delete AST entries for wds clients.
  2483. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2484. * and when SA's entry is deleted, firmware removes this AST entry
  2485. *
  2486. * The message would appear as follows:
  2487. *
  2488. * |31 30|29 |17 16|15 8|7 0|
  2489. * |----------------+----------------+----------------+----------------|
  2490. * | rsvd0 |PDVID| vdev_id | msg_type |
  2491. * |-------------------------------------------------------------------|
  2492. * | sa_addr_31_0 |
  2493. * |-------------------------------------------------------------------|
  2494. * | | ta_peer_id | sa_addr_47_32 |
  2495. * |-------------------------------------------------------------------|
  2496. * Where PDVID = pdev_id
  2497. *
  2498. * The message is interpreted as follows:
  2499. *
  2500. * dword0 - b'0:7 - msg_type: This will be set to
  2501. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2502. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2503. *
  2504. * dword0 - b'8:15 - vdev_id
  2505. *
  2506. * dword0 - b'16:17 - pdev_id
  2507. *
  2508. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2509. *
  2510. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2511. *
  2512. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2513. *
  2514. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2515. */
  2516. PREPACK struct htt_wds_entry {
  2517. A_UINT32
  2518. msg_type: 8,
  2519. vdev_id: 8,
  2520. pdev_id: 2,
  2521. rsvd0: 14;
  2522. A_UINT32 sa_addr_31_0;
  2523. A_UINT32
  2524. sa_addr_47_32: 16,
  2525. ta_peer_id: 14,
  2526. rsvd2: 2;
  2527. } POSTPACK;
  2528. /* DWORD 0 */
  2529. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2530. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2531. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2532. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2533. /* DWORD 2 */
  2534. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2535. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2536. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2537. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2538. /* DWORD 0 */
  2539. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2540. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2541. HTT_WDS_ENTRY_VDEV_ID_S)
  2542. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2543. do { \
  2544. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2545. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2546. } while (0)
  2547. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2548. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2549. HTT_WDS_ENTRY_PDEV_ID_S)
  2550. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2551. do { \
  2552. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2553. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2554. } while (0)
  2555. /* DWORD 2 */
  2556. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2557. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2558. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2559. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2560. do { \
  2561. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2562. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2563. } while (0)
  2564. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2565. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2566. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2567. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2568. do { \
  2569. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2570. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2571. } while (0)
  2572. /**
  2573. * @brief MAC DMA rx ring setup specification
  2574. * @details
  2575. * To allow for dynamic rx ring reconfiguration and to avoid race
  2576. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2577. * it uses. Instead, it sends this message to the target, indicating how
  2578. * the rx ring used by the host should be set up and maintained.
  2579. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2580. * specifications.
  2581. *
  2582. * |31 16|15 8|7 0|
  2583. * |---------------------------------------------------------------|
  2584. * header: | reserved | num rings | msg type |
  2585. * |---------------------------------------------------------------|
  2586. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2587. #if HTT_PADDR64
  2588. * | FW_IDX shadow register physical address (bits 63:32) |
  2589. #endif
  2590. * |---------------------------------------------------------------|
  2591. * | rx ring base physical address (bits 31:0) |
  2592. #if HTT_PADDR64
  2593. * | rx ring base physical address (bits 63:32) |
  2594. #endif
  2595. * |---------------------------------------------------------------|
  2596. * | rx ring buffer size | rx ring length |
  2597. * |---------------------------------------------------------------|
  2598. * | FW_IDX initial value | enabled flags |
  2599. * |---------------------------------------------------------------|
  2600. * | MSDU payload offset | 802.11 header offset |
  2601. * |---------------------------------------------------------------|
  2602. * | PPDU end offset | PPDU start offset |
  2603. * |---------------------------------------------------------------|
  2604. * | MPDU end offset | MPDU start offset |
  2605. * |---------------------------------------------------------------|
  2606. * | MSDU end offset | MSDU start offset |
  2607. * |---------------------------------------------------------------|
  2608. * | frag info offset | rx attention offset |
  2609. * |---------------------------------------------------------------|
  2610. * payload 2, if present, has the same format as payload 1
  2611. * Header fields:
  2612. * - MSG_TYPE
  2613. * Bits 7:0
  2614. * Purpose: identifies this as an rx ring configuration message
  2615. * Value: 0x2
  2616. * - NUM_RINGS
  2617. * Bits 15:8
  2618. * Purpose: indicates whether the host is setting up one rx ring or two
  2619. * Value: 1 or 2
  2620. * Payload:
  2621. * for systems using 64-bit format for bus addresses:
  2622. * - IDX_SHADOW_REG_PADDR_LO
  2623. * Bits 31:0
  2624. * Value: lower 4 bytes of physical address of the host's
  2625. * FW_IDX shadow register
  2626. * - IDX_SHADOW_REG_PADDR_HI
  2627. * Bits 31:0
  2628. * Value: upper 4 bytes of physical address of the host's
  2629. * FW_IDX shadow register
  2630. * - RING_BASE_PADDR_LO
  2631. * Bits 31:0
  2632. * Value: lower 4 bytes of physical address of the host's rx ring
  2633. * - RING_BASE_PADDR_HI
  2634. * Bits 31:0
  2635. * Value: uppper 4 bytes of physical address of the host's rx ring
  2636. * for systems using 32-bit format for bus addresses:
  2637. * - IDX_SHADOW_REG_PADDR
  2638. * Bits 31:0
  2639. * Value: physical address of the host's FW_IDX shadow register
  2640. * - RING_BASE_PADDR
  2641. * Bits 31:0
  2642. * Value: physical address of the host's rx ring
  2643. * - RING_LEN
  2644. * Bits 15:0
  2645. * Value: number of elements in the rx ring
  2646. * - RING_BUF_SZ
  2647. * Bits 31:16
  2648. * Value: size of the buffers referenced by the rx ring, in byte units
  2649. * - ENABLED_FLAGS
  2650. * Bits 15:0
  2651. * Value: 1-bit flags to show whether different rx fields are enabled
  2652. * bit 0: 802.11 header enabled (1) or disabled (0)
  2653. * bit 1: MSDU payload enabled (1) or disabled (0)
  2654. * bit 2: PPDU start enabled (1) or disabled (0)
  2655. * bit 3: PPDU end enabled (1) or disabled (0)
  2656. * bit 4: MPDU start enabled (1) or disabled (0)
  2657. * bit 5: MPDU end enabled (1) or disabled (0)
  2658. * bit 6: MSDU start enabled (1) or disabled (0)
  2659. * bit 7: MSDU end enabled (1) or disabled (0)
  2660. * bit 8: rx attention enabled (1) or disabled (0)
  2661. * bit 9: frag info enabled (1) or disabled (0)
  2662. * bit 10: unicast rx enabled (1) or disabled (0)
  2663. * bit 11: multicast rx enabled (1) or disabled (0)
  2664. * bit 12: ctrl rx enabled (1) or disabled (0)
  2665. * bit 13: mgmt rx enabled (1) or disabled (0)
  2666. * bit 14: null rx enabled (1) or disabled (0)
  2667. * bit 15: phy data rx enabled (1) or disabled (0)
  2668. * - IDX_INIT_VAL
  2669. * Bits 31:16
  2670. * Purpose: Specify the initial value for the FW_IDX.
  2671. * Value: the number of buffers initially present in the host's rx ring
  2672. * - OFFSET_802_11_HDR
  2673. * Bits 15:0
  2674. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2675. * - OFFSET_MSDU_PAYLOAD
  2676. * Bits 31:16
  2677. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2678. * - OFFSET_PPDU_START
  2679. * Bits 15:0
  2680. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2681. * - OFFSET_PPDU_END
  2682. * Bits 31:16
  2683. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2684. * - OFFSET_MPDU_START
  2685. * Bits 15:0
  2686. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2687. * - OFFSET_MPDU_END
  2688. * Bits 31:16
  2689. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2690. * - OFFSET_MSDU_START
  2691. * Bits 15:0
  2692. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2693. * - OFFSET_MSDU_END
  2694. * Bits 31:16
  2695. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2696. * - OFFSET_RX_ATTN
  2697. * Bits 15:0
  2698. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2699. * - OFFSET_FRAG_INFO
  2700. * Bits 31:16
  2701. * Value: offset in QUAD-bytes of frag info table
  2702. */
  2703. /* header fields */
  2704. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2705. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2706. /* payload fields */
  2707. /* for systems using a 64-bit format for bus addresses */
  2708. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2709. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2710. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2711. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2712. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2713. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2714. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2715. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2716. /* for systems using a 32-bit format for bus addresses */
  2717. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2718. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2719. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2720. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2721. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2722. #define HTT_RX_RING_CFG_LEN_S 0
  2723. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2724. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2725. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2726. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2727. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2728. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2729. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2730. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2731. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2732. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2733. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2734. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2735. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2736. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2737. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2738. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2739. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2740. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2741. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2742. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2743. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2744. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2745. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2746. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2747. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2748. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2749. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2750. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2751. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2752. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2753. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2754. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2755. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2756. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2757. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2758. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2759. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2760. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2761. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2762. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2763. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2764. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2765. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2766. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2767. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2768. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2769. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2770. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2771. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2772. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2773. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2774. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2775. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2776. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2777. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2778. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2779. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2780. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2781. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2782. #if HTT_PADDR64
  2783. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2784. #else
  2785. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2786. #endif
  2787. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2788. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2789. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2790. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2791. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2792. do { \
  2793. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2794. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2795. } while (0)
  2796. /* degenerate case for 32-bit fields */
  2797. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2798. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2799. ((_var) = (_val))
  2800. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2801. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2802. ((_var) = (_val))
  2803. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2804. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2805. ((_var) = (_val))
  2806. /* degenerate case for 32-bit fields */
  2807. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2808. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2809. ((_var) = (_val))
  2810. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2811. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2812. ((_var) = (_val))
  2813. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2814. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2815. ((_var) = (_val))
  2816. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2817. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2818. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2819. do { \
  2820. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2821. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2822. } while (0)
  2823. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2824. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2825. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2826. do { \
  2827. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2828. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2829. } while (0)
  2830. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2831. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2832. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2833. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2834. do { \
  2835. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2836. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2837. } while (0)
  2838. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2839. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2840. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2841. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2842. do { \
  2843. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2844. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2845. } while (0)
  2846. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2847. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2848. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2849. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2850. do { \
  2851. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2852. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2853. } while (0)
  2854. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2855. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2856. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2857. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2858. do { \
  2859. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2860. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2861. } while (0)
  2862. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2863. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2864. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2865. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2866. do { \
  2867. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2868. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2869. } while (0)
  2870. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2871. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2872. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2873. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2874. do { \
  2875. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2876. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2877. } while (0)
  2878. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2879. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2880. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2881. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2882. do { \
  2883. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2884. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2885. } while (0)
  2886. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2887. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2888. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2889. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2890. do { \
  2891. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2892. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2893. } while (0)
  2894. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2895. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2896. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2897. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2898. do { \
  2899. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2900. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2901. } while (0)
  2902. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2903. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2904. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2905. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2906. do { \
  2907. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2908. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2909. } while (0)
  2910. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2911. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2912. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2913. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2914. do { \
  2915. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2916. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2917. } while (0)
  2918. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2919. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2920. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2921. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2922. do { \
  2923. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2924. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2925. } while (0)
  2926. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2927. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2928. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2929. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2930. do { \
  2931. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2932. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2933. } while (0)
  2934. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2935. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2936. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2937. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2938. do { \
  2939. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2940. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2941. } while (0)
  2942. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2943. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2944. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2945. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2946. do { \
  2947. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2948. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2949. } while (0)
  2950. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2951. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2952. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2953. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2954. do { \
  2955. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2956. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2957. } while (0)
  2958. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2959. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2960. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2961. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2962. do { \
  2963. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2964. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2965. } while (0)
  2966. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2967. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2968. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2969. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2970. do { \
  2971. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2972. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2973. } while (0)
  2974. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2975. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2976. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2977. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2978. do { \
  2979. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2980. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2981. } while (0)
  2982. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2983. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2984. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2985. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2986. do { \
  2987. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2988. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2989. } while (0)
  2990. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2991. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2992. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2993. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2994. do { \
  2995. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2996. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2997. } while (0)
  2998. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2999. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3000. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3001. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3002. do { \
  3003. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3004. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3005. } while (0)
  3006. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3007. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3008. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3009. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3010. do { \
  3011. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3012. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3013. } while (0)
  3014. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3015. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3016. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3017. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3018. do { \
  3019. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3020. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3021. } while (0)
  3022. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3023. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3024. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3025. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3026. do { \
  3027. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3028. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3029. } while (0)
  3030. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3031. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3032. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3033. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3034. do { \
  3035. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3036. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3037. } while (0)
  3038. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3039. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3040. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3041. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3042. do { \
  3043. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3044. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3045. } while (0)
  3046. /**
  3047. * @brief host -> target FW statistics retrieve
  3048. *
  3049. * @details
  3050. * The following field definitions describe the format of the HTT host
  3051. * to target FW stats retrieve message. The message specifies the type of
  3052. * stats host wants to retrieve.
  3053. *
  3054. * |31 24|23 16|15 8|7 0|
  3055. * |-----------------------------------------------------------|
  3056. * | stats types request bitmask | msg type |
  3057. * |-----------------------------------------------------------|
  3058. * | stats types reset bitmask | reserved |
  3059. * |-----------------------------------------------------------|
  3060. * | stats type | config value |
  3061. * |-----------------------------------------------------------|
  3062. * | cookie LSBs |
  3063. * |-----------------------------------------------------------|
  3064. * | cookie MSBs |
  3065. * |-----------------------------------------------------------|
  3066. * Header fields:
  3067. * - MSG_TYPE
  3068. * Bits 7:0
  3069. * Purpose: identifies this is a stats upload request message
  3070. * Value: 0x3
  3071. * - UPLOAD_TYPES
  3072. * Bits 31:8
  3073. * Purpose: identifies which types of FW statistics to upload
  3074. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3075. * - RESET_TYPES
  3076. * Bits 31:8
  3077. * Purpose: identifies which types of FW statistics to reset
  3078. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3079. * - CFG_VAL
  3080. * Bits 23:0
  3081. * Purpose: give an opaque configuration value to the specified stats type
  3082. * Value: stats-type specific configuration value
  3083. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3084. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3085. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3086. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3087. * - CFG_STAT_TYPE
  3088. * Bits 31:24
  3089. * Purpose: specify which stats type (if any) the config value applies to
  3090. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3091. * a valid configuration specification
  3092. * - COOKIE_LSBS
  3093. * Bits 31:0
  3094. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3095. * message with its preceding host->target stats request message.
  3096. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3097. * - COOKIE_MSBS
  3098. * Bits 31:0
  3099. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3100. * message with its preceding host->target stats request message.
  3101. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3102. */
  3103. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3104. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3105. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3106. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3107. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3108. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3109. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3110. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3111. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3112. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3113. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3114. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3115. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3116. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3117. do { \
  3118. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3119. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3120. } while (0)
  3121. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3122. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3123. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3124. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3125. do { \
  3126. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3127. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3128. } while (0)
  3129. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3130. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3131. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3132. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3133. do { \
  3134. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3135. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3136. } while (0)
  3137. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3138. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3139. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3140. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3141. do { \
  3142. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3143. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3144. } while (0)
  3145. /**
  3146. * @brief host -> target HTT out-of-band sync request
  3147. *
  3148. * @details
  3149. * The HTT SYNC tells the target to suspend processing of subsequent
  3150. * HTT host-to-target messages until some other target agent locally
  3151. * informs the target HTT FW that the current sync counter is equal to
  3152. * or greater than (in a modulo sense) the sync counter specified in
  3153. * the SYNC message.
  3154. * This allows other host-target components to synchronize their operation
  3155. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3156. * security key has been downloaded to and activated by the target.
  3157. * In the absence of any explicit synchronization counter value
  3158. * specification, the target HTT FW will use zero as the default current
  3159. * sync value.
  3160. *
  3161. * |31 24|23 16|15 8|7 0|
  3162. * |-----------------------------------------------------------|
  3163. * | reserved | sync count | msg type |
  3164. * |-----------------------------------------------------------|
  3165. * Header fields:
  3166. * - MSG_TYPE
  3167. * Bits 7:0
  3168. * Purpose: identifies this as a sync message
  3169. * Value: 0x4
  3170. * - SYNC_COUNT
  3171. * Bits 15:8
  3172. * Purpose: specifies what sync value the HTT FW will wait for from
  3173. * an out-of-band specification to resume its operation
  3174. * Value: in-band sync counter value to compare against the out-of-band
  3175. * counter spec.
  3176. * The HTT target FW will suspend its host->target message processing
  3177. * as long as
  3178. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3179. */
  3180. #define HTT_H2T_SYNC_MSG_SZ 4
  3181. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3182. #define HTT_H2T_SYNC_COUNT_S 8
  3183. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3184. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3185. HTT_H2T_SYNC_COUNT_S)
  3186. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3187. do { \
  3188. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3189. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3190. } while (0)
  3191. /**
  3192. * @brief HTT aggregation configuration
  3193. */
  3194. #define HTT_AGGR_CFG_MSG_SZ 4
  3195. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3196. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3197. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3198. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3199. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3200. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3201. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3202. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3203. do { \
  3204. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3205. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3206. } while (0)
  3207. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3208. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3209. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3210. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3211. do { \
  3212. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3213. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3214. } while (0)
  3215. /**
  3216. * @brief host -> target HTT configure max amsdu info per vdev
  3217. *
  3218. * @details
  3219. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3220. *
  3221. * |31 21|20 16|15 8|7 0|
  3222. * |-----------------------------------------------------------|
  3223. * | reserved | vdev id | max amsdu | msg type |
  3224. * |-----------------------------------------------------------|
  3225. * Header fields:
  3226. * - MSG_TYPE
  3227. * Bits 7:0
  3228. * Purpose: identifies this as a aggr cfg ex message
  3229. * Value: 0xa
  3230. * - MAX_NUM_AMSDU_SUBFRM
  3231. * Bits 15:8
  3232. * Purpose: max MSDUs per A-MSDU
  3233. * - VDEV_ID
  3234. * Bits 20:16
  3235. * Purpose: ID of the vdev to which this limit is applied
  3236. */
  3237. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3238. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3239. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3240. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3241. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3242. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3243. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3244. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3245. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3246. do { \
  3247. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3248. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3249. } while (0)
  3250. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3251. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3252. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3253. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3254. do { \
  3255. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3256. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3257. } while (0)
  3258. /**
  3259. * @brief HTT WDI_IPA Config Message
  3260. *
  3261. * @details
  3262. * The HTT WDI_IPA config message is created/sent by host at driver
  3263. * init time. It contains information about data structures used on
  3264. * WDI_IPA TX and RX path.
  3265. * TX CE ring is used for pushing packet metadata from IPA uC
  3266. * to WLAN FW
  3267. * TX Completion ring is used for generating TX completions from
  3268. * WLAN FW to IPA uC
  3269. * RX Indication ring is used for indicating RX packets from FW
  3270. * to IPA uC
  3271. * RX Ring2 is used as either completion ring or as second
  3272. * indication ring. when Ring2 is used as completion ring, IPA uC
  3273. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3274. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3275. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3276. * indicated in RX Indication ring. Please see WDI_IPA specification
  3277. * for more details.
  3278. * |31 24|23 16|15 8|7 0|
  3279. * |----------------+----------------+----------------+----------------|
  3280. * | tx pkt pool size | Rsvd | msg_type |
  3281. * |-------------------------------------------------------------------|
  3282. * | tx comp ring base (bits 31:0) |
  3283. #if HTT_PADDR64
  3284. * | tx comp ring base (bits 63:32) |
  3285. #endif
  3286. * |-------------------------------------------------------------------|
  3287. * | tx comp ring size |
  3288. * |-------------------------------------------------------------------|
  3289. * | tx comp WR_IDX physical address (bits 31:0) |
  3290. #if HTT_PADDR64
  3291. * | tx comp WR_IDX physical address (bits 63:32) |
  3292. #endif
  3293. * |-------------------------------------------------------------------|
  3294. * | tx CE WR_IDX physical address (bits 31:0) |
  3295. #if HTT_PADDR64
  3296. * | tx CE WR_IDX physical address (bits 63:32) |
  3297. #endif
  3298. * |-------------------------------------------------------------------|
  3299. * | rx indication ring base (bits 31:0) |
  3300. #if HTT_PADDR64
  3301. * | rx indication ring base (bits 63:32) |
  3302. #endif
  3303. * |-------------------------------------------------------------------|
  3304. * | rx indication ring size |
  3305. * |-------------------------------------------------------------------|
  3306. * | rx ind RD_IDX physical address (bits 31:0) |
  3307. #if HTT_PADDR64
  3308. * | rx ind RD_IDX physical address (bits 63:32) |
  3309. #endif
  3310. * |-------------------------------------------------------------------|
  3311. * | rx ind WR_IDX physical address (bits 31:0) |
  3312. #if HTT_PADDR64
  3313. * | rx ind WR_IDX physical address (bits 63:32) |
  3314. #endif
  3315. * |-------------------------------------------------------------------|
  3316. * |-------------------------------------------------------------------|
  3317. * | rx ring2 base (bits 31:0) |
  3318. #if HTT_PADDR64
  3319. * | rx ring2 base (bits 63:32) |
  3320. #endif
  3321. * |-------------------------------------------------------------------|
  3322. * | rx ring2 size |
  3323. * |-------------------------------------------------------------------|
  3324. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3325. #if HTT_PADDR64
  3326. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3327. #endif
  3328. * |-------------------------------------------------------------------|
  3329. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3330. #if HTT_PADDR64
  3331. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3332. #endif
  3333. * |-------------------------------------------------------------------|
  3334. *
  3335. * Header fields:
  3336. * Header fields:
  3337. * - MSG_TYPE
  3338. * Bits 7:0
  3339. * Purpose: Identifies this as WDI_IPA config message
  3340. * value: = 0x8
  3341. * - TX_PKT_POOL_SIZE
  3342. * Bits 15:0
  3343. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3344. * WDI_IPA TX path
  3345. * For systems using 32-bit format for bus addresses:
  3346. * - TX_COMP_RING_BASE_ADDR
  3347. * Bits 31:0
  3348. * Purpose: TX Completion Ring base address in DDR
  3349. * - TX_COMP_RING_SIZE
  3350. * Bits 31:0
  3351. * Purpose: TX Completion Ring size (must be power of 2)
  3352. * - TX_COMP_WR_IDX_ADDR
  3353. * Bits 31:0
  3354. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3355. * updates the Write Index for WDI_IPA TX completion ring
  3356. * - TX_CE_WR_IDX_ADDR
  3357. * Bits 31:0
  3358. * Purpose: DDR address where IPA uC
  3359. * updates the WR Index for TX CE ring
  3360. * (needed for fusion platforms)
  3361. * - RX_IND_RING_BASE_ADDR
  3362. * Bits 31:0
  3363. * Purpose: RX Indication Ring base address in DDR
  3364. * - RX_IND_RING_SIZE
  3365. * Bits 31:0
  3366. * Purpose: RX Indication Ring size
  3367. * - RX_IND_RD_IDX_ADDR
  3368. * Bits 31:0
  3369. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3370. * RX indication ring
  3371. * - RX_IND_WR_IDX_ADDR
  3372. * Bits 31:0
  3373. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3374. * updates the Write Index for WDI_IPA RX indication ring
  3375. * - RX_RING2_BASE_ADDR
  3376. * Bits 31:0
  3377. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3378. * - RX_RING2_SIZE
  3379. * Bits 31:0
  3380. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3381. * - RX_RING2_RD_IDX_ADDR
  3382. * Bits 31:0
  3383. * Purpose: If Second RX ring is Indication ring, DDR address where
  3384. * IPA uC updates the Read Index for Ring2.
  3385. * If Second RX ring is completion ring, this is NOT used
  3386. * - RX_RING2_WR_IDX_ADDR
  3387. * Bits 31:0
  3388. * Purpose: If Second RX ring is Indication ring, DDR address where
  3389. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3390. * If second RX ring is completion ring, DDR address where
  3391. * IPA uC updates the Write Index for Ring 2.
  3392. * For systems using 64-bit format for bus addresses:
  3393. * - TX_COMP_RING_BASE_ADDR_LO
  3394. * Bits 31:0
  3395. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3396. * - TX_COMP_RING_BASE_ADDR_HI
  3397. * Bits 31:0
  3398. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3399. * - TX_COMP_RING_SIZE
  3400. * Bits 31:0
  3401. * Purpose: TX Completion Ring size (must be power of 2)
  3402. * - TX_COMP_WR_IDX_ADDR_LO
  3403. * Bits 31:0
  3404. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3405. * Lower 4 bytes of DDR address where WIFI FW
  3406. * updates the Write Index for WDI_IPA TX completion ring
  3407. * - TX_COMP_WR_IDX_ADDR_HI
  3408. * Bits 31:0
  3409. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3410. * Higher 4 bytes of DDR address where WIFI FW
  3411. * updates the Write Index for WDI_IPA TX completion ring
  3412. * - TX_CE_WR_IDX_ADDR_LO
  3413. * Bits 31:0
  3414. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3415. * updates the WR Index for TX CE ring
  3416. * (needed for fusion platforms)
  3417. * - TX_CE_WR_IDX_ADDR_HI
  3418. * Bits 31:0
  3419. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3420. * updates the WR Index for TX CE ring
  3421. * (needed for fusion platforms)
  3422. * - RX_IND_RING_BASE_ADDR_LO
  3423. * Bits 31:0
  3424. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3425. * - RX_IND_RING_BASE_ADDR_HI
  3426. * Bits 31:0
  3427. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3428. * - RX_IND_RING_SIZE
  3429. * Bits 31:0
  3430. * Purpose: RX Indication Ring size
  3431. * - RX_IND_RD_IDX_ADDR_LO
  3432. * Bits 31:0
  3433. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3434. * for WDI_IPA RX indication ring
  3435. * - RX_IND_RD_IDX_ADDR_HI
  3436. * Bits 31:0
  3437. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3438. * for WDI_IPA RX indication ring
  3439. * - RX_IND_WR_IDX_ADDR_LO
  3440. * Bits 31:0
  3441. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3442. * Lower 4 bytes of DDR address where WIFI FW
  3443. * updates the Write Index for WDI_IPA RX indication ring
  3444. * - RX_IND_WR_IDX_ADDR_HI
  3445. * Bits 31:0
  3446. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3447. * Higher 4 bytes of DDR address where WIFI FW
  3448. * updates the Write Index for WDI_IPA RX indication ring
  3449. * - RX_RING2_BASE_ADDR_LO
  3450. * Bits 31:0
  3451. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3452. * - RX_RING2_BASE_ADDR_HI
  3453. * Bits 31:0
  3454. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3455. * - RX_RING2_SIZE
  3456. * Bits 31:0
  3457. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3458. * - RX_RING2_RD_IDX_ADDR_LO
  3459. * Bits 31:0
  3460. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3461. * DDR address where IPA uC updates the Read Index for Ring2.
  3462. * If Second RX ring is completion ring, this is NOT used
  3463. * - RX_RING2_RD_IDX_ADDR_HI
  3464. * Bits 31:0
  3465. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3466. * DDR address where IPA uC updates the Read Index for Ring2.
  3467. * If Second RX ring is completion ring, this is NOT used
  3468. * - RX_RING2_WR_IDX_ADDR_LO
  3469. * Bits 31:0
  3470. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3471. * DDR address where WIFI FW updates the Write Index
  3472. * for WDI_IPA RX ring2
  3473. * If second RX ring is completion ring, lower 4 bytes of
  3474. * DDR address where IPA uC updates the Write Index for Ring 2.
  3475. * - RX_RING2_WR_IDX_ADDR_HI
  3476. * Bits 31:0
  3477. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3478. * DDR address where WIFI FW updates the Write Index
  3479. * for WDI_IPA RX ring2
  3480. * If second RX ring is completion ring, higher 4 bytes of
  3481. * DDR address where IPA uC updates the Write Index for Ring 2.
  3482. */
  3483. #if HTT_PADDR64
  3484. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3485. #else
  3486. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3487. #endif
  3488. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3489. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3490. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3491. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3492. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3493. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3494. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3495. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3496. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3497. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3498. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3499. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3500. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3501. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3502. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3503. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3504. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3505. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3506. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3507. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3508. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3509. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3510. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3511. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3512. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3513. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3514. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3515. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3516. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3517. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3518. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3519. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3520. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3521. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3522. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3523. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3524. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3525. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3526. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3527. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3528. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3529. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3530. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3531. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3532. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3533. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3534. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3535. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3536. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3537. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3538. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3539. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3540. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3541. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3542. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3543. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3544. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3545. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3546. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3547. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3548. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3549. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3550. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3551. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3552. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3553. do { \
  3554. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3555. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3556. } while (0)
  3557. /* for systems using 32-bit format for bus addr */
  3558. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3559. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3560. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3561. do { \
  3562. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3563. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3564. } while (0)
  3565. /* for systems using 64-bit format for bus addr */
  3566. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3567. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3568. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3569. do { \
  3570. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3571. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3572. } while (0)
  3573. /* for systems using 64-bit format for bus addr */
  3574. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3575. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3576. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3577. do { \
  3578. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3579. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3580. } while (0)
  3581. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3582. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3583. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3584. do { \
  3585. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3586. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3587. } while (0)
  3588. /* for systems using 32-bit format for bus addr */
  3589. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3590. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3591. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3592. do { \
  3593. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3594. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3595. } while (0)
  3596. /* for systems using 64-bit format for bus addr */
  3597. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3598. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3599. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3600. do { \
  3601. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3602. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3603. } while (0)
  3604. /* for systems using 64-bit format for bus addr */
  3605. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3606. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3607. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3608. do { \
  3609. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3610. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3611. } while (0)
  3612. /* for systems using 32-bit format for bus addr */
  3613. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3614. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3615. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3616. do { \
  3617. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3618. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3619. } while (0)
  3620. /* for systems using 64-bit format for bus addr */
  3621. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3622. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3623. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3624. do { \
  3625. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3626. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3627. } while (0)
  3628. /* for systems using 64-bit format for bus addr */
  3629. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3630. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3631. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3632. do { \
  3633. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3634. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3635. } while (0)
  3636. /* for systems using 32-bit format for bus addr */
  3637. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3638. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3639. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3640. do { \
  3641. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3642. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3643. } while (0)
  3644. /* for systems using 64-bit format for bus addr */
  3645. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3646. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3647. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3648. do { \
  3649. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3650. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3651. } while (0)
  3652. /* for systems using 64-bit format for bus addr */
  3653. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3654. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3655. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3656. do { \
  3657. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3658. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3659. } while (0)
  3660. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3661. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3662. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3663. do { \
  3664. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3665. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3666. } while (0)
  3667. /* for systems using 32-bit format for bus addr */
  3668. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3669. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3670. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3671. do { \
  3672. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3673. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3674. } while (0)
  3675. /* for systems using 64-bit format for bus addr */
  3676. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3677. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3678. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3679. do { \
  3680. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3681. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3682. } while (0)
  3683. /* for systems using 64-bit format for bus addr */
  3684. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3685. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3686. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3687. do { \
  3688. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3689. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3690. } while (0)
  3691. /* for systems using 32-bit format for bus addr */
  3692. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3693. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3694. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3695. do { \
  3696. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3697. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3698. } while (0)
  3699. /* for systems using 64-bit format for bus addr */
  3700. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3701. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3702. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3703. do { \
  3704. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3705. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3706. } while (0)
  3707. /* for systems using 64-bit format for bus addr */
  3708. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3709. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3710. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3711. do { \
  3712. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3713. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3714. } while (0)
  3715. /* for systems using 32-bit format for bus addr */
  3716. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3717. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3718. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3719. do { \
  3720. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3721. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3722. } while (0)
  3723. /* for systems using 64-bit format for bus addr */
  3724. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3725. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3726. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3727. do { \
  3728. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3729. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3730. } while (0)
  3731. /* for systems using 64-bit format for bus addr */
  3732. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3733. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3734. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3735. do { \
  3736. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3737. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3738. } while (0)
  3739. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3740. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3741. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3742. do { \
  3743. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3744. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3745. } while (0)
  3746. /* for systems using 32-bit format for bus addr */
  3747. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3748. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3749. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3750. do { \
  3751. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3752. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3753. } while (0)
  3754. /* for systems using 64-bit format for bus addr */
  3755. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3756. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3757. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3758. do { \
  3759. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3760. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3761. } while (0)
  3762. /* for systems using 64-bit format for bus addr */
  3763. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3764. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3765. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3766. do { \
  3767. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3768. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3769. } while (0)
  3770. /* for systems using 32-bit format for bus addr */
  3771. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3772. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3773. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3774. do { \
  3775. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3776. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3777. } while (0)
  3778. /* for systems using 64-bit format for bus addr */
  3779. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3780. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3781. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3782. do { \
  3783. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3784. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3785. } while (0)
  3786. /* for systems using 64-bit format for bus addr */
  3787. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3788. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3789. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3790. do { \
  3791. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3792. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3793. } while (0)
  3794. /*
  3795. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3796. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3797. * addresses are stored in a XXX-bit field.
  3798. * This macro is used to define both htt_wdi_ipa_config32_t and
  3799. * htt_wdi_ipa_config64_t structs.
  3800. */
  3801. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3802. _paddr__tx_comp_ring_base_addr_, \
  3803. _paddr__tx_comp_wr_idx_addr_, \
  3804. _paddr__tx_ce_wr_idx_addr_, \
  3805. _paddr__rx_ind_ring_base_addr_, \
  3806. _paddr__rx_ind_rd_idx_addr_, \
  3807. _paddr__rx_ind_wr_idx_addr_, \
  3808. _paddr__rx_ring2_base_addr_,\
  3809. _paddr__rx_ring2_rd_idx_addr_,\
  3810. _paddr__rx_ring2_wr_idx_addr_) \
  3811. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3812. { \
  3813. /* DWORD 0: flags and meta-data */ \
  3814. A_UINT32 \
  3815. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3816. reserved: 8, \
  3817. tx_pkt_pool_size: 16;\
  3818. /* DWORD 1 */\
  3819. _paddr__tx_comp_ring_base_addr_;\
  3820. /* DWORD 2 (or 3)*/\
  3821. A_UINT32 tx_comp_ring_size;\
  3822. /* DWORD 3 (or 4)*/\
  3823. _paddr__tx_comp_wr_idx_addr_;\
  3824. /* DWORD 4 (or 6)*/\
  3825. _paddr__tx_ce_wr_idx_addr_;\
  3826. /* DWORD 5 (or 8)*/\
  3827. _paddr__rx_ind_ring_base_addr_;\
  3828. /* DWORD 6 (or 10)*/\
  3829. A_UINT32 rx_ind_ring_size;\
  3830. /* DWORD 7 (or 11)*/\
  3831. _paddr__rx_ind_rd_idx_addr_;\
  3832. /* DWORD 8 (or 13)*/\
  3833. _paddr__rx_ind_wr_idx_addr_;\
  3834. /* DWORD 9 (or 15)*/\
  3835. _paddr__rx_ring2_base_addr_;\
  3836. /* DWORD 10 (or 17) */\
  3837. A_UINT32 rx_ring2_size;\
  3838. /* DWORD 11 (or 18) */\
  3839. _paddr__rx_ring2_rd_idx_addr_;\
  3840. /* DWORD 12 (or 20) */\
  3841. _paddr__rx_ring2_wr_idx_addr_;\
  3842. } POSTPACK
  3843. /* define a htt_wdi_ipa_config32_t type */
  3844. 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));
  3845. /* define a htt_wdi_ipa_config64_t type */
  3846. 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));
  3847. #if HTT_PADDR64
  3848. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3849. #else
  3850. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3851. #endif
  3852. enum htt_wdi_ipa_op_code {
  3853. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3854. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3855. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3856. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3857. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3858. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3859. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3860. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3861. /* keep this last */
  3862. HTT_WDI_IPA_OPCODE_MAX
  3863. };
  3864. /**
  3865. * @brief HTT WDI_IPA Operation Request Message
  3866. *
  3867. * @details
  3868. * HTT WDI_IPA Operation Request message is sent by host
  3869. * to either suspend or resume WDI_IPA TX or RX path.
  3870. * |31 24|23 16|15 8|7 0|
  3871. * |----------------+----------------+----------------+----------------|
  3872. * | op_code | Rsvd | msg_type |
  3873. * |-------------------------------------------------------------------|
  3874. *
  3875. * Header fields:
  3876. * - MSG_TYPE
  3877. * Bits 7:0
  3878. * Purpose: Identifies this as WDI_IPA Operation Request message
  3879. * value: = 0x9
  3880. * - OP_CODE
  3881. * Bits 31:16
  3882. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3883. * value: = enum htt_wdi_ipa_op_code
  3884. */
  3885. PREPACK struct htt_wdi_ipa_op_request_t
  3886. {
  3887. /* DWORD 0: flags and meta-data */
  3888. A_UINT32
  3889. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3890. reserved: 8,
  3891. op_code: 16;
  3892. } POSTPACK;
  3893. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3894. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3895. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3896. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3897. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3898. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3899. do { \
  3900. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3901. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3902. } while (0)
  3903. /*
  3904. * @brief host -> target HTT_SRING_SETUP message
  3905. *
  3906. * @details
  3907. * After target is booted up, Host can send SRING setup message for
  3908. * each host facing LMAC SRING. Target setups up HW registers based
  3909. * on setup message and confirms back to Host if response_required is set.
  3910. * Host should wait for confirmation message before sending new SRING
  3911. * setup message
  3912. *
  3913. * The message would appear as follows:
  3914. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  3915. * |--------------- +-----------------+-----------------+-----------------|
  3916. * | ring_type | ring_id | pdev_id | msg_type |
  3917. * |----------------------------------------------------------------------|
  3918. * | ring_base_addr_lo |
  3919. * |----------------------------------------------------------------------|
  3920. * | ring_base_addr_hi |
  3921. * |----------------------------------------------------------------------|
  3922. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3923. * |----------------------------------------------------------------------|
  3924. * | ring_head_offset32_remote_addr_lo |
  3925. * |----------------------------------------------------------------------|
  3926. * | ring_head_offset32_remote_addr_hi |
  3927. * |----------------------------------------------------------------------|
  3928. * | ring_tail_offset32_remote_addr_lo |
  3929. * |----------------------------------------------------------------------|
  3930. * | ring_tail_offset32_remote_addr_hi |
  3931. * |----------------------------------------------------------------------|
  3932. * | ring_msi_addr_lo |
  3933. * |----------------------------------------------------------------------|
  3934. * | ring_msi_addr_hi |
  3935. * |----------------------------------------------------------------------|
  3936. * | ring_msi_data |
  3937. * |----------------------------------------------------------------------|
  3938. * | intr_timer_th |IM| intr_batch_counter_th |
  3939. * |----------------------------------------------------------------------|
  3940. * | reserved |ID|RR| PTCF| intr_low_threshold |
  3941. * |----------------------------------------------------------------------|
  3942. * | reserved |IPA drop thres hi|IPA drop thres lo|
  3943. * |----------------------------------------------------------------------|
  3944. * Where
  3945. * IM = sw_intr_mode
  3946. * RR = response_required
  3947. * PTCF = prefetch_timer_cfg
  3948. * IP = IPA drop flag
  3949. *
  3950. * The message is interpreted as follows:
  3951. * dword0 - b'0:7 - msg_type: This will be set to
  3952. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3953. * b'8:15 - pdev_id:
  3954. * 0 (for rings at SOC/UMAC level),
  3955. * 1/2/3 mac id (for rings at LMAC level)
  3956. * b'16:23 - ring_id: identify which ring is to setup,
  3957. * more details can be got from enum htt_srng_ring_id
  3958. * b'24:31 - ring_type: identify type of host rings,
  3959. * more details can be got from enum htt_srng_ring_type
  3960. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3961. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3962. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3963. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3964. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3965. * SW_TO_HW_RING.
  3966. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3967. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3968. * Lower 32 bits of memory address of the remote variable
  3969. * storing the 4-byte word offset that identifies the head
  3970. * element within the ring.
  3971. * (The head offset variable has type A_UINT32.)
  3972. * Valid for HW_TO_SW and SW_TO_SW rings.
  3973. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3974. * Upper 32 bits of memory address of the remote variable
  3975. * storing the 4-byte word offset that identifies the head
  3976. * element within the ring.
  3977. * (The head offset variable has type A_UINT32.)
  3978. * Valid for HW_TO_SW and SW_TO_SW rings.
  3979. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3980. * Lower 32 bits of memory address of the remote variable
  3981. * storing the 4-byte word offset that identifies the tail
  3982. * element within the ring.
  3983. * (The tail offset variable has type A_UINT32.)
  3984. * Valid for HW_TO_SW and SW_TO_SW rings.
  3985. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3986. * Upper 32 bits of memory address of the remote variable
  3987. * storing the 4-byte word offset that identifies the tail
  3988. * element within the ring.
  3989. * (The tail offset variable has type A_UINT32.)
  3990. * Valid for HW_TO_SW and SW_TO_SW rings.
  3991. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3992. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3993. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3994. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3995. * dword10 - b'0:31 - ring_msi_data: MSI data
  3996. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3997. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3998. * dword11 - b'0:14 - intr_batch_counter_th:
  3999. * batch counter threshold is in units of 4-byte words.
  4000. * HW internally maintains and increments batch count.
  4001. * (see SRING spec for detail description).
  4002. * When batch count reaches threshold value, an interrupt
  4003. * is generated by HW.
  4004. * b'15 - sw_intr_mode:
  4005. * This configuration shall be static.
  4006. * Only programmed at power up.
  4007. * 0: generate pulse style sw interrupts
  4008. * 1: generate level style sw interrupts
  4009. * b'16:31 - intr_timer_th:
  4010. * The timer init value when timer is idle or is
  4011. * initialized to start downcounting.
  4012. * In 8us units (to cover a range of 0 to 524 ms)
  4013. * dword12 - b'0:15 - intr_low_threshold:
  4014. * Used only by Consumer ring to generate ring_sw_int_p.
  4015. * Ring entries low threshold water mark, that is used
  4016. * in combination with the interrupt timer as well as
  4017. * the the clearing of the level interrupt.
  4018. * b'16:18 - prefetch_timer_cfg:
  4019. * Used only by Consumer ring to set timer mode to
  4020. * support Application prefetch handling.
  4021. * The external tail offset/pointer will be updated
  4022. * at following intervals:
  4023. * 3'b000: (Prefetch feature disabled; used only for debug)
  4024. * 3'b001: 1 usec
  4025. * 3'b010: 4 usec
  4026. * 3'b011: 8 usec (default)
  4027. * 3'b100: 16 usec
  4028. * Others: Reserverd
  4029. * b'19 - response_required:
  4030. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4031. * b'20 - ipa_drop_flag:
  4032. Indicates that host will config ipa drop threshold percentage
  4033. * b'21:31 - reserved: reserved for future use
  4034. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4035. * b'8:15 - ipa drop high threshold percentage:
  4036. * b'16:31 - Reserved
  4037. */
  4038. PREPACK struct htt_sring_setup_t {
  4039. A_UINT32 msg_type: 8,
  4040. pdev_id: 8,
  4041. ring_id: 8,
  4042. ring_type: 8;
  4043. A_UINT32 ring_base_addr_lo;
  4044. A_UINT32 ring_base_addr_hi;
  4045. A_UINT32 ring_size: 16,
  4046. ring_entry_size: 8,
  4047. ring_misc_cfg_flag: 8;
  4048. A_UINT32 ring_head_offset32_remote_addr_lo;
  4049. A_UINT32 ring_head_offset32_remote_addr_hi;
  4050. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4051. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4052. A_UINT32 ring_msi_addr_lo;
  4053. A_UINT32 ring_msi_addr_hi;
  4054. A_UINT32 ring_msi_data;
  4055. A_UINT32 intr_batch_counter_th: 15,
  4056. sw_intr_mode: 1,
  4057. intr_timer_th: 16;
  4058. A_UINT32 intr_low_threshold: 16,
  4059. prefetch_timer_cfg: 3,
  4060. response_required: 1,
  4061. ipa_drop_flag: 1,
  4062. reserved1: 11;
  4063. A_UINT32 ipa_drop_low_threshold: 8,
  4064. ipa_drop_high_threshold: 8,
  4065. reserved: 16;
  4066. } POSTPACK;
  4067. enum htt_srng_ring_type {
  4068. HTT_HW_TO_SW_RING = 0,
  4069. HTT_SW_TO_HW_RING,
  4070. HTT_SW_TO_SW_RING,
  4071. /* Insert new ring types above this line */
  4072. };
  4073. enum htt_srng_ring_id {
  4074. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4075. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4076. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4077. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4078. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4079. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4080. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4081. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4082. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4083. /* Add Other SRING which can't be directly configured by host software above this line */
  4084. };
  4085. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4086. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4087. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4088. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4089. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4090. HTT_SRING_SETUP_PDEV_ID_S)
  4091. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4092. do { \
  4093. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4094. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4095. } while (0)
  4096. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4097. #define HTT_SRING_SETUP_RING_ID_S 16
  4098. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4099. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4100. HTT_SRING_SETUP_RING_ID_S)
  4101. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4102. do { \
  4103. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4104. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4105. } while (0)
  4106. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4107. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4108. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4109. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4110. HTT_SRING_SETUP_RING_TYPE_S)
  4111. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4112. do { \
  4113. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4114. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4115. } while (0)
  4116. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4117. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4118. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4119. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4120. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4121. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4122. do { \
  4123. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4124. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4125. } while (0)
  4126. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4127. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4128. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4129. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4130. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4131. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4132. do { \
  4133. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4134. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4135. } while (0)
  4136. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4137. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4138. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4139. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4140. HTT_SRING_SETUP_RING_SIZE_S)
  4141. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4142. do { \
  4143. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4144. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4145. } while (0)
  4146. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4147. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4148. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4149. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4150. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4151. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4152. do { \
  4153. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4154. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4155. } while (0)
  4156. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4157. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4158. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4159. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4160. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4161. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4162. do { \
  4163. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4164. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4165. } while (0)
  4166. /* This control bit is applicable to only Producer, which updates Ring ID field
  4167. * of each descriptor before pushing into the ring.
  4168. * 0: updates ring_id(default)
  4169. * 1: ring_id updating disabled */
  4170. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4171. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4172. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4173. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4174. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4175. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4176. do { \
  4177. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4178. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4179. } while (0)
  4180. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4181. * of each descriptor before pushing into the ring.
  4182. * 0: updates Loopcnt(default)
  4183. * 1: Loopcnt updating disabled */
  4184. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4185. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4186. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4187. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4188. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4189. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4190. do { \
  4191. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4192. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4193. } while (0)
  4194. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4195. * into security_id port of GXI/AXI. */
  4196. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4197. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4198. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4199. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4200. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4201. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4202. do { \
  4203. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4204. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4205. } while (0)
  4206. /* During MSI write operation, SRNG drives value of this register bit into
  4207. * swap bit of GXI/AXI. */
  4208. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4209. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4210. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4211. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4212. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4213. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4214. do { \
  4215. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4216. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4217. } while (0)
  4218. /* During Pointer write operation, SRNG drives value of this register bit into
  4219. * swap bit of GXI/AXI. */
  4220. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4221. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4222. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4223. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4224. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4225. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4226. do { \
  4227. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4228. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4229. } while (0)
  4230. /* During any data or TLV write operation, SRNG drives value of this register
  4231. * bit into swap bit of GXI/AXI. */
  4232. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4233. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4234. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4235. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4236. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4237. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4238. do { \
  4239. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4240. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4241. } while (0)
  4242. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4243. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4244. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4245. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4246. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4247. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4248. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4249. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4250. do { \
  4251. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4252. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4253. } while (0)
  4254. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4255. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4256. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4257. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4258. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4259. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4260. do { \
  4261. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4262. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4263. } while (0)
  4264. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4265. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4266. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4267. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4268. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4269. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4270. do { \
  4271. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4272. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4273. } while (0)
  4274. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4275. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4276. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4277. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4278. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4279. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4280. do { \
  4281. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4282. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4283. } while (0)
  4284. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4285. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4286. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4287. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4288. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4289. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4290. do { \
  4291. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4292. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4293. } while (0)
  4294. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4295. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4296. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4297. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4298. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4299. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4300. do { \
  4301. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4302. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4303. } while (0)
  4304. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4305. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4306. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4307. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4308. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4309. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4310. do { \
  4311. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4312. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4313. } while (0)
  4314. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4315. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4316. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4317. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4318. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4319. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4320. do { \
  4321. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4322. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4323. } while (0)
  4324. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4325. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4326. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4327. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4328. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4329. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4330. do { \
  4331. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4332. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4333. } while (0)
  4334. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4335. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4336. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4337. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4338. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4339. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4340. do { \
  4341. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4342. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4343. } while (0)
  4344. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4345. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4346. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4347. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4348. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4349. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4350. do { \
  4351. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4352. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4353. } while (0)
  4354. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4355. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4356. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4357. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4358. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4359. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4360. do { \
  4361. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4362. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4363. } while (0)
  4364. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4365. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4366. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4367. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4368. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4369. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4370. do { \
  4371. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4372. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4373. } while (0)
  4374. /**
  4375. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4376. *
  4377. * @details
  4378. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4379. * configure RXDMA rings.
  4380. * The configuration is per ring based and includes both packet subtypes
  4381. * and PPDU/MPDU TLVs.
  4382. *
  4383. * The message would appear as follows:
  4384. *
  4385. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4386. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4387. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4388. * |-------------------------------------------------------------------|
  4389. * | rsvd2 | ring_buffer_size |
  4390. * |-------------------------------------------------------------------|
  4391. * | packet_type_enable_flags_0 |
  4392. * |-------------------------------------------------------------------|
  4393. * | packet_type_enable_flags_1 |
  4394. * |-------------------------------------------------------------------|
  4395. * | packet_type_enable_flags_2 |
  4396. * |-------------------------------------------------------------------|
  4397. * | packet_type_enable_flags_3 |
  4398. * |-------------------------------------------------------------------|
  4399. * | tlv_filter_in_flags |
  4400. * |-------------------------------------------------------------------|
  4401. * | rx_header_offset | rx_packet_offset |
  4402. * |-------------------------------------------------------------------|
  4403. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4404. * |-------------------------------------------------------------------|
  4405. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4406. * |-------------------------------------------------------------------|
  4407. * | rsvd3 | rx_attention_offset |
  4408. * |-------------------------------------------------------------------|
  4409. * | rsvd4 | mo| fp| rx_drop_threshold |
  4410. * | |ndp|ndp| |
  4411. * |-------------------------------------------------------------------|
  4412. * Where:
  4413. * PS = pkt_swap
  4414. * SS = status_swap
  4415. * OV = rx_offsets_valid
  4416. * DT = drop_thresh_valid
  4417. * The message is interpreted as follows:
  4418. * dword0 - b'0:7 - msg_type: This will be set to
  4419. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4420. * b'8:15 - pdev_id:
  4421. * 0 (for rings at SOC/UMAC level),
  4422. * 1/2/3 mac id (for rings at LMAC level)
  4423. * b'16:23 - ring_id : Identify the ring to configure.
  4424. * More details can be got from enum htt_srng_ring_id
  4425. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4426. * BUF_RING_CFG_0 defs within HW .h files,
  4427. * e.g. wmac_top_reg_seq_hwioreg.h
  4428. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4429. * BUF_RING_CFG_0 defs within HW .h files,
  4430. * e.g. wmac_top_reg_seq_hwioreg.h
  4431. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4432. * configuration fields are valid
  4433. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4434. * rx_drop_threshold field is valid
  4435. * b'28:31 - rsvd1: reserved for future use
  4436. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4437. * in byte units.
  4438. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4439. * - b'16:31 - rsvd2: Reserved for future use
  4440. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4441. * Enable MGMT packet from 0b0000 to 0b1001
  4442. * bits from low to high: FP, MD, MO - 3 bits
  4443. * FP: Filter_Pass
  4444. * MD: Monitor_Direct
  4445. * MO: Monitor_Other
  4446. * 10 mgmt subtypes * 3 bits -> 30 bits
  4447. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4448. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4449. * Enable MGMT packet from 0b1010 to 0b1111
  4450. * bits from low to high: FP, MD, MO - 3 bits
  4451. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4452. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4453. * Enable CTRL packet from 0b0000 to 0b1001
  4454. * bits from low to high: FP, MD, MO - 3 bits
  4455. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4456. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4457. * Enable CTRL packet from 0b1010 to 0b1111,
  4458. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4459. * bits from low to high: FP, MD, MO - 3 bits
  4460. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4461. * dword6 - b'0:31 - tlv_filter_in_flags:
  4462. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4463. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4464. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4465. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4466. * A value of 0 will be considered as ignore this config.
  4467. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4468. * e.g. wmac_top_reg_seq_hwioreg.h
  4469. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4470. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4471. * A value of 0 will be considered as ignore this config.
  4472. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4473. * e.g. wmac_top_reg_seq_hwioreg.h
  4474. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4475. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4476. * A value of 0 will be considered as ignore this config.
  4477. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4478. * e.g. wmac_top_reg_seq_hwioreg.h
  4479. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4480. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4481. * A value of 0 will be considered as ignore this config.
  4482. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4483. * e.g. wmac_top_reg_seq_hwioreg.h
  4484. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4485. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4486. * A value of 0 will be considered as ignore this config.
  4487. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4488. * e.g. wmac_top_reg_seq_hwioreg.h
  4489. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4490. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4491. * A value of 0 will be considered as ignore this config.
  4492. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4493. * e.g. wmac_top_reg_seq_hwioreg.h
  4494. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4495. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4496. * A value of 0 will be considered as ignore this config.
  4497. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4498. * e.g. wmac_top_reg_seq_hwioreg.h
  4499. * - b'16:31 - rsvd3 for future use
  4500. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4501. * to source rings. Consumer drops packets if the available
  4502. * words in the ring falls below the configured threshold
  4503. * value.
  4504. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4505. * by host. 1 -> subscribed
  4506. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4507. * by host. 1 -> subscribed
  4508. */
  4509. PREPACK struct htt_rx_ring_selection_cfg_t {
  4510. A_UINT32 msg_type: 8,
  4511. pdev_id: 8,
  4512. ring_id: 8,
  4513. status_swap: 1,
  4514. pkt_swap: 1,
  4515. rx_offsets_valid: 1,
  4516. drop_thresh_valid: 1,
  4517. rsvd1: 4;
  4518. A_UINT32 ring_buffer_size: 16,
  4519. rsvd2: 16;
  4520. A_UINT32 packet_type_enable_flags_0;
  4521. A_UINT32 packet_type_enable_flags_1;
  4522. A_UINT32 packet_type_enable_flags_2;
  4523. A_UINT32 packet_type_enable_flags_3;
  4524. A_UINT32 tlv_filter_in_flags;
  4525. A_UINT32 rx_packet_offset: 16,
  4526. rx_header_offset: 16;
  4527. A_UINT32 rx_mpdu_end_offset: 16,
  4528. rx_mpdu_start_offset: 16;
  4529. A_UINT32 rx_msdu_end_offset: 16,
  4530. rx_msdu_start_offset: 16;
  4531. A_UINT32 rx_attn_offset: 16,
  4532. rsvd3: 16;
  4533. A_UINT32 rx_drop_threshold: 10,
  4534. fp_ndp: 1,
  4535. mo_ndp: 1,
  4536. rsvd4: 20;
  4537. } POSTPACK;
  4538. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4539. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4540. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4541. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4542. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4543. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4544. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4545. do { \
  4546. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4547. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4548. } while (0)
  4549. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4550. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4551. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4552. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4553. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4554. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4555. do { \
  4556. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4557. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4558. } while (0)
  4559. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4560. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4561. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4562. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4563. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4564. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4565. do { \
  4566. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4567. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4568. } while (0)
  4569. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4570. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4571. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4572. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4573. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4574. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4575. do { \
  4576. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4577. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4578. } while (0)
  4579. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4580. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4581. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4582. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4583. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4584. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4585. do { \
  4586. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4587. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4588. } while (0)
  4589. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4590. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4591. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4592. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4593. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4594. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4595. do { \
  4596. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4597. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4598. } while (0)
  4599. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4600. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4601. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4602. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4603. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4604. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4605. do { \
  4606. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4607. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4608. } while (0)
  4609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4612. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4613. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4615. do { \
  4616. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4617. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4618. } while (0)
  4619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4622. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4623. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4625. do { \
  4626. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4627. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4628. } while (0)
  4629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4632. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4633. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4635. do { \
  4636. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4637. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4638. } while (0)
  4639. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4642. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4643. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4645. do { \
  4646. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4647. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4648. } while (0)
  4649. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4650. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4651. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4652. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4653. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4654. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4655. do { \
  4656. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4657. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4658. } while (0)
  4659. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4660. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4661. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4662. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4663. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4664. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4665. do { \
  4666. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4667. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4668. } while (0)
  4669. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4670. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4671. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4672. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4673. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4674. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4675. do { \
  4676. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4677. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4678. } while (0)
  4679. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4680. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4681. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4682. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4683. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4684. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4685. do { \
  4686. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4687. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4688. } while (0)
  4689. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4690. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4691. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4692. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4693. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4694. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4695. do { \
  4696. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4697. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4698. } while (0)
  4699. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4700. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4701. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4702. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4703. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4704. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4705. do { \
  4706. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4707. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4708. } while (0)
  4709. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4710. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4711. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4712. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4713. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4714. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4715. do { \
  4716. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4717. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4718. } while (0)
  4719. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4720. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4721. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4722. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4723. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4724. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4725. do { \
  4726. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4727. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4728. } while (0)
  4729. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4730. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4731. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4732. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4733. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4734. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4735. do { \
  4736. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4737. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4738. } while (0)
  4739. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4740. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4741. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4742. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4743. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4744. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4745. do { \
  4746. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4747. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4748. } while (0)
  4749. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4750. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4751. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4752. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4753. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4754. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4755. do { \
  4756. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4757. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4758. } while (0)
  4759. /*
  4760. * Subtype based MGMT frames enable bits.
  4761. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4762. */
  4763. /* association request */
  4764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4770. /* association response */
  4771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4777. /* Reassociation request */
  4778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4784. /* Reassociation response */
  4785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4791. /* Probe request */
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4798. /* Probe response */
  4799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4805. /* Timing Advertisement */
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4812. /* Reserved */
  4813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4819. /* Beacon */
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4826. /* ATIM */
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4833. /* Disassociation */
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4840. /* Authentication */
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4847. /* Deauthentication */
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4854. /* Action */
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4861. /* Action No Ack */
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4868. /* Reserved */
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4875. /*
  4876. * Subtype based CTRL frames enable bits.
  4877. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4878. */
  4879. /* Reserved */
  4880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4886. /* Reserved */
  4887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4893. /* Reserved */
  4894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4900. /* Reserved */
  4901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4907. /* Reserved */
  4908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4914. /* Reserved */
  4915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4921. /* Reserved */
  4922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4928. /* Control Wrapper */
  4929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4935. /* Block Ack Request */
  4936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4942. /* Block Ack*/
  4943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4949. /* PS-POLL */
  4950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4956. /* RTS */
  4957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4963. /* CTS */
  4964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4970. /* ACK */
  4971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4977. /* CF-END */
  4978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4984. /* CF-END + CF-ACK */
  4985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4991. /* Multicast data */
  4992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4998. /* Unicast data */
  4999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5005. /* NULL data */
  5006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5013. do { \
  5014. HTT_CHECK_SET_VAL(httsym, value); \
  5015. (word) |= (value) << httsym##_S; \
  5016. } while (0)
  5017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5018. (((word) & httsym##_M) >> httsym##_S)
  5019. #define htt_rx_ring_pkt_enable_subtype_set( \
  5020. word, flag, mode, type, subtype, val) \
  5021. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5022. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5023. #define htt_rx_ring_pkt_enable_subtype_get( \
  5024. word, flag, mode, type, subtype) \
  5025. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5026. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5027. /* Definition to filter in TLVs */
  5028. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5029. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5030. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5031. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5032. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5033. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5034. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5035. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5036. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5037. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5038. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5039. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5040. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5041. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5042. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5043. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5044. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5045. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5046. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5047. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5048. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5049. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5050. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5051. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5052. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5053. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5054. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5055. do { \
  5056. HTT_CHECK_SET_VAL(httsym, enable); \
  5057. (word) |= (enable) << httsym##_S; \
  5058. } while (0)
  5059. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5060. (((word) & httsym##_M) >> httsym##_S)
  5061. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5062. HTT_RX_RING_TLV_ENABLE_SET( \
  5063. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5064. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5065. HTT_RX_RING_TLV_ENABLE_GET( \
  5066. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5067. /**
  5068. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  5069. * host --> target Receive Flow Steering configuration message definition.
  5070. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5071. * The reason for this is we want RFS to be configured and ready before MAC
  5072. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5073. *
  5074. * |31 24|23 16|15 9|8|7 0|
  5075. * |----------------+----------------+----------------+----------------|
  5076. * | reserved |E| msg type |
  5077. * |-------------------------------------------------------------------|
  5078. * Where E = RFS enable flag
  5079. *
  5080. * The RFS_CONFIG message consists of a single 4-byte word.
  5081. *
  5082. * Header fields:
  5083. * - MSG_TYPE
  5084. * Bits 7:0
  5085. * Purpose: identifies this as a RFS config msg
  5086. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5087. * - RFS_CONFIG
  5088. * Bit 8
  5089. * Purpose: Tells target whether to enable (1) or disable (0)
  5090. * flow steering feature when sending rx indication messages to host
  5091. */
  5092. #define HTT_H2T_RFS_CONFIG_M 0x100
  5093. #define HTT_H2T_RFS_CONFIG_S 8
  5094. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5095. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5096. HTT_H2T_RFS_CONFIG_S)
  5097. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5098. do { \
  5099. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5100. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5101. } while (0)
  5102. #define HTT_RFS_CFG_REQ_BYTES 4
  5103. /**
  5104. * @brief host -> target FW extended statistics retrieve
  5105. *
  5106. * @details
  5107. * The following field definitions describe the format of the HTT host
  5108. * to target FW extended stats retrieve message.
  5109. * The message specifies the type of stats the host wants to retrieve.
  5110. *
  5111. * |31 24|23 16|15 8|7 0|
  5112. * |-----------------------------------------------------------|
  5113. * | reserved | stats type | pdev_mask | msg type |
  5114. * |-----------------------------------------------------------|
  5115. * | config param [0] |
  5116. * |-----------------------------------------------------------|
  5117. * | config param [1] |
  5118. * |-----------------------------------------------------------|
  5119. * | config param [2] |
  5120. * |-----------------------------------------------------------|
  5121. * | config param [3] |
  5122. * |-----------------------------------------------------------|
  5123. * | reserved |
  5124. * |-----------------------------------------------------------|
  5125. * | cookie LSBs |
  5126. * |-----------------------------------------------------------|
  5127. * | cookie MSBs |
  5128. * |-----------------------------------------------------------|
  5129. * Header fields:
  5130. * - MSG_TYPE
  5131. * Bits 7:0
  5132. * Purpose: identifies this is a extended stats upload request message
  5133. * Value: 0x10
  5134. * - PDEV_MASK
  5135. * Bits 8:15
  5136. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5137. * Value: This is a overloaded field, refer to usage and interpretation of
  5138. * PDEV in interface document.
  5139. * Bit 8 : Reserved for SOC stats
  5140. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5141. * Indicates MACID_MASK in DBS
  5142. * - STATS_TYPE
  5143. * Bits 23:16
  5144. * Purpose: identifies which FW statistics to upload
  5145. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5146. * - Reserved
  5147. * Bits 31:24
  5148. * - CONFIG_PARAM [0]
  5149. * Bits 31:0
  5150. * Purpose: give an opaque configuration value to the specified stats type
  5151. * Value: stats-type specific configuration value
  5152. * Refer to htt_stats.h for interpretation for each stats sub_type
  5153. * - CONFIG_PARAM [1]
  5154. * Bits 31:0
  5155. * Purpose: give an opaque configuration value to the specified stats type
  5156. * Value: stats-type specific configuration value
  5157. * Refer to htt_stats.h for interpretation for each stats sub_type
  5158. * - CONFIG_PARAM [2]
  5159. * Bits 31:0
  5160. * Purpose: give an opaque configuration value to the specified stats type
  5161. * Value: stats-type specific configuration value
  5162. * Refer to htt_stats.h for interpretation for each stats sub_type
  5163. * - CONFIG_PARAM [3]
  5164. * Bits 31:0
  5165. * Purpose: give an opaque configuration value to the specified stats type
  5166. * Value: stats-type specific configuration value
  5167. * Refer to htt_stats.h for interpretation for each stats sub_type
  5168. * - Reserved [31:0] for future use.
  5169. * - COOKIE_LSBS
  5170. * Bits 31:0
  5171. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5172. * message with its preceding host->target stats request message.
  5173. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5174. * - COOKIE_MSBS
  5175. * Bits 31:0
  5176. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5177. * message with its preceding host->target stats request message.
  5178. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5179. */
  5180. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5181. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5182. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5183. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5184. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5185. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5186. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5187. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5188. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5189. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5190. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5191. do { \
  5192. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5193. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5194. } while (0)
  5195. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5196. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5197. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5198. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5199. do { \
  5200. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5201. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5202. } while (0)
  5203. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5204. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5205. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5206. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5207. do { \
  5208. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5209. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5210. } while (0)
  5211. /**
  5212. * @brief host -> target FW PPDU_STATS request message
  5213. *
  5214. * @details
  5215. * The following field definitions describe the format of the HTT host
  5216. * to target FW for PPDU_STATS_CFG msg.
  5217. * The message allows the host to configure the PPDU_STATS_IND messages
  5218. * produced by the target.
  5219. *
  5220. * |31 24|23 16|15 8|7 0|
  5221. * |-----------------------------------------------------------|
  5222. * | REQ bit mask | pdev_mask | msg type |
  5223. * |-----------------------------------------------------------|
  5224. * Header fields:
  5225. * - MSG_TYPE
  5226. * Bits 7:0
  5227. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5228. * Value: 0x11
  5229. * - PDEV_MASK
  5230. * Bits 8:15
  5231. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5232. * Value: This is a overloaded field, refer to usage and interpretation of
  5233. * PDEV in interface document.
  5234. * Bit 8 : Reserved for SOC stats
  5235. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5236. * Indicates MACID_MASK in DBS
  5237. * - REQ_TLV_BIT_MASK
  5238. * Bits 16:31
  5239. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5240. * needs to be included in the target's PPDU_STATS_IND messages.
  5241. * Value: refer htt_ppdu_stats_tlv_tag_t
  5242. *
  5243. */
  5244. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5245. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5246. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5247. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5248. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5249. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5250. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5251. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5252. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5253. do { \
  5254. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5255. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5256. } while (0)
  5257. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5258. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5259. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5260. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5261. do { \
  5262. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5263. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5264. } while (0)
  5265. /**
  5266. * @brief Host-->target HTT RX FSE setup message
  5267. * @details
  5268. * Through this message, the host will provide details of the flow tables
  5269. * in host DDR along with hash keys.
  5270. * This message can be sent per SOC or per PDEV, which is differentiated
  5271. * by pdev id values.
  5272. * The host will allocate flow search table and sends table size,
  5273. * physical DMA address of flow table, and hash keys to firmware to
  5274. * program into the RXOLE FSE HW block.
  5275. *
  5276. * The following field definitions describe the format of the RX FSE setup
  5277. * message sent from the host to target
  5278. *
  5279. * Header fields:
  5280. * dword0 - b'7:0 - msg_type: This will be set to
  5281. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  5282. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5283. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5284. * pdev's LMAC ring.
  5285. * b'31:16 - reserved : Reserved for future use
  5286. * dword1 - b'19:0 - number of records: This field indicates the number of
  5287. * entries in the flow table. For example: 8k number of
  5288. * records is equivalent to
  5289. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  5290. * b'27:20 - max search: This field specifies the skid length to FSE
  5291. * parser HW module whenever match is not found at the
  5292. * exact index pointed by hash.
  5293. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  5294. * Refer htt_ip_da_sa_prefix below for more details.
  5295. * b'31:30 - reserved: Reserved for future use
  5296. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  5297. * table allocated by host in DDR
  5298. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  5299. * table allocated by host in DDR
  5300. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  5301. * entry hashing
  5302. *
  5303. *
  5304. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  5305. * |---------------------------------------------------------------|
  5306. * | reserved | pdev_id | MSG_TYPE |
  5307. * |---------------------------------------------------------------|
  5308. * |resvd|IPDSA| max_search | Number of records |
  5309. * |---------------------------------------------------------------|
  5310. * | base address lo |
  5311. * |---------------------------------------------------------------|
  5312. * | base address high |
  5313. * |---------------------------------------------------------------|
  5314. * | toeplitz key 31_0 |
  5315. * |---------------------------------------------------------------|
  5316. * | toeplitz key 63_32 |
  5317. * |---------------------------------------------------------------|
  5318. * | toeplitz key 95_64 |
  5319. * |---------------------------------------------------------------|
  5320. * | toeplitz key 127_96 |
  5321. * |---------------------------------------------------------------|
  5322. * | toeplitz key 159_128 |
  5323. * |---------------------------------------------------------------|
  5324. * | toeplitz key 191_160 |
  5325. * |---------------------------------------------------------------|
  5326. * | toeplitz key 223_192 |
  5327. * |---------------------------------------------------------------|
  5328. * | toeplitz key 255_224 |
  5329. * |---------------------------------------------------------------|
  5330. * | toeplitz key 287_256 |
  5331. * |---------------------------------------------------------------|
  5332. * | reserved | toeplitz key 314_288(26:0 bits) |
  5333. * |---------------------------------------------------------------|
  5334. * where:
  5335. * IPDSA = ip_da_sa
  5336. */
  5337. /**
  5338. * @brief: htt_ip_da_sa_prefix
  5339. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  5340. * IPv6 addresses beginning with 0x20010db8 are reserved for
  5341. * documentation per RFC3849
  5342. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  5343. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  5344. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  5345. */
  5346. enum htt_ip_da_sa_prefix {
  5347. HTT_RX_IPV6_20010db8,
  5348. HTT_RX_IPV4_MAPPED_IPV6,
  5349. HTT_RX_IPV4_COMPATIBLE_IPV6,
  5350. HTT_RX_IPV6_64FF9B,
  5351. };
  5352. /**
  5353. * @brief Host-->target HTT RX FISA configure and enable
  5354. * @details
  5355. * The host will send this command down to configure and enable the FISA
  5356. * operational params.
  5357. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  5358. * register.
  5359. * Should configure both the MACs.
  5360. *
  5361. * dword0 - b'7:0 - msg_type: This will be set to HTT_H2T_MSG_TYPE_RX_FISA_CFG
  5362. *
  5363. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5364. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5365. * pdev's LMAC ring.
  5366. * b'31:16 - reserved : Reserved for future use
  5367. *
  5368. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  5369. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  5370. * packets. 1 flow search will be skipped
  5371. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  5372. * tcp,udp packets
  5373. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  5374. * calculation
  5375. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  5376. * calculation
  5377. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  5378. * calculation
  5379. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  5380. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  5381. * length
  5382. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  5383. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  5384. * length
  5385. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  5386. * num jump
  5387. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  5388. * num jump
  5389. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  5390. * data type switch has happend for MPDU Sequence num jump
  5391. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  5392. * for MPDU Sequence num jump
  5393. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  5394. * for decrypt errors
  5395. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  5396. * while aggregating a msdu
  5397. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  5398. * The aggregation is done until (number of MSDUs aggregated
  5399. * < LIMIT + 1)
  5400. * b'31:18 - Reserved
  5401. *
  5402. * fisa_control_value - 32bit value FW can write to register
  5403. *
  5404. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  5405. * Threshold value for FISA timeout (units are microseconds).
  5406. * When the global timestamp exceeds this threshold, FISA
  5407. * aggregation will be restarted.
  5408. * A value of 0 means timeout is disabled.
  5409. * Compare the threshold register with timestamp field in
  5410. * flow entry to generate timeout for the flow.
  5411. *
  5412. * |31 18 |17 16|15 8|7 0|
  5413. * |-------------------------------------------------------------|
  5414. * | reserved | pdev_mask | msg type |
  5415. * |-------------------------------------------------------------|
  5416. * | reserved | FISA_CTRL |
  5417. * |-------------------------------------------------------------|
  5418. * | FISA_TIMEOUT_THRESH |
  5419. * |-------------------------------------------------------------|
  5420. */
  5421. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  5422. A_UINT32 msg_type:8,
  5423. pdev_id:8,
  5424. reserved0:16;
  5425. /**
  5426. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  5427. * [17:0]
  5428. */
  5429. union {
  5430. struct {
  5431. A_UINT32 fisa_enable: 1,
  5432. ipsec_skip_search: 1,
  5433. nontcp_skip_search: 1,
  5434. add_ipv4_fixed_hdr_len: 1,
  5435. add_ipv6_fixed_hdr_len: 1,
  5436. add_tcp_fixed_hdr_len: 1,
  5437. add_udp_hdr_len: 1,
  5438. chksum_cum_ip_len_en: 1,
  5439. disable_tid_check: 1,
  5440. disable_ta_check: 1,
  5441. disable_qos_check: 1,
  5442. disable_raw_check: 1,
  5443. disable_decrypt_err_check: 1,
  5444. disable_msdu_drop_check: 1,
  5445. fisa_aggr_limit: 4,
  5446. reserved: 14;
  5447. } fisa_control_bits;
  5448. A_UINT32 fisa_control_value;
  5449. } u_fisa_control;
  5450. /**
  5451. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  5452. * timeout threshold for aggregation. Unit in usec.
  5453. * [31:0]
  5454. */
  5455. A_UINT32 fisa_timeout_threshold;
  5456. } POSTPACK;
  5457. /* DWord 0: pdev-ID */
  5458. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  5459. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  5460. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  5461. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  5462. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  5463. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  5464. do { \
  5465. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  5466. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  5467. } while (0)
  5468. /* Dword 1: fisa_control_value fisa config */
  5469. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  5470. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  5471. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  5472. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  5473. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  5474. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  5475. do { \
  5476. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  5477. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  5478. } while (0)
  5479. /* Dword 1: fisa_control_value ipsec_skip_search */
  5480. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  5481. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  5482. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  5483. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  5484. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  5485. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  5486. do { \
  5487. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  5488. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  5489. } while (0)
  5490. /* Dword 1: fisa_control_value non_tcp_skip_search */
  5491. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  5492. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  5493. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  5494. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  5495. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  5496. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  5497. do { \
  5498. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  5499. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  5500. } while (0)
  5501. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  5502. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  5503. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  5504. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  5505. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  5506. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  5507. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  5508. do { \
  5509. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  5510. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  5511. } while (0)
  5512. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  5513. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  5514. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  5515. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  5516. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  5517. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  5518. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  5519. do { \
  5520. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  5521. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  5522. } while (0)
  5523. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  5524. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  5525. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  5526. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  5527. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  5528. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  5529. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  5530. do { \
  5531. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  5532. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  5533. } while (0)
  5534. /* Dword 1: fisa_control_value add_udp_hdr_len */
  5535. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  5536. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  5537. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  5538. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  5539. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  5540. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  5541. do { \
  5542. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  5543. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  5544. } while (0)
  5545. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  5546. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  5547. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  5548. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  5549. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  5550. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  5551. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  5552. do { \
  5553. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  5554. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  5555. } while (0)
  5556. /* Dword 1: fisa_control_value disable_tid_check */
  5557. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  5558. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  5559. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  5560. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  5561. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  5562. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  5563. do { \
  5564. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  5565. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  5566. } while (0)
  5567. /* Dword 1: fisa_control_value disable_ta_check */
  5568. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  5569. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  5570. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  5571. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  5572. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  5573. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  5574. do { \
  5575. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  5576. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  5577. } while (0)
  5578. /* Dword 1: fisa_control_value disable_qos_check */
  5579. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  5580. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  5581. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  5582. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  5583. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  5584. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  5585. do { \
  5586. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  5587. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  5588. } while (0)
  5589. /* Dword 1: fisa_control_value disable_raw_check */
  5590. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  5591. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  5592. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  5593. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  5594. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  5595. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  5596. do { \
  5597. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  5598. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  5599. } while (0)
  5600. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  5601. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  5602. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  5603. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  5604. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  5605. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  5606. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  5607. do { \
  5608. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  5609. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  5610. } while (0)
  5611. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  5612. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  5613. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  5614. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  5615. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  5616. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  5617. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  5618. do { \
  5619. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  5620. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  5621. } while (0)
  5622. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5623. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  5624. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  5625. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  5626. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  5627. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  5628. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  5629. do { \
  5630. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  5631. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  5632. } while (0)
  5633. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  5634. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  5635. pdev_id:8,
  5636. reserved0:16;
  5637. A_UINT32 num_records:20,
  5638. max_search:8,
  5639. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  5640. reserved1:2;
  5641. A_UINT32 base_addr_lo;
  5642. A_UINT32 base_addr_hi;
  5643. A_UINT32 toeplitz31_0;
  5644. A_UINT32 toeplitz63_32;
  5645. A_UINT32 toeplitz95_64;
  5646. A_UINT32 toeplitz127_96;
  5647. A_UINT32 toeplitz159_128;
  5648. A_UINT32 toeplitz191_160;
  5649. A_UINT32 toeplitz223_192;
  5650. A_UINT32 toeplitz255_224;
  5651. A_UINT32 toeplitz287_256;
  5652. A_UINT32 toeplitz314_288:27,
  5653. reserved2:5;
  5654. } POSTPACK;
  5655. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  5656. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  5657. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  5658. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  5659. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  5660. /* DWORD 0: Pdev ID */
  5661. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  5662. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  5663. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  5664. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  5665. HTT_RX_FSE_SETUP_PDEV_ID_S)
  5666. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  5667. do { \
  5668. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  5669. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  5670. } while (0)
  5671. /* DWORD 1:num of records */
  5672. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  5673. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  5674. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  5675. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  5676. HTT_RX_FSE_SETUP_NUM_REC_S)
  5677. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  5678. do { \
  5679. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  5680. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  5681. } while (0)
  5682. /* DWORD 1:max_search */
  5683. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  5684. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  5685. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  5686. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  5687. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  5688. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  5689. do { \
  5690. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  5691. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  5692. } while (0)
  5693. /* DWORD 1:ip_da_sa prefix */
  5694. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  5695. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  5696. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  5697. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  5698. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  5699. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  5700. do { \
  5701. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  5702. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  5703. } while (0)
  5704. /* DWORD 2: Base Address LO */
  5705. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  5706. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  5707. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  5708. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  5709. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  5710. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  5711. do { \
  5712. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  5713. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  5714. } while (0)
  5715. /* DWORD 3: Base Address High */
  5716. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  5717. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  5718. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  5719. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  5720. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  5721. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  5722. do { \
  5723. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  5724. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  5725. } while (0)
  5726. /* DWORD 4-12: Hash Value */
  5727. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  5728. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  5729. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  5730. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  5731. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  5732. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  5733. do { \
  5734. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  5735. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  5736. } while (0)
  5737. /* DWORD 13: Hash Value 314:288 bits */
  5738. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  5739. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  5740. HTT_RX_FSE_SETUP_HASH_314_288_S)
  5741. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  5742. do { \
  5743. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  5744. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  5745. } while (0)
  5746. /**
  5747. * @brief Host-->target HTT RX FSE operation message
  5748. * @details
  5749. * The host will send this Flow Search Engine (FSE) operation message for
  5750. * every flow add/delete operation.
  5751. * The FSE operation includes FSE full cache invalidation or individual entry
  5752. * invalidation.
  5753. * This message can be sent per SOC or per PDEV which is differentiated
  5754. * by pdev id values.
  5755. *
  5756. * |31 16|15 8|7 1|0|
  5757. * |-------------------------------------------------------------|
  5758. * | reserved | pdev_id | MSG_TYPE |
  5759. * |-------------------------------------------------------------|
  5760. * | reserved | operation |I|
  5761. * |-------------------------------------------------------------|
  5762. * | ip_src_addr_31_0 |
  5763. * |-------------------------------------------------------------|
  5764. * | ip_src_addr_63_32 |
  5765. * |-------------------------------------------------------------|
  5766. * | ip_src_addr_95_64 |
  5767. * |-------------------------------------------------------------|
  5768. * | ip_src_addr_127_96 |
  5769. * |-------------------------------------------------------------|
  5770. * | ip_dst_addr_31_0 |
  5771. * |-------------------------------------------------------------|
  5772. * | ip_dst_addr_63_32 |
  5773. * |-------------------------------------------------------------|
  5774. * | ip_dst_addr_95_64 |
  5775. * |-------------------------------------------------------------|
  5776. * | ip_dst_addr_127_96 |
  5777. * |-------------------------------------------------------------|
  5778. * | l4_dst_port | l4_src_port |
  5779. * | (32-bit SPI incase of IPsec) |
  5780. * |-------------------------------------------------------------|
  5781. * | reserved | l4_proto |
  5782. * |-------------------------------------------------------------|
  5783. *
  5784. * where I is 1-bit ipsec_valid.
  5785. *
  5786. * The following field definitions describe the format of the RX FSE operation
  5787. * message sent from the host to target for every add/delete flow entry to flow
  5788. * table.
  5789. *
  5790. * Header fields:
  5791. * dword0 - b'7:0 - msg_type: This will be set to
  5792. * HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  5793. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5794. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5795. * specified pdev's LMAC ring.
  5796. * b'31:16 - reserved : Reserved for future use
  5797. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  5798. * (Internet Protocol Security).
  5799. * IPsec describes the framework for providing security at
  5800. * IP layer. IPsec is defined for both versions of IP:
  5801. * IPV4 and IPV6.
  5802. * Please refer to htt_rx_flow_proto enumeration below for
  5803. * more info.
  5804. * ipsec_valid = 1 for IPSEC packets
  5805. * ipsec_valid = 0 for IP Packets
  5806. * b'7:1 - operation: This indicates types of FSE operation.
  5807. * Refer to htt_rx_fse_operation enumeration:
  5808. * 0 - No Cache Invalidation required
  5809. * 1 - Cache invalidate only one entry given by IP
  5810. * src/dest address at DWORD[2:9]
  5811. * 2 - Complete FSE Cache Invalidation
  5812. * 3 - FSE Disable
  5813. * 4 - FSE Enable
  5814. * b'31:8 - reserved: Reserved for future use
  5815. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  5816. * for per flow addition/deletion
  5817. * For IPV4 src/dest addresses, the first A_UINT32 is used
  5818. * and the subsequent 3 A_UINT32 will be padding bytes.
  5819. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  5820. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  5821. * from 0 to 65535 but only 0 to 1023 are designated as
  5822. * well-known ports. Refer to [RFC1700] for more details.
  5823. * This field is valid only if
  5824. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5825. * - L4 dest port (31:16): 16-bit Destination Port numbers
  5826. * range from 0 to 65535 but only 0 to 1023 are designated
  5827. * as well-known ports. Refer to [RFC1700] for more details.
  5828. * This field is valid only if
  5829. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5830. * - SPI (31:0): Security Parameters Index is an
  5831. * identification tag added to the header while using IPsec
  5832. * for tunneling the IP traffici.
  5833. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  5834. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  5835. * Assigned Internet Protocol Numbers.
  5836. * l4_proto numbers for standard protocol like UDP/TCP
  5837. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  5838. * l4_proto = 17 for UDP etc.
  5839. * b'31:8 - reserved: Reserved for future use.
  5840. *
  5841. */
  5842. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  5843. A_UINT32 msg_type:8,
  5844. pdev_id:8,
  5845. reserved0:16;
  5846. A_UINT32 ipsec_valid:1,
  5847. operation:7,
  5848. reserved1:24;
  5849. A_UINT32 ip_src_addr_31_0;
  5850. A_UINT32 ip_src_addr_63_32;
  5851. A_UINT32 ip_src_addr_95_64;
  5852. A_UINT32 ip_src_addr_127_96;
  5853. A_UINT32 ip_dest_addr_31_0;
  5854. A_UINT32 ip_dest_addr_63_32;
  5855. A_UINT32 ip_dest_addr_95_64;
  5856. A_UINT32 ip_dest_addr_127_96;
  5857. union {
  5858. A_UINT32 spi;
  5859. struct {
  5860. A_UINT32 l4_src_port:16,
  5861. l4_dest_port:16;
  5862. } ip;
  5863. } u;
  5864. A_UINT32 l4_proto:8,
  5865. reserved:24;
  5866. } POSTPACK;
  5867. /**
  5868. * Enumeration for IP Protocol or IPSEC Protocol
  5869. * IPsec describes the framework for providing security at IP layer.
  5870. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  5871. */
  5872. enum htt_rx_flow_proto {
  5873. HTT_RX_FLOW_IP_PROTO,
  5874. HTT_RX_FLOW_IPSEC_PROTO,
  5875. };
  5876. /**
  5877. * Enumeration for FSE Cache Invalidation
  5878. * 0 - No Cache Invalidation required
  5879. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  5880. * 2 - Complete FSE Cache Invalidation
  5881. * 3 - FSE Disable
  5882. * 4 - FSE Enable
  5883. */
  5884. enum htt_rx_fse_operation {
  5885. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  5886. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  5887. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  5888. HTT_RX_FSE_DISABLE,
  5889. HTT_RX_FSE_ENABLE,
  5890. };
  5891. /* DWORD 0: Pdev ID */
  5892. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  5893. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  5894. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  5895. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  5896. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  5897. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  5898. do { \
  5899. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  5900. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  5901. } while (0)
  5902. /* DWORD 1:IP PROTO or IPSEC */
  5903. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  5904. #define HTT_RX_FSE_IPSEC_VALID_S 0
  5905. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  5906. do { \
  5907. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  5908. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  5909. } while (0)
  5910. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  5911. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  5912. /* DWORD 1:FSE Operation */
  5913. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  5914. #define HTT_RX_FSE_OPERATION_S 1
  5915. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  5916. do { \
  5917. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  5918. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  5919. } while (0)
  5920. #define HTT_RX_FSE_OPERATION_GET(word) \
  5921. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  5922. /* DWORD 2-9:IP Address */
  5923. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  5924. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  5925. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  5926. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  5927. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  5928. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  5929. do { \
  5930. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  5931. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  5932. } while (0)
  5933. /* DWORD 10:Source Port Number */
  5934. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  5935. #define HTT_RX_FSE_SOURCEPORT_S 0
  5936. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  5937. do { \
  5938. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  5939. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  5940. } while (0)
  5941. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  5942. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  5943. /* DWORD 11:Destination Port Number */
  5944. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  5945. #define HTT_RX_FSE_DESTPORT_S 16
  5946. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  5947. do { \
  5948. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  5949. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  5950. } while (0)
  5951. #define HTT_RX_FSE_DESTPORT_GET(word) \
  5952. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  5953. /* DWORD 10-11:SPI (In case of IPSEC) */
  5954. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  5955. #define HTT_RX_FSE_OPERATION_SPI_S 0
  5956. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  5957. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  5958. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  5959. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  5960. do { \
  5961. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  5962. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  5963. } while (0)
  5964. /* DWORD 12:L4 PROTO */
  5965. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  5966. #define HTT_RX_FSE_L4_PROTO_S 0
  5967. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  5968. do { \
  5969. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  5970. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  5971. } while (0)
  5972. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  5973. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  5974. /*=== target -> host messages ===============================================*/
  5975. enum htt_t2h_msg_type {
  5976. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  5977. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  5978. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  5979. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  5980. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  5981. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  5982. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  5983. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  5984. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  5985. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  5986. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  5987. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  5988. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  5989. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  5990. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  5991. /* only used for HL, add HTT MSG for HTT CREDIT update */
  5992. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  5993. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  5994. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  5995. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  5996. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  5997. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  5998. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  5999. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  6000. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  6001. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  6002. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  6003. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  6004. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  6005. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  6006. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  6007. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  6008. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  6009. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  6010. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  6011. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  6012. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  6013. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  6014. /* TX_OFFLOAD_DELIVER_IND:
  6015. * Forward the target's locally-generated packets to the host,
  6016. * to provide to the monitor mode interface.
  6017. */
  6018. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  6019. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  6020. HTT_T2H_MSG_TYPE_TEST,
  6021. /* keep this last */
  6022. HTT_T2H_NUM_MSGS
  6023. };
  6024. /*
  6025. * HTT target to host message type -
  6026. * stored in bits 7:0 of the first word of the message
  6027. */
  6028. #define HTT_T2H_MSG_TYPE_M 0xff
  6029. #define HTT_T2H_MSG_TYPE_S 0
  6030. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  6031. do { \
  6032. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  6033. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  6034. } while (0)
  6035. #define HTT_T2H_MSG_TYPE_GET(word) \
  6036. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  6037. /**
  6038. * @brief target -> host version number confirmation message definition
  6039. *
  6040. * |31 24|23 16|15 8|7 0|
  6041. * |----------------+----------------+----------------+----------------|
  6042. * | reserved | major number | minor number | msg type |
  6043. * |-------------------------------------------------------------------|
  6044. * : option request TLV (optional) |
  6045. * :...................................................................:
  6046. *
  6047. * The VER_CONF message may consist of a single 4-byte word, or may be
  6048. * extended with TLVs that specify HTT options selected by the target.
  6049. * The following option TLVs may be appended to the VER_CONF message:
  6050. * - LL_BUS_ADDR_SIZE
  6051. * - HL_SUPPRESS_TX_COMPL_IND
  6052. * - MAX_TX_QUEUE_GROUPS
  6053. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  6054. * may be appended to the VER_CONF message (but only one TLV of each type).
  6055. *
  6056. * Header fields:
  6057. * - MSG_TYPE
  6058. * Bits 7:0
  6059. * Purpose: identifies this as a version number confirmation message
  6060. * Value: 0x0
  6061. * - VER_MINOR
  6062. * Bits 15:8
  6063. * Purpose: Specify the minor number of the HTT message library version
  6064. * in use by the target firmware.
  6065. * The minor number specifies the specific revision within a range
  6066. * of fundamentally compatible HTT message definition revisions.
  6067. * Compatible revisions involve adding new messages or perhaps
  6068. * adding new fields to existing messages, in a backwards-compatible
  6069. * manner.
  6070. * Incompatible revisions involve changing the message type values,
  6071. * or redefining existing messages.
  6072. * Value: minor number
  6073. * - VER_MAJOR
  6074. * Bits 15:8
  6075. * Purpose: Specify the major number of the HTT message library version
  6076. * in use by the target firmware.
  6077. * The major number specifies the family of minor revisions that are
  6078. * fundamentally compatible with each other, but not with prior or
  6079. * later families.
  6080. * Value: major number
  6081. */
  6082. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  6083. #define HTT_VER_CONF_MINOR_S 8
  6084. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  6085. #define HTT_VER_CONF_MAJOR_S 16
  6086. #define HTT_VER_CONF_MINOR_SET(word, value) \
  6087. do { \
  6088. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  6089. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  6090. } while (0)
  6091. #define HTT_VER_CONF_MINOR_GET(word) \
  6092. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  6093. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  6094. do { \
  6095. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  6096. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  6097. } while (0)
  6098. #define HTT_VER_CONF_MAJOR_GET(word) \
  6099. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  6100. #define HTT_VER_CONF_BYTES 4
  6101. /**
  6102. * @brief - target -> host HTT Rx In order indication message
  6103. *
  6104. * @details
  6105. *
  6106. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  6107. * |----------------+-------------------+---------------------+---------------|
  6108. * | peer ID | P| F| O| ext TID | msg type |
  6109. * |--------------------------------------------------------------------------|
  6110. * | MSDU count | Reserved | vdev id |
  6111. * |--------------------------------------------------------------------------|
  6112. * | MSDU 0 bus address (bits 31:0) |
  6113. #if HTT_PADDR64
  6114. * | MSDU 0 bus address (bits 63:32) |
  6115. #endif
  6116. * |--------------------------------------------------------------------------|
  6117. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  6118. * |--------------------------------------------------------------------------|
  6119. * | MSDU 1 bus address (bits 31:0) |
  6120. #if HTT_PADDR64
  6121. * | MSDU 1 bus address (bits 63:32) |
  6122. #endif
  6123. * |--------------------------------------------------------------------------|
  6124. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  6125. * |--------------------------------------------------------------------------|
  6126. */
  6127. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  6128. *
  6129. * @details
  6130. * bits
  6131. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  6132. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6133. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  6134. * | | frag | | | | fail |chksum fail|
  6135. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6136. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  6137. */
  6138. struct htt_rx_in_ord_paddr_ind_hdr_t
  6139. {
  6140. A_UINT32 /* word 0 */
  6141. msg_type: 8,
  6142. ext_tid: 5,
  6143. offload: 1,
  6144. frag: 1,
  6145. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  6146. peer_id: 16;
  6147. A_UINT32 /* word 1 */
  6148. vap_id: 8,
  6149. /* NOTE:
  6150. * This reserved_1 field is not truly reserved - certain targets use
  6151. * this field internally to store debug information, and do not zero
  6152. * out the contents of the field before uploading the message to the
  6153. * host. Thus, any host-target communication supported by this field
  6154. * is limited to using values that are never used by the debug
  6155. * information stored by certain targets in the reserved_1 field.
  6156. * In particular, the targets in question don't use the value 0x3
  6157. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  6158. * so this previously-unused value within these bits is available to
  6159. * use as the host / target PKT_CAPTURE_MODE flag.
  6160. */
  6161. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  6162. /* if pkt_capture_mode == 0x3, host should
  6163. * send rx frames to monitor mode interface
  6164. */
  6165. msdu_cnt: 16;
  6166. };
  6167. struct htt_rx_in_ord_paddr_ind_msdu32_t
  6168. {
  6169. A_UINT32 dma_addr;
  6170. A_UINT32
  6171. length: 16,
  6172. fw_desc: 8,
  6173. msdu_info:8;
  6174. };
  6175. struct htt_rx_in_ord_paddr_ind_msdu64_t
  6176. {
  6177. A_UINT32 dma_addr_lo;
  6178. A_UINT32 dma_addr_hi;
  6179. A_UINT32
  6180. length: 16,
  6181. fw_desc: 8,
  6182. msdu_info:8;
  6183. };
  6184. #if HTT_PADDR64
  6185. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  6186. #else
  6187. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  6188. #endif
  6189. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  6190. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  6191. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  6192. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  6193. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  6194. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  6195. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  6196. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  6197. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  6198. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  6199. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  6200. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  6201. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  6202. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  6203. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  6204. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  6205. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  6206. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  6207. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  6208. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  6209. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  6210. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  6211. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  6212. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  6213. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  6214. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  6215. /* for systems using 64-bit format for bus addresses */
  6216. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  6217. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  6218. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  6219. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  6220. /* for systems using 32-bit format for bus addresses */
  6221. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  6222. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  6223. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  6224. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  6225. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  6226. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  6227. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  6228. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  6229. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  6230. do { \
  6231. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  6232. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  6233. } while (0)
  6234. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  6235. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  6236. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  6237. do { \
  6238. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  6239. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  6240. } while (0)
  6241. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  6242. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  6243. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  6244. do { \
  6245. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  6246. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  6247. } while (0)
  6248. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  6249. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  6250. /*
  6251. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  6252. * deliver the rx frames to the monitor mode interface.
  6253. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  6254. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  6255. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  6256. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  6257. */
  6258. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  6259. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  6260. do { \
  6261. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  6262. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  6263. } while (0)
  6264. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  6265. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  6266. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  6267. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  6268. do { \
  6269. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  6270. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  6271. } while (0)
  6272. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  6273. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  6274. /* for systems using 64-bit format for bus addresses */
  6275. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  6276. do { \
  6277. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  6278. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  6279. } while (0)
  6280. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  6281. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  6282. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  6283. do { \
  6284. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  6285. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  6286. } while (0)
  6287. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  6288. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  6289. /* for systems using 32-bit format for bus addresses */
  6290. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  6291. do { \
  6292. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  6293. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  6294. } while (0)
  6295. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  6296. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  6297. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  6298. do { \
  6299. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  6300. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  6301. } while (0)
  6302. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  6303. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  6304. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  6305. do { \
  6306. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  6307. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  6308. } while (0)
  6309. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  6310. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  6311. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  6312. do { \
  6313. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  6314. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  6315. } while (0)
  6316. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  6317. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  6318. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  6319. do { \
  6320. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  6321. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  6322. } while (0)
  6323. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  6324. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  6325. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  6326. do { \
  6327. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  6328. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  6329. } while (0)
  6330. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  6331. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  6332. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  6333. do { \
  6334. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  6335. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  6336. } while (0)
  6337. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  6338. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  6339. /* definitions used within target -> host rx indication message */
  6340. PREPACK struct htt_rx_ind_hdr_prefix_t
  6341. {
  6342. A_UINT32 /* word 0 */
  6343. msg_type: 8,
  6344. ext_tid: 5,
  6345. release_valid: 1,
  6346. flush_valid: 1,
  6347. reserved0: 1,
  6348. peer_id: 16;
  6349. A_UINT32 /* word 1 */
  6350. flush_start_seq_num: 6,
  6351. flush_end_seq_num: 6,
  6352. release_start_seq_num: 6,
  6353. release_end_seq_num: 6,
  6354. num_mpdu_ranges: 8;
  6355. } POSTPACK;
  6356. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  6357. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  6358. #define HTT_TGT_RSSI_INVALID 0x80
  6359. PREPACK struct htt_rx_ppdu_desc_t
  6360. {
  6361. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  6362. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  6363. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  6364. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  6365. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  6366. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  6367. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  6368. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  6369. A_UINT32 /* word 0 */
  6370. rssi_cmb: 8,
  6371. timestamp_submicrosec: 8,
  6372. phy_err_code: 8,
  6373. phy_err: 1,
  6374. legacy_rate: 4,
  6375. legacy_rate_sel: 1,
  6376. end_valid: 1,
  6377. start_valid: 1;
  6378. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  6379. union {
  6380. A_UINT32 /* word 1 */
  6381. rssi0_pri20: 8,
  6382. rssi0_ext20: 8,
  6383. rssi0_ext40: 8,
  6384. rssi0_ext80: 8;
  6385. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  6386. } u0;
  6387. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  6388. union {
  6389. A_UINT32 /* word 2 */
  6390. rssi1_pri20: 8,
  6391. rssi1_ext20: 8,
  6392. rssi1_ext40: 8,
  6393. rssi1_ext80: 8;
  6394. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  6395. } u1;
  6396. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  6397. union {
  6398. A_UINT32 /* word 3 */
  6399. rssi2_pri20: 8,
  6400. rssi2_ext20: 8,
  6401. rssi2_ext40: 8,
  6402. rssi2_ext80: 8;
  6403. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  6404. } u2;
  6405. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  6406. union {
  6407. A_UINT32 /* word 4 */
  6408. rssi3_pri20: 8,
  6409. rssi3_ext20: 8,
  6410. rssi3_ext40: 8,
  6411. rssi3_ext80: 8;
  6412. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  6413. } u3;
  6414. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  6415. A_UINT32 tsf32; /* word 5 */
  6416. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  6417. A_UINT32 timestamp_microsec; /* word 6 */
  6418. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  6419. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  6420. A_UINT32 /* word 7 */
  6421. vht_sig_a1: 24,
  6422. preamble_type: 8;
  6423. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  6424. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  6425. A_UINT32 /* word 8 */
  6426. vht_sig_a2: 24,
  6427. /* sa_ant_matrix
  6428. * For cases where a single rx chain has options to be connected to
  6429. * different rx antennas, show which rx antennas were in use during
  6430. * receipt of a given PPDU.
  6431. * This sa_ant_matrix provides a bitmask of the antennas used while
  6432. * receiving this frame.
  6433. */
  6434. sa_ant_matrix: 8;
  6435. } POSTPACK;
  6436. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  6437. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  6438. PREPACK struct htt_rx_ind_hdr_suffix_t
  6439. {
  6440. A_UINT32 /* word 0 */
  6441. fw_rx_desc_bytes: 16,
  6442. reserved0: 16;
  6443. } POSTPACK;
  6444. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  6445. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  6446. PREPACK struct htt_rx_ind_hdr_t
  6447. {
  6448. struct htt_rx_ind_hdr_prefix_t prefix;
  6449. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  6450. struct htt_rx_ind_hdr_suffix_t suffix;
  6451. } POSTPACK;
  6452. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  6453. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  6454. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  6455. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  6456. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  6457. /*
  6458. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  6459. * the offset into the HTT rx indication message at which the
  6460. * FW rx PPDU descriptor resides
  6461. */
  6462. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  6463. /*
  6464. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  6465. * the offset into the HTT rx indication message at which the
  6466. * header suffix (FW rx MSDU byte count) resides
  6467. */
  6468. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  6469. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  6470. /*
  6471. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  6472. * the offset into the HTT rx indication message at which the per-MSDU
  6473. * information starts
  6474. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  6475. * per-MSDU information portion of the message. The per-MSDU info itself
  6476. * starts at byte 12.
  6477. */
  6478. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  6479. /**
  6480. * @brief target -> host rx indication message definition
  6481. *
  6482. * @details
  6483. * The following field definitions describe the format of the rx indication
  6484. * message sent from the target to the host.
  6485. * The message consists of three major sections:
  6486. * 1. a fixed-length header
  6487. * 2. a variable-length list of firmware rx MSDU descriptors
  6488. * 3. one or more 4-octet MPDU range information elements
  6489. * The fixed length header itself has two sub-sections
  6490. * 1. the message meta-information, including identification of the
  6491. * sender and type of the received data, and a 4-octet flush/release IE
  6492. * 2. the firmware rx PPDU descriptor
  6493. *
  6494. * The format of the message is depicted below.
  6495. * in this depiction, the following abbreviations are used for information
  6496. * elements within the message:
  6497. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  6498. * elements associated with the PPDU start are valid.
  6499. * Specifically, the following fields are valid only if SV is set:
  6500. * RSSI (all variants), L, legacy rate, preamble type, service,
  6501. * VHT-SIG-A
  6502. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  6503. * elements associated with the PPDU end are valid.
  6504. * Specifically, the following fields are valid only if EV is set:
  6505. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  6506. * - L - Legacy rate selector - if legacy rates are used, this flag
  6507. * indicates whether the rate is from a CCK (L == 1) or OFDM
  6508. * (L == 0) PHY.
  6509. * - P - PHY error flag - boolean indication of whether the rx frame had
  6510. * a PHY error
  6511. *
  6512. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  6513. * |----------------+-------------------+---------------------+---------------|
  6514. * | peer ID | |RV|FV| ext TID | msg type |
  6515. * |--------------------------------------------------------------------------|
  6516. * | num | release | release | flush | flush |
  6517. * | MPDU | end | start | end | start |
  6518. * | ranges | seq num | seq num | seq num | seq num |
  6519. * |==========================================================================|
  6520. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  6521. * |V|V| | rate | | | timestamp | RSSI |
  6522. * |--------------------------------------------------------------------------|
  6523. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  6524. * |--------------------------------------------------------------------------|
  6525. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  6526. * |--------------------------------------------------------------------------|
  6527. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  6528. * |--------------------------------------------------------------------------|
  6529. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  6530. * |--------------------------------------------------------------------------|
  6531. * | TSF LSBs |
  6532. * |--------------------------------------------------------------------------|
  6533. * | microsec timestamp |
  6534. * |--------------------------------------------------------------------------|
  6535. * | preamble type | HT-SIG / VHT-SIG-A1 |
  6536. * |--------------------------------------------------------------------------|
  6537. * | service | HT-SIG / VHT-SIG-A2 |
  6538. * |==========================================================================|
  6539. * | reserved | FW rx desc bytes |
  6540. * |--------------------------------------------------------------------------|
  6541. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  6542. * | desc B3 | desc B2 | desc B1 | desc B0 |
  6543. * |--------------------------------------------------------------------------|
  6544. * : : :
  6545. * |--------------------------------------------------------------------------|
  6546. * | alignment | MSDU Rx |
  6547. * | padding | desc Bn |
  6548. * |--------------------------------------------------------------------------|
  6549. * | reserved | MPDU range status | MPDU count |
  6550. * |--------------------------------------------------------------------------|
  6551. * : reserved : MPDU range status : MPDU count :
  6552. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  6553. *
  6554. * Header fields:
  6555. * - MSG_TYPE
  6556. * Bits 7:0
  6557. * Purpose: identifies this as an rx indication message
  6558. * Value: 0x1
  6559. * - EXT_TID
  6560. * Bits 12:8
  6561. * Purpose: identify the traffic ID of the rx data, including
  6562. * special "extended" TID values for multicast, broadcast, and
  6563. * non-QoS data frames
  6564. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  6565. * - FLUSH_VALID (FV)
  6566. * Bit 13
  6567. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  6568. * is valid
  6569. * Value:
  6570. * 1 -> flush IE is valid and needs to be processed
  6571. * 0 -> flush IE is not valid and should be ignored
  6572. * - REL_VALID (RV)
  6573. * Bit 13
  6574. * Purpose: indicate whether the release IE (start/end sequence numbers)
  6575. * is valid
  6576. * Value:
  6577. * 1 -> release IE is valid and needs to be processed
  6578. * 0 -> release IE is not valid and should be ignored
  6579. * - PEER_ID
  6580. * Bits 31:16
  6581. * Purpose: Identify, by ID, which peer sent the rx data
  6582. * Value: ID of the peer who sent the rx data
  6583. * - FLUSH_SEQ_NUM_START
  6584. * Bits 5:0
  6585. * Purpose: Indicate the start of a series of MPDUs to flush
  6586. * Not all MPDUs within this series are necessarily valid - the host
  6587. * must check each sequence number within this range to see if the
  6588. * corresponding MPDU is actually present.
  6589. * This field is only valid if the FV bit is set.
  6590. * Value:
  6591. * The sequence number for the first MPDUs to check to flush.
  6592. * The sequence number is masked by 0x3f.
  6593. * - FLUSH_SEQ_NUM_END
  6594. * Bits 11:6
  6595. * Purpose: Indicate the end of a series of MPDUs to flush
  6596. * Value:
  6597. * The sequence number one larger than the sequence number of the
  6598. * last MPDU to check to flush.
  6599. * The sequence number is masked by 0x3f.
  6600. * Not all MPDUs within this series are necessarily valid - the host
  6601. * must check each sequence number within this range to see if the
  6602. * corresponding MPDU is actually present.
  6603. * This field is only valid if the FV bit is set.
  6604. * - REL_SEQ_NUM_START
  6605. * Bits 17:12
  6606. * Purpose: Indicate the start of a series of MPDUs to release.
  6607. * All MPDUs within this series are present and valid - the host
  6608. * need not check each sequence number within this range to see if
  6609. * the corresponding MPDU is actually present.
  6610. * This field is only valid if the RV bit is set.
  6611. * Value:
  6612. * The sequence number for the first MPDUs to check to release.
  6613. * The sequence number is masked by 0x3f.
  6614. * - REL_SEQ_NUM_END
  6615. * Bits 23:18
  6616. * Purpose: Indicate the end of a series of MPDUs to release.
  6617. * Value:
  6618. * The sequence number one larger than the sequence number of the
  6619. * last MPDU to check to release.
  6620. * The sequence number is masked by 0x3f.
  6621. * All MPDUs within this series are present and valid - the host
  6622. * need not check each sequence number within this range to see if
  6623. * the corresponding MPDU is actually present.
  6624. * This field is only valid if the RV bit is set.
  6625. * - NUM_MPDU_RANGES
  6626. * Bits 31:24
  6627. * Purpose: Indicate how many ranges of MPDUs are present.
  6628. * Each MPDU range consists of a series of contiguous MPDUs within the
  6629. * rx frame sequence which all have the same MPDU status.
  6630. * Value: 1-63 (typically a small number, like 1-3)
  6631. *
  6632. * Rx PPDU descriptor fields:
  6633. * - RSSI_CMB
  6634. * Bits 7:0
  6635. * Purpose: Combined RSSI from all active rx chains, across the active
  6636. * bandwidth.
  6637. * Value: RSSI dB units w.r.t. noise floor
  6638. * - TIMESTAMP_SUBMICROSEC
  6639. * Bits 15:8
  6640. * Purpose: high-resolution timestamp
  6641. * Value:
  6642. * Sub-microsecond time of PPDU reception.
  6643. * This timestamp ranges from [0,MAC clock MHz).
  6644. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  6645. * to form a high-resolution, large range rx timestamp.
  6646. * - PHY_ERR_CODE
  6647. * Bits 23:16
  6648. * Purpose:
  6649. * If the rx frame processing resulted in a PHY error, indicate what
  6650. * type of rx PHY error occurred.
  6651. * Value:
  6652. * This field is valid if the "P" (PHY_ERR) flag is set.
  6653. * TBD: document/specify the values for this field
  6654. * - PHY_ERR
  6655. * Bit 24
  6656. * Purpose: indicate whether the rx PPDU had a PHY error
  6657. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  6658. * - LEGACY_RATE
  6659. * Bits 28:25
  6660. * Purpose:
  6661. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  6662. * specify which rate was used.
  6663. * Value:
  6664. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  6665. * flag.
  6666. * If LEGACY_RATE_SEL is 0:
  6667. * 0x8: OFDM 48 Mbps
  6668. * 0x9: OFDM 24 Mbps
  6669. * 0xA: OFDM 12 Mbps
  6670. * 0xB: OFDM 6 Mbps
  6671. * 0xC: OFDM 54 Mbps
  6672. * 0xD: OFDM 36 Mbps
  6673. * 0xE: OFDM 18 Mbps
  6674. * 0xF: OFDM 9 Mbps
  6675. * If LEGACY_RATE_SEL is 1:
  6676. * 0x8: CCK 11 Mbps long preamble
  6677. * 0x9: CCK 5.5 Mbps long preamble
  6678. * 0xA: CCK 2 Mbps long preamble
  6679. * 0xB: CCK 1 Mbps long preamble
  6680. * 0xC: CCK 11 Mbps short preamble
  6681. * 0xD: CCK 5.5 Mbps short preamble
  6682. * 0xE: CCK 2 Mbps short preamble
  6683. * - LEGACY_RATE_SEL
  6684. * Bit 29
  6685. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  6686. * Value:
  6687. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  6688. * used a legacy rate.
  6689. * 0 -> OFDM, 1 -> CCK
  6690. * - END_VALID
  6691. * Bit 30
  6692. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6693. * the start of the PPDU are valid. Specifically, the following
  6694. * fields are only valid if END_VALID is set:
  6695. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  6696. * TIMESTAMP_SUBMICROSEC
  6697. * Value:
  6698. * 0 -> rx PPDU desc end fields are not valid
  6699. * 1 -> rx PPDU desc end fields are valid
  6700. * - START_VALID
  6701. * Bit 31
  6702. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6703. * the end of the PPDU are valid. Specifically, the following
  6704. * fields are only valid if START_VALID is set:
  6705. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  6706. * VHT-SIG-A
  6707. * Value:
  6708. * 0 -> rx PPDU desc start fields are not valid
  6709. * 1 -> rx PPDU desc start fields are valid
  6710. * - RSSI0_PRI20
  6711. * Bits 7:0
  6712. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  6713. * Value: RSSI dB units w.r.t. noise floor
  6714. *
  6715. * - RSSI0_EXT20
  6716. * Bits 7:0
  6717. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  6718. * (if the rx bandwidth was >= 40 MHz)
  6719. * Value: RSSI dB units w.r.t. noise floor
  6720. * - RSSI0_EXT40
  6721. * Bits 7:0
  6722. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  6723. * (if the rx bandwidth was >= 80 MHz)
  6724. * Value: RSSI dB units w.r.t. noise floor
  6725. * - RSSI0_EXT80
  6726. * Bits 7:0
  6727. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  6728. * (if the rx bandwidth was >= 160 MHz)
  6729. * Value: RSSI dB units w.r.t. noise floor
  6730. *
  6731. * - RSSI1_PRI20
  6732. * Bits 7:0
  6733. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  6734. * Value: RSSI dB units w.r.t. noise floor
  6735. * - RSSI1_EXT20
  6736. * Bits 7:0
  6737. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  6738. * (if the rx bandwidth was >= 40 MHz)
  6739. * Value: RSSI dB units w.r.t. noise floor
  6740. * - RSSI1_EXT40
  6741. * Bits 7:0
  6742. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  6743. * (if the rx bandwidth was >= 80 MHz)
  6744. * Value: RSSI dB units w.r.t. noise floor
  6745. * - RSSI1_EXT80
  6746. * Bits 7:0
  6747. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  6748. * (if the rx bandwidth was >= 160 MHz)
  6749. * Value: RSSI dB units w.r.t. noise floor
  6750. *
  6751. * - RSSI2_PRI20
  6752. * Bits 7:0
  6753. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  6754. * Value: RSSI dB units w.r.t. noise floor
  6755. * - RSSI2_EXT20
  6756. * Bits 7:0
  6757. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  6758. * (if the rx bandwidth was >= 40 MHz)
  6759. * Value: RSSI dB units w.r.t. noise floor
  6760. * - RSSI2_EXT40
  6761. * Bits 7:0
  6762. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  6763. * (if the rx bandwidth was >= 80 MHz)
  6764. * Value: RSSI dB units w.r.t. noise floor
  6765. * - RSSI2_EXT80
  6766. * Bits 7:0
  6767. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  6768. * (if the rx bandwidth was >= 160 MHz)
  6769. * Value: RSSI dB units w.r.t. noise floor
  6770. *
  6771. * - RSSI3_PRI20
  6772. * Bits 7:0
  6773. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  6774. * Value: RSSI dB units w.r.t. noise floor
  6775. * - RSSI3_EXT20
  6776. * Bits 7:0
  6777. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  6778. * (if the rx bandwidth was >= 40 MHz)
  6779. * Value: RSSI dB units w.r.t. noise floor
  6780. * - RSSI3_EXT40
  6781. * Bits 7:0
  6782. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  6783. * (if the rx bandwidth was >= 80 MHz)
  6784. * Value: RSSI dB units w.r.t. noise floor
  6785. * - RSSI3_EXT80
  6786. * Bits 7:0
  6787. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  6788. * (if the rx bandwidth was >= 160 MHz)
  6789. * Value: RSSI dB units w.r.t. noise floor
  6790. *
  6791. * - TSF32
  6792. * Bits 31:0
  6793. * Purpose: specify the time the rx PPDU was received, in TSF units
  6794. * Value: 32 LSBs of the TSF
  6795. * - TIMESTAMP_MICROSEC
  6796. * Bits 31:0
  6797. * Purpose: specify the time the rx PPDU was received, in microsecond units
  6798. * Value: PPDU rx time, in microseconds
  6799. * - VHT_SIG_A1
  6800. * Bits 23:0
  6801. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  6802. * from the rx PPDU
  6803. * Value:
  6804. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  6805. * VHT-SIG-A1 data.
  6806. * If PREAMBLE_TYPE specifies HT, then this field contains the
  6807. * first 24 bits of the HT-SIG data.
  6808. * Otherwise, this field is invalid.
  6809. * Refer to the the 802.11 protocol for the definition of the
  6810. * HT-SIG and VHT-SIG-A1 fields
  6811. * - VHT_SIG_A2
  6812. * Bits 23:0
  6813. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  6814. * from the rx PPDU
  6815. * Value:
  6816. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  6817. * VHT-SIG-A2 data.
  6818. * If PREAMBLE_TYPE specifies HT, then this field contains the
  6819. * last 24 bits of the HT-SIG data.
  6820. * Otherwise, this field is invalid.
  6821. * Refer to the the 802.11 protocol for the definition of the
  6822. * HT-SIG and VHT-SIG-A2 fields
  6823. * - PREAMBLE_TYPE
  6824. * Bits 31:24
  6825. * Purpose: indicate the PHY format of the received burst
  6826. * Value:
  6827. * 0x4: Legacy (OFDM/CCK)
  6828. * 0x8: HT
  6829. * 0x9: HT with TxBF
  6830. * 0xC: VHT
  6831. * 0xD: VHT with TxBF
  6832. * - SERVICE
  6833. * Bits 31:24
  6834. * Purpose: TBD
  6835. * Value: TBD
  6836. *
  6837. * Rx MSDU descriptor fields:
  6838. * - FW_RX_DESC_BYTES
  6839. * Bits 15:0
  6840. * Purpose: Indicate how many bytes in the Rx indication are used for
  6841. * FW Rx descriptors
  6842. *
  6843. * Payload fields:
  6844. * - MPDU_COUNT
  6845. * Bits 7:0
  6846. * Purpose: Indicate how many sequential MPDUs share the same status.
  6847. * All MPDUs within the indicated list are from the same RA-TA-TID.
  6848. * - MPDU_STATUS
  6849. * Bits 15:8
  6850. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  6851. * received successfully.
  6852. * Value:
  6853. * 0x1: success
  6854. * 0x2: FCS error
  6855. * 0x3: duplicate error
  6856. * 0x4: replay error
  6857. * 0x5: invalid peer
  6858. */
  6859. /* header fields */
  6860. #define HTT_RX_IND_EXT_TID_M 0x1f00
  6861. #define HTT_RX_IND_EXT_TID_S 8
  6862. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  6863. #define HTT_RX_IND_FLUSH_VALID_S 13
  6864. #define HTT_RX_IND_REL_VALID_M 0x4000
  6865. #define HTT_RX_IND_REL_VALID_S 14
  6866. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  6867. #define HTT_RX_IND_PEER_ID_S 16
  6868. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  6869. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  6870. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  6871. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  6872. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  6873. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  6874. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  6875. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  6876. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  6877. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  6878. /* rx PPDU descriptor fields */
  6879. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  6880. #define HTT_RX_IND_RSSI_CMB_S 0
  6881. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  6882. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  6883. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  6884. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  6885. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  6886. #define HTT_RX_IND_PHY_ERR_S 24
  6887. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  6888. #define HTT_RX_IND_LEGACY_RATE_S 25
  6889. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  6890. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  6891. #define HTT_RX_IND_END_VALID_M 0x40000000
  6892. #define HTT_RX_IND_END_VALID_S 30
  6893. #define HTT_RX_IND_START_VALID_M 0x80000000
  6894. #define HTT_RX_IND_START_VALID_S 31
  6895. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  6896. #define HTT_RX_IND_RSSI_PRI20_S 0
  6897. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  6898. #define HTT_RX_IND_RSSI_EXT20_S 8
  6899. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  6900. #define HTT_RX_IND_RSSI_EXT40_S 16
  6901. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  6902. #define HTT_RX_IND_RSSI_EXT80_S 24
  6903. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  6904. #define HTT_RX_IND_VHT_SIG_A1_S 0
  6905. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  6906. #define HTT_RX_IND_VHT_SIG_A2_S 0
  6907. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  6908. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  6909. #define HTT_RX_IND_SERVICE_M 0xff000000
  6910. #define HTT_RX_IND_SERVICE_S 24
  6911. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  6912. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  6913. /* rx MSDU descriptor fields */
  6914. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  6915. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  6916. /* payload fields */
  6917. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  6918. #define HTT_RX_IND_MPDU_COUNT_S 0
  6919. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  6920. #define HTT_RX_IND_MPDU_STATUS_S 8
  6921. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  6922. do { \
  6923. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  6924. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  6925. } while (0)
  6926. #define HTT_RX_IND_EXT_TID_GET(word) \
  6927. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  6928. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  6929. do { \
  6930. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  6931. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  6932. } while (0)
  6933. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  6934. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  6935. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  6936. do { \
  6937. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  6938. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  6939. } while (0)
  6940. #define HTT_RX_IND_REL_VALID_GET(word) \
  6941. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  6942. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  6943. do { \
  6944. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  6945. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  6946. } while (0)
  6947. #define HTT_RX_IND_PEER_ID_GET(word) \
  6948. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  6949. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  6950. do { \
  6951. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  6952. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  6953. } while (0)
  6954. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  6955. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  6956. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  6957. do { \
  6958. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  6959. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  6960. } while (0)
  6961. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  6962. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  6963. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  6964. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  6965. do { \
  6966. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  6967. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  6968. } while (0)
  6969. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  6970. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  6971. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  6972. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  6973. do { \
  6974. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  6975. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  6976. } while (0)
  6977. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  6978. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  6979. HTT_RX_IND_REL_SEQ_NUM_START_S)
  6980. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  6981. do { \
  6982. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  6983. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  6984. } while (0)
  6985. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  6986. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  6987. HTT_RX_IND_REL_SEQ_NUM_END_S)
  6988. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  6989. do { \
  6990. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  6991. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  6992. } while (0)
  6993. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  6994. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  6995. HTT_RX_IND_NUM_MPDU_RANGES_S)
  6996. /* FW rx PPDU descriptor fields */
  6997. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  6998. do { \
  6999. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  7000. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  7001. } while (0)
  7002. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  7003. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  7004. HTT_RX_IND_RSSI_CMB_S)
  7005. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  7006. do { \
  7007. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  7008. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  7009. } while (0)
  7010. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  7011. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  7012. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  7013. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  7014. do { \
  7015. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  7016. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  7017. } while (0)
  7018. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  7019. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  7020. HTT_RX_IND_PHY_ERR_CODE_S)
  7021. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  7022. do { \
  7023. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  7024. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  7025. } while (0)
  7026. #define HTT_RX_IND_PHY_ERR_GET(word) \
  7027. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  7028. HTT_RX_IND_PHY_ERR_S)
  7029. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  7030. do { \
  7031. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  7032. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  7033. } while (0)
  7034. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  7035. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  7036. HTT_RX_IND_LEGACY_RATE_S)
  7037. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  7038. do { \
  7039. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  7040. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  7041. } while (0)
  7042. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  7043. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  7044. HTT_RX_IND_LEGACY_RATE_SEL_S)
  7045. #define HTT_RX_IND_END_VALID_SET(word, value) \
  7046. do { \
  7047. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  7048. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  7049. } while (0)
  7050. #define HTT_RX_IND_END_VALID_GET(word) \
  7051. (((word) & HTT_RX_IND_END_VALID_M) >> \
  7052. HTT_RX_IND_END_VALID_S)
  7053. #define HTT_RX_IND_START_VALID_SET(word, value) \
  7054. do { \
  7055. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  7056. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  7057. } while (0)
  7058. #define HTT_RX_IND_START_VALID_GET(word) \
  7059. (((word) & HTT_RX_IND_START_VALID_M) >> \
  7060. HTT_RX_IND_START_VALID_S)
  7061. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  7062. do { \
  7063. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  7064. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  7065. } while (0)
  7066. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  7067. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  7068. HTT_RX_IND_RSSI_PRI20_S)
  7069. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  7070. do { \
  7071. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  7072. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  7073. } while (0)
  7074. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  7075. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  7076. HTT_RX_IND_RSSI_EXT20_S)
  7077. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  7078. do { \
  7079. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  7080. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  7081. } while (0)
  7082. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  7083. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  7084. HTT_RX_IND_RSSI_EXT40_S)
  7085. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  7086. do { \
  7087. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  7088. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  7089. } while (0)
  7090. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  7091. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  7092. HTT_RX_IND_RSSI_EXT80_S)
  7093. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  7094. do { \
  7095. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  7096. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  7097. } while (0)
  7098. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  7099. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  7100. HTT_RX_IND_VHT_SIG_A1_S)
  7101. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  7102. do { \
  7103. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  7104. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  7105. } while (0)
  7106. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  7107. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  7108. HTT_RX_IND_VHT_SIG_A2_S)
  7109. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  7110. do { \
  7111. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  7112. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  7113. } while (0)
  7114. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  7115. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  7116. HTT_RX_IND_PREAMBLE_TYPE_S)
  7117. #define HTT_RX_IND_SERVICE_SET(word, value) \
  7118. do { \
  7119. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  7120. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  7121. } while (0)
  7122. #define HTT_RX_IND_SERVICE_GET(word) \
  7123. (((word) & HTT_RX_IND_SERVICE_M) >> \
  7124. HTT_RX_IND_SERVICE_S)
  7125. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  7126. do { \
  7127. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  7128. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  7129. } while (0)
  7130. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  7131. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  7132. HTT_RX_IND_SA_ANT_MATRIX_S)
  7133. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  7134. do { \
  7135. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  7136. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  7137. } while (0)
  7138. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  7139. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  7140. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  7141. do { \
  7142. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  7143. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  7144. } while (0)
  7145. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  7146. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  7147. #define HTT_RX_IND_HL_BYTES \
  7148. (HTT_RX_IND_HDR_BYTES + \
  7149. 4 /* single FW rx MSDU descriptor */ + \
  7150. 4 /* single MPDU range information element */)
  7151. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  7152. /* Could we use one macro entry? */
  7153. #define HTT_WORD_SET(word, field, value) \
  7154. do { \
  7155. HTT_CHECK_SET_VAL(field, value); \
  7156. (word) |= ((value) << field ## _S); \
  7157. } while (0)
  7158. #define HTT_WORD_GET(word, field) \
  7159. (((word) & field ## _M) >> field ## _S)
  7160. PREPACK struct hl_htt_rx_ind_base {
  7161. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  7162. } POSTPACK;
  7163. /*
  7164. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  7165. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  7166. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  7167. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  7168. * htt_rx_ind_hl_rx_desc_t.
  7169. */
  7170. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  7171. struct htt_rx_ind_hl_rx_desc_t {
  7172. A_UINT8 ver;
  7173. A_UINT8 len;
  7174. struct {
  7175. A_UINT8
  7176. first_msdu: 1,
  7177. last_msdu: 1,
  7178. c3_failed: 1,
  7179. c4_failed: 1,
  7180. ipv6: 1,
  7181. tcp: 1,
  7182. udp: 1,
  7183. reserved: 1;
  7184. } flags;
  7185. /* NOTE: no reserved space - don't append any new fields here */
  7186. };
  7187. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  7188. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7189. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  7190. #define HTT_RX_IND_HL_RX_DESC_VER 0
  7191. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  7192. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7193. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  7194. #define HTT_RX_IND_HL_FLAG_OFFSET \
  7195. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7196. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  7197. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  7198. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  7199. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  7200. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  7201. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  7202. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  7203. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  7204. /* This structure is used in HL, the basic descriptor information
  7205. * used by host. the structure is translated by FW from HW desc
  7206. * or generated by FW. But in HL monitor mode, the host would use
  7207. * the same structure with LL.
  7208. */
  7209. PREPACK struct hl_htt_rx_desc_base {
  7210. A_UINT32
  7211. seq_num:12,
  7212. encrypted:1,
  7213. chan_info_present:1,
  7214. resv0:2,
  7215. mcast_bcast:1,
  7216. fragment:1,
  7217. key_id_oct:8,
  7218. resv1:6;
  7219. A_UINT32
  7220. pn_31_0;
  7221. union {
  7222. struct {
  7223. A_UINT16 pn_47_32;
  7224. A_UINT16 pn_63_48;
  7225. } pn16;
  7226. A_UINT32 pn_63_32;
  7227. } u0;
  7228. A_UINT32
  7229. pn_95_64;
  7230. A_UINT32
  7231. pn_127_96;
  7232. } POSTPACK;
  7233. /*
  7234. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  7235. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  7236. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  7237. * Please see htt_chan_change_t for description of the fields.
  7238. */
  7239. PREPACK struct htt_chan_info_t
  7240. {
  7241. A_UINT32 primary_chan_center_freq_mhz: 16,
  7242. contig_chan1_center_freq_mhz: 16;
  7243. A_UINT32 contig_chan2_center_freq_mhz: 16,
  7244. phy_mode: 8,
  7245. reserved: 8;
  7246. } POSTPACK;
  7247. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  7248. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  7249. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  7250. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  7251. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  7252. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  7253. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  7254. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  7255. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  7256. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  7257. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  7258. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  7259. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  7260. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  7261. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  7262. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  7263. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  7264. /* Channel information */
  7265. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  7266. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  7267. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  7268. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  7269. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  7270. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  7271. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  7272. #define HTT_CHAN_INFO_PHY_MODE_S 16
  7273. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  7274. do { \
  7275. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  7276. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  7277. } while (0)
  7278. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  7279. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  7280. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  7281. do { \
  7282. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  7283. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  7284. } while (0)
  7285. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  7286. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  7287. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  7288. do { \
  7289. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  7290. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  7291. } while (0)
  7292. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  7293. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  7294. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  7295. do { \
  7296. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  7297. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  7298. } while (0)
  7299. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  7300. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  7301. /*
  7302. * HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  7303. * @brief target -> host message definition for FW offloaded pkts
  7304. *
  7305. * @details
  7306. * The following field definitions describe the format of the firmware
  7307. * offload deliver message sent from the target to the host.
  7308. *
  7309. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  7310. *
  7311. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  7312. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  7313. * | reserved_1 | msg type |
  7314. * |--------------------------------------------------------------------------|
  7315. * | phy_timestamp_l32 |
  7316. * |--------------------------------------------------------------------------|
  7317. * | WORD2 (see below) |
  7318. * |--------------------------------------------------------------------------|
  7319. * | seqno | framectrl |
  7320. * |--------------------------------------------------------------------------|
  7321. * | reserved_3 | vdev_id | tid_num|
  7322. * |--------------------------------------------------------------------------|
  7323. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  7324. * |--------------------------------------------------------------------------|
  7325. *
  7326. * where:
  7327. * STAT = status
  7328. * F = format (802.3 vs. 802.11)
  7329. *
  7330. * definition for word 2
  7331. *
  7332. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  7333. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  7334. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  7335. * |--------------------------------------------------------------------------|
  7336. *
  7337. * where:
  7338. * PR = preamble
  7339. * BF = beamformed
  7340. */
  7341. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  7342. {
  7343. A_UINT32 /* word 0 */
  7344. msg_type:8, /* [ 7: 0] */
  7345. reserved_1:24; /* [31: 8] */
  7346. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  7347. A_UINT32 /* word 2 */
  7348. /* preamble:
  7349. * 0-OFDM,
  7350. * 1-CCk,
  7351. * 2-HT,
  7352. * 3-VHT
  7353. */
  7354. preamble: 2, /* [1:0] */
  7355. /* mcs:
  7356. * In case of HT preamble interpret
  7357. * MCS along with NSS.
  7358. * Valid values for HT are 0 to 7.
  7359. * HT mcs 0 with NSS 2 is mcs 8.
  7360. * Valid values for VHT are 0 to 9.
  7361. */
  7362. mcs: 4, /* [5:2] */
  7363. /* rate:
  7364. * This is applicable only for
  7365. * CCK and OFDM preamble type
  7366. * rate 0: OFDM 48 Mbps,
  7367. * 1: OFDM 24 Mbps,
  7368. * 2: OFDM 12 Mbps
  7369. * 3: OFDM 6 Mbps
  7370. * 4: OFDM 54 Mbps
  7371. * 5: OFDM 36 Mbps
  7372. * 6: OFDM 18 Mbps
  7373. * 7: OFDM 9 Mbps
  7374. * rate 0: CCK 11 Mbps Long
  7375. * 1: CCK 5.5 Mbps Long
  7376. * 2: CCK 2 Mbps Long
  7377. * 3: CCK 1 Mbps Long
  7378. * 4: CCK 11 Mbps Short
  7379. * 5: CCK 5.5 Mbps Short
  7380. * 6: CCK 2 Mbps Short
  7381. */
  7382. rate : 3, /* [ 8: 6] */
  7383. rssi : 8, /* [16: 9] units=dBm */
  7384. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  7385. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  7386. stbc : 1, /* [22] */
  7387. sgi : 1, /* [23] */
  7388. ldpc : 1, /* [24] */
  7389. beamformed: 1, /* [25] */
  7390. reserved_2: 6; /* [31:26] */
  7391. A_UINT32 /* word 3 */
  7392. framectrl:16, /* [15: 0] */
  7393. seqno:16; /* [31:16] */
  7394. A_UINT32 /* word 4 */
  7395. tid_num:5, /* [ 4: 0] actual TID number */
  7396. vdev_id:8, /* [12: 5] */
  7397. reserved_3:19; /* [31:13] */
  7398. A_UINT32 /* word 5 */
  7399. /* status:
  7400. * 0: tx_ok
  7401. * 1: retry
  7402. * 2: drop
  7403. * 3: filtered
  7404. * 4: abort
  7405. * 5: tid delete
  7406. * 6: sw abort
  7407. * 7: dropped by peer migration
  7408. */
  7409. status:3, /* [2:0] */
  7410. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  7411. tx_mpdu_bytes:16, /* [19:4] */
  7412. /* Indicates retry count of offloaded/local generated Data tx frames */
  7413. tx_retry_cnt:6, /* [25:20] */
  7414. reserved_4:6; /* [31:26] */
  7415. } POSTPACK;
  7416. /* FW offload deliver ind message header fields */
  7417. /* DWORD one */
  7418. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  7419. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  7420. /* DWORD two */
  7421. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  7422. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  7423. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  7424. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  7425. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  7426. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  7427. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  7428. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  7429. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  7430. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  7431. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  7432. #define HTT_FW_OFFLOAD_IND_BW_S 19
  7433. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  7434. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  7435. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  7436. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  7437. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  7438. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  7439. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  7440. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  7441. /* DWORD three*/
  7442. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  7443. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  7444. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  7445. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  7446. /* DWORD four */
  7447. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  7448. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  7449. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  7450. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  7451. /* DWORD five */
  7452. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  7453. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  7454. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  7455. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  7456. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  7457. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  7458. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  7459. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  7460. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  7461. do { \
  7462. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  7463. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  7464. } while (0)
  7465. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  7466. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  7467. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  7468. do { \
  7469. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  7470. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  7471. } while (0)
  7472. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  7473. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  7474. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  7475. do { \
  7476. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  7477. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  7478. } while (0)
  7479. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  7480. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  7481. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  7482. do { \
  7483. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  7484. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  7485. } while (0)
  7486. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  7487. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  7488. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  7489. do { \
  7490. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  7491. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  7492. } while (0)
  7493. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  7494. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  7495. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  7496. do { \
  7497. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  7498. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  7499. } while (0)
  7500. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  7501. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  7502. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  7503. do { \
  7504. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  7505. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  7506. } while (0)
  7507. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  7508. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  7509. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  7510. do { \
  7511. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  7512. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  7513. } while (0)
  7514. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  7515. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  7516. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  7517. do { \
  7518. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  7519. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  7520. } while (0)
  7521. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  7522. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  7523. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  7524. do { \
  7525. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  7526. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  7527. } while (0)
  7528. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  7529. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  7530. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  7531. do { \
  7532. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  7533. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  7534. } while (0)
  7535. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  7536. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  7537. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  7538. do { \
  7539. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  7540. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  7541. } while (0)
  7542. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  7543. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  7544. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  7545. do { \
  7546. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  7547. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  7548. } while (0)
  7549. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  7550. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  7551. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  7552. do { \
  7553. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  7554. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  7555. } while (0)
  7556. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  7557. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  7558. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  7559. do { \
  7560. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  7561. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  7562. } while (0)
  7563. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  7564. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  7565. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  7566. do { \
  7567. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  7568. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  7569. } while (0)
  7570. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  7571. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  7572. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  7573. do { \
  7574. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  7575. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  7576. } while (0)
  7577. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  7578. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  7579. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  7580. do { \
  7581. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  7582. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  7583. } while (0)
  7584. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  7585. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  7586. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  7587. do { \
  7588. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  7589. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  7590. } while (0)
  7591. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  7592. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  7593. /*
  7594. * @brief target -> host rx reorder flush message definition
  7595. *
  7596. * @details
  7597. * The following field definitions describe the format of the rx flush
  7598. * message sent from the target to the host.
  7599. * The message consists of a 4-octet header, followed by one or more
  7600. * 4-octet payload information elements.
  7601. *
  7602. * |31 24|23 8|7 0|
  7603. * |--------------------------------------------------------------|
  7604. * | TID | peer ID | msg type |
  7605. * |--------------------------------------------------------------|
  7606. * | seq num end | seq num start | MPDU status | reserved |
  7607. * |--------------------------------------------------------------|
  7608. * First DWORD:
  7609. * - MSG_TYPE
  7610. * Bits 7:0
  7611. * Purpose: identifies this as an rx flush message
  7612. * Value: 0x2
  7613. * - PEER_ID
  7614. * Bits 23:8 (only bits 18:8 actually used)
  7615. * Purpose: identify which peer's rx data is being flushed
  7616. * Value: (rx) peer ID
  7617. * - TID
  7618. * Bits 31:24 (only bits 27:24 actually used)
  7619. * Purpose: Specifies which traffic identifier's rx data is being flushed
  7620. * Value: traffic identifier
  7621. * Second DWORD:
  7622. * - MPDU_STATUS
  7623. * Bits 15:8
  7624. * Purpose:
  7625. * Indicate whether the flushed MPDUs should be discarded or processed.
  7626. * Value:
  7627. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  7628. * stages of rx processing
  7629. * other: discard the MPDUs
  7630. * It is anticipated that flush messages will always have
  7631. * MPDU status == 1, but the status flag is included for
  7632. * flexibility.
  7633. * - SEQ_NUM_START
  7634. * Bits 23:16
  7635. * Purpose:
  7636. * Indicate the start of a series of consecutive MPDUs being flushed.
  7637. * Not all MPDUs within this range are necessarily valid - the host
  7638. * must check each sequence number within this range to see if the
  7639. * corresponding MPDU is actually present.
  7640. * Value:
  7641. * The sequence number for the first MPDU in the sequence.
  7642. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7643. * - SEQ_NUM_END
  7644. * Bits 30:24
  7645. * Purpose:
  7646. * Indicate the end of a series of consecutive MPDUs being flushed.
  7647. * Value:
  7648. * The sequence number one larger than the sequence number of the
  7649. * last MPDU being flushed.
  7650. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7651. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  7652. * are to be released for further rx processing.
  7653. * Not all MPDUs within this range are necessarily valid - the host
  7654. * must check each sequence number within this range to see if the
  7655. * corresponding MPDU is actually present.
  7656. */
  7657. /* first DWORD */
  7658. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  7659. #define HTT_RX_FLUSH_PEER_ID_S 8
  7660. #define HTT_RX_FLUSH_TID_M 0xff000000
  7661. #define HTT_RX_FLUSH_TID_S 24
  7662. /* second DWORD */
  7663. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  7664. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  7665. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  7666. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  7667. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  7668. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  7669. #define HTT_RX_FLUSH_BYTES 8
  7670. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  7671. do { \
  7672. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  7673. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  7674. } while (0)
  7675. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  7676. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  7677. #define HTT_RX_FLUSH_TID_SET(word, value) \
  7678. do { \
  7679. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  7680. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  7681. } while (0)
  7682. #define HTT_RX_FLUSH_TID_GET(word) \
  7683. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  7684. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  7685. do { \
  7686. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  7687. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  7688. } while (0)
  7689. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  7690. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  7691. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  7692. do { \
  7693. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  7694. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  7695. } while (0)
  7696. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  7697. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  7698. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  7699. do { \
  7700. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  7701. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  7702. } while (0)
  7703. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  7704. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  7705. /*
  7706. * @brief target -> host rx pn check indication message
  7707. *
  7708. * @details
  7709. * The following field definitions describe the format of the Rx PN check
  7710. * indication message sent from the target to the host.
  7711. * The message consists of a 4-octet header, followed by the start and
  7712. * end sequence numbers to be released, followed by the PN IEs. Each PN
  7713. * IE is one octet containing the sequence number that failed the PN
  7714. * check.
  7715. *
  7716. * |31 24|23 8|7 0|
  7717. * |--------------------------------------------------------------|
  7718. * | TID | peer ID | msg type |
  7719. * |--------------------------------------------------------------|
  7720. * | Reserved | PN IE count | seq num end | seq num start|
  7721. * |--------------------------------------------------------------|
  7722. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  7723. * |--------------------------------------------------------------|
  7724. * First DWORD:
  7725. * - MSG_TYPE
  7726. * Bits 7:0
  7727. * Purpose: Identifies this as an rx pn check indication message
  7728. * Value: 0x2
  7729. * - PEER_ID
  7730. * Bits 23:8 (only bits 18:8 actually used)
  7731. * Purpose: identify which peer
  7732. * Value: (rx) peer ID
  7733. * - TID
  7734. * Bits 31:24 (only bits 27:24 actually used)
  7735. * Purpose: identify traffic identifier
  7736. * Value: traffic identifier
  7737. * Second DWORD:
  7738. * - SEQ_NUM_START
  7739. * Bits 7:0
  7740. * Purpose:
  7741. * Indicates the starting sequence number of the MPDU in this
  7742. * series of MPDUs that went though PN check.
  7743. * Value:
  7744. * The sequence number for the first MPDU in the sequence.
  7745. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7746. * - SEQ_NUM_END
  7747. * Bits 15:8
  7748. * Purpose:
  7749. * Indicates the ending sequence number of the MPDU in this
  7750. * series of MPDUs that went though PN check.
  7751. * Value:
  7752. * The sequence number one larger then the sequence number of the last
  7753. * MPDU being flushed.
  7754. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7755. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  7756. * for invalid PN numbers and are ready to be released for further processing.
  7757. * Not all MPDUs within this range are necessarily valid - the host
  7758. * must check each sequence number within this range to see if the
  7759. * corresponding MPDU is actually present.
  7760. * - PN_IE_COUNT
  7761. * Bits 23:16
  7762. * Purpose:
  7763. * Used to determine the variable number of PN information elements in this
  7764. * message
  7765. *
  7766. * PN information elements:
  7767. * - PN_IE_x-
  7768. * Purpose:
  7769. * Each PN information element contains the sequence number of the MPDU that
  7770. * has failed the target PN check.
  7771. * Value:
  7772. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  7773. * that failed the PN check.
  7774. */
  7775. /* first DWORD */
  7776. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  7777. #define HTT_RX_PN_IND_PEER_ID_S 8
  7778. #define HTT_RX_PN_IND_TID_M 0xff000000
  7779. #define HTT_RX_PN_IND_TID_S 24
  7780. /* second DWORD */
  7781. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  7782. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  7783. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  7784. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  7785. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  7786. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  7787. #define HTT_RX_PN_IND_BYTES 8
  7788. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  7789. do { \
  7790. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  7791. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  7792. } while (0)
  7793. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  7794. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  7795. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  7796. do { \
  7797. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  7798. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  7799. } while (0)
  7800. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  7801. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  7802. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  7803. do { \
  7804. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  7805. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  7806. } while (0)
  7807. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  7808. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  7809. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  7810. do { \
  7811. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  7812. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  7813. } while (0)
  7814. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  7815. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  7816. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  7817. do { \
  7818. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  7819. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  7820. } while (0)
  7821. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  7822. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  7823. /*
  7824. * @brief target -> host rx offload deliver message for LL system
  7825. *
  7826. * @details
  7827. * In a low latency system this message is sent whenever the offload
  7828. * manager flushes out the packets it has coalesced in its coalescing buffer.
  7829. * The DMA of the actual packets into host memory is done before sending out
  7830. * this message. This message indicates only how many MSDUs to reap. The
  7831. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  7832. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  7833. * DMA'd by the MAC directly into host memory these packets do not contain
  7834. * the MAC descriptors in the header portion of the packet. Instead they contain
  7835. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  7836. * message, the packets are delivered directly to the NW stack without going
  7837. * through the regular reorder buffering and PN checking path since it has
  7838. * already been done in target.
  7839. *
  7840. * |31 24|23 16|15 8|7 0|
  7841. * |-----------------------------------------------------------------------|
  7842. * | Total MSDU count | reserved | msg type |
  7843. * |-----------------------------------------------------------------------|
  7844. *
  7845. * @brief target -> host rx offload deliver message for HL system
  7846. *
  7847. * @details
  7848. * In a high latency system this message is sent whenever the offload manager
  7849. * flushes out the packets it has coalesced in its coalescing buffer. The
  7850. * actual packets are also carried along with this message. When the host
  7851. * receives this message, it is expected to deliver these packets to the NW
  7852. * stack directly instead of routing them through the reorder buffering and
  7853. * PN checking path since it has already been done in target.
  7854. *
  7855. * |31 24|23 16|15 8|7 0|
  7856. * |-----------------------------------------------------------------------|
  7857. * | Total MSDU count | reserved | msg type |
  7858. * |-----------------------------------------------------------------------|
  7859. * | peer ID | MSDU length |
  7860. * |-----------------------------------------------------------------------|
  7861. * | MSDU payload | FW Desc | tid | vdev ID |
  7862. * |-----------------------------------------------------------------------|
  7863. * | MSDU payload contd. |
  7864. * |-----------------------------------------------------------------------|
  7865. * | peer ID | MSDU length |
  7866. * |-----------------------------------------------------------------------|
  7867. * | MSDU payload | FW Desc | tid | vdev ID |
  7868. * |-----------------------------------------------------------------------|
  7869. * | MSDU payload contd. |
  7870. * |-----------------------------------------------------------------------|
  7871. *
  7872. */
  7873. /* first DWORD */
  7874. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  7875. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  7876. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  7877. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  7878. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  7879. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  7880. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  7881. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  7882. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  7883. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  7884. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  7885. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  7886. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  7887. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  7888. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  7889. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  7890. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  7891. do { \
  7892. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  7893. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  7894. } while (0)
  7895. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  7896. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  7897. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  7898. do { \
  7899. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  7900. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  7901. } while (0)
  7902. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  7903. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  7904. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  7905. do { \
  7906. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  7907. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  7908. } while (0)
  7909. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  7910. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  7911. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  7912. do { \
  7913. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  7914. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  7915. } while (0)
  7916. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  7917. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  7918. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  7919. do { \
  7920. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  7921. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  7922. } while (0)
  7923. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  7924. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  7925. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  7926. do { \
  7927. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  7928. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  7929. } while (0)
  7930. /**
  7931. * @brief target -> host rx peer map/unmap message definition
  7932. *
  7933. * @details
  7934. * The following diagram shows the format of the rx peer map message sent
  7935. * from the target to the host. This layout assumes the target operates
  7936. * as little-endian.
  7937. *
  7938. * This message always contains a SW peer ID. The main purpose of the
  7939. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  7940. * with, so that the host can use that peer ID to determine which peer
  7941. * transmitted the rx frame. This SW peer ID is sometimes also used for
  7942. * other purposes, such as identifying during tx completions which peer
  7943. * the tx frames in question were transmitted to.
  7944. *
  7945. * In certain generations of chips, the peer map message also contains
  7946. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  7947. * to identify which peer the frame needs to be forwarded to (i.e. the
  7948. * peer assocated with the Destination MAC Address within the packet),
  7949. * and particularly which vdev needs to transmit the frame (for cases
  7950. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  7951. * meaning as AST_INDEX_0.
  7952. * This DA-based peer ID that is provided for certain rx frames
  7953. * (the rx frames that need to be re-transmitted as tx frames)
  7954. * is the ID that the HW uses for referring to the peer in question,
  7955. * rather than the peer ID that the SW+FW use to refer to the peer.
  7956. *
  7957. *
  7958. * |31 24|23 16|15 8|7 0|
  7959. * |-----------------------------------------------------------------------|
  7960. * | SW peer ID | VDEV ID | msg type |
  7961. * |-----------------------------------------------------------------------|
  7962. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7963. * |-----------------------------------------------------------------------|
  7964. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  7965. * |-----------------------------------------------------------------------|
  7966. *
  7967. *
  7968. * The following diagram shows the format of the rx peer unmap message sent
  7969. * from the target to the host.
  7970. *
  7971. * |31 24|23 16|15 8|7 0|
  7972. * |-----------------------------------------------------------------------|
  7973. * | SW peer ID | VDEV ID | msg type |
  7974. * |-----------------------------------------------------------------------|
  7975. *
  7976. * The following field definitions describe the format of the rx peer map
  7977. * and peer unmap messages sent from the target to the host.
  7978. * - MSG_TYPE
  7979. * Bits 7:0
  7980. * Purpose: identifies this as an rx peer map or peer unmap message
  7981. * Value: peer map -> 0x3, peer unmap -> 0x4
  7982. * - VDEV_ID
  7983. * Bits 15:8
  7984. * Purpose: Indicates which virtual device the peer is associated
  7985. * with.
  7986. * Value: vdev ID (used in the host to look up the vdev object)
  7987. * - PEER_ID (a.k.a. SW_PEER_ID)
  7988. * Bits 31:16
  7989. * Purpose: The peer ID (index) that WAL is allocating (map) or
  7990. * freeing (unmap)
  7991. * Value: (rx) peer ID
  7992. * - MAC_ADDR_L32 (peer map only)
  7993. * Bits 31:0
  7994. * Purpose: Identifies which peer node the peer ID is for.
  7995. * Value: lower 4 bytes of peer node's MAC address
  7996. * - MAC_ADDR_U16 (peer map only)
  7997. * Bits 15:0
  7998. * Purpose: Identifies which peer node the peer ID is for.
  7999. * Value: upper 2 bytes of peer node's MAC address
  8000. * - HW_PEER_ID
  8001. * Bits 31:16
  8002. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8003. * address, so for rx frames marked for rx --> tx forwarding, the
  8004. * host can determine from the HW peer ID provided as meta-data with
  8005. * the rx frame which peer the frame is supposed to be forwarded to.
  8006. * Value: ID used by the MAC HW to identify the peer
  8007. */
  8008. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  8009. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  8010. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  8011. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  8012. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  8013. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  8014. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  8015. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  8016. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  8017. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  8018. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  8019. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  8020. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  8021. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  8022. do { \
  8023. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  8024. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  8025. } while (0)
  8026. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  8027. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  8028. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  8029. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  8030. do { \
  8031. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  8032. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  8033. } while (0)
  8034. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  8035. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  8036. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  8037. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  8038. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  8039. do { \
  8040. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  8041. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  8042. } while (0)
  8043. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  8044. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  8045. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  8046. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  8047. #define HTT_RX_PEER_MAP_BYTES 12
  8048. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  8049. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  8050. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  8051. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  8052. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  8053. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  8054. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  8055. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  8056. #define HTT_RX_PEER_UNMAP_BYTES 4
  8057. /**
  8058. * @brief target -> host rx peer map V2 message definition
  8059. *
  8060. * @details
  8061. * The following diagram shows the format of the rx peer map v2 message sent
  8062. * from the target to the host. This layout assumes the target operates
  8063. * as little-endian.
  8064. *
  8065. * This message always contains a SW peer ID. The main purpose of the
  8066. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8067. * with, so that the host can use that peer ID to determine which peer
  8068. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8069. * other purposes, such as identifying during tx completions which peer
  8070. * the tx frames in question were transmitted to.
  8071. *
  8072. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  8073. * is used during rx --> tx frame forwarding to identify which peer the
  8074. * frame needs to be forwarded to (i.e. the peer assocated with the
  8075. * Destination MAC Address within the packet), and particularly which vdev
  8076. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  8077. * This DA-based peer ID that is provided for certain rx frames
  8078. * (the rx frames that need to be re-transmitted as tx frames)
  8079. * is the ID that the HW uses for referring to the peer in question,
  8080. * rather than the peer ID that the SW+FW use to refer to the peer.
  8081. *
  8082. * The HW peer id here is the same meaning as AST_INDEX_0.
  8083. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  8084. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  8085. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  8086. * AST is valid.
  8087. *
  8088. * |31 28|27 24|23 20|19 17|16|15 8|7 0|
  8089. * |-----------------------------------------------------------------------|
  8090. * | SW peer ID | VDEV ID | msg type |
  8091. * |-----------------------------------------------------------------------|
  8092. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8093. * |-----------------------------------------------------------------------|
  8094. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8095. * |-----------------------------------------------------------------------|
  8096. * | Reserved_20_31 |ASTVM|NH| AST Hash Value |
  8097. * |-----------------------------------------------------------------------|
  8098. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  8099. * |-----------------------------------------------------------------------|
  8100. * |TID valid low pri| TID valid hi pri| AST index 2 |
  8101. * |-----------------------------------------------------------------------|
  8102. * | Reserved_1 | AST index 3 |
  8103. * |-----------------------------------------------------------------------|
  8104. * | Reserved_2 |
  8105. * |-----------------------------------------------------------------------|
  8106. * Where:
  8107. * NH = Next Hop
  8108. * ASTVM = AST valid mask
  8109. * ASTFM = AST flow mask
  8110. *
  8111. * The following field definitions describe the format of the rx peer map v2
  8112. * messages sent from the target to the host.
  8113. * - MSG_TYPE
  8114. * Bits 7:0
  8115. * Purpose: identifies this as an rx peer map v2 message
  8116. * Value: peer map v2 -> 0x1e
  8117. * - VDEV_ID
  8118. * Bits 15:8
  8119. * Purpose: Indicates which virtual device the peer is associated with.
  8120. * Value: vdev ID (used in the host to look up the vdev object)
  8121. * - SW_PEER_ID
  8122. * Bits 31:16
  8123. * Purpose: The peer ID (index) that WAL is allocating
  8124. * Value: (rx) peer ID
  8125. * - MAC_ADDR_L32
  8126. * Bits 31:0
  8127. * Purpose: Identifies which peer node the peer ID is for.
  8128. * Value: lower 4 bytes of peer node's MAC address
  8129. * - MAC_ADDR_U16
  8130. * Bits 15:0
  8131. * Purpose: Identifies which peer node the peer ID is for.
  8132. * Value: upper 2 bytes of peer node's MAC address
  8133. * - HW_PEER_ID / AST_INDEX_0
  8134. * Bits 31:16
  8135. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8136. * address, so for rx frames marked for rx --> tx forwarding, the
  8137. * host can determine from the HW peer ID provided as meta-data with
  8138. * the rx frame which peer the frame is supposed to be forwarded to.
  8139. * Value: ID used by the MAC HW to identify the peer
  8140. * - AST_HASH_VALUE
  8141. * Bits 15:0
  8142. * Purpose: Indicates AST Hash value is required for the TCL AST index
  8143. * override feature.
  8144. * - NEXT_HOP
  8145. * Bit 16
  8146. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  8147. * (Wireless Distribution System).
  8148. * - AST_VALID_MASK
  8149. * Bits 19:17
  8150. * Purpose: Indicate if the AST 1 through AST 3 are valid
  8151. * - AST_INDEX_1
  8152. * Bits 15:0
  8153. * Purpose: indicate the second AST index for this peer
  8154. * - AST_0_FLOW_MASK
  8155. * Bits 19:16
  8156. * Purpose: identify the which flow the AST 0 entry corresponds to.
  8157. * - AST_1_FLOW_MASK
  8158. * Bits 23:20
  8159. * Purpose: identify the which flow the AST 1 entry corresponds to.
  8160. * - AST_2_FLOW_MASK
  8161. * Bits 27:24
  8162. * Purpose: identify the which flow the AST 2 entry corresponds to.
  8163. * - AST_3_FLOW_MASK
  8164. * Bits 31:28
  8165. * Purpose: identify the which flow the AST 3 entry corresponds to.
  8166. * - AST_INDEX_2
  8167. * Bits 15:0
  8168. * Purpose: indicate the third AST index for this peer
  8169. * - TID_VALID_HI_PRI
  8170. * Bits 23:16
  8171. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  8172. * - TID_VALID_LOW_PRI
  8173. * Bits 31:24
  8174. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  8175. * - AST_INDEX_3
  8176. * Bits 15:0
  8177. * Purpose: indicate the fourth AST index for this peer
  8178. */
  8179. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  8180. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  8181. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  8182. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  8183. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  8184. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  8185. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  8186. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  8187. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  8188. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  8189. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  8190. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  8191. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  8192. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  8193. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  8194. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  8195. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  8196. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  8197. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  8198. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  8199. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  8200. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  8201. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  8202. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  8203. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  8204. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  8205. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  8206. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  8207. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  8208. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  8209. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  8210. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  8211. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  8212. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  8213. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  8214. do { \
  8215. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  8216. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  8217. } while (0)
  8218. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  8219. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  8220. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  8221. do { \
  8222. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  8223. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  8224. } while (0)
  8225. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  8226. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  8227. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  8228. do { \
  8229. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  8230. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  8231. } while (0)
  8232. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  8233. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  8234. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  8235. do { \
  8236. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  8237. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  8238. } while (0)
  8239. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  8240. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  8241. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  8242. do { \
  8243. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  8244. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  8245. } while (0)
  8246. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  8247. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  8248. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  8249. do { \
  8250. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  8251. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  8252. } while (0)
  8253. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  8254. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  8255. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  8256. do { \
  8257. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  8258. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  8259. } while (0)
  8260. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  8261. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  8262. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  8263. do { \
  8264. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  8265. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  8266. } while (0)
  8267. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  8268. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  8269. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  8270. do { \
  8271. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  8272. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  8273. } while (0)
  8274. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  8275. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  8276. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  8277. do { \
  8278. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  8279. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  8280. } while (0)
  8281. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  8282. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  8283. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  8284. do { \
  8285. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  8286. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  8287. } while (0)
  8288. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  8289. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  8290. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  8291. do { \
  8292. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  8293. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  8294. } while (0)
  8295. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  8296. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  8297. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  8298. do { \
  8299. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  8300. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  8301. } while (0)
  8302. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  8303. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  8304. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  8305. do { \
  8306. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  8307. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  8308. } while (0)
  8309. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  8310. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  8311. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  8312. do { \
  8313. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  8314. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  8315. } while (0)
  8316. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  8317. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  8318. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8319. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  8320. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  8321. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  8322. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  8323. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  8324. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  8325. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  8326. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  8327. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  8328. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  8329. #define HTT_RX_PEER_MAP_V2_BYTES 32
  8330. /**
  8331. * @brief target -> host rx peer unmap V2 message definition
  8332. *
  8333. *
  8334. * The following diagram shows the format of the rx peer unmap message sent
  8335. * from the target to the host.
  8336. *
  8337. * |31 24|23 16|15 8|7 0|
  8338. * |-----------------------------------------------------------------------|
  8339. * | SW peer ID | VDEV ID | msg type |
  8340. * |-----------------------------------------------------------------------|
  8341. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8342. * |-----------------------------------------------------------------------|
  8343. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  8344. * |-----------------------------------------------------------------------|
  8345. * | Peer Delete Duration |
  8346. * |-----------------------------------------------------------------------|
  8347. * | Reserved_0 |
  8348. * |-----------------------------------------------------------------------|
  8349. * | Reserved_1 |
  8350. * |-----------------------------------------------------------------------|
  8351. * | Reserved_2 |
  8352. * |-----------------------------------------------------------------------|
  8353. *
  8354. *
  8355. * The following field definitions describe the format of the rx peer unmap
  8356. * messages sent from the target to the host.
  8357. * - MSG_TYPE
  8358. * Bits 7:0
  8359. * Purpose: identifies this as an rx peer unmap v2 message
  8360. * Value: peer unmap v2 -> 0x1f
  8361. * - VDEV_ID
  8362. * Bits 15:8
  8363. * Purpose: Indicates which virtual device the peer is associated
  8364. * with.
  8365. * Value: vdev ID (used in the host to look up the vdev object)
  8366. * - SW_PEER_ID
  8367. * Bits 31:16
  8368. * Purpose: The peer ID (index) that WAL is freeing
  8369. * Value: (rx) peer ID
  8370. * - MAC_ADDR_L32
  8371. * Bits 31:0
  8372. * Purpose: Identifies which peer node the peer ID is for.
  8373. * Value: lower 4 bytes of peer node's MAC address
  8374. * - MAC_ADDR_U16
  8375. * Bits 15:0
  8376. * Purpose: Identifies which peer node the peer ID is for.
  8377. * Value: upper 2 bytes of peer node's MAC address
  8378. * - NEXT_HOP
  8379. * Bits 16
  8380. * Purpose: Bit indicates next_hop AST entry used for WDS
  8381. * (Wireless Distribution System).
  8382. * - PEER_DELETE_DURATION
  8383. * Bits 31:0
  8384. * Purpose: Time taken to delete peer, in msec,
  8385. * Used for monitoring / debugging PEER delete response delay
  8386. */
  8387. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  8388. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  8389. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  8390. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  8391. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  8392. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  8393. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  8394. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  8395. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  8396. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  8397. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  8398. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  8399. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  8400. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  8401. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  8402. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  8403. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  8404. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  8405. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  8406. do { \
  8407. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  8408. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  8409. } while (0)
  8410. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  8411. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  8412. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8413. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  8414. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  8415. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  8416. /**
  8417. * @brief target -> host message specifying security parameters
  8418. *
  8419. * @details
  8420. * The following diagram shows the format of the security specification
  8421. * message sent from the target to the host.
  8422. * This security specification message tells the host whether a PN check is
  8423. * necessary on rx data frames, and if so, how large the PN counter is.
  8424. * This message also tells the host about the security processing to apply
  8425. * to defragmented rx frames - specifically, whether a Message Integrity
  8426. * Check is required, and the Michael key to use.
  8427. *
  8428. * |31 24|23 16|15|14 8|7 0|
  8429. * |-----------------------------------------------------------------------|
  8430. * | peer ID | U| security type | msg type |
  8431. * |-----------------------------------------------------------------------|
  8432. * | Michael Key K0 |
  8433. * |-----------------------------------------------------------------------|
  8434. * | Michael Key K1 |
  8435. * |-----------------------------------------------------------------------|
  8436. * | WAPI RSC Low0 |
  8437. * |-----------------------------------------------------------------------|
  8438. * | WAPI RSC Low1 |
  8439. * |-----------------------------------------------------------------------|
  8440. * | WAPI RSC Hi0 |
  8441. * |-----------------------------------------------------------------------|
  8442. * | WAPI RSC Hi1 |
  8443. * |-----------------------------------------------------------------------|
  8444. *
  8445. * The following field definitions describe the format of the security
  8446. * indication message sent from the target to the host.
  8447. * - MSG_TYPE
  8448. * Bits 7:0
  8449. * Purpose: identifies this as a security specification message
  8450. * Value: 0xb
  8451. * - SEC_TYPE
  8452. * Bits 14:8
  8453. * Purpose: specifies which type of security applies to the peer
  8454. * Value: htt_sec_type enum value
  8455. * - UNICAST
  8456. * Bit 15
  8457. * Purpose: whether this security is applied to unicast or multicast data
  8458. * Value: 1 -> unicast, 0 -> multicast
  8459. * - PEER_ID
  8460. * Bits 31:16
  8461. * Purpose: The ID number for the peer the security specification is for
  8462. * Value: peer ID
  8463. * - MICHAEL_KEY_K0
  8464. * Bits 31:0
  8465. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  8466. * Value: Michael Key K0 (if security type is TKIP)
  8467. * - MICHAEL_KEY_K1
  8468. * Bits 31:0
  8469. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  8470. * Value: Michael Key K1 (if security type is TKIP)
  8471. * - WAPI_RSC_LOW0
  8472. * Bits 31:0
  8473. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  8474. * Value: WAPI RSC Low0 (if security type is WAPI)
  8475. * - WAPI_RSC_LOW1
  8476. * Bits 31:0
  8477. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  8478. * Value: WAPI RSC Low1 (if security type is WAPI)
  8479. * - WAPI_RSC_HI0
  8480. * Bits 31:0
  8481. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  8482. * Value: WAPI RSC Hi0 (if security type is WAPI)
  8483. * - WAPI_RSC_HI1
  8484. * Bits 31:0
  8485. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  8486. * Value: WAPI RSC Hi1 (if security type is WAPI)
  8487. */
  8488. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  8489. #define HTT_SEC_IND_SEC_TYPE_S 8
  8490. #define HTT_SEC_IND_UNICAST_M 0x00008000
  8491. #define HTT_SEC_IND_UNICAST_S 15
  8492. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  8493. #define HTT_SEC_IND_PEER_ID_S 16
  8494. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  8495. do { \
  8496. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  8497. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  8498. } while (0)
  8499. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  8500. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  8501. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  8502. do { \
  8503. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  8504. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  8505. } while (0)
  8506. #define HTT_SEC_IND_UNICAST_GET(word) \
  8507. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  8508. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  8509. do { \
  8510. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  8511. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  8512. } while (0)
  8513. #define HTT_SEC_IND_PEER_ID_GET(word) \
  8514. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  8515. #define HTT_SEC_IND_BYTES 28
  8516. /**
  8517. * @brief target -> host rx ADDBA / DELBA message definitions
  8518. *
  8519. * @details
  8520. * The following diagram shows the format of the rx ADDBA message sent
  8521. * from the target to the host:
  8522. *
  8523. * |31 20|19 16|15 8|7 0|
  8524. * |---------------------------------------------------------------------|
  8525. * | peer ID | TID | window size | msg type |
  8526. * |---------------------------------------------------------------------|
  8527. *
  8528. * The following diagram shows the format of the rx DELBA message sent
  8529. * from the target to the host:
  8530. *
  8531. * |31 20|19 16|15 10|9 8|7 0|
  8532. * |---------------------------------------------------------------------|
  8533. * | peer ID | TID | reserved | IR| msg type |
  8534. * |---------------------------------------------------------------------|
  8535. *
  8536. * The following field definitions describe the format of the rx ADDBA
  8537. * and DELBA messages sent from the target to the host.
  8538. * - MSG_TYPE
  8539. * Bits 7:0
  8540. * Purpose: identifies this as an rx ADDBA or DELBA message
  8541. * Value: ADDBA -> 0x5, DELBA -> 0x6
  8542. * - IR (initiator / recipient)
  8543. * Bits 9:8 (DELBA only)
  8544. * Purpose: specify whether the DELBA handshake was initiated by the
  8545. * local STA/AP, or by the peer STA/AP
  8546. * Value:
  8547. * 0 - unspecified
  8548. * 1 - initiator (a.k.a. originator)
  8549. * 2 - recipient (a.k.a. responder)
  8550. * 3 - unused / reserved
  8551. * - WIN_SIZE
  8552. * Bits 15:8 (ADDBA only)
  8553. * Purpose: Specifies the length of the block ack window (max = 64).
  8554. * Value:
  8555. * block ack window length specified by the received ADDBA
  8556. * management message.
  8557. * - TID
  8558. * Bits 19:16
  8559. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  8560. * Value:
  8561. * TID specified by the received ADDBA or DELBA management message.
  8562. * - PEER_ID
  8563. * Bits 31:20
  8564. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  8565. * Value:
  8566. * ID (hash value) used by the host for fast, direct lookup of
  8567. * host SW peer info, including rx reorder states.
  8568. */
  8569. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  8570. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  8571. #define HTT_RX_ADDBA_TID_M 0xf0000
  8572. #define HTT_RX_ADDBA_TID_S 16
  8573. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  8574. #define HTT_RX_ADDBA_PEER_ID_S 20
  8575. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  8576. do { \
  8577. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  8578. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  8579. } while (0)
  8580. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  8581. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  8582. #define HTT_RX_ADDBA_TID_SET(word, value) \
  8583. do { \
  8584. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  8585. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  8586. } while (0)
  8587. #define HTT_RX_ADDBA_TID_GET(word) \
  8588. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  8589. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  8590. do { \
  8591. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  8592. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  8593. } while (0)
  8594. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  8595. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  8596. #define HTT_RX_ADDBA_BYTES 4
  8597. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  8598. #define HTT_RX_DELBA_INITIATOR_S 8
  8599. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  8600. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  8601. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  8602. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  8603. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  8604. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  8605. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  8606. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  8607. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  8608. do { \
  8609. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  8610. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  8611. } while (0)
  8612. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  8613. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  8614. #define HTT_RX_DELBA_BYTES 4
  8615. /**
  8616. * @brief tx queue group information element definition
  8617. *
  8618. * @details
  8619. * The following diagram shows the format of the tx queue group
  8620. * information element, which can be included in target --> host
  8621. * messages to specify the number of tx "credits" (tx descriptors
  8622. * for LL, or tx buffers for HL) available to a particular group
  8623. * of host-side tx queues, and which host-side tx queues belong to
  8624. * the group.
  8625. *
  8626. * |31|30 24|23 16|15|14|13 0|
  8627. * |------------------------------------------------------------------------|
  8628. * | X| reserved | tx queue grp ID | A| S| credit count |
  8629. * |------------------------------------------------------------------------|
  8630. * | vdev ID mask | AC mask |
  8631. * |------------------------------------------------------------------------|
  8632. *
  8633. * The following definitions describe the fields within the tx queue group
  8634. * information element:
  8635. * - credit_count
  8636. * Bits 13:1
  8637. * Purpose: specify how many tx credits are available to the tx queue group
  8638. * Value: An absolute or relative, positive or negative credit value
  8639. * The 'A' bit specifies whether the value is absolute or relative.
  8640. * The 'S' bit specifies whether the value is positive or negative.
  8641. * A negative value can only be relative, not absolute.
  8642. * An absolute value replaces any prior credit value the host has for
  8643. * the tx queue group in question.
  8644. * A relative value is added to the prior credit value the host has for
  8645. * the tx queue group in question.
  8646. * - sign
  8647. * Bit 14
  8648. * Purpose: specify whether the credit count is positive or negative
  8649. * Value: 0 -> positive, 1 -> negative
  8650. * - absolute
  8651. * Bit 15
  8652. * Purpose: specify whether the credit count is absolute or relative
  8653. * Value: 0 -> relative, 1 -> absolute
  8654. * - txq_group_id
  8655. * Bits 23:16
  8656. * Purpose: indicate which tx queue group's credit and/or membership are
  8657. * being specified
  8658. * Value: 0 to max_tx_queue_groups-1
  8659. * - reserved
  8660. * Bits 30:16
  8661. * Value: 0x0
  8662. * - eXtension
  8663. * Bit 31
  8664. * Purpose: specify whether another tx queue group info element follows
  8665. * Value: 0 -> no more tx queue group information elements
  8666. * 1 -> another tx queue group information element immediately follows
  8667. * - ac_mask
  8668. * Bits 15:0
  8669. * Purpose: specify which Access Categories belong to the tx queue group
  8670. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  8671. * the tx queue group.
  8672. * The AC bit-mask values are obtained by left-shifting by the
  8673. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  8674. * - vdev_id_mask
  8675. * Bits 31:16
  8676. * Purpose: specify which vdev's tx queues belong to the tx queue group
  8677. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  8678. * belong to the tx queue group.
  8679. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  8680. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  8681. */
  8682. PREPACK struct htt_txq_group {
  8683. A_UINT32
  8684. credit_count: 14,
  8685. sign: 1,
  8686. absolute: 1,
  8687. tx_queue_group_id: 8,
  8688. reserved0: 7,
  8689. extension: 1;
  8690. A_UINT32
  8691. ac_mask: 16,
  8692. vdev_id_mask: 16;
  8693. } POSTPACK;
  8694. /* first word */
  8695. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  8696. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  8697. #define HTT_TXQ_GROUP_SIGN_S 14
  8698. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  8699. #define HTT_TXQ_GROUP_ABS_S 15
  8700. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  8701. #define HTT_TXQ_GROUP_ID_S 16
  8702. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  8703. #define HTT_TXQ_GROUP_EXT_S 31
  8704. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  8705. /* second word */
  8706. #define HTT_TXQ_GROUP_AC_MASK_S 0
  8707. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  8708. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  8709. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  8710. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  8711. do { \
  8712. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  8713. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  8714. } while (0)
  8715. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  8716. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  8717. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  8718. do { \
  8719. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  8720. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  8721. } while (0)
  8722. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  8723. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  8724. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  8725. do { \
  8726. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  8727. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  8728. } while (0)
  8729. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  8730. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  8731. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  8732. do { \
  8733. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  8734. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  8735. } while (0)
  8736. #define HTT_TXQ_GROUP_ID_GET(_info) \
  8737. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  8738. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  8739. do { \
  8740. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  8741. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  8742. } while (0)
  8743. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  8744. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  8745. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  8746. do { \
  8747. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  8748. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  8749. } while (0)
  8750. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  8751. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  8752. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  8753. do { \
  8754. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  8755. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  8756. } while (0)
  8757. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  8758. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  8759. /**
  8760. * @brief target -> host TX completion indication message definition
  8761. *
  8762. * @details
  8763. * The following diagram shows the format of the TX completion indication sent
  8764. * from the target to the host
  8765. *
  8766. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  8767. * |-------------------------------------------------------------------|
  8768. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  8769. * |-------------------------------------------------------------------|
  8770. * payload:| MSDU1 ID | MSDU0 ID |
  8771. * |-------------------------------------------------------------------|
  8772. * : MSDU3 ID | MSDU2 ID :
  8773. * |-------------------------------------------------------------------|
  8774. * | struct htt_tx_compl_ind_append_retries |
  8775. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8776. * | struct htt_tx_compl_ind_append_tx_tstamp |
  8777. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8778. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  8779. * |-------------------------------------------------------------------|
  8780. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  8781. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8782. * | MSDU0 tx_tsf64_low |
  8783. * |-------------------------------------------------------------------|
  8784. * | MSDU0 tx_tsf64_high |
  8785. * |-------------------------------------------------------------------|
  8786. * | MSDU1 tx_tsf64_low |
  8787. * |-------------------------------------------------------------------|
  8788. * | MSDU1 tx_tsf64_high |
  8789. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8790. * | phy_timestamp |
  8791. * |-------------------------------------------------------------------|
  8792. * | rate specs (see below) |
  8793. * |-------------------------------------------------------------------|
  8794. * | seqctrl | framectrl |
  8795. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8796. * Where:
  8797. * A0 = append (a.k.a. append0)
  8798. * A1 = append1
  8799. * TP = MSDU tx power presence
  8800. * A2 = append2
  8801. * A3 = append3
  8802. * A4 = append4
  8803. *
  8804. * The following field definitions describe the format of the TX completion
  8805. * indication sent from the target to the host
  8806. * Header fields:
  8807. * - msg_type
  8808. * Bits 7:0
  8809. * Purpose: identifies this as HTT TX completion indication
  8810. * Value: 0x7
  8811. * - status
  8812. * Bits 10:8
  8813. * Purpose: the TX completion status of payload fragmentations descriptors
  8814. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  8815. * - tid
  8816. * Bits 14:11
  8817. * Purpose: the tid associated with those fragmentation descriptors. It is
  8818. * valid or not, depending on the tid_invalid bit.
  8819. * Value: 0 to 15
  8820. * - tid_invalid
  8821. * Bits 15:15
  8822. * Purpose: this bit indicates whether the tid field is valid or not
  8823. * Value: 0 indicates valid; 1 indicates invalid
  8824. * - num
  8825. * Bits 23:16
  8826. * Purpose: the number of payload in this indication
  8827. * Value: 1 to 255
  8828. * - append (a.k.a. append0)
  8829. * Bits 24:24
  8830. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  8831. * the number of tx retries for one MSDU at the end of this message
  8832. * Value: 0 indicates no appending; 1 indicates appending
  8833. * - append1
  8834. * Bits 25:25
  8835. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  8836. * contains the timestamp info for each TX msdu id in payload.
  8837. * The order of the timestamps matches the order of the MSDU IDs.
  8838. * Note that a big-endian host needs to account for the reordering
  8839. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  8840. * conversion) when determining which tx timestamp corresponds to
  8841. * which MSDU ID.
  8842. * Value: 0 indicates no appending; 1 indicates appending
  8843. * - msdu_tx_power_presence
  8844. * Bits 26:26
  8845. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  8846. * for each MSDU referenced by the TX_COMPL_IND message.
  8847. * The tx power is reported in 0.5 dBm units.
  8848. * The order of the per-MSDU tx power reports matches the order
  8849. * of the MSDU IDs.
  8850. * Note that a big-endian host needs to account for the reordering
  8851. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  8852. * conversion) when determining which Tx Power corresponds to
  8853. * which MSDU ID.
  8854. * Value: 0 indicates MSDU tx power reports are not appended,
  8855. * 1 indicates MSDU tx power reports are appended
  8856. * - append2
  8857. * Bits 27:27
  8858. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  8859. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  8860. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  8861. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  8862. * for each MSDU, for convenience.
  8863. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  8864. * this append2 bit is set).
  8865. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  8866. * dB above the noise floor.
  8867. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  8868. * 1 indicates MSDU ACK RSSI values are appended.
  8869. * - append3
  8870. * Bits 28:28
  8871. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  8872. * contains the tx tsf info based on wlan global TSF for
  8873. * each TX msdu id in payload.
  8874. * The order of the tx tsf matches the order of the MSDU IDs.
  8875. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  8876. * values to indicate the the lower 32 bits and higher 32 bits of
  8877. * the tx tsf.
  8878. * The tx_tsf64 here represents the time MSDU was acked and the
  8879. * tx_tsf64 has microseconds units.
  8880. * Value: 0 indicates no appending; 1 indicates appending
  8881. * - append4
  8882. * Bits 29:29
  8883. * Purpose: Indicate whether data frame control fields and fields required
  8884. * for radio tap header are appended for each MSDU in TX_COMP_IND
  8885. * message. The order of the this message matches the order of
  8886. * the MSDU IDs.
  8887. * Value: 0 indicates frame control fields and fields required for
  8888. * radio tap header values are not appended,
  8889. * 1 indicates frame control fields and fields required for
  8890. * radio tap header values are appended.
  8891. * Payload fields:
  8892. * - hmsdu_id
  8893. * Bits 15:0
  8894. * Purpose: this ID is used to track the Tx buffer in host
  8895. * Value: 0 to "size of host MSDU descriptor pool - 1"
  8896. */
  8897. PREPACK struct htt_tx_data_hdr_information {
  8898. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  8899. A_UINT32 /* word 1 */
  8900. /* preamble:
  8901. * 0-OFDM,
  8902. * 1-CCk,
  8903. * 2-HT,
  8904. * 3-VHT
  8905. */
  8906. preamble: 2, /* [1:0] */
  8907. /* mcs:
  8908. * In case of HT preamble interpret
  8909. * MCS along with NSS.
  8910. * Valid values for HT are 0 to 7.
  8911. * HT mcs 0 with NSS 2 is mcs 8.
  8912. * Valid values for VHT are 0 to 9.
  8913. */
  8914. mcs: 4, /* [5:2] */
  8915. /* rate:
  8916. * This is applicable only for
  8917. * CCK and OFDM preamble type
  8918. * rate 0: OFDM 48 Mbps,
  8919. * 1: OFDM 24 Mbps,
  8920. * 2: OFDM 12 Mbps
  8921. * 3: OFDM 6 Mbps
  8922. * 4: OFDM 54 Mbps
  8923. * 5: OFDM 36 Mbps
  8924. * 6: OFDM 18 Mbps
  8925. * 7: OFDM 9 Mbps
  8926. * rate 0: CCK 11 Mbps Long
  8927. * 1: CCK 5.5 Mbps Long
  8928. * 2: CCK 2 Mbps Long
  8929. * 3: CCK 1 Mbps Long
  8930. * 4: CCK 11 Mbps Short
  8931. * 5: CCK 5.5 Mbps Short
  8932. * 6: CCK 2 Mbps Short
  8933. */
  8934. rate : 3, /* [ 8: 6] */
  8935. rssi : 8, /* [16: 9] units=dBm */
  8936. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  8937. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  8938. stbc : 1, /* [22] */
  8939. sgi : 1, /* [23] */
  8940. ldpc : 1, /* [24] */
  8941. beamformed: 1, /* [25] */
  8942. /* tx_retry_cnt:
  8943. * Indicates retry count of data tx frames provided by the host.
  8944. */
  8945. tx_retry_cnt: 6; /* [31:26] */
  8946. A_UINT32 /* word 2 */
  8947. framectrl:16, /* [15: 0] */
  8948. seqno:16; /* [31:16] */
  8949. } POSTPACK;
  8950. #define HTT_TX_COMPL_IND_STATUS_S 8
  8951. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  8952. #define HTT_TX_COMPL_IND_TID_S 11
  8953. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  8954. #define HTT_TX_COMPL_IND_TID_INV_S 15
  8955. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  8956. #define HTT_TX_COMPL_IND_NUM_S 16
  8957. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  8958. #define HTT_TX_COMPL_IND_APPEND_S 24
  8959. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  8960. #define HTT_TX_COMPL_IND_APPEND1_S 25
  8961. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  8962. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  8963. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  8964. #define HTT_TX_COMPL_IND_APPEND2_S 27
  8965. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  8966. #define HTT_TX_COMPL_IND_APPEND3_S 28
  8967. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  8968. #define HTT_TX_COMPL_IND_APPEND4_S 29
  8969. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  8970. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  8971. do { \
  8972. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  8973. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  8974. } while (0)
  8975. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  8976. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  8977. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  8978. do { \
  8979. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  8980. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  8981. } while (0)
  8982. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  8983. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  8984. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  8985. do { \
  8986. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  8987. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  8988. } while (0)
  8989. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  8990. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  8991. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  8992. do { \
  8993. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  8994. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  8995. } while (0)
  8996. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  8997. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  8998. HTT_TX_COMPL_IND_TID_INV_S)
  8999. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  9000. do { \
  9001. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  9002. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  9003. } while (0)
  9004. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  9005. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  9006. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  9007. do { \
  9008. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  9009. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  9010. } while (0)
  9011. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  9012. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  9013. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  9014. do { \
  9015. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  9016. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  9017. } while (0)
  9018. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  9019. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  9020. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  9021. do { \
  9022. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  9023. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  9024. } while (0)
  9025. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  9026. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  9027. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  9028. do { \
  9029. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  9030. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  9031. } while (0)
  9032. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  9033. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  9034. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  9035. do { \
  9036. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  9037. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  9038. } while (0)
  9039. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  9040. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  9041. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  9042. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  9043. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  9044. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  9045. #define HTT_TX_COMPL_IND_STAT_OK 0
  9046. /* DISCARD:
  9047. * current meaning:
  9048. * MSDUs were queued for transmission but filtered by HW or SW
  9049. * without any over the air attempts
  9050. * legacy meaning (HL Rome):
  9051. * MSDUs were discarded by the target FW without any over the air
  9052. * attempts due to lack of space
  9053. */
  9054. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  9055. /* NO_ACK:
  9056. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  9057. */
  9058. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  9059. /* POSTPONE:
  9060. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  9061. * be downloaded again later (in the appropriate order), when they are
  9062. * deliverable.
  9063. */
  9064. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  9065. /*
  9066. * The PEER_DEL tx completion status is used for HL cases
  9067. * where the peer the frame is for has been deleted.
  9068. * The host has already discarded its copy of the frame, but
  9069. * it still needs the tx completion to restore its credit.
  9070. */
  9071. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  9072. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  9073. #define HTT_TX_COMPL_IND_STAT_DROP 5
  9074. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  9075. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  9076. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  9077. PREPACK struct htt_tx_compl_ind_base {
  9078. A_UINT32 hdr;
  9079. A_UINT16 payload[1/*or more*/];
  9080. } POSTPACK;
  9081. PREPACK struct htt_tx_compl_ind_append_retries {
  9082. A_UINT16 msdu_id;
  9083. A_UINT8 tx_retries;
  9084. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  9085. 0: this is the last append_retries struct */
  9086. } POSTPACK;
  9087. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  9088. A_UINT32 timestamp[1/*or more*/];
  9089. } POSTPACK;
  9090. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  9091. A_UINT32 tx_tsf64_low;
  9092. A_UINT32 tx_tsf64_high;
  9093. } POSTPACK;
  9094. /* htt_tx_data_hdr_information payload extension fields: */
  9095. /* DWORD zero */
  9096. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  9097. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  9098. /* DWORD one */
  9099. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  9100. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  9101. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  9102. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  9103. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  9104. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  9105. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  9106. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  9107. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  9108. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  9109. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  9110. #define HTT_FW_TX_DATA_HDR_BW_S 19
  9111. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  9112. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  9113. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  9114. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  9115. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  9116. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  9117. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  9118. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  9119. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  9120. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  9121. /* DWORD two */
  9122. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  9123. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  9124. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  9125. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  9126. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  9127. do { \
  9128. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  9129. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  9130. } while (0)
  9131. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  9132. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  9133. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  9134. do { \
  9135. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  9136. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  9137. } while (0)
  9138. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  9139. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  9140. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  9141. do { \
  9142. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  9143. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  9144. } while (0)
  9145. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  9146. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  9147. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  9148. do { \
  9149. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  9150. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  9151. } while (0)
  9152. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  9153. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  9154. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  9155. do { \
  9156. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  9157. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  9158. } while (0)
  9159. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  9160. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  9161. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  9162. do { \
  9163. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  9164. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  9165. } while (0)
  9166. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  9167. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  9168. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  9169. do { \
  9170. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  9171. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  9172. } while (0)
  9173. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  9174. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  9175. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  9176. do { \
  9177. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  9178. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  9179. } while (0)
  9180. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  9181. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  9182. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  9183. do { \
  9184. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  9185. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  9186. } while (0)
  9187. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  9188. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  9189. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  9190. do { \
  9191. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  9192. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  9193. } while (0)
  9194. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  9195. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  9196. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  9197. do { \
  9198. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  9199. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  9200. } while (0)
  9201. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  9202. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  9203. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  9204. do { \
  9205. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  9206. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  9207. } while (0)
  9208. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  9209. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  9210. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  9211. do { \
  9212. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  9213. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  9214. } while (0)
  9215. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  9216. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  9217. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  9218. do { \
  9219. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  9220. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  9221. } while (0)
  9222. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  9223. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  9224. /**
  9225. * @brief target -> host rate-control update indication message
  9226. *
  9227. * @details
  9228. * The following diagram shows the format of the RC Update message
  9229. * sent from the target to the host, while processing the tx-completion
  9230. * of a transmitted PPDU.
  9231. *
  9232. * |31 24|23 16|15 8|7 0|
  9233. * |-------------------------------------------------------------|
  9234. * | peer ID | vdev ID | msg_type |
  9235. * |-------------------------------------------------------------|
  9236. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9237. * |-------------------------------------------------------------|
  9238. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  9239. * |-------------------------------------------------------------|
  9240. * | : |
  9241. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9242. * | : |
  9243. * |-------------------------------------------------------------|
  9244. * | : |
  9245. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9246. * | : |
  9247. * |-------------------------------------------------------------|
  9248. * : :
  9249. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9250. *
  9251. */
  9252. typedef struct {
  9253. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  9254. A_UINT32 rate_code_flags;
  9255. A_UINT32 flags; /* Encodes information such as excessive
  9256. retransmission, aggregate, some info
  9257. from .11 frame control,
  9258. STBC, LDPC, (SGI and Tx Chain Mask
  9259. are encoded in ptx_rc->flags field),
  9260. AMPDU truncation (BT/time based etc.),
  9261. RTS/CTS attempt */
  9262. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  9263. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  9264. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  9265. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  9266. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  9267. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  9268. } HTT_RC_TX_DONE_PARAMS;
  9269. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  9270. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  9271. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  9272. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  9273. #define HTT_RC_UPDATE_VDEVID_S 8
  9274. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  9275. #define HTT_RC_UPDATE_PEERID_S 16
  9276. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  9277. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  9278. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  9279. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  9280. do { \
  9281. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  9282. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  9283. } while (0)
  9284. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  9285. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  9286. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  9287. do { \
  9288. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  9289. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  9290. } while (0)
  9291. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  9292. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  9293. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  9294. do { \
  9295. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  9296. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  9297. } while (0)
  9298. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  9299. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  9300. /**
  9301. * @brief target -> host rx fragment indication message definition
  9302. *
  9303. * @details
  9304. * The following field definitions describe the format of the rx fragment
  9305. * indication message sent from the target to the host.
  9306. * The rx fragment indication message shares the format of the
  9307. * rx indication message, but not all fields from the rx indication message
  9308. * are relevant to the rx fragment indication message.
  9309. *
  9310. *
  9311. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9312. * |-----------+-------------------+---------------------+-------------|
  9313. * | peer ID | |FV| ext TID | msg type |
  9314. * |-------------------------------------------------------------------|
  9315. * | | flush | flush |
  9316. * | | end | start |
  9317. * | | seq num | seq num |
  9318. * |-------------------------------------------------------------------|
  9319. * | reserved | FW rx desc bytes |
  9320. * |-------------------------------------------------------------------|
  9321. * | | FW MSDU Rx |
  9322. * | | desc B0 |
  9323. * |-------------------------------------------------------------------|
  9324. * Header fields:
  9325. * - MSG_TYPE
  9326. * Bits 7:0
  9327. * Purpose: identifies this as an rx fragment indication message
  9328. * Value: 0xa
  9329. * - EXT_TID
  9330. * Bits 12:8
  9331. * Purpose: identify the traffic ID of the rx data, including
  9332. * special "extended" TID values for multicast, broadcast, and
  9333. * non-QoS data frames
  9334. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9335. * - FLUSH_VALID (FV)
  9336. * Bit 13
  9337. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9338. * is valid
  9339. * Value:
  9340. * 1 -> flush IE is valid and needs to be processed
  9341. * 0 -> flush IE is not valid and should be ignored
  9342. * - PEER_ID
  9343. * Bits 31:16
  9344. * Purpose: Identify, by ID, which peer sent the rx data
  9345. * Value: ID of the peer who sent the rx data
  9346. * - FLUSH_SEQ_NUM_START
  9347. * Bits 5:0
  9348. * Purpose: Indicate the start of a series of MPDUs to flush
  9349. * Not all MPDUs within this series are necessarily valid - the host
  9350. * must check each sequence number within this range to see if the
  9351. * corresponding MPDU is actually present.
  9352. * This field is only valid if the FV bit is set.
  9353. * Value:
  9354. * The sequence number for the first MPDUs to check to flush.
  9355. * The sequence number is masked by 0x3f.
  9356. * - FLUSH_SEQ_NUM_END
  9357. * Bits 11:6
  9358. * Purpose: Indicate the end of a series of MPDUs to flush
  9359. * Value:
  9360. * The sequence number one larger than the sequence number of the
  9361. * last MPDU to check to flush.
  9362. * The sequence number is masked by 0x3f.
  9363. * Not all MPDUs within this series are necessarily valid - the host
  9364. * must check each sequence number within this range to see if the
  9365. * corresponding MPDU is actually present.
  9366. * This field is only valid if the FV bit is set.
  9367. * Rx descriptor fields:
  9368. * - FW_RX_DESC_BYTES
  9369. * Bits 15:0
  9370. * Purpose: Indicate how many bytes in the Rx indication are used for
  9371. * FW Rx descriptors
  9372. * Value: 1
  9373. */
  9374. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  9375. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  9376. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  9377. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  9378. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  9379. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  9380. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  9381. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  9382. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  9383. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  9384. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  9385. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  9386. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  9387. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  9388. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  9389. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  9390. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  9391. #define HTT_RX_FRAG_IND_BYTES \
  9392. (4 /* msg hdr */ + \
  9393. 4 /* flush spec */ + \
  9394. 4 /* (unused) FW rx desc bytes spec */ + \
  9395. 4 /* FW rx desc */)
  9396. /**
  9397. * @brief target -> host test message definition
  9398. *
  9399. * @details
  9400. * The following field definitions describe the format of the test
  9401. * message sent from the target to the host.
  9402. * The message consists of a 4-octet header, followed by a variable
  9403. * number of 32-bit integer values, followed by a variable number
  9404. * of 8-bit character values.
  9405. *
  9406. * |31 16|15 8|7 0|
  9407. * |-----------------------------------------------------------|
  9408. * | num chars | num ints | msg type |
  9409. * |-----------------------------------------------------------|
  9410. * | int 0 |
  9411. * |-----------------------------------------------------------|
  9412. * | int 1 |
  9413. * |-----------------------------------------------------------|
  9414. * | ... |
  9415. * |-----------------------------------------------------------|
  9416. * | char 3 | char 2 | char 1 | char 0 |
  9417. * |-----------------------------------------------------------|
  9418. * | | | ... | char 4 |
  9419. * |-----------------------------------------------------------|
  9420. * - MSG_TYPE
  9421. * Bits 7:0
  9422. * Purpose: identifies this as a test message
  9423. * Value: HTT_MSG_TYPE_TEST
  9424. * - NUM_INTS
  9425. * Bits 15:8
  9426. * Purpose: indicate how many 32-bit integers follow the message header
  9427. * - NUM_CHARS
  9428. * Bits 31:16
  9429. * Purpose: indicate how many 8-bit charaters follow the series of integers
  9430. */
  9431. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  9432. #define HTT_RX_TEST_NUM_INTS_S 8
  9433. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  9434. #define HTT_RX_TEST_NUM_CHARS_S 16
  9435. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  9436. do { \
  9437. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  9438. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  9439. } while (0)
  9440. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  9441. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  9442. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  9443. do { \
  9444. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  9445. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  9446. } while (0)
  9447. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  9448. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  9449. /**
  9450. * @brief target -> host packet log message
  9451. *
  9452. * @details
  9453. * The following field definitions describe the format of the packet log
  9454. * message sent from the target to the host.
  9455. * The message consists of a 4-octet header,followed by a variable number
  9456. * of 32-bit character values.
  9457. *
  9458. * |31 16|15 12|11 10|9 8|7 0|
  9459. * |------------------------------------------------------------------|
  9460. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  9461. * |------------------------------------------------------------------|
  9462. * | payload |
  9463. * |------------------------------------------------------------------|
  9464. * - MSG_TYPE
  9465. * Bits 7:0
  9466. * Purpose: identifies this as a pktlog message
  9467. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  9468. * - mac_id
  9469. * Bits 9:8
  9470. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  9471. * Value: 0-3
  9472. * - pdev_id
  9473. * Bits 11:10
  9474. * Purpose: pdev_id
  9475. * Value: 0-3
  9476. * 0 (for rings at SOC level),
  9477. * 1/2/3 PDEV -> 0/1/2
  9478. * - payload_size
  9479. * Bits 31:16
  9480. * Purpose: explicitly specify the payload size
  9481. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  9482. */
  9483. PREPACK struct htt_pktlog_msg {
  9484. A_UINT32 header;
  9485. A_UINT32 payload[1/* or more */];
  9486. } POSTPACK;
  9487. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  9488. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  9489. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  9490. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  9491. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  9492. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  9493. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  9494. do { \
  9495. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  9496. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  9497. } while (0)
  9498. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  9499. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  9500. HTT_T2H_PKTLOG_MAC_ID_S)
  9501. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  9502. do { \
  9503. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  9504. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  9505. } while (0)
  9506. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  9507. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  9508. HTT_T2H_PKTLOG_PDEV_ID_S)
  9509. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  9510. do { \
  9511. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  9512. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  9513. } while (0)
  9514. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  9515. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  9516. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  9517. /*
  9518. * Rx reorder statistics
  9519. * NB: all the fields must be defined in 4 octets size.
  9520. */
  9521. struct rx_reorder_stats {
  9522. /* Non QoS MPDUs received */
  9523. A_UINT32 deliver_non_qos;
  9524. /* MPDUs received in-order */
  9525. A_UINT32 deliver_in_order;
  9526. /* Flush due to reorder timer expired */
  9527. A_UINT32 deliver_flush_timeout;
  9528. /* Flush due to move out of window */
  9529. A_UINT32 deliver_flush_oow;
  9530. /* Flush due to DELBA */
  9531. A_UINT32 deliver_flush_delba;
  9532. /* MPDUs dropped due to FCS error */
  9533. A_UINT32 fcs_error;
  9534. /* MPDUs dropped due to monitor mode non-data packet */
  9535. A_UINT32 mgmt_ctrl;
  9536. /* Unicast-data MPDUs dropped due to invalid peer */
  9537. A_UINT32 invalid_peer;
  9538. /* MPDUs dropped due to duplication (non aggregation) */
  9539. A_UINT32 dup_non_aggr;
  9540. /* MPDUs dropped due to processed before */
  9541. A_UINT32 dup_past;
  9542. /* MPDUs dropped due to duplicate in reorder queue */
  9543. A_UINT32 dup_in_reorder;
  9544. /* Reorder timeout happened */
  9545. A_UINT32 reorder_timeout;
  9546. /* invalid bar ssn */
  9547. A_UINT32 invalid_bar_ssn;
  9548. /* reorder reset due to bar ssn */
  9549. A_UINT32 ssn_reset;
  9550. /* Flush due to delete peer */
  9551. A_UINT32 deliver_flush_delpeer;
  9552. /* Flush due to offload*/
  9553. A_UINT32 deliver_flush_offload;
  9554. /* Flush due to out of buffer*/
  9555. A_UINT32 deliver_flush_oob;
  9556. /* MPDUs dropped due to PN check fail */
  9557. A_UINT32 pn_fail;
  9558. /* MPDUs dropped due to unable to allocate memory */
  9559. A_UINT32 store_fail;
  9560. /* Number of times the tid pool alloc succeeded */
  9561. A_UINT32 tid_pool_alloc_succ;
  9562. /* Number of times the MPDU pool alloc succeeded */
  9563. A_UINT32 mpdu_pool_alloc_succ;
  9564. /* Number of times the MSDU pool alloc succeeded */
  9565. A_UINT32 msdu_pool_alloc_succ;
  9566. /* Number of times the tid pool alloc failed */
  9567. A_UINT32 tid_pool_alloc_fail;
  9568. /* Number of times the MPDU pool alloc failed */
  9569. A_UINT32 mpdu_pool_alloc_fail;
  9570. /* Number of times the MSDU pool alloc failed */
  9571. A_UINT32 msdu_pool_alloc_fail;
  9572. /* Number of times the tid pool freed */
  9573. A_UINT32 tid_pool_free;
  9574. /* Number of times the MPDU pool freed */
  9575. A_UINT32 mpdu_pool_free;
  9576. /* Number of times the MSDU pool freed */
  9577. A_UINT32 msdu_pool_free;
  9578. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  9579. A_UINT32 msdu_queued;
  9580. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  9581. A_UINT32 msdu_recycled;
  9582. /* Number of MPDUs with invalid peer but A2 found in AST */
  9583. A_UINT32 invalid_peer_a2_in_ast;
  9584. /* Number of MPDUs with invalid peer but A3 found in AST */
  9585. A_UINT32 invalid_peer_a3_in_ast;
  9586. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  9587. A_UINT32 invalid_peer_bmc_mpdus;
  9588. /* Number of MSDUs with err attention word */
  9589. A_UINT32 rxdesc_err_att;
  9590. /* Number of MSDUs with flag of peer_idx_invalid */
  9591. A_UINT32 rxdesc_err_peer_idx_inv;
  9592. /* Number of MSDUs with flag of peer_idx_timeout */
  9593. A_UINT32 rxdesc_err_peer_idx_to;
  9594. /* Number of MSDUs with flag of overflow */
  9595. A_UINT32 rxdesc_err_ov;
  9596. /* Number of MSDUs with flag of msdu_length_err */
  9597. A_UINT32 rxdesc_err_msdu_len;
  9598. /* Number of MSDUs with flag of mpdu_length_err */
  9599. A_UINT32 rxdesc_err_mpdu_len;
  9600. /* Number of MSDUs with flag of tkip_mic_err */
  9601. A_UINT32 rxdesc_err_tkip_mic;
  9602. /* Number of MSDUs with flag of decrypt_err */
  9603. A_UINT32 rxdesc_err_decrypt;
  9604. /* Number of MSDUs with flag of fcs_err */
  9605. A_UINT32 rxdesc_err_fcs;
  9606. /* Number of Unicast (bc_mc bit is not set in attention word)
  9607. * frames with invalid peer handler
  9608. */
  9609. A_UINT32 rxdesc_uc_msdus_inv_peer;
  9610. /* Number of unicast frame directly (direct bit is set in attention word)
  9611. * to DUT with invalid peer handler
  9612. */
  9613. A_UINT32 rxdesc_direct_msdus_inv_peer;
  9614. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  9615. * frames with invalid peer handler
  9616. */
  9617. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  9618. /* Number of MSDUs dropped due to no first MSDU flag */
  9619. A_UINT32 rxdesc_no_1st_msdu;
  9620. /* Number of MSDUs droped due to ring overflow */
  9621. A_UINT32 msdu_drop_ring_ov;
  9622. /* Number of MSDUs dropped due to FC mismatch */
  9623. A_UINT32 msdu_drop_fc_mismatch;
  9624. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  9625. A_UINT32 msdu_drop_mgmt_remote_ring;
  9626. /* Number of MSDUs dropped due to errors not reported in attention word */
  9627. A_UINT32 msdu_drop_misc;
  9628. /* Number of MSDUs go to offload before reorder */
  9629. A_UINT32 offload_msdu_wal;
  9630. /* Number of data frame dropped by offload after reorder */
  9631. A_UINT32 offload_msdu_reorder;
  9632. /* Number of MPDUs with sequence number in the past and within the BA window */
  9633. A_UINT32 dup_past_within_window;
  9634. /* Number of MPDUs with sequence number in the past and outside the BA window */
  9635. A_UINT32 dup_past_outside_window;
  9636. /* Number of MSDUs with decrypt/MIC error */
  9637. A_UINT32 rxdesc_err_decrypt_mic;
  9638. /* Number of data MSDUs received on both local and remote rings */
  9639. A_UINT32 data_msdus_on_both_rings;
  9640. /* MPDUs never filled */
  9641. A_UINT32 holes_not_filled;
  9642. };
  9643. /*
  9644. * Rx Remote buffer statistics
  9645. * NB: all the fields must be defined in 4 octets size.
  9646. */
  9647. struct rx_remote_buffer_mgmt_stats {
  9648. /* Total number of MSDUs reaped for Rx processing */
  9649. A_UINT32 remote_reaped;
  9650. /* MSDUs recycled within firmware */
  9651. A_UINT32 remote_recycled;
  9652. /* MSDUs stored by Data Rx */
  9653. A_UINT32 data_rx_msdus_stored;
  9654. /* Number of HTT indications from WAL Rx MSDU */
  9655. A_UINT32 wal_rx_ind;
  9656. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  9657. A_UINT32 wal_rx_ind_unconsumed;
  9658. /* Number of HTT indications from Data Rx MSDU */
  9659. A_UINT32 data_rx_ind;
  9660. /* Number of unconsumed HTT indications from Data Rx MSDU */
  9661. A_UINT32 data_rx_ind_unconsumed;
  9662. /* Number of HTT indications from ATHBUF */
  9663. A_UINT32 athbuf_rx_ind;
  9664. /* Number of remote buffers requested for refill */
  9665. A_UINT32 refill_buf_req;
  9666. /* Number of remote buffers filled by the host */
  9667. A_UINT32 refill_buf_rsp;
  9668. /* Number of times MAC hw_index = f/w write_index */
  9669. A_INT32 mac_no_bufs;
  9670. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  9671. A_INT32 fw_indices_equal;
  9672. /* Number of times f/w finds no buffers to post */
  9673. A_INT32 host_no_bufs;
  9674. };
  9675. /*
  9676. * TXBF MU/SU packets and NDPA statistics
  9677. * NB: all the fields must be defined in 4 octets size.
  9678. */
  9679. struct rx_txbf_musu_ndpa_pkts_stats {
  9680. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  9681. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  9682. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  9683. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  9684. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  9685. A_UINT32 reserved[3]; /* must be set to 0x0 */
  9686. };
  9687. /*
  9688. * htt_dbg_stats_status -
  9689. * present - The requested stats have been delivered in full.
  9690. * This indicates that either the stats information was contained
  9691. * in its entirety within this message, or else this message
  9692. * completes the delivery of the requested stats info that was
  9693. * partially delivered through earlier STATS_CONF messages.
  9694. * partial - The requested stats have been delivered in part.
  9695. * One or more subsequent STATS_CONF messages with the same
  9696. * cookie value will be sent to deliver the remainder of the
  9697. * information.
  9698. * error - The requested stats could not be delivered, for example due
  9699. * to a shortage of memory to construct a message holding the
  9700. * requested stats.
  9701. * invalid - The requested stat type is either not recognized, or the
  9702. * target is configured to not gather the stats type in question.
  9703. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9704. * series_done - This special value indicates that no further stats info
  9705. * elements are present within a series of stats info elems
  9706. * (within a stats upload confirmation message).
  9707. */
  9708. enum htt_dbg_stats_status {
  9709. HTT_DBG_STATS_STATUS_PRESENT = 0,
  9710. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  9711. HTT_DBG_STATS_STATUS_ERROR = 2,
  9712. HTT_DBG_STATS_STATUS_INVALID = 3,
  9713. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  9714. };
  9715. /**
  9716. * @brief target -> host statistics upload
  9717. *
  9718. * @details
  9719. * The following field definitions describe the format of the HTT target
  9720. * to host stats upload confirmation message.
  9721. * The message contains a cookie echoed from the HTT host->target stats
  9722. * upload request, which identifies which request the confirmation is
  9723. * for, and a series of tag-length-value stats information elements.
  9724. * The tag-length header for each stats info element also includes a
  9725. * status field, to indicate whether the request for the stat type in
  9726. * question was fully met, partially met, unable to be met, or invalid
  9727. * (if the stat type in question is disabled in the target).
  9728. * A special value of all 1's in this status field is used to indicate
  9729. * the end of the series of stats info elements.
  9730. *
  9731. *
  9732. * |31 16|15 8|7 5|4 0|
  9733. * |------------------------------------------------------------|
  9734. * | reserved | msg type |
  9735. * |------------------------------------------------------------|
  9736. * | cookie LSBs |
  9737. * |------------------------------------------------------------|
  9738. * | cookie MSBs |
  9739. * |------------------------------------------------------------|
  9740. * | stats entry length | reserved | S |stat type|
  9741. * |------------------------------------------------------------|
  9742. * | |
  9743. * | type-specific stats info |
  9744. * | |
  9745. * |------------------------------------------------------------|
  9746. * | stats entry length | reserved | S |stat type|
  9747. * |------------------------------------------------------------|
  9748. * | |
  9749. * | type-specific stats info |
  9750. * | |
  9751. * |------------------------------------------------------------|
  9752. * | n/a | reserved | 111 | n/a |
  9753. * |------------------------------------------------------------|
  9754. * Header fields:
  9755. * - MSG_TYPE
  9756. * Bits 7:0
  9757. * Purpose: identifies this is a statistics upload confirmation message
  9758. * Value: 0x9
  9759. * - COOKIE_LSBS
  9760. * Bits 31:0
  9761. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9762. * message with its preceding host->target stats request message.
  9763. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9764. * - COOKIE_MSBS
  9765. * Bits 31:0
  9766. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9767. * message with its preceding host->target stats request message.
  9768. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9769. *
  9770. * Stats Information Element tag-length header fields:
  9771. * - STAT_TYPE
  9772. * Bits 4:0
  9773. * Purpose: identifies the type of statistics info held in the
  9774. * following information element
  9775. * Value: htt_dbg_stats_type
  9776. * - STATUS
  9777. * Bits 7:5
  9778. * Purpose: indicate whether the requested stats are present
  9779. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  9780. * the completion of the stats entry series
  9781. * - LENGTH
  9782. * Bits 31:16
  9783. * Purpose: indicate the stats information size
  9784. * Value: This field specifies the number of bytes of stats information
  9785. * that follows the element tag-length header.
  9786. * It is expected but not required that this length is a multiple of
  9787. * 4 bytes. Even if the length is not an integer multiple of 4, the
  9788. * subsequent stats entry header will begin on a 4-byte aligned
  9789. * boundary.
  9790. */
  9791. #define HTT_T2H_STATS_COOKIE_SIZE 8
  9792. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  9793. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  9794. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  9795. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  9796. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  9797. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  9798. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  9799. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9800. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  9801. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  9802. do { \
  9803. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  9804. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  9805. } while (0)
  9806. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  9807. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  9808. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  9809. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  9810. do { \
  9811. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  9812. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  9813. } while (0)
  9814. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  9815. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  9816. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  9817. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9818. do { \
  9819. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  9820. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  9821. } while (0)
  9822. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  9823. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  9824. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  9825. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  9826. #define HTT_MAX_AGGR 64
  9827. #define HTT_HL_MAX_AGGR 18
  9828. /**
  9829. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  9830. *
  9831. * @details
  9832. * The following field definitions describe the format of the HTT host
  9833. * to target frag_desc/msdu_ext bank configuration message.
  9834. * The message contains the based address and the min and max id of the
  9835. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  9836. * MSDU_EXT/FRAG_DESC.
  9837. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  9838. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  9839. * the hardware does the mapping/translation.
  9840. *
  9841. * Total banks that can be configured is configured to 16.
  9842. *
  9843. * This should be called before any TX has be initiated by the HTT
  9844. *
  9845. * |31 16|15 8|7 5|4 0|
  9846. * |------------------------------------------------------------|
  9847. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  9848. * |------------------------------------------------------------|
  9849. * | BANK0_BASE_ADDRESS (bits 31:0) |
  9850. #if HTT_PADDR64
  9851. * | BANK0_BASE_ADDRESS (bits 63:32) |
  9852. #endif
  9853. * |------------------------------------------------------------|
  9854. * | ... |
  9855. * |------------------------------------------------------------|
  9856. * | BANK15_BASE_ADDRESS (bits 31:0) |
  9857. #if HTT_PADDR64
  9858. * | BANK15_BASE_ADDRESS (bits 63:32) |
  9859. #endif
  9860. * |------------------------------------------------------------|
  9861. * | BANK0_MAX_ID | BANK0_MIN_ID |
  9862. * |------------------------------------------------------------|
  9863. * | ... |
  9864. * |------------------------------------------------------------|
  9865. * | BANK15_MAX_ID | BANK15_MIN_ID |
  9866. * |------------------------------------------------------------|
  9867. * Header fields:
  9868. * - MSG_TYPE
  9869. * Bits 7:0
  9870. * Value: 0x6
  9871. * for systems with 64-bit format for bus addresses:
  9872. * - BANKx_BASE_ADDRESS_LO
  9873. * Bits 31:0
  9874. * Purpose: Provide a mechanism to specify the base address of the
  9875. * MSDU_EXT bank physical/bus address.
  9876. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  9877. * - BANKx_BASE_ADDRESS_HI
  9878. * Bits 31:0
  9879. * Purpose: Provide a mechanism to specify the base address of the
  9880. * MSDU_EXT bank physical/bus address.
  9881. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  9882. * for systems with 32-bit format for bus addresses:
  9883. * - BANKx_BASE_ADDRESS
  9884. * Bits 31:0
  9885. * Purpose: Provide a mechanism to specify the base address of the
  9886. * MSDU_EXT bank physical/bus address.
  9887. * Value: MSDU_EXT bank physical / bus address
  9888. * - BANKx_MIN_ID
  9889. * Bits 15:0
  9890. * Purpose: Provide a mechanism to specify the min index that needs to
  9891. * mapped.
  9892. * - BANKx_MAX_ID
  9893. * Bits 31:16
  9894. * Purpose: Provide a mechanism to specify the max index that needs to
  9895. * mapped.
  9896. *
  9897. */
  9898. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  9899. * safe value.
  9900. * @note MAX supported banks is 16.
  9901. */
  9902. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  9903. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  9904. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  9905. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  9906. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  9907. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  9908. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  9909. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  9910. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  9911. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  9912. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  9913. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  9914. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  9915. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  9916. do { \
  9917. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  9918. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  9919. } while (0)
  9920. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  9921. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  9922. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  9923. do { \
  9924. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  9925. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  9926. } while (0)
  9927. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  9928. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  9929. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  9930. do { \
  9931. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  9932. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  9933. } while (0)
  9934. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  9935. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  9936. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  9937. do { \
  9938. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  9939. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  9940. } while (0)
  9941. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  9942. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  9943. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  9944. do { \
  9945. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  9946. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  9947. } while (0)
  9948. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  9949. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  9950. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  9951. do { \
  9952. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  9953. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  9954. } while (0)
  9955. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  9956. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  9957. /*
  9958. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  9959. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  9960. * addresses are stored in a XXX-bit field.
  9961. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  9962. * htt_tx_frag_desc64_bank_cfg_t structs.
  9963. */
  9964. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  9965. _paddr_bits_, \
  9966. _paddr__bank_base_address_) \
  9967. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  9968. /** word 0 \
  9969. * msg_type: 8, \
  9970. * pdev_id: 2, \
  9971. * swap: 1, \
  9972. * reserved0: 5, \
  9973. * num_banks: 8, \
  9974. * desc_size: 8; \
  9975. */ \
  9976. A_UINT32 word0; \
  9977. /* \
  9978. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  9979. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  9980. * the second A_UINT32). \
  9981. */ \
  9982. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  9983. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  9984. } POSTPACK
  9985. /* define htt_tx_frag_desc32_bank_cfg_t */
  9986. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  9987. /* define htt_tx_frag_desc64_bank_cfg_t */
  9988. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  9989. /*
  9990. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  9991. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  9992. */
  9993. #if HTT_PADDR64
  9994. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  9995. #else
  9996. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  9997. #endif
  9998. /**
  9999. * @brief target -> host HTT TX Credit total count update message definition
  10000. *
  10001. *|31 16|15|14 9| 8 |7 0 |
  10002. *|---------------------+--+----------+-------+----------|
  10003. *|cur htt credit delta | Q| reserved | sign | msg type |
  10004. *|------------------------------------------------------|
  10005. *
  10006. * Header fields:
  10007. * - MSG_TYPE
  10008. * Bits 7:0
  10009. * Purpose: identifies this as a htt tx credit delta update message
  10010. * Value: 0xe
  10011. * - SIGN
  10012. * Bits 8
  10013. * identifies whether credit delta is positive or negative
  10014. * Value:
  10015. * - 0x0: credit delta is positive, rebalance in some buffers
  10016. * - 0x1: credit delta is negative, rebalance out some buffers
  10017. * - reserved
  10018. * Bits 14:9
  10019. * Value: 0x0
  10020. * - TXQ_GRP
  10021. * Bit 15
  10022. * Purpose: indicates whether any tx queue group information elements
  10023. * are appended to the tx credit update message
  10024. * Value: 0 -> no tx queue group information element is present
  10025. * 1 -> a tx queue group information element immediately follows
  10026. * - DELTA_COUNT
  10027. * Bits 31:16
  10028. * Purpose: Specify current htt credit delta absolute count
  10029. */
  10030. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  10031. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  10032. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  10033. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  10034. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  10035. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  10036. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  10037. do { \
  10038. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  10039. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  10040. } while (0)
  10041. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  10042. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  10043. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  10044. do { \
  10045. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  10046. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  10047. } while (0)
  10048. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  10049. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  10050. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  10051. do { \
  10052. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  10053. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  10054. } while (0)
  10055. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  10056. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  10057. #define HTT_TX_CREDIT_MSG_BYTES 4
  10058. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  10059. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  10060. /**
  10061. * @brief HTT WDI_IPA Operation Response Message
  10062. *
  10063. * @details
  10064. * HTT WDI_IPA Operation Response message is sent by target
  10065. * to host confirming suspend or resume operation.
  10066. * |31 24|23 16|15 8|7 0|
  10067. * |----------------+----------------+----------------+----------------|
  10068. * | op_code | Rsvd | msg_type |
  10069. * |-------------------------------------------------------------------|
  10070. * | Rsvd | Response len |
  10071. * |-------------------------------------------------------------------|
  10072. * | |
  10073. * | Response-type specific info |
  10074. * | |
  10075. * | |
  10076. * |-------------------------------------------------------------------|
  10077. * Header fields:
  10078. * - MSG_TYPE
  10079. * Bits 7:0
  10080. * Purpose: Identifies this as WDI_IPA Operation Response message
  10081. * value: = 0x13
  10082. * - OP_CODE
  10083. * Bits 31:16
  10084. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  10085. * value: = enum htt_wdi_ipa_op_code
  10086. * - RSP_LEN
  10087. * Bits 16:0
  10088. * Purpose: length for the response-type specific info
  10089. * value: = length in bytes for response-type specific info
  10090. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  10091. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  10092. */
  10093. PREPACK struct htt_wdi_ipa_op_response_t
  10094. {
  10095. /* DWORD 0: flags and meta-data */
  10096. A_UINT32
  10097. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10098. reserved1: 8,
  10099. op_code: 16;
  10100. A_UINT32
  10101. rsp_len: 16,
  10102. reserved2: 16;
  10103. } POSTPACK;
  10104. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  10105. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  10106. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  10107. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  10108. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  10109. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  10110. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  10111. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  10112. do { \
  10113. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  10114. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  10115. } while (0)
  10116. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  10117. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  10118. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  10119. do { \
  10120. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  10121. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  10122. } while (0)
  10123. enum htt_phy_mode {
  10124. htt_phy_mode_11a = 0,
  10125. htt_phy_mode_11g = 1,
  10126. htt_phy_mode_11b = 2,
  10127. htt_phy_mode_11g_only = 3,
  10128. htt_phy_mode_11na_ht20 = 4,
  10129. htt_phy_mode_11ng_ht20 = 5,
  10130. htt_phy_mode_11na_ht40 = 6,
  10131. htt_phy_mode_11ng_ht40 = 7,
  10132. htt_phy_mode_11ac_vht20 = 8,
  10133. htt_phy_mode_11ac_vht40 = 9,
  10134. htt_phy_mode_11ac_vht80 = 10,
  10135. htt_phy_mode_11ac_vht20_2g = 11,
  10136. htt_phy_mode_11ac_vht40_2g = 12,
  10137. htt_phy_mode_11ac_vht80_2g = 13,
  10138. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  10139. htt_phy_mode_11ac_vht160 = 15,
  10140. htt_phy_mode_max,
  10141. };
  10142. /**
  10143. * @brief target -> host HTT channel change indication
  10144. * @details
  10145. * Specify when a channel change occurs.
  10146. * This allows the host to precisely determine which rx frames arrived
  10147. * on the old channel and which rx frames arrived on the new channel.
  10148. *
  10149. *|31 |7 0 |
  10150. *|-------------------------------------------+----------|
  10151. *| reserved | msg type |
  10152. *|------------------------------------------------------|
  10153. *| primary_chan_center_freq_mhz |
  10154. *|------------------------------------------------------|
  10155. *| contiguous_chan1_center_freq_mhz |
  10156. *|------------------------------------------------------|
  10157. *| contiguous_chan2_center_freq_mhz |
  10158. *|------------------------------------------------------|
  10159. *| phy_mode |
  10160. *|------------------------------------------------------|
  10161. *
  10162. * Header fields:
  10163. * - MSG_TYPE
  10164. * Bits 7:0
  10165. * Purpose: identifies this as a htt channel change indication message
  10166. * Value: 0x15
  10167. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  10168. * Bits 31:0
  10169. * Purpose: identify the (center of the) new 20 MHz primary channel
  10170. * Value: center frequency of the 20 MHz primary channel, in MHz units
  10171. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  10172. * Bits 31:0
  10173. * Purpose: identify the (center of the) contiguous frequency range
  10174. * comprising the new channel.
  10175. * For example, if the new channel is a 80 MHz channel extending
  10176. * 60 MHz beyond the primary channel, this field would be 30 larger
  10177. * than the primary channel center frequency field.
  10178. * Value: center frequency of the contiguous frequency range comprising
  10179. * the full channel in MHz units
  10180. * (80+80 channels also use the CONTIG_CHAN2 field)
  10181. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  10182. * Bits 31:0
  10183. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  10184. * within a VHT 80+80 channel.
  10185. * This field is only relevant for VHT 80+80 channels.
  10186. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  10187. * channel (arbitrary value for cases besides VHT 80+80)
  10188. * - PHY_MODE
  10189. * Bits 31:0
  10190. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  10191. * and band
  10192. * Value: htt_phy_mode enum value
  10193. */
  10194. PREPACK struct htt_chan_change_t
  10195. {
  10196. /* DWORD 0: flags and meta-data */
  10197. A_UINT32
  10198. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10199. reserved1: 24;
  10200. A_UINT32 primary_chan_center_freq_mhz;
  10201. A_UINT32 contig_chan1_center_freq_mhz;
  10202. A_UINT32 contig_chan2_center_freq_mhz;
  10203. A_UINT32 phy_mode;
  10204. } POSTPACK;
  10205. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  10206. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  10207. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  10208. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  10209. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  10210. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  10211. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  10212. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  10213. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  10214. do { \
  10215. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  10216. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  10217. } while (0)
  10218. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  10219. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  10220. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  10221. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  10222. do { \
  10223. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  10224. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  10225. } while (0)
  10226. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  10227. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  10228. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  10229. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  10230. do { \
  10231. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  10232. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  10233. } while (0)
  10234. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  10235. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  10236. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  10237. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  10238. do { \
  10239. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  10240. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  10241. } while (0)
  10242. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  10243. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  10244. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  10245. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  10246. /**
  10247. * @brief rx offload packet error message
  10248. *
  10249. * @details
  10250. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  10251. * of target payload like mic err.
  10252. *
  10253. * |31 24|23 16|15 8|7 0|
  10254. * |----------------+----------------+----------------+----------------|
  10255. * | tid | vdev_id | msg_sub_type | msg_type |
  10256. * |-------------------------------------------------------------------|
  10257. * : (sub-type dependent content) :
  10258. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10259. * Header fields:
  10260. * - msg_type
  10261. * Bits 7:0
  10262. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  10263. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  10264. * - msg_sub_type
  10265. * Bits 15:8
  10266. * Purpose: Identifies which type of rx error is reported by this message
  10267. * value: htt_rx_ofld_pkt_err_type
  10268. * - vdev_id
  10269. * Bits 23:16
  10270. * Purpose: Identifies which vdev received the erroneous rx frame
  10271. * value:
  10272. * - tid
  10273. * Bits 31:24
  10274. * Purpose: Identifies the traffic type of the rx frame
  10275. * value:
  10276. *
  10277. * - The payload fields used if the sub-type == MIC error are shown below.
  10278. * Note - MIC err is per MSDU, while PN is per MPDU.
  10279. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  10280. * with MIC err in A-MSDU case, so FW will send only one HTT message
  10281. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  10282. * instead of sending separate HTT messages for each wrong MSDU within
  10283. * the MPDU.
  10284. *
  10285. * |31 24|23 16|15 8|7 0|
  10286. * |----------------+----------------+----------------+----------------|
  10287. * | Rsvd | key_id | peer_id |
  10288. * |-------------------------------------------------------------------|
  10289. * | receiver MAC addr 31:0 |
  10290. * |-------------------------------------------------------------------|
  10291. * | Rsvd | receiver MAC addr 47:32 |
  10292. * |-------------------------------------------------------------------|
  10293. * | transmitter MAC addr 31:0 |
  10294. * |-------------------------------------------------------------------|
  10295. * | Rsvd | transmitter MAC addr 47:32 |
  10296. * |-------------------------------------------------------------------|
  10297. * | PN 31:0 |
  10298. * |-------------------------------------------------------------------|
  10299. * | Rsvd | PN 47:32 |
  10300. * |-------------------------------------------------------------------|
  10301. * - peer_id
  10302. * Bits 15:0
  10303. * Purpose: identifies which peer is frame is from
  10304. * value:
  10305. * - key_id
  10306. * Bits 23:16
  10307. * Purpose: identifies key_id of rx frame
  10308. * value:
  10309. * - RA_31_0 (receiver MAC addr 31:0)
  10310. * Bits 31:0
  10311. * Purpose: identifies by MAC address which vdev received the frame
  10312. * value: MAC address lower 4 bytes
  10313. * - RA_47_32 (receiver MAC addr 47:32)
  10314. * Bits 15:0
  10315. * Purpose: identifies by MAC address which vdev received the frame
  10316. * value: MAC address upper 2 bytes
  10317. * - TA_31_0 (transmitter MAC addr 31:0)
  10318. * Bits 31:0
  10319. * Purpose: identifies by MAC address which peer transmitted the frame
  10320. * value: MAC address lower 4 bytes
  10321. * - TA_47_32 (transmitter MAC addr 47:32)
  10322. * Bits 15:0
  10323. * Purpose: identifies by MAC address which peer transmitted the frame
  10324. * value: MAC address upper 2 bytes
  10325. * - PN_31_0
  10326. * Bits 31:0
  10327. * Purpose: Identifies pn of rx frame
  10328. * value: PN lower 4 bytes
  10329. * - PN_47_32
  10330. * Bits 15:0
  10331. * Purpose: Identifies pn of rx frame
  10332. * value:
  10333. * TKIP or CCMP: PN upper 2 bytes
  10334. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  10335. */
  10336. enum htt_rx_ofld_pkt_err_type {
  10337. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  10338. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  10339. };
  10340. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  10341. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  10342. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  10343. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  10344. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  10345. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  10346. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  10347. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  10348. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  10349. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  10350. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  10351. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  10352. do { \
  10353. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  10354. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  10355. } while (0)
  10356. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  10357. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  10358. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  10359. do { \
  10360. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  10361. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  10362. } while (0)
  10363. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  10364. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  10365. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  10366. do { \
  10367. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  10368. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  10369. } while (0)
  10370. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  10371. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  10372. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  10373. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  10374. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  10375. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  10376. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  10377. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  10378. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  10379. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  10380. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  10381. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  10382. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  10383. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  10384. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  10385. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  10386. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  10387. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  10388. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  10389. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  10390. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  10391. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  10392. do { \
  10393. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  10394. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  10395. } while (0)
  10396. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  10397. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  10398. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  10399. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  10400. do { \
  10401. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  10402. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  10403. } while (0)
  10404. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  10405. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  10406. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  10407. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  10408. do { \
  10409. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  10410. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  10411. } while (0)
  10412. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  10413. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  10414. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  10415. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  10416. do { \
  10417. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  10418. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  10419. } while (0)
  10420. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  10421. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  10422. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  10423. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  10424. do { \
  10425. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  10426. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  10427. } while (0)
  10428. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  10429. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  10430. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  10431. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  10432. do { \
  10433. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  10434. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  10435. } while (0)
  10436. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  10437. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  10438. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  10439. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  10440. do { \
  10441. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  10442. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  10443. } while (0)
  10444. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  10445. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  10446. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  10447. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  10448. do { \
  10449. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  10450. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  10451. } while (0)
  10452. /**
  10453. * @brief peer rate report message
  10454. *
  10455. * @details
  10456. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  10457. * justified rate of all the peers.
  10458. *
  10459. * |31 24|23 16|15 8|7 0|
  10460. * |----------------+----------------+----------------+----------------|
  10461. * | peer_count | | msg_type |
  10462. * |-------------------------------------------------------------------|
  10463. * : Payload (variant number of peer rate report) :
  10464. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10465. * Header fields:
  10466. * - msg_type
  10467. * Bits 7:0
  10468. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  10469. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  10470. * - reserved
  10471. * Bits 15:8
  10472. * Purpose:
  10473. * value:
  10474. * - peer_count
  10475. * Bits 31:16
  10476. * Purpose: Specify how many peer rate report elements are present in the payload.
  10477. * value:
  10478. *
  10479. * Payload:
  10480. * There are variant number of peer rate report follow the first 32 bits.
  10481. * The peer rate report is defined as follows.
  10482. *
  10483. * |31 20|19 16|15 0|
  10484. * |-----------------------+---------+---------------------------------|-
  10485. * | reserved | phy | peer_id | \
  10486. * |-------------------------------------------------------------------| -> report #0
  10487. * | rate | /
  10488. * |-----------------------+---------+---------------------------------|-
  10489. * | reserved | phy | peer_id | \
  10490. * |-------------------------------------------------------------------| -> report #1
  10491. * | rate | /
  10492. * |-----------------------+---------+---------------------------------|-
  10493. * | reserved | phy | peer_id | \
  10494. * |-------------------------------------------------------------------| -> report #2
  10495. * | rate | /
  10496. * |-------------------------------------------------------------------|-
  10497. * : :
  10498. * : :
  10499. * : :
  10500. * :-------------------------------------------------------------------:
  10501. *
  10502. * - peer_id
  10503. * Bits 15:0
  10504. * Purpose: identify the peer
  10505. * value:
  10506. * - phy
  10507. * Bits 19:16
  10508. * Purpose: identify which phy is in use
  10509. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  10510. * Please see enum htt_peer_report_phy_type for detail.
  10511. * - reserved
  10512. * Bits 31:20
  10513. * Purpose:
  10514. * value:
  10515. * - rate
  10516. * Bits 31:0
  10517. * Purpose: represent the justified rate of the peer specified by peer_id
  10518. * value:
  10519. */
  10520. enum htt_peer_rate_report_phy_type {
  10521. HTT_PEER_RATE_REPORT_11B = 0,
  10522. HTT_PEER_RATE_REPORT_11A_G,
  10523. HTT_PEER_RATE_REPORT_11N,
  10524. HTT_PEER_RATE_REPORT_11AC,
  10525. };
  10526. #define HTT_PEER_RATE_REPORT_SIZE 8
  10527. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  10528. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  10529. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  10530. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  10531. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  10532. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  10533. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  10534. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  10535. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  10536. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  10537. do { \
  10538. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  10539. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  10540. } while (0)
  10541. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  10542. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  10543. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  10544. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  10545. do { \
  10546. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  10547. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  10548. } while (0)
  10549. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  10550. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  10551. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  10552. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  10553. do { \
  10554. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  10555. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  10556. } while (0)
  10557. /**
  10558. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  10559. *
  10560. * @details
  10561. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  10562. * a flow of descriptors.
  10563. *
  10564. * This message is in TLV format and indicates the parameters to be setup a
  10565. * flow in the host. Each entry indicates that a particular flow ID is ready to
  10566. * receive descriptors from a specified pool.
  10567. *
  10568. * The message would appear as follows:
  10569. *
  10570. * |31 24|23 16|15 8|7 0|
  10571. * |----------------+----------------+----------------+----------------|
  10572. * header | reserved | num_flows | msg_type |
  10573. * |-------------------------------------------------------------------|
  10574. * | |
  10575. * : payload :
  10576. * | |
  10577. * |-------------------------------------------------------------------|
  10578. *
  10579. * The header field is one DWORD long and is interpreted as follows:
  10580. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  10581. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  10582. * this message
  10583. * b'16-31 - reserved: These bits are reserved for future use
  10584. *
  10585. * Payload:
  10586. * The payload would contain multiple objects of the following structure. Each
  10587. * object represents a flow.
  10588. *
  10589. * |31 24|23 16|15 8|7 0|
  10590. * |----------------+----------------+----------------+----------------|
  10591. * header | reserved | num_flows | msg_type |
  10592. * |-------------------------------------------------------------------|
  10593. * payload0| flow_type |
  10594. * |-------------------------------------------------------------------|
  10595. * | flow_id |
  10596. * |-------------------------------------------------------------------|
  10597. * | reserved0 | flow_pool_id |
  10598. * |-------------------------------------------------------------------|
  10599. * | reserved1 | flow_pool_size |
  10600. * |-------------------------------------------------------------------|
  10601. * | reserved2 |
  10602. * |-------------------------------------------------------------------|
  10603. * payload1| flow_type |
  10604. * |-------------------------------------------------------------------|
  10605. * | flow_id |
  10606. * |-------------------------------------------------------------------|
  10607. * | reserved0 | flow_pool_id |
  10608. * |-------------------------------------------------------------------|
  10609. * | reserved1 | flow_pool_size |
  10610. * |-------------------------------------------------------------------|
  10611. * | reserved2 |
  10612. * |-------------------------------------------------------------------|
  10613. * | . |
  10614. * | . |
  10615. * | . |
  10616. * |-------------------------------------------------------------------|
  10617. *
  10618. * Each payload is 5 DWORDS long and is interpreted as follows:
  10619. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  10620. * this flow is associated. It can be VDEV, peer,
  10621. * or tid (AC). Based on enum htt_flow_type.
  10622. *
  10623. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  10624. * object. For flow_type vdev it is set to the
  10625. * vdevid, for peer it is peerid and for tid, it is
  10626. * tid_num.
  10627. *
  10628. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  10629. * in the host for this flow
  10630. * b'16:31 - reserved0: This field in reserved for the future. In case
  10631. * we have a hierarchical implementation (HCM) of
  10632. * pools, it can be used to indicate the ID of the
  10633. * parent-pool.
  10634. *
  10635. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  10636. * Descriptors for this flow will be
  10637. * allocated from this pool in the host.
  10638. * b'16:31 - reserved1: This field in reserved for the future. In case
  10639. * we have a hierarchical implementation of pools,
  10640. * it can be used to indicate the max number of
  10641. * descriptors in the pool. The b'0:15 can be used
  10642. * to indicate min number of descriptors in the
  10643. * HCM scheme.
  10644. *
  10645. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  10646. * we have a hierarchical implementation of pools,
  10647. * b'0:15 can be used to indicate the
  10648. * priority-based borrowing (PBB) threshold of
  10649. * the flow's pool. The b'16:31 are still left
  10650. * reserved.
  10651. */
  10652. enum htt_flow_type {
  10653. FLOW_TYPE_VDEV = 0,
  10654. /* Insert new flow types above this line */
  10655. };
  10656. PREPACK struct htt_flow_pool_map_payload_t {
  10657. A_UINT32 flow_type;
  10658. A_UINT32 flow_id;
  10659. A_UINT32 flow_pool_id:16,
  10660. reserved0:16;
  10661. A_UINT32 flow_pool_size:16,
  10662. reserved1:16;
  10663. A_UINT32 reserved2;
  10664. } POSTPACK;
  10665. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  10666. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  10667. (sizeof(struct htt_flow_pool_map_payload_t))
  10668. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  10669. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  10670. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  10671. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  10672. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  10673. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  10674. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  10675. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  10676. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  10677. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  10678. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  10679. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  10680. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  10681. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  10682. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  10683. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  10684. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  10685. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  10686. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  10687. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  10688. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  10689. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  10690. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  10691. do { \
  10692. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  10693. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  10694. } while (0)
  10695. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  10696. do { \
  10697. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  10698. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  10699. } while (0)
  10700. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  10701. do { \
  10702. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  10703. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  10704. } while (0)
  10705. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  10706. do { \
  10707. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  10708. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  10709. } while (0)
  10710. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  10711. do { \
  10712. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  10713. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  10714. } while (0)
  10715. /**
  10716. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  10717. *
  10718. * @details
  10719. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  10720. * down a flow of descriptors.
  10721. * This message indicates that for the flow (whose ID is provided) is wanting
  10722. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  10723. * pool of descriptors from where descriptors are being allocated for this
  10724. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  10725. * be unmapped by the host.
  10726. *
  10727. * The message would appear as follows:
  10728. *
  10729. * |31 24|23 16|15 8|7 0|
  10730. * |----------------+----------------+----------------+----------------|
  10731. * | reserved0 | msg_type |
  10732. * |-------------------------------------------------------------------|
  10733. * | flow_type |
  10734. * |-------------------------------------------------------------------|
  10735. * | flow_id |
  10736. * |-------------------------------------------------------------------|
  10737. * | reserved1 | flow_pool_id |
  10738. * |-------------------------------------------------------------------|
  10739. *
  10740. * The message is interpreted as follows:
  10741. * dword0 - b'0:7 - msg_type: This will be set to
  10742. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  10743. * b'8:31 - reserved0: Reserved for future use
  10744. *
  10745. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  10746. * this flow is associated. It can be VDEV, peer,
  10747. * or tid (AC). Based on enum htt_flow_type.
  10748. *
  10749. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  10750. * object. For flow_type vdev it is set to the
  10751. * vdevid, for peer it is peerid and for tid, it is
  10752. * tid_num.
  10753. *
  10754. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  10755. * used in the host for this flow
  10756. * b'16:31 - reserved0: This field in reserved for the future.
  10757. *
  10758. */
  10759. PREPACK struct htt_flow_pool_unmap_t {
  10760. A_UINT32 msg_type:8,
  10761. reserved0:24;
  10762. A_UINT32 flow_type;
  10763. A_UINT32 flow_id;
  10764. A_UINT32 flow_pool_id:16,
  10765. reserved1:16;
  10766. } POSTPACK;
  10767. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  10768. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  10769. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  10770. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  10771. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  10772. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  10773. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  10774. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  10775. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  10776. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  10777. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  10778. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  10779. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  10780. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  10781. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  10782. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  10783. do { \
  10784. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  10785. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  10786. } while (0)
  10787. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  10788. do { \
  10789. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  10790. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  10791. } while (0)
  10792. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  10793. do { \
  10794. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  10795. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  10796. } while (0)
  10797. /**
  10798. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  10799. *
  10800. * @details
  10801. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  10802. * SRNG ring setup is done
  10803. *
  10804. * This message indicates whether the last setup operation is successful.
  10805. * It will be sent to host when host set respose_required bit in
  10806. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  10807. * The message would appear as follows:
  10808. *
  10809. * |31 24|23 16|15 8|7 0|
  10810. * |--------------- +----------------+----------------+----------------|
  10811. * | setup_status | ring_id | pdev_id | msg_type |
  10812. * |-------------------------------------------------------------------|
  10813. *
  10814. * The message is interpreted as follows:
  10815. * dword0 - b'0:7 - msg_type: This will be set to
  10816. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  10817. * b'8:15 - pdev_id:
  10818. * 0 (for rings at SOC/UMAC level),
  10819. * 1/2/3 mac id (for rings at LMAC level)
  10820. * b'16:23 - ring_id: Identify the ring which is set up
  10821. * More details can be got from enum htt_srng_ring_id
  10822. * b'24:31 - setup_status: Indicate status of setup operation
  10823. * Refer to htt_ring_setup_status
  10824. */
  10825. PREPACK struct htt_sring_setup_done_t {
  10826. A_UINT32 msg_type: 8,
  10827. pdev_id: 8,
  10828. ring_id: 8,
  10829. setup_status: 8;
  10830. } POSTPACK;
  10831. enum htt_ring_setup_status {
  10832. htt_ring_setup_status_ok = 0,
  10833. htt_ring_setup_status_error,
  10834. };
  10835. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  10836. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  10837. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  10838. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  10839. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  10840. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  10841. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  10842. do { \
  10843. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  10844. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  10845. } while (0)
  10846. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  10847. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  10848. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  10849. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  10850. HTT_SRING_SETUP_DONE_RING_ID_S)
  10851. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  10852. do { \
  10853. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  10854. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  10855. } while (0)
  10856. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  10857. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  10858. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  10859. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  10860. HTT_SRING_SETUP_DONE_STATUS_S)
  10861. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  10862. do { \
  10863. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  10864. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  10865. } while (0)
  10866. /**
  10867. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  10868. *
  10869. * @details
  10870. * HTT TX map flow entry with tqm flow pointer
  10871. * Sent from firmware to host to add tqm flow pointer in corresponding
  10872. * flow search entry. Flow metadata is replayed back to host as part of this
  10873. * struct to enable host to find the specific flow search entry
  10874. *
  10875. * The message would appear as follows:
  10876. *
  10877. * |31 28|27 18|17 14|13 8|7 0|
  10878. * |-------+------------------------------------------+----------------|
  10879. * | rsvd0 | fse_hsh_idx | msg_type |
  10880. * |-------------------------------------------------------------------|
  10881. * | rsvd1 | tid | peer_id |
  10882. * |-------------------------------------------------------------------|
  10883. * | tqm_flow_pntr_lo |
  10884. * |-------------------------------------------------------------------|
  10885. * | tqm_flow_pntr_hi |
  10886. * |-------------------------------------------------------------------|
  10887. * | fse_meta_data |
  10888. * |-------------------------------------------------------------------|
  10889. *
  10890. * The message is interpreted as follows:
  10891. *
  10892. * dword0 - b'0:7 - msg_type: This will be set to
  10893. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  10894. *
  10895. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  10896. * for this flow entry
  10897. *
  10898. * dword0 - b'28:31 - rsvd0: Reserved for future use
  10899. *
  10900. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  10901. *
  10902. * dword1 - b'14:17 - tid
  10903. *
  10904. * dword1 - b'18:31 - rsvd1: Reserved for future use
  10905. *
  10906. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  10907. *
  10908. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  10909. *
  10910. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  10911. * given by host
  10912. */
  10913. PREPACK struct htt_tx_map_flow_info {
  10914. A_UINT32
  10915. msg_type: 8,
  10916. fse_hsh_idx: 20,
  10917. rsvd0: 4;
  10918. A_UINT32
  10919. peer_id: 14,
  10920. tid: 4,
  10921. rsvd1: 14;
  10922. A_UINT32 tqm_flow_pntr_lo;
  10923. A_UINT32 tqm_flow_pntr_hi;
  10924. struct htt_tx_flow_metadata fse_meta_data;
  10925. } POSTPACK;
  10926. /* DWORD 0 */
  10927. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  10928. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  10929. /* DWORD 1 */
  10930. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  10931. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  10932. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  10933. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  10934. /* DWORD 0 */
  10935. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  10936. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  10937. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  10938. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  10939. do { \
  10940. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  10941. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  10942. } while (0)
  10943. /* DWORD 1 */
  10944. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  10945. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  10946. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  10947. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  10948. do { \
  10949. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  10950. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  10951. } while (0)
  10952. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  10953. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  10954. HTT_TX_MAP_FLOW_INFO_TID_S)
  10955. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  10956. do { \
  10957. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  10958. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  10959. } while (0)
  10960. /*
  10961. * htt_dbg_ext_stats_status -
  10962. * present - The requested stats have been delivered in full.
  10963. * This indicates that either the stats information was contained
  10964. * in its entirety within this message, or else this message
  10965. * completes the delivery of the requested stats info that was
  10966. * partially delivered through earlier STATS_CONF messages.
  10967. * partial - The requested stats have been delivered in part.
  10968. * One or more subsequent STATS_CONF messages with the same
  10969. * cookie value will be sent to deliver the remainder of the
  10970. * information.
  10971. * error - The requested stats could not be delivered, for example due
  10972. * to a shortage of memory to construct a message holding the
  10973. * requested stats.
  10974. * invalid - The requested stat type is either not recognized, or the
  10975. * target is configured to not gather the stats type in question.
  10976. */
  10977. enum htt_dbg_ext_stats_status {
  10978. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  10979. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  10980. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  10981. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  10982. };
  10983. /**
  10984. * @brief target -> host ppdu stats upload
  10985. *
  10986. * @details
  10987. * The following field definitions describe the format of the HTT target
  10988. * to host ppdu stats indication message.
  10989. *
  10990. *
  10991. * |31 16|15 12|11 10|9 8|7 0 |
  10992. * |----------------------------------------------------------------------|
  10993. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  10994. * |----------------------------------------------------------------------|
  10995. * | ppdu_id |
  10996. * |----------------------------------------------------------------------|
  10997. * | Timestamp in us |
  10998. * |----------------------------------------------------------------------|
  10999. * | reserved |
  11000. * |----------------------------------------------------------------------|
  11001. * | type-specific stats info |
  11002. * | (see htt_ppdu_stats.h) |
  11003. * |----------------------------------------------------------------------|
  11004. * Header fields:
  11005. * - MSG_TYPE
  11006. * Bits 7:0
  11007. * Purpose: Identifies this is a PPDU STATS indication
  11008. * message.
  11009. * Value: 0x1d
  11010. * - mac_id
  11011. * Bits 9:8
  11012. * Purpose: mac_id of this ppdu_id
  11013. * Value: 0-3
  11014. * - pdev_id
  11015. * Bits 11:10
  11016. * Purpose: pdev_id of this ppdu_id
  11017. * Value: 0-3
  11018. * 0 (for rings at SOC level),
  11019. * 1/2/3 PDEV -> 0/1/2
  11020. * - payload_size
  11021. * Bits 31:16
  11022. * Purpose: total tlv size
  11023. * Value: payload_size in bytes
  11024. */
  11025. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  11026. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  11027. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  11028. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  11029. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  11030. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  11031. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  11032. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  11033. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  11034. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  11035. do { \
  11036. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  11037. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  11038. } while (0)
  11039. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  11040. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  11041. HTT_T2H_PPDU_STATS_MAC_ID_S)
  11042. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  11043. do { \
  11044. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  11045. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  11046. } while (0)
  11047. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  11048. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  11049. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  11050. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  11051. do { \
  11052. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  11053. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  11054. } while (0)
  11055. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  11056. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  11057. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  11058. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  11059. do { \
  11060. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  11061. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  11062. } while (0)
  11063. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  11064. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  11065. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  11066. /* htt_t2h_ppdu_stats_ind_hdr_t
  11067. * This struct contains the fields within the header of the
  11068. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  11069. * stats info.
  11070. * This struct assumes little-endian layout, and thus is only
  11071. * suitable for use within processors known to be little-endian
  11072. * (such as the target).
  11073. * In contrast, the above macros provide endian-portable methods
  11074. * to get and set the bitfields within this PPDU_STATS_IND header.
  11075. */
  11076. typedef struct {
  11077. A_UINT32 msg_type: 8, /* bits 7:0 */
  11078. mac_id: 2, /* bits 9:8 */
  11079. pdev_id: 2, /* bits 11:10 */
  11080. reserved1: 4, /* bits 15:12 */
  11081. payload_size: 16; /* bits 31:16 */
  11082. A_UINT32 ppdu_id;
  11083. A_UINT32 timestamp_us;
  11084. A_UINT32 reserved2;
  11085. } htt_t2h_ppdu_stats_ind_hdr_t;
  11086. /**
  11087. * @brief target -> host extended statistics upload
  11088. *
  11089. * @details
  11090. * The following field definitions describe the format of the HTT target
  11091. * to host stats upload confirmation message.
  11092. * The message contains a cookie echoed from the HTT host->target stats
  11093. * upload request, which identifies which request the confirmation is
  11094. * for, and a single stats can span over multiple HTT stats indication
  11095. * due to the HTT message size limitation so every HTT ext stats indication
  11096. * will have tag-length-value stats information elements.
  11097. * The tag-length header for each HTT stats IND message also includes a
  11098. * status field, to indicate whether the request for the stat type in
  11099. * question was fully met, partially met, unable to be met, or invalid
  11100. * (if the stat type in question is disabled in the target).
  11101. * A Done bit 1's indicate the end of the of stats info elements.
  11102. *
  11103. *
  11104. * |31 16|15 12|11|10 8|7 5|4 0|
  11105. * |--------------------------------------------------------------|
  11106. * | reserved | msg type |
  11107. * |--------------------------------------------------------------|
  11108. * | cookie LSBs |
  11109. * |--------------------------------------------------------------|
  11110. * | cookie MSBs |
  11111. * |--------------------------------------------------------------|
  11112. * | stats entry length | rsvd | D| S | stat type |
  11113. * |--------------------------------------------------------------|
  11114. * | type-specific stats info |
  11115. * | (see htt_stats.h) |
  11116. * |--------------------------------------------------------------|
  11117. * Header fields:
  11118. * - MSG_TYPE
  11119. * Bits 7:0
  11120. * Purpose: Identifies this is a extended statistics upload confirmation
  11121. * message.
  11122. * Value: 0x1c
  11123. * - COOKIE_LSBS
  11124. * Bits 31:0
  11125. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11126. * message with its preceding host->target stats request message.
  11127. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11128. * - COOKIE_MSBS
  11129. * Bits 31:0
  11130. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11131. * message with its preceding host->target stats request message.
  11132. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11133. *
  11134. * Stats Information Element tag-length header fields:
  11135. * - STAT_TYPE
  11136. * Bits 7:0
  11137. * Purpose: identifies the type of statistics info held in the
  11138. * following information element
  11139. * Value: htt_dbg_ext_stats_type
  11140. * - STATUS
  11141. * Bits 10:8
  11142. * Purpose: indicate whether the requested stats are present
  11143. * Value: htt_dbg_ext_stats_status
  11144. * - DONE
  11145. * Bits 11
  11146. * Purpose:
  11147. * Indicates the completion of the stats entry, this will be the last
  11148. * stats conf HTT segment for the requested stats type.
  11149. * Value:
  11150. * 0 -> the stats retrieval is ongoing
  11151. * 1 -> the stats retrieval is complete
  11152. * - LENGTH
  11153. * Bits 31:16
  11154. * Purpose: indicate the stats information size
  11155. * Value: This field specifies the number of bytes of stats information
  11156. * that follows the element tag-length header.
  11157. * It is expected but not required that this length is a multiple of
  11158. * 4 bytes.
  11159. */
  11160. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  11161. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  11162. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  11163. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  11164. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  11165. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  11166. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  11167. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  11168. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  11169. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11170. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  11171. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  11172. do { \
  11173. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  11174. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  11175. } while (0)
  11176. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  11177. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  11178. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  11179. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  11180. do { \
  11181. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  11182. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  11183. } while (0)
  11184. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  11185. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  11186. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  11187. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  11188. do { \
  11189. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  11190. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  11191. } while (0)
  11192. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  11193. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  11194. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  11195. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11196. do { \
  11197. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  11198. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  11199. } while (0)
  11200. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  11201. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  11202. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  11203. typedef enum {
  11204. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  11205. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  11206. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  11207. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  11208. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  11209. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  11210. /* Reserved from 128 - 255 for target internal use.*/
  11211. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  11212. } HTT_PEER_TYPE;
  11213. /** 2 word representation of MAC addr */
  11214. typedef struct {
  11215. /** upper 4 bytes of MAC address */
  11216. A_UINT32 mac_addr31to0;
  11217. /** lower 2 bytes of MAC address */
  11218. A_UINT32 mac_addr47to32;
  11219. } htt_mac_addr;
  11220. /** macro to convert MAC address from char array to HTT word format */
  11221. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  11222. (phtt_mac_addr)->mac_addr31to0 = \
  11223. (((c_macaddr)[0] << 0) | \
  11224. ((c_macaddr)[1] << 8) | \
  11225. ((c_macaddr)[2] << 16) | \
  11226. ((c_macaddr)[3] << 24)); \
  11227. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  11228. } while (0)
  11229. /**
  11230. * @brief target -> host monitor mac header indication message
  11231. *
  11232. * @details
  11233. * The following diagram shows the format of the monitor mac header message
  11234. * sent from the target to the host.
  11235. * This message is primarily sent when promiscuous rx mode is enabled.
  11236. * One message is sent per rx PPDU.
  11237. *
  11238. * |31 24|23 16|15 8|7 0|
  11239. * |-------------------------------------------------------------|
  11240. * | peer_id | reserved0 | msg_type |
  11241. * |-------------------------------------------------------------|
  11242. * | reserved1 | num_mpdu |
  11243. * |-------------------------------------------------------------|
  11244. * | struct hw_rx_desc |
  11245. * | (see wal_rx_desc.h) |
  11246. * |-------------------------------------------------------------|
  11247. * | struct ieee80211_frame_addr4 |
  11248. * | (see ieee80211_defs.h) |
  11249. * |-------------------------------------------------------------|
  11250. * | struct ieee80211_frame_addr4 |
  11251. * | (see ieee80211_defs.h) |
  11252. * |-------------------------------------------------------------|
  11253. * | ...... |
  11254. * |-------------------------------------------------------------|
  11255. *
  11256. * Header fields:
  11257. * - msg_type
  11258. * Bits 7:0
  11259. * Purpose: Identifies this is a monitor mac header indication message.
  11260. * Value: 0x20
  11261. * - peer_id
  11262. * Bits 31:16
  11263. * Purpose: Software peer id given by host during association,
  11264. * During promiscuous mode, the peer ID will be invalid (0xFF)
  11265. * for rx PPDUs received from unassociated peers.
  11266. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  11267. * - num_mpdu
  11268. * Bits 15:0
  11269. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  11270. * delivered within the message.
  11271. * Value: 1 to 32
  11272. * num_mpdu is limited to a maximum value of 32, due to buffer
  11273. * size limits. For PPDUs with more than 32 MPDUs, only the
  11274. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  11275. * the PPDU will be provided.
  11276. */
  11277. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  11278. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  11279. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  11280. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  11281. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  11282. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  11283. do { \
  11284. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  11285. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  11286. } while (0)
  11287. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  11288. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  11289. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  11290. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  11291. do { \
  11292. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  11293. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  11294. } while (0)
  11295. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  11296. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  11297. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  11298. /**
  11299. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  11300. *
  11301. * @details
  11302. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  11303. * the flow pool associated with the specified ID is resized
  11304. *
  11305. * The message would appear as follows:
  11306. *
  11307. * |31 16|15 8|7 0|
  11308. * |---------------------------------+----------------+----------------|
  11309. * | reserved0 | Msg type |
  11310. * |-------------------------------------------------------------------|
  11311. * | flow pool new size | flow pool ID |
  11312. * |-------------------------------------------------------------------|
  11313. *
  11314. * The message is interpreted as follows:
  11315. * b'0:7 - msg_type: This will be set to
  11316. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  11317. *
  11318. * b'0:15 - flow pool ID: Existing flow pool ID
  11319. *
  11320. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  11321. *
  11322. */
  11323. PREPACK struct htt_flow_pool_resize_t {
  11324. A_UINT32 msg_type:8,
  11325. reserved0:24;
  11326. A_UINT32 flow_pool_id:16,
  11327. flow_pool_new_size:16;
  11328. } POSTPACK;
  11329. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  11330. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  11331. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  11332. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  11333. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  11334. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  11335. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  11336. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  11337. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  11338. do { \
  11339. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  11340. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  11341. } while (0)
  11342. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  11343. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  11344. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  11345. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  11346. do { \
  11347. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  11348. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  11349. } while (0)
  11350. /**
  11351. * @brief host -> target channel change message
  11352. *
  11353. * @details
  11354. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  11355. * to associate RX frames to correct channel they were received on.
  11356. * The following field definitions describe the format of the HTT target
  11357. * to host channel change message.
  11358. * |31 16|15 8|7 5|4 0|
  11359. * |------------------------------------------------------------|
  11360. * | reserved | MSG_TYPE |
  11361. * |------------------------------------------------------------|
  11362. * | CHAN_MHZ |
  11363. * |------------------------------------------------------------|
  11364. * | BAND_CENTER_FREQ1 |
  11365. * |------------------------------------------------------------|
  11366. * | BAND_CENTER_FREQ2 |
  11367. * |------------------------------------------------------------|
  11368. * | CHAN_PHY_MODE |
  11369. * |------------------------------------------------------------|
  11370. * Header fields:
  11371. * - MSG_TYPE
  11372. * Bits 7:0
  11373. * Value: 0xf
  11374. * - CHAN_MHZ
  11375. * Bits 31:0
  11376. * Purpose: frequency of the primary 20mhz channel.
  11377. * - BAND_CENTER_FREQ1
  11378. * Bits 31:0
  11379. * Purpose: centre frequency of the full channel.
  11380. * - BAND_CENTER_FREQ2
  11381. * Bits 31:0
  11382. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  11383. * - CHAN_PHY_MODE
  11384. * Bits 31:0
  11385. * Purpose: phy mode of the channel.
  11386. */
  11387. PREPACK struct htt_chan_change_msg {
  11388. A_UINT32 chan_mhz; /* frequency in mhz */
  11389. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  11390. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  11391. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  11392. } POSTPACK;
  11393. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  11394. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  11395. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  11396. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  11397. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  11398. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  11399. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  11400. /*
  11401. * The read and write indices point to the data within the host buffer.
  11402. * Because the first 4 bytes of the host buffer is used for the read index and
  11403. * the next 4 bytes for the write index, the data itself starts at offset 8.
  11404. * The read index and write index are the byte offsets from the base of the
  11405. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  11406. * Refer the ASCII text picture below.
  11407. */
  11408. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  11409. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  11410. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  11411. /*
  11412. ***************************************************************************
  11413. *
  11414. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11415. *
  11416. ***************************************************************************
  11417. *
  11418. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  11419. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  11420. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  11421. * written into the Host memory region mentioned below.
  11422. *
  11423. * Read index is updated by the Host. At any point of time, the read index will
  11424. * indicate the index that will next be read by the Host. The read index is
  11425. * in units of bytes offset from the base of the meta-data buffer.
  11426. *
  11427. * Write index is updated by the FW. At any point of time, the write index will
  11428. * indicate from where the FW can start writing any new data. The write index is
  11429. * in units of bytes offset from the base of the meta-data buffer.
  11430. *
  11431. * If the Host is not fast enough in reading the CFR data, any new capture data
  11432. * would be dropped if there is no space left to write the new captures.
  11433. *
  11434. * The last 4 bytes of the memory region will have the magic pattern
  11435. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  11436. * not overrun the host buffer.
  11437. *
  11438. * ,--------------------. read and write indices store the
  11439. * | | byte offset from the base of the
  11440. * | ,--------+--------. meta-data buffer to the next
  11441. * | | | | location within the data buffer
  11442. * | | v v that will be read / written
  11443. * ************************************************************************
  11444. * * Read * Write * * Magic *
  11445. * * index * index * CFR data1 ...... CFR data N * pattern *
  11446. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  11447. * ************************************************************************
  11448. * |<---------- data buffer ---------->|
  11449. *
  11450. * |<----------------- meta-data buffer allocated in Host ----------------|
  11451. *
  11452. * Note:
  11453. * - Considering the 4 bytes needed to store the Read index (R) and the
  11454. * Write index (W), the initial value is as follows:
  11455. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  11456. * - Buffer empty condition:
  11457. * R = W
  11458. *
  11459. * Regarding CFR data format:
  11460. * --------------------------
  11461. *
  11462. * Each CFR tone is stored in HW as 16-bits with the following format:
  11463. * {bits[15:12], bits[11:6], bits[5:0]} =
  11464. * {unsigned exponent (4 bits),
  11465. * signed mantissa_real (6 bits),
  11466. * signed mantissa_imag (6 bits)}
  11467. *
  11468. * CFR_real = mantissa_real * 2^(exponent-5)
  11469. * CFR_imag = mantissa_imag * 2^(exponent-5)
  11470. *
  11471. *
  11472. * The CFR data is written to the 16-bit unsigned output array (buff) in
  11473. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  11474. *
  11475. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  11476. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  11477. * .
  11478. * .
  11479. * .
  11480. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  11481. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  11482. */
  11483. /* Bandwidth of peer CFR captures */
  11484. typedef enum {
  11485. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  11486. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  11487. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  11488. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  11489. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  11490. HTT_PEER_CFR_CAPTURE_BW_MAX,
  11491. } HTT_PEER_CFR_CAPTURE_BW;
  11492. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  11493. * was captured
  11494. */
  11495. typedef enum {
  11496. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  11497. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  11498. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  11499. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  11500. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  11501. } HTT_PEER_CFR_CAPTURE_MODE;
  11502. typedef enum {
  11503. /* This message type is currently used for the below purpose:
  11504. *
  11505. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  11506. * wmi_peer_cfr_capture_cmd.
  11507. * If payload_present bit is set to 0 then the associated memory region
  11508. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  11509. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  11510. * message; the CFR dump will be present at the end of the message,
  11511. * after the chan_phy_mode.
  11512. */
  11513. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  11514. /* Always keep this last */
  11515. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  11516. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  11517. /**
  11518. * @brief target -> host CFR dump completion indication message definition
  11519. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  11520. *
  11521. * @details
  11522. * The following diagram shows the format of the Channel Frequency Response
  11523. * (CFR) dump completion indication. This inidcation is sent to the Host when
  11524. * the channel capture of a peer is copied by Firmware into the Host memory
  11525. *
  11526. * **************************************************************************
  11527. *
  11528. * Message format when the CFR capture message type is
  11529. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11530. *
  11531. * **************************************************************************
  11532. *
  11533. * |31 16|15 |8|7 0|
  11534. * |----------------------------------------------------------------|
  11535. * header: | reserved |P| msg_type |
  11536. * word 0 | | | |
  11537. * |----------------------------------------------------------------|
  11538. * payload: | cfr_capture_msg_type |
  11539. * word 1 | |
  11540. * |----------------------------------------------------------------|
  11541. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  11542. * word 2 | | | | | | | | |
  11543. * |----------------------------------------------------------------|
  11544. * | mac_addr31to0 |
  11545. * word 3 | |
  11546. * |----------------------------------------------------------------|
  11547. * | unused / reserved | mac_addr47to32 |
  11548. * word 4 | | |
  11549. * |----------------------------------------------------------------|
  11550. * | index |
  11551. * word 5 | |
  11552. * |----------------------------------------------------------------|
  11553. * | length |
  11554. * word 6 | |
  11555. * |----------------------------------------------------------------|
  11556. * | timestamp |
  11557. * word 7 | |
  11558. * |----------------------------------------------------------------|
  11559. * | counter |
  11560. * word 8 | |
  11561. * |----------------------------------------------------------------|
  11562. * | chan_mhz |
  11563. * word 9 | |
  11564. * |----------------------------------------------------------------|
  11565. * | band_center_freq1 |
  11566. * word 10 | |
  11567. * |----------------------------------------------------------------|
  11568. * | band_center_freq2 |
  11569. * word 11 | |
  11570. * |----------------------------------------------------------------|
  11571. * | chan_phy_mode |
  11572. * word 12 | |
  11573. * |----------------------------------------------------------------|
  11574. * where,
  11575. * P - payload present bit (payload_present explained below)
  11576. * req_id - memory request id (mem_req_id explained below)
  11577. * S - status field (status explained below)
  11578. * capbw - capture bandwidth (capture_bw explained below)
  11579. * mode - mode of capture (mode explained below)
  11580. * sts - space time streams (sts_count explained below)
  11581. * chbw - channel bandwidth (channel_bw explained below)
  11582. * captype - capture type (cap_type explained below)
  11583. *
  11584. * The following field definitions describe the format of the CFR dump
  11585. * completion indication sent from the target to the host
  11586. *
  11587. * Header fields:
  11588. *
  11589. * Word 0
  11590. * - msg_type
  11591. * Bits 7:0
  11592. * Purpose: Identifies this as CFR TX completion indication
  11593. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  11594. * - payload_present
  11595. * Bit 8
  11596. * Purpose: Identifies how CFR data is sent to host
  11597. * Value: 0 - If CFR Payload is written to host memory
  11598. * 1 - If CFR Payload is sent as part of HTT message
  11599. * (This is the requirement for SDIO/USB where it is
  11600. * not possible to write CFR data to host memory)
  11601. * - reserved
  11602. * Bits 31:9
  11603. * Purpose: Reserved
  11604. * Value: 0
  11605. *
  11606. * Payload fields:
  11607. *
  11608. * Word 1
  11609. * - cfr_capture_msg_type
  11610. * Bits 31:0
  11611. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  11612. * to specify the format used for the remainder of the message
  11613. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11614. * (currently only MSG_TYPE_1 is defined)
  11615. *
  11616. * Word 2
  11617. * - mem_req_id
  11618. * Bits 6:0
  11619. * Purpose: Contain the mem request id of the region where the CFR capture
  11620. * has been stored - of type WMI_HOST_MEM_REQ_ID
  11621. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  11622. this value is invalid)
  11623. * - status
  11624. * Bit 7
  11625. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  11626. * Value: 1 (True) - Successful; 0 (False) - Not successful
  11627. * - capture_bw
  11628. * Bits 10:8
  11629. * Purpose: Carry the bandwidth of the CFR capture
  11630. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  11631. * - mode
  11632. * Bits 13:11
  11633. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  11634. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  11635. * - sts_count
  11636. * Bits 16:14
  11637. * Purpose: Carry the number of space time streams
  11638. * Value: Number of space time streams
  11639. * - channel_bw
  11640. * Bits 19:17
  11641. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  11642. * measurement
  11643. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  11644. * - cap_type
  11645. * Bits 23:20
  11646. * Purpose: Carry the type of the capture
  11647. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  11648. * - vdev_id
  11649. * Bits 31:24
  11650. * Purpose: Carry the virtual device id
  11651. * Value: vdev ID
  11652. *
  11653. * Word 3
  11654. * - mac_addr31to0
  11655. * Bits 31:0
  11656. * Purpose: Contain the bits 31:0 of the peer MAC address
  11657. * Value: Bits 31:0 of the peer MAC address
  11658. *
  11659. * Word 4
  11660. * - mac_addr47to32
  11661. * Bits 15:0
  11662. * Purpose: Contain the bits 47:32 of the peer MAC address
  11663. * Value: Bits 47:32 of the peer MAC address
  11664. *
  11665. * Word 5
  11666. * - index
  11667. * Bits 31:0
  11668. * Purpose: Contain the index at which this CFR dump was written in the Host
  11669. * allocated memory. This index is the number of bytes from the base address.
  11670. * Value: Index position
  11671. *
  11672. * Word 6
  11673. * - length
  11674. * Bits 31:0
  11675. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  11676. * Value: Length of the CFR capture of the peer
  11677. *
  11678. * Word 7
  11679. * - timestamp
  11680. * Bits 31:0
  11681. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  11682. * clock used for this timestamp is private to the target and not visible to
  11683. * the host i.e., Host can interpret only the relative timestamp deltas from
  11684. * one message to the next, but can't interpret the absolute timestamp from a
  11685. * single message.
  11686. * Value: Timestamp in microseconds
  11687. *
  11688. * Word 8
  11689. * - counter
  11690. * Bits 31:0
  11691. * Purpose: Carry the count of the current CFR capture from FW. This is
  11692. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  11693. * in host memory)
  11694. * Value: Count of the current CFR capture
  11695. *
  11696. * Word 9
  11697. * - chan_mhz
  11698. * Bits 31:0
  11699. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  11700. * Value: Primary 20 channel frequency
  11701. *
  11702. * Word 10
  11703. * - band_center_freq1
  11704. * Bits 31:0
  11705. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  11706. * Value: Center frequency 1 in MHz
  11707. *
  11708. * Word 11
  11709. * - band_center_freq2
  11710. * Bits 31:0
  11711. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  11712. * the VDEV
  11713. * 80plus80 mode
  11714. * Value: Center frequency 2 in MHz
  11715. *
  11716. * Word 12
  11717. * - chan_phy_mode
  11718. * Bits 31:0
  11719. * Purpose: Carry the phy mode of the channel, of the VDEV
  11720. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  11721. */
  11722. PREPACK struct htt_cfr_dump_ind_type_1 {
  11723. A_UINT32 mem_req_id:7,
  11724. status:1,
  11725. capture_bw:3,
  11726. mode:3,
  11727. sts_count:3,
  11728. channel_bw:3,
  11729. cap_type:4,
  11730. vdev_id:8;
  11731. htt_mac_addr addr;
  11732. A_UINT32 index;
  11733. A_UINT32 length;
  11734. A_UINT32 timestamp;
  11735. A_UINT32 counter;
  11736. struct htt_chan_change_msg chan;
  11737. } POSTPACK;
  11738. PREPACK struct htt_cfr_dump_compl_ind {
  11739. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  11740. union {
  11741. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  11742. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  11743. /* If there is a need to change the memory layout and its associated
  11744. * HTT indication format, a new CFR capture message type can be
  11745. * introduced and added into this union.
  11746. */
  11747. };
  11748. } POSTPACK;
  11749. /*
  11750. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  11751. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11752. */
  11753. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  11754. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  11755. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  11756. do { \
  11757. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  11758. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  11759. } while(0)
  11760. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  11761. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  11762. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  11763. /*
  11764. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  11765. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11766. */
  11767. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  11768. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  11769. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  11770. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  11771. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  11772. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  11773. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  11774. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  11775. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  11776. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  11777. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  11778. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  11779. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  11780. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  11781. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  11782. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  11783. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  11784. do { \
  11785. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  11786. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  11787. } while (0)
  11788. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  11789. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  11790. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  11791. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  11792. do { \
  11793. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  11794. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  11795. } while (0)
  11796. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  11797. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  11798. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  11799. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  11800. do { \
  11801. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  11802. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  11803. } while (0)
  11804. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  11805. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  11806. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  11807. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  11808. do { \
  11809. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  11810. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  11811. } while (0)
  11812. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  11813. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  11814. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  11815. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  11816. do { \
  11817. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  11818. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  11819. } while (0)
  11820. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  11821. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  11822. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  11823. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  11824. do { \
  11825. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  11826. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  11827. } while (0)
  11828. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  11829. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  11830. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  11831. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  11832. do { \
  11833. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  11834. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  11835. } while (0)
  11836. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  11837. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  11838. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  11839. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  11840. do { \
  11841. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  11842. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  11843. } while (0)
  11844. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  11845. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  11846. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  11847. /**
  11848. * @brief target -> host peer (PPDU) stats message
  11849. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  11850. * @details
  11851. * This message is generated by FW when FW is sending stats to host
  11852. * about one or more PPDUs that the FW has transmitted to one or more peers.
  11853. * This message is sent autonomously by the target rather than upon request
  11854. * by the host.
  11855. * The following field definitions describe the format of the HTT target
  11856. * to host peer stats indication message.
  11857. *
  11858. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  11859. * or more PPDU stats records.
  11860. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  11861. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  11862. * then the message would start with the
  11863. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  11864. * below.
  11865. *
  11866. * |31 16|15|14|13 11|10 9|8|7 0|
  11867. * |-------------------------------------------------------------|
  11868. * | reserved |MSG_TYPE |
  11869. * |-------------------------------------------------------------|
  11870. * rec 0 | TLV header |
  11871. * rec 0 |-------------------------------------------------------------|
  11872. * rec 0 | ppdu successful bytes |
  11873. * rec 0 |-------------------------------------------------------------|
  11874. * rec 0 | ppdu retry bytes |
  11875. * rec 0 |-------------------------------------------------------------|
  11876. * rec 0 | ppdu failed bytes |
  11877. * rec 0 |-------------------------------------------------------------|
  11878. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  11879. * rec 0 |-------------------------------------------------------------|
  11880. * rec 0 | retried MSDUs | successful MSDUs |
  11881. * rec 0 |-------------------------------------------------------------|
  11882. * rec 0 | TX duration | failed MSDUs |
  11883. * rec 0 |-------------------------------------------------------------|
  11884. * ...
  11885. * |-------------------------------------------------------------|
  11886. * rec N | TLV header |
  11887. * rec N |-------------------------------------------------------------|
  11888. * rec N | ppdu successful bytes |
  11889. * rec N |-------------------------------------------------------------|
  11890. * rec N | ppdu retry bytes |
  11891. * rec N |-------------------------------------------------------------|
  11892. * rec N | ppdu failed bytes |
  11893. * rec N |-------------------------------------------------------------|
  11894. * rec N | peer id | S|SG| BW | BA |A|rate code|
  11895. * rec N |-------------------------------------------------------------|
  11896. * rec N | retried MSDUs | successful MSDUs |
  11897. * rec N |-------------------------------------------------------------|
  11898. * rec N | TX duration | failed MSDUs |
  11899. * rec N |-------------------------------------------------------------|
  11900. *
  11901. * where:
  11902. * A = is A-MPDU flag
  11903. * BA = block-ack failure flags
  11904. * BW = bandwidth spec
  11905. * SG = SGI enabled spec
  11906. * S = skipped rate ctrl
  11907. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  11908. *
  11909. * Header
  11910. * ------
  11911. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  11912. * dword0 - b'8:31 - reserved : Reserved for future use
  11913. *
  11914. * payload include below peer_stats information
  11915. * --------------------------------------------
  11916. * @TLV : HTT_PPDU_STATS_INFO_TLV
  11917. * @tx_success_bytes : total successful bytes in the PPDU.
  11918. * @tx_retry_bytes : total retried bytes in the PPDU.
  11919. * @tx_failed_bytes : total failed bytes in the PPDU.
  11920. * @tx_ratecode : rate code used for the PPDU.
  11921. * @is_ampdu : Indicates PPDU is AMPDU or not.
  11922. * @ba_ack_failed : BA/ACK failed for this PPDU
  11923. * b00 -> BA received
  11924. * b01 -> BA failed once
  11925. * b10 -> BA failed twice, when HW retry is enabled.
  11926. * @bw : BW
  11927. * b00 -> 20 MHz
  11928. * b01 -> 40 MHz
  11929. * b10 -> 80 MHz
  11930. * b11 -> 160 MHz (or 80+80)
  11931. * @sg : SGI enabled
  11932. * @s : skipped ratectrl
  11933. * @peer_id : peer id
  11934. * @tx_success_msdus : successful MSDUs
  11935. * @tx_retry_msdus : retried MSDUs
  11936. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  11937. * @tx_duration : Tx duration for the PPDU (microsecond units)
  11938. */
  11939. /**
  11940. * @brief HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID Message
  11941. *
  11942. * @details
  11943. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  11944. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  11945. * This message will only be sent if the backpressure condition has existed
  11946. * continuously for an initial period (100 ms).
  11947. * Repeat messages with updated information will be sent after each
  11948. * subsequent period (100 ms) as long as the backpressure remains unabated.
  11949. * This message indicates the ring id along with current head and tail index
  11950. * locations (i.e. write and read indices).
  11951. * The backpressure time indicates the time in ms for which continous
  11952. * backpressure has been observed in the ring.
  11953. *
  11954. * The message format is as follows:
  11955. *
  11956. * |31 24|23 16|15 8|7 0|
  11957. * |----------------+----------------+----------------+----------------|
  11958. * | ring_id | ring_type | pdev_id | msg_type |
  11959. * |-------------------------------------------------------------------|
  11960. * | tail_idx | head_idx |
  11961. * |-------------------------------------------------------------------|
  11962. * | backpressure_time_ms |
  11963. * |-------------------------------------------------------------------|
  11964. *
  11965. * The message is interpreted as follows:
  11966. * dword0 - b'0:7 - msg_type: This will be set to
  11967. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  11968. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  11969. * 1, 2, 3 indicates pdev_id 0,1,2 and
  11970. the msg is for LMAC ring.
  11971. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  11972. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  11973. * htt_backpressure_lmac_ring_id. This represents
  11974. * the ring id for which continous backpressure is seen
  11975. *
  11976. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  11977. * the ring indicated by the ring_id
  11978. *
  11979. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  11980. * the ring indicated by the ring id
  11981. *
  11982. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  11983. * backpressure has been seen in the ring
  11984. * indicated by the ring_id.
  11985. * Units = milliseconds
  11986. */
  11987. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  11988. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  11989. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  11990. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  11991. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  11992. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  11993. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  11994. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  11995. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  11996. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  11997. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  11998. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  11999. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  12000. do { \
  12001. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  12002. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  12003. } while (0)
  12004. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  12005. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  12006. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  12007. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  12008. do { \
  12009. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  12010. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  12011. } while (0)
  12012. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  12013. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  12014. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  12015. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  12016. do { \
  12017. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  12018. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  12019. } while (0)
  12020. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  12021. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  12022. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  12023. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  12024. do { \
  12025. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  12026. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  12027. } while (0)
  12028. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  12029. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  12030. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  12031. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  12032. do { \
  12033. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  12034. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  12035. } while (0)
  12036. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  12037. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  12038. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  12039. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  12040. do { \
  12041. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  12042. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  12043. } while (0)
  12044. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  12045. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  12046. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  12047. enum htt_backpressure_ring_type {
  12048. HTT_SW_RING_TYPE_UMAC,
  12049. HTT_SW_RING_TYPE_LMAC,
  12050. HTT_SW_RING_TYPE_MAX,
  12051. };
  12052. /* Ring id for which the message is sent to host */
  12053. enum htt_backpressure_umac_ringid {
  12054. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  12055. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  12056. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  12057. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  12058. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  12059. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  12060. HTT_SW_RING_IDX_REO_REO2FW_RING,
  12061. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  12062. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  12063. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  12064. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  12065. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  12066. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  12067. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  12068. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  12069. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  12070. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  12071. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  12072. HTT_SW_UMAC_RING_IDX_MAX,
  12073. };
  12074. enum htt_backpressure_lmac_ringid {
  12075. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  12076. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  12077. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  12078. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  12079. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  12080. HTT_SW_RING_IDX_RXDMA2FW_RING,
  12081. HTT_SW_RING_IDX_RXDMA2SW_RING,
  12082. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  12083. HTT_SW_RING_IDX_RXDMA2REO_RING,
  12084. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  12085. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  12086. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  12087. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  12088. HTT_SW_LMAC_RING_IDX_MAX,
  12089. };
  12090. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  12091. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  12092. pdev_id: 8,
  12093. ring_type: 8, /* htt_backpressure_ring_type */
  12094. /*
  12095. * ring_id holds an enum value from either
  12096. * htt_backpressure_umac_ringid or
  12097. * htt_backpressure_lmac_ringid, based on
  12098. * the ring_type setting.
  12099. */
  12100. ring_id: 8;
  12101. A_UINT16 head_idx;
  12102. A_UINT16 tail_idx;
  12103. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  12104. } POSTPACK;
  12105. /*
  12106. * Defines two 32 bit words that can be used by the target to indicate a per
  12107. * user RU allocation and rate information.
  12108. *
  12109. * This information is currently provided in the "sw_response_reference_ptr"
  12110. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  12111. * "rx_ppdu_end_user_stats" TLV.
  12112. *
  12113. * VALID:
  12114. * The consumer of these words must explicitly check the valid bit,
  12115. * and only attempt interpretation of any of the remaining fields if
  12116. * the valid bit is set to 1.
  12117. *
  12118. * VERSION:
  12119. * The consumer of these words must also explicitly check the version bit,
  12120. * and only use the V0 definition if the VERSION field is set to 0.
  12121. *
  12122. * Version 1 is currently undefined, with the exception of the VALID and
  12123. * VERSION fields.
  12124. *
  12125. * Version 0:
  12126. *
  12127. * The fields below are duplicated per BW.
  12128. *
  12129. * The consumer must determine which BW field to use, based on the UL OFDMA
  12130. * PPDU BW indicated by HW.
  12131. *
  12132. * RU_START: RU26 start index for the user.
  12133. * Note that this is always using the RU26 index, regardless
  12134. * of the actual RU assigned to the user
  12135. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  12136. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  12137. *
  12138. * For example, 20MHz (the value in the top row is RU_START)
  12139. *
  12140. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  12141. * RU Size 1 (52): | | | | | |
  12142. * RU Size 2 (106): | | | |
  12143. * RU Size 3 (242): | |
  12144. *
  12145. * RU_SIZE: Indicates the RU size, as defined by enum
  12146. * htt_ul_ofdma_user_info_ru_size.
  12147. *
  12148. * LDPC: LDPC enabled (if 0, BCC is used)
  12149. *
  12150. * DCM: DCM enabled
  12151. *
  12152. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  12153. * |---------------------------------+--------------------------------|
  12154. * |Ver|Valid| FW internal |
  12155. * |---------------------------------+--------------------------------|
  12156. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  12157. * |---------------------------------+--------------------------------|
  12158. */
  12159. enum htt_ul_ofdma_user_info_ru_size {
  12160. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  12161. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  12162. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  12163. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  12164. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  12165. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  12166. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  12167. };
  12168. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  12169. struct htt_ul_ofdma_user_info_v0 {
  12170. A_UINT32 word0;
  12171. A_UINT32 word1;
  12172. };
  12173. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  12174. A_UINT32 w0_fw_rsvd:30; \
  12175. A_UINT32 w0_valid:1; \
  12176. A_UINT32 w0_version:1;
  12177. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  12178. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12179. };
  12180. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  12181. A_UINT32 w1_nss:3; \
  12182. A_UINT32 w1_mcs:4; \
  12183. A_UINT32 w1_ldpc:1; \
  12184. A_UINT32 w1_dcm:1; \
  12185. A_UINT32 w1_ru_start:7; \
  12186. A_UINT32 w1_ru_size:3; \
  12187. A_UINT32 w1_trig_type:4; \
  12188. A_UINT32 w1_unused:9;
  12189. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  12190. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12191. };
  12192. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  12193. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  12194. union {
  12195. A_UINT32 word0;
  12196. struct {
  12197. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12198. };
  12199. };
  12200. union {
  12201. A_UINT32 word1;
  12202. struct {
  12203. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12204. };
  12205. };
  12206. } POSTPACK;
  12207. enum HTT_UL_OFDMA_TRIG_TYPE {
  12208. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  12209. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  12210. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  12211. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  12212. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  12213. };
  12214. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  12215. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  12216. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  12217. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  12218. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  12219. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  12220. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  12221. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  12222. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  12223. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  12224. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  12225. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  12226. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  12227. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  12228. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  12229. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  12230. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  12231. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  12232. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  12233. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  12234. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  12235. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  12236. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  12237. /*--- word 0 ---*/
  12238. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  12239. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  12240. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  12241. do { \
  12242. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  12243. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  12244. } while (0)
  12245. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  12246. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  12247. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  12248. do { \
  12249. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  12250. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  12251. } while (0)
  12252. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  12253. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  12254. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  12255. do { \
  12256. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  12257. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  12258. } while (0)
  12259. /*--- word 1 ---*/
  12260. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  12261. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  12262. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  12263. do { \
  12264. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  12265. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  12266. } while (0)
  12267. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  12268. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  12269. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  12270. do { \
  12271. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  12272. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  12273. } while (0)
  12274. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  12275. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  12276. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  12277. do { \
  12278. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  12279. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  12280. } while (0)
  12281. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  12282. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  12283. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  12284. do { \
  12285. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  12286. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  12287. } while (0)
  12288. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  12289. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  12290. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  12291. do { \
  12292. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  12293. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  12294. } while (0)
  12295. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  12296. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  12297. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  12298. do { \
  12299. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  12300. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  12301. } while (0)
  12302. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  12303. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  12304. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  12305. do { \
  12306. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  12307. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  12308. } while (0)
  12309. /**
  12310. * @brief target -> host channel calibration data message
  12311. * @brief host -> target channel calibration data message
  12312. *
  12313. * @details
  12314. * The following field definitions describe the format of the channel
  12315. * calibration data message sent from the target to the host when
  12316. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  12317. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  12318. * The message is defined as htt_chan_caldata_msg followed by a variable
  12319. * number of 32-bit character values.
  12320. *
  12321. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  12322. * |------------------------------------------------------------------|
  12323. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  12324. * |------------------------------------------------------------------|
  12325. * | payload size | mhz |
  12326. * |------------------------------------------------------------------|
  12327. * | center frequency 2 | center frequency 1 |
  12328. * |------------------------------------------------------------------|
  12329. * | check sum |
  12330. * |------------------------------------------------------------------|
  12331. * | payload |
  12332. * |------------------------------------------------------------------|
  12333. * message info field:
  12334. * - MSG_TYPE
  12335. * Bits 7:0
  12336. * Purpose: identifies this as a channel calibration data message
  12337. * Value: HTT_T2H_MSG_TYPE_CHAN_CALDATA (0x15) or
  12338. * HTT_H2T_MSG_TYPE_CHAN_CALDATA (0xb)
  12339. * - SUB_TYPE
  12340. * Bits 11:8
  12341. * Purpose: T2H: indicates whether target is providing chan cal data
  12342. * to the host to store, or requesting that the host
  12343. * download previously-stored data.
  12344. * H2T: indicates whether the host is providing the requested
  12345. * channel cal data, or if it is rejecting the data
  12346. * request because it does not have the requested data.
  12347. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  12348. * - CHKSUM_VALID
  12349. * Bit 12
  12350. * Purpose: indicates if the checksum field is valid
  12351. * value:
  12352. * - FRAG
  12353. * Bit 19:16
  12354. * Purpose: indicates the fragment index for message
  12355. * value: 0 for first fragment, 1 for second fragment, ...
  12356. * - APPEND
  12357. * Bit 20
  12358. * Purpose: indicates if this is the last fragment
  12359. * value: 0 = final fragment, 1 = more fragments will be appended
  12360. *
  12361. * channel and payload size field
  12362. * - MHZ
  12363. * Bits 15:0
  12364. * Purpose: indicates the channel primary frequency
  12365. * Value:
  12366. * - PAYLOAD_SIZE
  12367. * Bits 31:16
  12368. * Purpose: indicates the bytes of calibration data in payload
  12369. * Value:
  12370. *
  12371. * center frequency field
  12372. * - CENTER FREQUENCY 1
  12373. * Bits 15:0
  12374. * Purpose: indicates the channel center frequency
  12375. * Value: channel center frequency, in MHz units
  12376. * - CENTER FREQUENCY 2
  12377. * Bits 31:16
  12378. * Purpose: indicates the secondary channel center frequency,
  12379. * only for 11acvht 80plus80 mode
  12380. * Value: secondary channel center frequeny, in MHz units, if applicable
  12381. *
  12382. * checksum field
  12383. * - CHECK_SUM
  12384. * Bits 31:0
  12385. * Purpose: check the payload data, it is just for this fragment.
  12386. * This is intended for the target to check that the channel
  12387. * calibration data returned by the host is the unmodified data
  12388. * that was previously provided to the host by the target.
  12389. * value: checksum of fragment payload
  12390. */
  12391. PREPACK struct htt_chan_caldata_msg {
  12392. /* DWORD 0: message info */
  12393. A_UINT32
  12394. msg_type: 8,
  12395. sub_type: 4 ,
  12396. chksum_valid: 1, /** 1:valid, 0:invalid */
  12397. reserved1: 3,
  12398. frag_idx: 4, /** fragment index for calibration data */
  12399. appending: 1, /** 0: no fragment appending,
  12400. * 1: extra fragment appending */
  12401. reserved2: 11;
  12402. /* DWORD 1: channel and payload size */
  12403. A_UINT32
  12404. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  12405. payload_size: 16; /** unit: bytes */
  12406. /* DWORD 2: center frequency */
  12407. A_UINT32
  12408. band_center_freq1: 16, /** Center frequency 1 in MHz */
  12409. band_center_freq2: 16; /** Center frequency 2 in MHz,
  12410. * valid only for 11acvht 80plus80 mode */
  12411. /* DWORD 3: check sum */
  12412. A_UINT32 chksum;
  12413. /* variable length for calibration data */
  12414. A_UINT32 payload[1/* or more */];
  12415. } POSTPACK;
  12416. /* T2H SUBTYPE */
  12417. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  12418. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  12419. /* H2T SUBTYPE */
  12420. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  12421. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  12422. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  12423. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  12424. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  12425. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  12426. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  12427. do { \
  12428. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  12429. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  12430. } while (0)
  12431. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  12432. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  12433. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  12434. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  12435. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  12436. do { \
  12437. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  12438. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  12439. } while (0)
  12440. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  12441. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  12442. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  12443. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  12444. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  12445. do { \
  12446. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  12447. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  12448. } while (0)
  12449. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  12450. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  12451. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  12452. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  12453. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  12454. do { \
  12455. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  12456. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  12457. } while (0)
  12458. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  12459. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  12460. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  12461. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  12462. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  12463. do { \
  12464. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  12465. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  12466. } while (0)
  12467. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  12468. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  12469. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  12470. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  12471. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  12472. do { \
  12473. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  12474. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  12475. } while (0)
  12476. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  12477. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  12478. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  12479. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  12480. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  12481. do { \
  12482. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  12483. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  12484. } while (0)
  12485. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  12486. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  12487. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  12488. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  12489. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  12490. do { \
  12491. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  12492. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  12493. } while (0)
  12494. #endif