htt.h 478 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572
  1. /*
  2. * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 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. */
  166. #define HTT_CURRENT_VERSION_MAJOR 3
  167. #define HTT_CURRENT_VERSION_MINOR 54
  168. #define HTT_NUM_TX_FRAG_DESC 1024
  169. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  170. #define HTT_CHECK_SET_VAL(field, val) \
  171. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  172. /* macros to assist in sign-extending fields from HTT messages */
  173. #define HTT_SIGN_BIT_MASK(field) \
  174. ((field ## _M + (1 << field ## _S)) >> 1)
  175. #define HTT_SIGN_BIT(_val, field) \
  176. (_val & HTT_SIGN_BIT_MASK(field))
  177. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  178. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  179. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  180. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  181. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  182. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  183. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  184. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  185. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  186. /*
  187. * TEMPORARY:
  188. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  189. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  190. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  191. * updated.
  192. */
  193. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  194. /*
  195. * TEMPORARY:
  196. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  197. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  198. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  199. * updated.
  200. */
  201. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  202. /* HTT Access Category values */
  203. enum HTT_AC_WMM {
  204. /* WMM Access Categories */
  205. HTT_AC_WMM_BE = 0x0,
  206. HTT_AC_WMM_BK = 0x1,
  207. HTT_AC_WMM_VI = 0x2,
  208. HTT_AC_WMM_VO = 0x3,
  209. /* extension Access Categories */
  210. HTT_AC_EXT_NON_QOS = 0x4,
  211. HTT_AC_EXT_UCAST_MGMT = 0x5,
  212. HTT_AC_EXT_MCAST_DATA = 0x6,
  213. HTT_AC_EXT_MCAST_MGMT = 0x7,
  214. };
  215. enum HTT_AC_WMM_MASK {
  216. /* WMM Access Categories */
  217. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  218. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  219. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  220. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  221. /* extension Access Categories */
  222. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  223. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  224. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  225. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  226. };
  227. #define HTT_AC_MASK_WMM \
  228. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  229. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  230. #define HTT_AC_MASK_EXT \
  231. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  232. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  233. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  234. /*
  235. * htt_dbg_stats_type -
  236. * bit positions for each stats type within a stats type bitmask
  237. * The bitmask contains 24 bits.
  238. */
  239. enum htt_dbg_stats_type {
  240. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  241. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  242. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  243. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  244. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  245. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  246. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  247. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  248. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  249. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  250. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  251. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  252. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  253. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  254. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  255. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  256. /* bits 16-23 currently reserved */
  257. /* keep this last */
  258. HTT_DBG_NUM_STATS
  259. };
  260. /*=== HTT option selection TLVs ===
  261. * Certain HTT messages have alternatives or options.
  262. * For such cases, the host and target need to agree on which option to use.
  263. * Option specification TLVs can be appended to the VERSION_REQ and
  264. * VERSION_CONF messages to select options other than the default.
  265. * These TLVs are entirely optional - if they are not provided, there is a
  266. * well-defined default for each option. If they are provided, they can be
  267. * provided in any order. Each TLV can be present or absent independent of
  268. * the presence / absence of other TLVs.
  269. *
  270. * The HTT option selection TLVs use the following format:
  271. * |31 16|15 8|7 0|
  272. * |---------------------------------+----------------+----------------|
  273. * | value (payload) | length | tag |
  274. * |-------------------------------------------------------------------|
  275. * The value portion need not be only 2 bytes; it can be extended by any
  276. * integer number of 4-byte units. The total length of the TLV, including
  277. * the tag and length fields, must be a multiple of 4 bytes. The length
  278. * field specifies the total TLV size in 4-byte units. Thus, the typical
  279. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  280. * field, would store 0x1 in its length field, to show that the TLV occupies
  281. * a single 4-byte unit.
  282. */
  283. /*--- TLV header format - applies to all HTT option TLVs ---*/
  284. enum HTT_OPTION_TLV_TAGS {
  285. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  286. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  287. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  288. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  289. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  290. };
  291. PREPACK struct htt_option_tlv_header_t {
  292. A_UINT8 tag;
  293. A_UINT8 length;
  294. } POSTPACK;
  295. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  296. #define HTT_OPTION_TLV_TAG_S 0
  297. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  298. #define HTT_OPTION_TLV_LENGTH_S 8
  299. /*
  300. * value0 - 16 bit value field stored in word0
  301. * The TLV's value field may be longer than 2 bytes, in which case
  302. * the remainder of the value is stored in word1, word2, etc.
  303. */
  304. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  305. #define HTT_OPTION_TLV_VALUE0_S 16
  306. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  307. do { \
  308. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  309. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  310. } while (0)
  311. #define HTT_OPTION_TLV_TAG_GET(word) \
  312. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  313. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  314. do { \
  315. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  316. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  317. } while (0)
  318. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  319. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  320. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  321. do { \
  322. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  323. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  324. } while (0)
  325. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  326. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  327. /*--- format of specific HTT option TLVs ---*/
  328. /*
  329. * HTT option TLV for specifying LL bus address size
  330. * Some chips require bus addresses used by the target to access buffers
  331. * within the host's memory to be 32 bits; others require bus addresses
  332. * used by the target to access buffers within the host's memory to be
  333. * 64 bits.
  334. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  335. * a suffix to the VERSION_CONF message to specify which bus address format
  336. * the target requires.
  337. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  338. * default to providing bus addresses to the target in 32-bit format.
  339. */
  340. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  341. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  342. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  343. };
  344. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  345. struct htt_option_tlv_header_t hdr;
  346. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  347. } POSTPACK;
  348. /*
  349. * HTT option TLV for specifying whether HL systems should indicate
  350. * over-the-air tx completion for individual frames, or should instead
  351. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  352. * requests an OTA tx completion for a particular tx frame.
  353. * This option does not apply to LL systems, where the TX_COMPL_IND
  354. * is mandatory.
  355. * This option is primarily intended for HL systems in which the tx frame
  356. * downloads over the host --> target bus are as slow as or slower than
  357. * the transmissions over the WLAN PHY. For cases where the bus is faster
  358. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  359. * and consquently will send one TX_COMPL_IND message that covers several
  360. * tx frames. For cases where the WLAN PHY is faster than the bus,
  361. * the target will end up transmitting very short A-MPDUs, and consequently
  362. * sending many TX_COMPL_IND messages, which each cover a very small number
  363. * of tx frames.
  364. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  365. * a suffix to the VERSION_REQ message to request whether the host desires to
  366. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  367. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  368. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  369. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  370. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  371. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  372. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  373. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  374. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  375. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  376. * TLV.
  377. */
  378. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  379. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  380. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  381. };
  382. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  383. struct htt_option_tlv_header_t hdr;
  384. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  385. } POSTPACK;
  386. /*
  387. * HTT option TLV for specifying how many tx queue groups the target
  388. * may establish.
  389. * This TLV specifies the maximum value the target may send in the
  390. * txq_group_id field of any TXQ_GROUP information elements sent by
  391. * the target to the host. This allows the host to pre-allocate an
  392. * appropriate number of tx queue group structs.
  393. *
  394. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  395. * a suffix to the VERSION_REQ message to specify whether the host supports
  396. * tx queue groups at all, and if so if there is any limit on the number of
  397. * tx queue groups that the host supports.
  398. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  399. * a suffix to the VERSION_CONF message. If the host has specified in the
  400. * VER_REQ message a limit on the number of tx queue groups the host can
  401. * supprt, the target shall limit its specification of the maximum tx groups
  402. * to be no larger than this host-specified limit.
  403. *
  404. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  405. * shall preallocate 4 tx queue group structs, and the target shall not
  406. * specify a txq_group_id larger than 3.
  407. */
  408. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  409. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  410. /*
  411. * values 1 through N specify the max number of tx queue groups
  412. * the sender supports
  413. */
  414. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  415. };
  416. /* TEMPORARY backwards-compatibility alias for a typo fix -
  417. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  418. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  419. * to support the old name (with the typo) until all references to the
  420. * old name are replaced with the new name.
  421. */
  422. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  423. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  424. struct htt_option_tlv_header_t hdr;
  425. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  426. } POSTPACK;
  427. /*
  428. * HTT option TLV for specifying whether the target supports an extended
  429. * version of the HTT tx descriptor. If the target provides this TLV
  430. * and specifies in the TLV that the target supports an extended version
  431. * of the HTT tx descriptor, the target must check the "extension" bit in
  432. * the HTT tx descriptor, and if the extension bit is set, to expect a
  433. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  434. * descriptor. Furthermore, the target must provide room for the HTT
  435. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  436. * This option is intended for systems where the host needs to explicitly
  437. * control the transmission parameters such as tx power for individual
  438. * tx frames.
  439. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  440. * as a suffix to the VERSION_CONF message to explicitly specify whether
  441. * the target supports the HTT tx MSDU extension descriptor.
  442. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  443. * by the host as lack of target support for the HTT tx MSDU extension
  444. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  445. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  446. * the HTT tx MSDU extension descriptor.
  447. * The host is not required to provide the HTT tx MSDU extension descriptor
  448. * just because the target supports it; the target must check the
  449. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  450. * extension descriptor is present.
  451. */
  452. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  453. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  454. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  455. };
  456. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  457. struct htt_option_tlv_header_t hdr;
  458. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  459. } POSTPACK;
  460. /*=== host -> target messages ===============================================*/
  461. enum htt_h2t_msg_type {
  462. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  463. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  464. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  465. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  466. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  467. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  468. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  469. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  470. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  471. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  472. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  473. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  474. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  475. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  476. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  477. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  478. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  479. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  480. /* keep this last */
  481. HTT_H2T_NUM_MSGS
  482. };
  483. /*
  484. * HTT host to target message type -
  485. * stored in bits 7:0 of the first word of the message
  486. */
  487. #define HTT_H2T_MSG_TYPE_M 0xff
  488. #define HTT_H2T_MSG_TYPE_S 0
  489. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  490. do { \
  491. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  492. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  493. } while (0)
  494. #define HTT_H2T_MSG_TYPE_GET(word) \
  495. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  496. /**
  497. * @brief host -> target version number request message definition
  498. *
  499. * |31 24|23 16|15 8|7 0|
  500. * |----------------+----------------+----------------+----------------|
  501. * | reserved | msg type |
  502. * |-------------------------------------------------------------------|
  503. * : option request TLV (optional) |
  504. * :...................................................................:
  505. *
  506. * The VER_REQ message may consist of a single 4-byte word, or may be
  507. * extended with TLVs that specify which HTT options the host is requesting
  508. * from the target.
  509. * The following option TLVs may be appended to the VER_REQ message:
  510. * - HL_SUPPRESS_TX_COMPL_IND
  511. * - HL_MAX_TX_QUEUE_GROUPS
  512. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  513. * may be appended to the VER_REQ message (but only one TLV of each type).
  514. *
  515. * Header fields:
  516. * - MSG_TYPE
  517. * Bits 7:0
  518. * Purpose: identifies this as a version number request message
  519. * Value: 0x0
  520. */
  521. #define HTT_VER_REQ_BYTES 4
  522. /* TBDXXX: figure out a reasonable number */
  523. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  524. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  525. /**
  526. * @brief HTT tx MSDU descriptor
  527. *
  528. * @details
  529. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  530. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  531. * the target firmware needs for the FW's tx processing, particularly
  532. * for creating the HW msdu descriptor.
  533. * The same HTT tx descriptor is used for HL and LL systems, though
  534. * a few fields within the tx descriptor are used only by LL or
  535. * only by HL.
  536. * The HTT tx descriptor is defined in two manners: by a struct with
  537. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  538. * definitions.
  539. * The target should use the struct def, for simplicitly and clarity,
  540. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  541. * neutral. Specifically, the host shall use the get/set macros built
  542. * around the mask + shift defs.
  543. */
  544. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  545. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  546. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  547. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  548. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  549. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  550. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  551. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  552. #define HTT_TX_VDEV_ID_WORD 0
  553. #define HTT_TX_VDEV_ID_MASK 0x3f
  554. #define HTT_TX_VDEV_ID_SHIFT 16
  555. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  556. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  557. #define HTT_TX_MSDU_LEN_DWORD 1
  558. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  559. /*
  560. * HTT_VAR_PADDR macros
  561. * Allow physical / bus addresses to be either a single 32-bit value,
  562. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  563. */
  564. #define HTT_VAR_PADDR32(var_name) \
  565. A_UINT32 var_name
  566. #define HTT_VAR_PADDR64_LE(var_name) \
  567. struct { \
  568. /* little-endian: lo precedes hi */ \
  569. A_UINT32 lo; \
  570. A_UINT32 hi; \
  571. } var_name
  572. /*
  573. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  574. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  575. * addresses are stored in a XXX-bit field.
  576. * This macro is used to define both htt_tx_msdu_desc32_t and
  577. * htt_tx_msdu_desc64_t structs.
  578. */
  579. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  580. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  581. { \
  582. /* DWORD 0: flags and meta-data */ \
  583. A_UINT32 \
  584. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  585. \
  586. /* pkt_subtype - \
  587. * Detailed specification of the tx frame contents, extending the \
  588. * general specification provided by pkt_type. \
  589. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  590. * pkt_type | pkt_subtype \
  591. * ============================================================== \
  592. * 802.3 | bit 0:3 - Reserved \
  593. * | bit 4: 0x0 - Copy-Engine Classification Results \
  594. * | not appended to the HTT message \
  595. * | 0x1 - Copy-Engine Classification Results \
  596. * | appended to the HTT message in the \
  597. * | format: \
  598. * | [HTT tx desc, frame header, \
  599. * | CE classification results] \
  600. * | The CE classification results begin \
  601. * | at the next 4-byte boundary after \
  602. * | the frame header. \
  603. * ------------+------------------------------------------------- \
  604. * Eth2 | bit 0:3 - Reserved \
  605. * | bit 4: 0x0 - Copy-Engine Classification Results \
  606. * | not appended to the HTT message \
  607. * | 0x1 - Copy-Engine Classification Results \
  608. * | appended to the HTT message. \
  609. * | See the above specification of the \
  610. * | CE classification results location. \
  611. * ------------+------------------------------------------------- \
  612. * native WiFi | bit 0:3 - Reserved \
  613. * | bit 4: 0x0 - Copy-Engine Classification Results \
  614. * | not appended to the HTT message \
  615. * | 0x1 - Copy-Engine Classification Results \
  616. * | appended to the HTT message. \
  617. * | See the above specification of the \
  618. * | CE classification results location. \
  619. * ------------+------------------------------------------------- \
  620. * mgmt | 0x0 - 802.11 MAC header absent \
  621. * | 0x1 - 802.11 MAC header present \
  622. * ------------+------------------------------------------------- \
  623. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  624. * | 0x1 - 802.11 MAC header present \
  625. * | bit 1: 0x0 - allow aggregation \
  626. * | 0x1 - don't allow aggregation \
  627. * | bit 2: 0x0 - perform encryption \
  628. * | 0x1 - don't perform encryption \
  629. * | bit 3: 0x0 - perform tx classification / queuing \
  630. * | 0x1 - don't perform tx classification; \
  631. * | insert the frame into the "misc" \
  632. * | tx queue \
  633. * | bit 4: 0x0 - Copy-Engine Classification Results \
  634. * | not appended to the HTT message \
  635. * | 0x1 - Copy-Engine Classification Results \
  636. * | appended to the HTT message. \
  637. * | See the above specification of the \
  638. * | CE classification results location. \
  639. */ \
  640. pkt_subtype: 5, \
  641. \
  642. /* pkt_type - \
  643. * General specification of the tx frame contents. \
  644. * The htt_pkt_type enum should be used to specify and check the \
  645. * value of this field. \
  646. */ \
  647. pkt_type: 3, \
  648. \
  649. /* vdev_id - \
  650. * ID for the vdev that is sending this tx frame. \
  651. * For certain non-standard packet types, e.g. pkt_type == raw \
  652. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  653. * This field is used primarily for determining where to queue \
  654. * broadcast and multicast frames. \
  655. */ \
  656. vdev_id: 6, \
  657. /* ext_tid - \
  658. * The extended traffic ID. \
  659. * If the TID is unknown, the extended TID is set to \
  660. * HTT_TX_EXT_TID_INVALID. \
  661. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  662. * value of the QoS TID. \
  663. * If the tx frame is non-QoS data, then the extended TID is set to \
  664. * HTT_TX_EXT_TID_NON_QOS. \
  665. * If the tx frame is multicast or broadcast, then the extended TID \
  666. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  667. */ \
  668. ext_tid: 5, \
  669. \
  670. /* postponed - \
  671. * This flag indicates whether the tx frame has been downloaded to \
  672. * the target before but discarded by the target, and now is being \
  673. * downloaded again; or if this is a new frame that is being \
  674. * downloaded for the first time. \
  675. * This flag allows the target to determine the correct order for \
  676. * transmitting new vs. old frames. \
  677. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  678. * This flag only applies to HL systems, since in LL systems, \
  679. * the tx flow control is handled entirely within the target. \
  680. */ \
  681. postponed: 1, \
  682. \
  683. /* extension - \
  684. * This flag indicates whether a HTT tx MSDU extension descriptor \
  685. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  686. * \
  687. * 0x0 - no extension MSDU descriptor is present \
  688. * 0x1 - an extension MSDU descriptor immediately follows the \
  689. * regular MSDU descriptor \
  690. */ \
  691. extension: 1, \
  692. \
  693. /* cksum_offload - \
  694. * This flag indicates whether checksum offload is enabled or not \
  695. * for this frame. Target FW use this flag to turn on HW checksumming \
  696. * 0x0 - No checksum offload \
  697. * 0x1 - L3 header checksum only \
  698. * 0x2 - L4 checksum only \
  699. * 0x3 - L3 header checksum + L4 checksum \
  700. */ \
  701. cksum_offload: 2, \
  702. \
  703. /* tx_comp_req - \
  704. * This flag indicates whether Tx Completion \
  705. * from fw is required or not. \
  706. * This flag is only relevant if tx completion is not \
  707. * universally enabled. \
  708. * For all LL systems, tx completion is mandatory, \
  709. * so this flag will be irrelevant. \
  710. * For HL systems tx completion is optional, but HL systems in which \
  711. * the bus throughput exceeds the WLAN throughput will \
  712. * probably want to always use tx completion, and thus \
  713. * would not check this flag. \
  714. * This flag is required when tx completions are not used universally, \
  715. * but are still required for certain tx frames for which \
  716. * an OTA delivery acknowledgment is needed by the host. \
  717. * In practice, this would be for HL systems in which the \
  718. * bus throughput is less than the WLAN throughput. \
  719. * \
  720. * 0x0 - Tx Completion Indication from Fw not required \
  721. * 0x1 - Tx Completion Indication from Fw is required \
  722. */ \
  723. tx_compl_req: 1; \
  724. \
  725. \
  726. /* DWORD 1: MSDU length and ID */ \
  727. A_UINT32 \
  728. len: 16, /* MSDU length, in bytes */ \
  729. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  730. * and this id is used to calculate fragmentation \
  731. * descriptor pointer inside the target based on \
  732. * the base address, configured inside the target. \
  733. */ \
  734. \
  735. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  736. /* frags_desc_ptr - \
  737. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  738. * where the tx frame's fragments reside in memory. \
  739. * This field only applies to LL systems, since in HL systems the \
  740. * (degenerate single-fragment) fragmentation descriptor is created \
  741. * within the target. \
  742. */ \
  743. _paddr__frags_desc_ptr_; \
  744. \
  745. /* DWORD 3 (or 4): peerid, chanfreq */ \
  746. /* \
  747. * Peer ID : Target can use this value to know which peer-id packet \
  748. * destined to. \
  749. * It's intended to be specified by host in case of NAWDS. \
  750. */ \
  751. A_UINT16 peerid; \
  752. \
  753. /* \
  754. * Channel frequency: This identifies the desired channel \
  755. * frequency (in mhz) for tx frames. This is used by FW to help \
  756. * determine when it is safe to transmit or drop frames for \
  757. * off-channel operation. \
  758. * The default value of zero indicates to FW that the corresponding \
  759. * VDEV's home channel (if there is one) is the desired channel \
  760. * frequency. \
  761. */ \
  762. A_UINT16 chanfreq; \
  763. \
  764. /* Reason reserved is commented is increasing the htt structure size \
  765. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  766. * A_UINT32 reserved_dword3_bits0_31; \
  767. */ \
  768. } POSTPACK
  769. /* define a htt_tx_msdu_desc32_t type */
  770. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  771. /* define a htt_tx_msdu_desc64_t type */
  772. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  773. /*
  774. * Make htt_tx_msdu_desc_t be an alias for either
  775. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  776. */
  777. #if HTT_PADDR64
  778. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  779. #else
  780. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  781. #endif
  782. /* decriptor information for Management frame*/
  783. /*
  784. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  785. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  786. */
  787. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  788. extern A_UINT32 mgmt_hdr_len;
  789. PREPACK struct htt_mgmt_tx_desc_t {
  790. A_UINT32 msg_type;
  791. #if HTT_PADDR64
  792. A_UINT64 frag_paddr; /* DMAble address of the data */
  793. #else
  794. A_UINT32 frag_paddr; /* DMAble address of the data */
  795. #endif
  796. A_UINT32 desc_id; /* returned to host during completion
  797. * to free the meory*/
  798. A_UINT32 len; /* Fragment length */
  799. A_UINT32 vdev_id; /* virtual device ID*/
  800. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  801. } POSTPACK;
  802. PREPACK struct htt_mgmt_tx_compl_ind {
  803. A_UINT32 desc_id;
  804. A_UINT32 status;
  805. } POSTPACK;
  806. /*
  807. * This SDU header size comes from the summation of the following:
  808. * 1. Max of:
  809. * a. Native WiFi header, for native WiFi frames: 24 bytes
  810. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  811. * b. 802.11 header, for raw frames: 36 bytes
  812. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  813. * QoS header, HT header)
  814. * c. 802.3 header, for ethernet frames: 14 bytes
  815. * (destination address, source address, ethertype / length)
  816. * 2. Max of:
  817. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  818. * b. IPv6 header, up through the Traffic Class: 2 bytes
  819. * 3. 802.1Q VLAN header: 4 bytes
  820. * 4. LLC/SNAP header: 8 bytes
  821. */
  822. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  823. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  824. #define HTT_TX_HDR_SIZE_ETHERNET 14
  825. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  826. A_COMPILE_TIME_ASSERT(
  827. htt_encap_hdr_size_max_check_nwifi,
  828. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  829. A_COMPILE_TIME_ASSERT(
  830. htt_encap_hdr_size_max_check_enet,
  831. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  832. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  833. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  834. #define HTT_TX_HDR_SIZE_802_1Q 4
  835. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  836. #define HTT_COMMON_TX_FRM_HDR_LEN \
  837. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  838. HTT_TX_HDR_SIZE_802_1Q + \
  839. HTT_TX_HDR_SIZE_LLC_SNAP)
  840. #define HTT_HL_TX_FRM_HDR_LEN \
  841. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  842. #define HTT_LL_TX_FRM_HDR_LEN \
  843. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  844. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  845. /* dword 0 */
  846. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  847. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  848. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  849. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  850. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  851. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  852. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  853. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  854. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  855. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  856. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  857. #define HTT_TX_DESC_PKT_TYPE_S 13
  858. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  859. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  860. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  861. #define HTT_TX_DESC_VDEV_ID_S 16
  862. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  863. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  864. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  865. #define HTT_TX_DESC_EXT_TID_S 22
  866. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  867. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  868. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  869. #define HTT_TX_DESC_POSTPONED_S 27
  870. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  871. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  872. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  873. #define HTT_TX_DESC_EXTENSION_S 28
  874. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  875. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  876. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  877. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  878. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  879. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  880. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  881. #define HTT_TX_DESC_TX_COMP_S 31
  882. /* dword 1 */
  883. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  884. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  885. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  886. #define HTT_TX_DESC_FRM_LEN_S 0
  887. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  888. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  889. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  890. #define HTT_TX_DESC_FRM_ID_S 16
  891. /* dword 2 */
  892. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  893. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  894. /* for systems using 64-bit format for bus addresses */
  895. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  896. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  897. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  898. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  899. /* for systems using 32-bit format for bus addresses */
  900. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  901. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  902. /* dword 3 */
  903. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  904. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  905. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  906. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  907. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  908. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  909. #if HTT_PADDR64
  910. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  911. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  912. #else
  913. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  914. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  915. #endif
  916. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  917. #define HTT_TX_DESC_PEER_ID_S 0
  918. /*
  919. * TEMPORARY:
  920. * The original definitions for the PEER_ID fields contained typos
  921. * (with _DESC_PADDR appended to this PEER_ID field name).
  922. * Retain deprecated original names for PEER_ID fields until all code that
  923. * refers to them has been updated.
  924. */
  925. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  926. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  927. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  928. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  929. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  930. HTT_TX_DESC_PEER_ID_M
  931. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  932. HTT_TX_DESC_PEER_ID_S
  933. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  934. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  935. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  936. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  937. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  938. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  939. #if HTT_PADDR64
  940. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  941. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  942. #else
  943. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  944. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  945. #endif
  946. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  947. #define HTT_TX_DESC_CHAN_FREQ_S 16
  948. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  949. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  950. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  951. do { \
  952. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  953. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  954. } while (0)
  955. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  956. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  957. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  958. do { \
  959. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  960. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  961. } while (0)
  962. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  963. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  964. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  965. do { \
  966. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  967. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  968. } while (0)
  969. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  970. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  971. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  972. do { \
  973. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  974. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  975. } while (0)
  976. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  977. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  978. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  979. do { \
  980. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  981. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  982. } while (0)
  983. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  984. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  985. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  986. do { \
  987. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  988. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  989. } while (0)
  990. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  991. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  992. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  993. do { \
  994. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  995. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  996. } while (0)
  997. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  998. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  999. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1000. do { \
  1001. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1002. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1003. } while (0)
  1004. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1005. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1006. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1007. do { \
  1008. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1009. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1010. } while (0)
  1011. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1012. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1013. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1014. do { \
  1015. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1016. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1017. } while (0)
  1018. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1019. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1020. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1021. do { \
  1022. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1023. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1024. } while (0)
  1025. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1026. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1027. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1028. do { \
  1029. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1030. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1031. } while (0)
  1032. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1033. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1034. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1035. do { \
  1036. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1037. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1038. } while (0)
  1039. /* enums used in the HTT tx MSDU extension descriptor */
  1040. enum {
  1041. htt_tx_guard_interval_regular = 0,
  1042. htt_tx_guard_interval_short = 1,
  1043. };
  1044. enum {
  1045. htt_tx_preamble_type_ofdm = 0,
  1046. htt_tx_preamble_type_cck = 1,
  1047. htt_tx_preamble_type_ht = 2,
  1048. htt_tx_preamble_type_vht = 3,
  1049. };
  1050. enum {
  1051. htt_tx_bandwidth_5MHz = 0,
  1052. htt_tx_bandwidth_10MHz = 1,
  1053. htt_tx_bandwidth_20MHz = 2,
  1054. htt_tx_bandwidth_40MHz = 3,
  1055. htt_tx_bandwidth_80MHz = 4,
  1056. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1057. };
  1058. /**
  1059. * @brief HTT tx MSDU extension descriptor
  1060. * @details
  1061. * If the target supports HTT tx MSDU extension descriptors, the host has
  1062. * the option of appending the following struct following the regular
  1063. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1064. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1065. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1066. * tx specs for each frame.
  1067. */
  1068. PREPACK struct htt_tx_msdu_desc_ext_t {
  1069. /* DWORD 0: flags */
  1070. A_UINT32
  1071. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1072. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1073. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1074. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1075. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1076. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1077. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1078. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1079. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1080. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1081. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1082. /* DWORD 1: tx power, tx rate, tx BW */
  1083. A_UINT32
  1084. /* pwr -
  1085. * Specify what power the tx frame needs to be transmitted at.
  1086. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1087. * The value needs to be appropriately sign-extended when extracting
  1088. * the value from the message and storing it in a variable that is
  1089. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1090. * automatically handles this sign-extension.)
  1091. * If the transmission uses multiple tx chains, this power spec is
  1092. * the total transmit power, assuming incoherent combination of
  1093. * per-chain power to produce the total power.
  1094. */
  1095. pwr: 8,
  1096. /* mcs_mask -
  1097. * Specify the allowable values for MCS index (modulation and coding)
  1098. * to use for transmitting the frame.
  1099. *
  1100. * For HT / VHT preamble types, this mask directly corresponds to
  1101. * the HT or VHT MCS indices that are allowed. For each bit N set
  1102. * within the mask, MCS index N is allowed for transmitting the frame.
  1103. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1104. * rates versus OFDM rates, so the host has the option of specifying
  1105. * that the target must transmit the frame with CCK or OFDM rates
  1106. * (not HT or VHT), but leaving the decision to the target whether
  1107. * to use CCK or OFDM.
  1108. *
  1109. * For CCK and OFDM, the bits within this mask are interpreted as
  1110. * follows:
  1111. * bit 0 -> CCK 1 Mbps rate is allowed
  1112. * bit 1 -> CCK 2 Mbps rate is allowed
  1113. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1114. * bit 3 -> CCK 11 Mbps rate is allowed
  1115. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1116. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1117. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1118. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1119. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1120. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1121. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1122. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1123. *
  1124. * The MCS index specification needs to be compatible with the
  1125. * bandwidth mask specification. For example, a MCS index == 9
  1126. * specification is inconsistent with a preamble type == VHT,
  1127. * Nss == 1, and channel bandwidth == 20 MHz.
  1128. *
  1129. * Furthermore, the host has only a limited ability to specify to
  1130. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1131. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1132. */
  1133. mcs_mask: 12,
  1134. /* nss_mask -
  1135. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1136. * Each bit in this mask corresponds to a Nss value:
  1137. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1138. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1139. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1140. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1141. * The values in the Nss mask must be suitable for the recipient, e.g.
  1142. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1143. * recipient which only supports 2x2 MIMO.
  1144. */
  1145. nss_mask: 4,
  1146. /* guard_interval -
  1147. * Specify a htt_tx_guard_interval enum value to indicate whether
  1148. * the transmission should use a regular guard interval or a
  1149. * short guard interval.
  1150. */
  1151. guard_interval: 1,
  1152. /* preamble_type_mask -
  1153. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1154. * may choose from for transmitting this frame.
  1155. * The bits in this mask correspond to the values in the
  1156. * htt_tx_preamble_type enum. For example, to allow the target
  1157. * to transmit the frame as either CCK or OFDM, this field would
  1158. * be set to
  1159. * (1 << htt_tx_preamble_type_ofdm) |
  1160. * (1 << htt_tx_preamble_type_cck)
  1161. */
  1162. preamble_type_mask: 4,
  1163. reserved1_31_29: 3; /* unused, set to 0x0 */
  1164. /* DWORD 2: tx chain mask, tx retries */
  1165. A_UINT32
  1166. /* chain_mask - specify which chains to transmit from */
  1167. chain_mask: 4,
  1168. /* retry_limit -
  1169. * Specify the maximum number of transmissions, including the
  1170. * initial transmission, to attempt before giving up if no ack
  1171. * is received.
  1172. * If the tx rate is specified, then all retries shall use the
  1173. * same rate as the initial transmission.
  1174. * If no tx rate is specified, the target can choose whether to
  1175. * retain the original rate during the retransmissions, or to
  1176. * fall back to a more robust rate.
  1177. */
  1178. retry_limit: 4,
  1179. /* bandwidth_mask -
  1180. * Specify what channel widths may be used for the transmission.
  1181. * A value of zero indicates "don't care" - the target may choose
  1182. * the transmission bandwidth.
  1183. * The bits within this mask correspond to the htt_tx_bandwidth
  1184. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1185. * The bandwidth_mask must be consistent with the preamble_type_mask
  1186. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1187. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1188. */
  1189. bandwidth_mask: 6,
  1190. reserved2_31_14: 18; /* unused, set to 0x0 */
  1191. /* DWORD 3: tx expiry time (TSF) LSBs */
  1192. A_UINT32 expire_tsf_lo;
  1193. /* DWORD 4: tx expiry time (TSF) MSBs */
  1194. A_UINT32 expire_tsf_hi;
  1195. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1196. } POSTPACK;
  1197. /* DWORD 0 */
  1198. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1199. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1200. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1201. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1202. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1203. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1204. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1205. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1206. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1207. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1208. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1209. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1210. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1211. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1213. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1214. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1216. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1217. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1218. /* DWORD 1 */
  1219. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1220. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1221. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1222. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1223. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1224. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1225. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1226. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1227. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1228. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1229. /* DWORD 2 */
  1230. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1231. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1232. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1233. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1234. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1235. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1236. /* DWORD 0 */
  1237. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1238. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1239. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1240. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1241. do { \
  1242. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1243. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1244. } while (0)
  1245. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1246. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1247. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1248. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1249. do { \
  1250. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1251. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1252. } while (0)
  1253. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1254. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1255. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1256. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1257. do { \
  1258. HTT_CHECK_SET_VAL( \
  1259. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1260. ((_var) |= ((_val) \
  1261. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1262. } while (0)
  1263. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1264. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1265. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1266. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1267. do { \
  1268. HTT_CHECK_SET_VAL( \
  1269. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1270. ((_var) |= ((_val) \
  1271. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1272. } while (0)
  1273. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1274. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1275. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1276. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1277. do { \
  1278. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1279. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1280. } while (0)
  1281. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1282. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1283. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1284. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1285. do { \
  1286. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1287. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1288. } while (0)
  1289. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1290. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1291. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1292. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1293. do { \
  1294. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1295. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1296. } while (0)
  1297. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1298. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1299. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1300. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1301. do { \
  1302. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1303. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1304. } while (0)
  1305. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1306. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1307. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1308. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1309. do { \
  1310. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1311. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1312. } while (0)
  1313. /* DWORD 1 */
  1314. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1315. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1316. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1317. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1318. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1319. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1320. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1321. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1322. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1323. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1324. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1325. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1326. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1327. do { \
  1328. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1329. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1330. } while (0)
  1331. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1332. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1333. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1334. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1335. do { \
  1336. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1337. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1338. } while (0)
  1339. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1340. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1341. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1342. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1343. do { \
  1344. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1345. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1346. } while (0)
  1347. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1348. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1349. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1350. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1351. do { \
  1352. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1353. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1354. } while (0)
  1355. /* DWORD 2 */
  1356. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1357. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1358. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1359. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1360. do { \
  1361. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1362. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1363. } while (0)
  1364. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1365. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1366. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1367. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1368. do { \
  1369. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1370. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1371. } while (0)
  1372. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1373. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1374. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1375. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1376. do { \
  1377. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1378. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1379. } while (0)
  1380. typedef enum {
  1381. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1382. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1383. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1384. } htt_11ax_ltf_subtype_t;
  1385. typedef enum {
  1386. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1387. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1388. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1389. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1390. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1391. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1392. } htt_tx_ext2_preamble_type_t;
  1393. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1394. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1395. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1396. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1397. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1398. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1399. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1400. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1401. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1402. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1403. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1404. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1405. /**
  1406. * @brief HTT tx MSDU extension descriptor v2
  1407. * @details
  1408. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1409. * is received as tcl_exit_base->host_meta_info in firmware.
  1410. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1411. * are already part of tcl_exit_base.
  1412. */
  1413. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1414. /* DWORD 0: flags */
  1415. A_UINT32
  1416. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1417. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1418. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1419. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1420. valid_retries : 1, /* if set, tx retries spec is valid */
  1421. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1422. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1423. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1424. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1425. valid_key_flags : 1, /* if set, key flags is valid */
  1426. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1427. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1428. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1429. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1430. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1431. 1 = ENCRYPT,
  1432. 2 ~ 3 - Reserved */
  1433. /* retry_limit -
  1434. * Specify the maximum number of transmissions, including the
  1435. * initial transmission, to attempt before giving up if no ack
  1436. * is received.
  1437. * If the tx rate is specified, then all retries shall use the
  1438. * same rate as the initial transmission.
  1439. * If no tx rate is specified, the target can choose whether to
  1440. * retain the original rate during the retransmissions, or to
  1441. * fall back to a more robust rate.
  1442. */
  1443. retry_limit : 4,
  1444. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1445. * Valid only for 11ax preamble types HE_SU
  1446. * and HE_EXT_SU
  1447. */
  1448. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1449. * Valid only for 11ax preamble types HE_SU
  1450. * and HE_EXT_SU
  1451. */
  1452. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1453. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1454. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1455. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1456. */
  1457. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1458. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1459. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1460. * Use cases:
  1461. * Any time firmware uses TQM-BYPASS for Data
  1462. * TID, firmware expect host to set this bit.
  1463. */
  1464. /* DWORD 1: tx power, tx rate */
  1465. A_UINT32
  1466. power : 8, /* unit of the power field is 0.5 dbm
  1467. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1468. * signed value ranging from -64dbm to 63.5 dbm
  1469. */
  1470. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1471. * Setting more than one MCS isn't currently
  1472. * supported by the target (but is supported
  1473. * in the interface in case in the future
  1474. * the target supports specifications of
  1475. * a limited set of MCS values.
  1476. */
  1477. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1478. * Setting more than one Nss isn't currently
  1479. * supported by the target (but is supported
  1480. * in the interface in case in the future
  1481. * the target supports specifications of
  1482. * a limited set of Nss values.
  1483. */
  1484. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1485. update_peer_cache : 1; /* When set these custom values will be
  1486. * used for all packets, until the next
  1487. * update via this ext header.
  1488. * This is to make sure not all packets
  1489. * need to include this header.
  1490. */
  1491. /* DWORD 2: tx chain mask, tx retries */
  1492. A_UINT32
  1493. /* chain_mask - specify which chains to transmit from */
  1494. chain_mask : 8,
  1495. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1496. * TODO: Update Enum values for key_flags
  1497. */
  1498. /*
  1499. * Channel frequency: This identifies the desired channel
  1500. * frequency (in MHz) for tx frames. This is used by FW to help
  1501. * determine when it is safe to transmit or drop frames for
  1502. * off-channel operation.
  1503. * The default value of zero indicates to FW that the corresponding
  1504. * VDEV's home channel (if there is one) is the desired channel
  1505. * frequency.
  1506. */
  1507. chanfreq : 16;
  1508. /* DWORD 3: tx expiry time (TSF) LSBs */
  1509. A_UINT32 expire_tsf_lo;
  1510. /* DWORD 4: tx expiry time (TSF) MSBs */
  1511. A_UINT32 expire_tsf_hi;
  1512. /* DWORD 5: reserved
  1513. * This structure can be expanded further up to 60 bytes
  1514. * by adding further DWORDs as needed.
  1515. */
  1516. A_UINT32
  1517. /* learning_frame
  1518. * When this flag is set, this frame will be dropped by FW
  1519. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1520. */
  1521. learning_frame : 1,
  1522. rsvd0 : 31;
  1523. } POSTPACK;
  1524. /* DWORD 0 */
  1525. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1526. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1527. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1528. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1529. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1530. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1531. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1532. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1533. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1534. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1535. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1536. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1537. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1538. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1539. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1540. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1541. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1542. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1543. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1544. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1545. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1546. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1547. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1548. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1549. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1550. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1551. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1552. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1553. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1554. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1555. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1556. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1557. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1558. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1559. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1560. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1561. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1562. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1563. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1564. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1565. /* DWORD 1 */
  1566. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1567. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1568. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1569. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1570. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1571. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1572. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1573. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1574. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1575. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1576. /* DWORD 2 */
  1577. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1578. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1579. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1580. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1581. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1582. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1583. /* DWORD 5 */
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1585. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1586. /* DWORD 0 */
  1587. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1588. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1589. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1590. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1591. do { \
  1592. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1593. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1594. } while (0)
  1595. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1596. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1597. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1598. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1599. do { \
  1600. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1601. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1602. } while (0)
  1603. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1604. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1605. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1606. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1607. do { \
  1608. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1609. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1610. } while (0)
  1611. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1612. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1613. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1614. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1615. do { \
  1616. HTT_CHECK_SET_VAL( \
  1617. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1618. ((_var) |= ((_val) \
  1619. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1620. } while (0)
  1621. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1622. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1623. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1624. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1625. do { \
  1626. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1627. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1628. } while (0)
  1629. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1630. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1631. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1632. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1633. do { \
  1634. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1635. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1636. } while (0)
  1637. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1638. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1639. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1640. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1641. do { \
  1642. HTT_CHECK_SET_VAL( \
  1643. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1644. ((_var) |= ((_val) \
  1645. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1646. } while (0)
  1647. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1648. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1649. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1650. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1651. do { \
  1652. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1653. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1654. } while (0)
  1655. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1656. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1657. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1658. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1659. do { \
  1660. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1661. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1662. } while (0)
  1663. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1664. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1665. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1666. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1667. do { \
  1668. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1669. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1670. } while (0)
  1671. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1672. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1673. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1674. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1675. do { \
  1676. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1677. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1678. } while (0)
  1679. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1680. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1681. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1682. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1683. do { \
  1684. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1685. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1686. } while (0)
  1687. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1688. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1689. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1690. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1691. do { \
  1692. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1693. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1694. } while (0)
  1695. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1696. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1697. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1698. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1699. do { \
  1700. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1701. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1702. } while (0)
  1703. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1704. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1705. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1706. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1707. do { \
  1708. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1709. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1710. } while (0)
  1711. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1712. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1713. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1714. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1715. do { \
  1716. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1717. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1718. } while (0)
  1719. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1720. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1721. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1722. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1723. do { \
  1724. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1725. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1726. } while (0)
  1727. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1728. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1729. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1730. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1731. do { \
  1732. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1733. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1734. } while (0)
  1735. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1736. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1737. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1738. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1739. do { \
  1740. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1741. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1742. } while (0)
  1743. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1744. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1745. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1746. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1747. do { \
  1748. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1749. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1750. } while (0)
  1751. /* DWORD 1 */
  1752. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1753. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1754. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1755. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1756. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1757. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1758. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1759. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1760. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1761. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1762. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1763. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1764. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1765. do { \
  1766. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1767. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1768. } while (0)
  1769. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1770. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1771. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1772. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1773. do { \
  1774. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1775. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1776. } while (0)
  1777. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1778. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1779. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1780. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1781. do { \
  1782. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1783. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1784. } while (0)
  1785. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1786. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1787. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1788. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1789. do { \
  1790. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1791. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1792. } while (0)
  1793. /* DWORD 2 */
  1794. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1795. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1796. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1797. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1798. do { \
  1799. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1800. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1801. } while (0)
  1802. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1803. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1804. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1805. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1806. do { \
  1807. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1808. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1809. } while (0)
  1810. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1811. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1812. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1813. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1814. do { \
  1815. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1816. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1817. } while (0)
  1818. /* DWORD 5 */
  1819. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1820. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1821. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1822. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1823. do { \
  1824. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1825. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1826. } while (0)
  1827. typedef enum {
  1828. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1829. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1830. } htt_tcl_metadata_type;
  1831. /**
  1832. * @brief HTT TCL command number format
  1833. * @details
  1834. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1835. * available to firmware as tcl_exit_base->tcl_status_number.
  1836. * For regular / multicast packets host will send vdev and mac id and for
  1837. * NAWDS packets, host will send peer id.
  1838. * A_UINT32 is used to avoid endianness conversion problems.
  1839. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1840. */
  1841. typedef struct {
  1842. A_UINT32
  1843. type: 1, /* vdev_id based or peer_id based */
  1844. rsvd: 31;
  1845. } htt_tx_tcl_vdev_or_peer_t;
  1846. typedef struct {
  1847. A_UINT32
  1848. type: 1, /* vdev_id based or peer_id based */
  1849. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1850. vdev_id: 8,
  1851. pdev_id: 2,
  1852. host_inspected:1,
  1853. rsvd: 19;
  1854. } htt_tx_tcl_vdev_metadata;
  1855. typedef struct {
  1856. A_UINT32
  1857. type: 1, /* vdev_id based or peer_id based */
  1858. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1859. peer_id: 14,
  1860. rsvd: 16;
  1861. } htt_tx_tcl_peer_metadata;
  1862. PREPACK struct htt_tx_tcl_metadata {
  1863. union {
  1864. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1865. htt_tx_tcl_vdev_metadata vdev_meta;
  1866. htt_tx_tcl_peer_metadata peer_meta;
  1867. };
  1868. } POSTPACK;
  1869. /* DWORD 0 */
  1870. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1871. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1872. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1873. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1874. /* VDEV metadata */
  1875. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1876. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1877. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1878. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1879. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1880. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1881. /* PEER metadata */
  1882. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1883. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1884. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1885. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1886. HTT_TX_TCL_METADATA_TYPE_S)
  1887. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1888. do { \
  1889. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1890. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1891. } while (0)
  1892. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1893. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1894. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1895. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1896. do { \
  1897. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1898. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1899. } while (0)
  1900. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1901. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1902. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1903. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1904. do { \
  1905. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1906. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1907. } while (0)
  1908. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1909. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1910. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1911. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1912. do { \
  1913. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1914. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1915. } while (0)
  1916. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1917. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1918. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1919. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1920. do { \
  1921. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1922. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1923. } while (0)
  1924. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1925. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1926. HTT_TX_TCL_METADATA_PEER_ID_S)
  1927. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1928. do { \
  1929. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1930. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1931. } while (0)
  1932. typedef enum {
  1933. HTT_TX_FW2WBM_TX_STATUS_OK,
  1934. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1935. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1936. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1937. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1938. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  1939. HTT_TX_FW2WBM_TX_STATUS_MAX
  1940. } htt_tx_fw2wbm_tx_status_t;
  1941. typedef enum {
  1942. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  1943. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  1944. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1945. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1946. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1947. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1948. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1949. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1950. } htt_tx_fw2wbm_reinject_reason_t;
  1951. /**
  1952. * @brief HTT TX WBM Completion from firmware to host
  1953. * @details
  1954. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1955. * DWORD 3 and 4 for software based completions (Exception frames and
  1956. * TQM bypass frames)
  1957. * For software based completions, wbm_release_ring->release_source_module will
  1958. * be set to release_source_fw
  1959. */
  1960. PREPACK struct htt_tx_wbm_completion {
  1961. A_UINT32
  1962. sch_cmd_id: 24,
  1963. exception_frame: 1, /* If set, this packet was queued via exception path */
  1964. rsvd0_31_25: 7;
  1965. A_UINT32
  1966. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1967. * reception of an ACK or BA, this field indicates
  1968. * the RSSI of the received ACK or BA frame.
  1969. * When the frame is removed as result of a direct
  1970. * remove command from the SW, this field is set
  1971. * to 0x0 (which is never a valid value when real
  1972. * RSSI is available).
  1973. * Units: dB w.r.t noise floor
  1974. */
  1975. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1976. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1977. rsvd1_31_16: 16;
  1978. } POSTPACK;
  1979. /* DWORD 0 */
  1980. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1981. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1982. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1983. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1984. /* DWORD 1 */
  1985. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1986. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1987. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1988. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1989. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1990. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  1991. /* DWORD 0 */
  1992. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  1993. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  1994. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  1995. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  1996. do { \
  1997. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  1998. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  1999. } while (0)
  2000. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2001. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2002. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2003. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2004. do { \
  2005. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2006. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2007. } while (0)
  2008. /* DWORD 1 */
  2009. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2010. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2011. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2012. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2013. do { \
  2014. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2015. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2016. } while (0)
  2017. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2018. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2019. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2020. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2021. do { \
  2022. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2023. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2024. } while (0)
  2025. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2026. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2027. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2028. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2029. do { \
  2030. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2031. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2032. } while (0)
  2033. /**
  2034. * @brief HTT TX WBM Completion from firmware to host
  2035. * @details
  2036. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2037. * (WBM) offload HW.
  2038. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2039. * For software based completions, release_source_module will
  2040. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2041. * struct wbm_release_ring and then switch to this after looking at
  2042. * release_source_module.
  2043. */
  2044. PREPACK struct htt_tx_wbm_completion_v2 {
  2045. A_UINT32
  2046. used_by_hw0; /* Refer to struct wbm_release_ring */
  2047. A_UINT32
  2048. used_by_hw1; /* Refer to struct wbm_release_ring */
  2049. A_UINT32
  2050. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2051. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2052. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2053. exception_frame: 1,
  2054. rsvd0: 12, /* For future use */
  2055. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2056. rsvd1: 1; /* For future use */
  2057. A_UINT32
  2058. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2059. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2060. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2061. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2062. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2063. */
  2064. A_UINT32
  2065. data1: 32;
  2066. A_UINT32
  2067. data2: 32;
  2068. A_UINT32
  2069. used_by_hw3; /* Refer to struct wbm_release_ring */
  2070. } POSTPACK;
  2071. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2072. /* DWORD 3 */
  2073. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2074. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2075. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2076. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2077. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2078. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2079. /* DWORD 3 */
  2080. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2081. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2082. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2083. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2084. do { \
  2085. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2086. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2087. } while (0)
  2088. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2089. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2090. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2091. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2092. do { \
  2093. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2094. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2095. } while (0)
  2096. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2097. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2098. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2099. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2100. do { \
  2101. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2102. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2103. } while (0)
  2104. /**
  2105. * @brief HTT TX WBM transmit status from firmware to host
  2106. * @details
  2107. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2108. * (WBM) offload HW.
  2109. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2110. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2111. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2112. */
  2113. PREPACK struct htt_tx_wbm_transmit_status {
  2114. A_UINT32
  2115. sch_cmd_id: 24,
  2116. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2117. * reception of an ACK or BA, this field indicates
  2118. * the RSSI of the received ACK or BA frame.
  2119. * When the frame is removed as result of a direct
  2120. * remove command from the SW, this field is set
  2121. * to 0x0 (which is never a valid value when real
  2122. * RSSI is available).
  2123. * Units: dB w.r.t noise floor
  2124. */
  2125. A_UINT32
  2126. sw_peer_id: 16,
  2127. tid_num: 5,
  2128. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2129. * and tid_num fields contain valid data.
  2130. * If this "valid" flag is not set, the
  2131. * sw_peer_id and tid_num fields must be ignored.
  2132. */
  2133. mcast: 1,
  2134. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2135. * contains valid data.
  2136. */
  2137. reserved0: 8;
  2138. A_UINT32
  2139. reserved1: 32;
  2140. } POSTPACK;
  2141. /* DWORD 4 */
  2142. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2143. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2144. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2145. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2146. /* DWORD 5 */
  2147. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2148. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2149. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2150. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2151. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2152. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2153. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2154. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2155. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2156. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2157. /* DWORD 4 */
  2158. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2159. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2160. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2161. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2162. do { \
  2163. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2164. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2165. } while (0)
  2166. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2167. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2168. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2169. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2170. do { \
  2171. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2172. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2173. } while (0)
  2174. /* DWORD 5 */
  2175. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2176. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2177. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2178. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2179. do { \
  2180. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2181. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2182. } while (0)
  2183. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2184. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2185. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2186. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2187. do { \
  2188. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2189. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2190. } while (0)
  2191. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2192. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2193. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2194. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2195. do { \
  2196. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2197. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2198. } while (0)
  2199. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2200. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2201. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2202. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2203. do { \
  2204. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2205. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2206. } while (0)
  2207. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2208. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2209. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2210. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2211. do { \
  2212. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2213. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2214. } while (0)
  2215. /**
  2216. * @brief HTT TX WBM reinject status from firmware to host
  2217. * @details
  2218. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2219. * (WBM) offload HW.
  2220. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2221. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2222. */
  2223. PREPACK struct htt_tx_wbm_reinject_status {
  2224. A_UINT32
  2225. reserved0: 32;
  2226. A_UINT32
  2227. reserved1: 32;
  2228. A_UINT32
  2229. reserved2: 32;
  2230. } POSTPACK;
  2231. /**
  2232. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2233. * @details
  2234. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2235. * (WBM) offload HW.
  2236. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2237. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2238. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2239. * STA side.
  2240. */
  2241. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2242. A_UINT32
  2243. mec_sa_addr_31_0;
  2244. A_UINT32
  2245. mec_sa_addr_47_32: 16,
  2246. sa_ast_index: 16;
  2247. A_UINT32
  2248. vdev_id: 8,
  2249. reserved0: 24;
  2250. } POSTPACK;
  2251. /* DWORD 4 - mec_sa_addr_31_0 */
  2252. /* DWORD 5 */
  2253. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2254. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2255. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2256. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2257. /* DWORD 6 */
  2258. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2259. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2260. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2261. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2262. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2263. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2264. do { \
  2265. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2266. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2267. } while (0)
  2268. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2269. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2270. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2271. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2272. do { \
  2273. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2274. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2275. } while (0)
  2276. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2277. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2278. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2279. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2280. do { \
  2281. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2282. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2283. } while (0)
  2284. typedef enum {
  2285. TX_FLOW_PRIORITY_BE,
  2286. TX_FLOW_PRIORITY_HIGH,
  2287. TX_FLOW_PRIORITY_LOW,
  2288. } htt_tx_flow_priority_t;
  2289. typedef enum {
  2290. TX_FLOW_LATENCY_SENSITIVE,
  2291. TX_FLOW_LATENCY_INSENSITIVE,
  2292. } htt_tx_flow_latency_t;
  2293. typedef enum {
  2294. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2295. TX_FLOW_INTERACTIVE_TRAFFIC,
  2296. TX_FLOW_PERIODIC_TRAFFIC,
  2297. TX_FLOW_BURSTY_TRAFFIC,
  2298. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2299. } htt_tx_flow_traffic_pattern_t;
  2300. /**
  2301. * @brief HTT TX Flow search metadata format
  2302. * @details
  2303. * Host will set this metadata in flow table's flow search entry along with
  2304. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2305. * firmware and TQM ring if the flow search entry wins.
  2306. * This metadata is available to firmware in that first MSDU's
  2307. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2308. * to one of the available flows for specific tid and returns the tqm flow
  2309. * pointer as part of htt_tx_map_flow_info message.
  2310. */
  2311. PREPACK struct htt_tx_flow_metadata {
  2312. A_UINT32
  2313. rsvd0_1_0: 2,
  2314. tid: 4,
  2315. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2316. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2317. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2318. * Else choose final tid based on latency, priority.
  2319. */
  2320. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2321. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2322. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2323. } POSTPACK;
  2324. /* DWORD 0 */
  2325. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2326. #define HTT_TX_FLOW_METADATA_TID_S 2
  2327. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2328. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2329. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2330. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2331. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2332. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2333. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2334. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2335. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2336. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2337. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2338. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2339. /* DWORD 0 */
  2340. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2341. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2342. HTT_TX_FLOW_METADATA_TID_S)
  2343. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2344. do { \
  2345. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2346. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2347. } while (0)
  2348. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2349. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2350. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2351. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2352. do { \
  2353. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2354. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2355. } while (0)
  2356. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2357. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2358. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2359. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2360. do { \
  2361. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2362. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2363. } while (0)
  2364. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2365. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2366. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2367. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2368. do { \
  2369. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2370. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2371. } while (0)
  2372. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2373. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2374. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2375. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2376. do { \
  2377. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2378. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2379. } while (0)
  2380. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2381. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2382. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2383. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2384. do { \
  2385. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2386. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2387. } while (0)
  2388. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2389. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2390. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2391. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2392. do { \
  2393. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2394. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2395. } while (0)
  2396. /**
  2397. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2398. *
  2399. * @details
  2400. * HTT wds entry from source port learning
  2401. * Host will learn wds entries from rx and send this message to firmware
  2402. * to enable firmware to configure/delete AST entries for wds clients.
  2403. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2404. * and when SA's entry is deleted, firmware removes this AST entry
  2405. *
  2406. * The message would appear as follows:
  2407. *
  2408. * |31 30|29 |17 16|15 8|7 0|
  2409. * |----------------+----------------+----------------+----------------|
  2410. * | rsvd0 |PDVID| vdev_id | msg_type |
  2411. * |-------------------------------------------------------------------|
  2412. * | sa_addr_31_0 |
  2413. * |-------------------------------------------------------------------|
  2414. * | | ta_peer_id | sa_addr_47_32 |
  2415. * |-------------------------------------------------------------------|
  2416. * Where PDVID = pdev_id
  2417. *
  2418. * The message is interpreted as follows:
  2419. *
  2420. * dword0 - b'0:7 - msg_type: This will be set to
  2421. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2422. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2423. *
  2424. * dword0 - b'8:15 - vdev_id
  2425. *
  2426. * dword0 - b'16:17 - pdev_id
  2427. *
  2428. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2429. *
  2430. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2431. *
  2432. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2433. *
  2434. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2435. */
  2436. PREPACK struct htt_wds_entry {
  2437. A_UINT32
  2438. msg_type: 8,
  2439. vdev_id: 8,
  2440. pdev_id: 2,
  2441. rsvd0: 14;
  2442. A_UINT32 sa_addr_31_0;
  2443. A_UINT32
  2444. sa_addr_47_32: 16,
  2445. ta_peer_id: 14,
  2446. rsvd2: 2;
  2447. } POSTPACK;
  2448. /* DWORD 0 */
  2449. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2450. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2451. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2452. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2453. /* DWORD 2 */
  2454. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2455. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2456. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2457. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2458. /* DWORD 0 */
  2459. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2460. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2461. HTT_WDS_ENTRY_VDEV_ID_S)
  2462. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2463. do { \
  2464. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2465. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2466. } while (0)
  2467. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2468. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2469. HTT_WDS_ENTRY_PDEV_ID_S)
  2470. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2471. do { \
  2472. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2473. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2474. } while (0)
  2475. /* DWORD 2 */
  2476. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2477. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2478. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2479. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2480. do { \
  2481. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2482. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2483. } while (0)
  2484. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2485. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2486. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2487. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2488. do { \
  2489. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2490. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2491. } while (0)
  2492. /**
  2493. * @brief MAC DMA rx ring setup specification
  2494. * @details
  2495. * To allow for dynamic rx ring reconfiguration and to avoid race
  2496. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2497. * it uses. Instead, it sends this message to the target, indicating how
  2498. * the rx ring used by the host should be set up and maintained.
  2499. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2500. * specifications.
  2501. *
  2502. * |31 16|15 8|7 0|
  2503. * |---------------------------------------------------------------|
  2504. * header: | reserved | num rings | msg type |
  2505. * |---------------------------------------------------------------|
  2506. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2507. #if HTT_PADDR64
  2508. * | FW_IDX shadow register physical address (bits 63:32) |
  2509. #endif
  2510. * |---------------------------------------------------------------|
  2511. * | rx ring base physical address (bits 31:0) |
  2512. #if HTT_PADDR64
  2513. * | rx ring base physical address (bits 63:32) |
  2514. #endif
  2515. * |---------------------------------------------------------------|
  2516. * | rx ring buffer size | rx ring length |
  2517. * |---------------------------------------------------------------|
  2518. * | FW_IDX initial value | enabled flags |
  2519. * |---------------------------------------------------------------|
  2520. * | MSDU payload offset | 802.11 header offset |
  2521. * |---------------------------------------------------------------|
  2522. * | PPDU end offset | PPDU start offset |
  2523. * |---------------------------------------------------------------|
  2524. * | MPDU end offset | MPDU start offset |
  2525. * |---------------------------------------------------------------|
  2526. * | MSDU end offset | MSDU start offset |
  2527. * |---------------------------------------------------------------|
  2528. * | frag info offset | rx attention offset |
  2529. * |---------------------------------------------------------------|
  2530. * payload 2, if present, has the same format as payload 1
  2531. * Header fields:
  2532. * - MSG_TYPE
  2533. * Bits 7:0
  2534. * Purpose: identifies this as an rx ring configuration message
  2535. * Value: 0x2
  2536. * - NUM_RINGS
  2537. * Bits 15:8
  2538. * Purpose: indicates whether the host is setting up one rx ring or two
  2539. * Value: 1 or 2
  2540. * Payload:
  2541. * for systems using 64-bit format for bus addresses:
  2542. * - IDX_SHADOW_REG_PADDR_LO
  2543. * Bits 31:0
  2544. * Value: lower 4 bytes of physical address of the host's
  2545. * FW_IDX shadow register
  2546. * - IDX_SHADOW_REG_PADDR_HI
  2547. * Bits 31:0
  2548. * Value: upper 4 bytes of physical address of the host's
  2549. * FW_IDX shadow register
  2550. * - RING_BASE_PADDR_LO
  2551. * Bits 31:0
  2552. * Value: lower 4 bytes of physical address of the host's rx ring
  2553. * - RING_BASE_PADDR_HI
  2554. * Bits 31:0
  2555. * Value: uppper 4 bytes of physical address of the host's rx ring
  2556. * for systems using 32-bit format for bus addresses:
  2557. * - IDX_SHADOW_REG_PADDR
  2558. * Bits 31:0
  2559. * Value: physical address of the host's FW_IDX shadow register
  2560. * - RING_BASE_PADDR
  2561. * Bits 31:0
  2562. * Value: physical address of the host's rx ring
  2563. * - RING_LEN
  2564. * Bits 15:0
  2565. * Value: number of elements in the rx ring
  2566. * - RING_BUF_SZ
  2567. * Bits 31:16
  2568. * Value: size of the buffers referenced by the rx ring, in byte units
  2569. * - ENABLED_FLAGS
  2570. * Bits 15:0
  2571. * Value: 1-bit flags to show whether different rx fields are enabled
  2572. * bit 0: 802.11 header enabled (1) or disabled (0)
  2573. * bit 1: MSDU payload enabled (1) or disabled (0)
  2574. * bit 2: PPDU start enabled (1) or disabled (0)
  2575. * bit 3: PPDU end enabled (1) or disabled (0)
  2576. * bit 4: MPDU start enabled (1) or disabled (0)
  2577. * bit 5: MPDU end enabled (1) or disabled (0)
  2578. * bit 6: MSDU start enabled (1) or disabled (0)
  2579. * bit 7: MSDU end enabled (1) or disabled (0)
  2580. * bit 8: rx attention enabled (1) or disabled (0)
  2581. * bit 9: frag info enabled (1) or disabled (0)
  2582. * bit 10: unicast rx enabled (1) or disabled (0)
  2583. * bit 11: multicast rx enabled (1) or disabled (0)
  2584. * bit 12: ctrl rx enabled (1) or disabled (0)
  2585. * bit 13: mgmt rx enabled (1) or disabled (0)
  2586. * bit 14: null rx enabled (1) or disabled (0)
  2587. * bit 15: phy data rx enabled (1) or disabled (0)
  2588. * - IDX_INIT_VAL
  2589. * Bits 31:16
  2590. * Purpose: Specify the initial value for the FW_IDX.
  2591. * Value: the number of buffers initially present in the host's rx ring
  2592. * - OFFSET_802_11_HDR
  2593. * Bits 15:0
  2594. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2595. * - OFFSET_MSDU_PAYLOAD
  2596. * Bits 31:16
  2597. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2598. * - OFFSET_PPDU_START
  2599. * Bits 15:0
  2600. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2601. * - OFFSET_PPDU_END
  2602. * Bits 31:16
  2603. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2604. * - OFFSET_MPDU_START
  2605. * Bits 15:0
  2606. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2607. * - OFFSET_MPDU_END
  2608. * Bits 31:16
  2609. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2610. * - OFFSET_MSDU_START
  2611. * Bits 15:0
  2612. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2613. * - OFFSET_MSDU_END
  2614. * Bits 31:16
  2615. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2616. * - OFFSET_RX_ATTN
  2617. * Bits 15:0
  2618. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2619. * - OFFSET_FRAG_INFO
  2620. * Bits 31:16
  2621. * Value: offset in QUAD-bytes of frag info table
  2622. */
  2623. /* header fields */
  2624. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2625. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2626. /* payload fields */
  2627. /* for systems using a 64-bit format for bus addresses */
  2628. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2629. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2630. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2631. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2632. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2633. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2634. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2635. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2636. /* for systems using a 32-bit format for bus addresses */
  2637. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2638. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2639. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2640. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2641. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2642. #define HTT_RX_RING_CFG_LEN_S 0
  2643. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2644. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2645. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2646. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2647. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2648. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2649. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2650. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2651. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2652. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2653. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2654. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2655. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2656. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2657. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2658. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2659. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2660. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2661. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2662. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2663. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2664. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2665. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2666. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2667. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2668. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2669. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2670. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2671. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2672. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2673. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2674. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2675. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2676. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2677. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2678. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2679. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2680. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2681. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2682. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2683. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2684. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2685. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2686. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2687. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2688. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2689. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2690. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2691. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2692. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2693. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2694. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2695. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2696. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2697. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2698. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2699. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2700. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2701. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2702. #if HTT_PADDR64
  2703. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2704. #else
  2705. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2706. #endif
  2707. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2708. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2709. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2710. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2711. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2712. do { \
  2713. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2714. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2715. } while (0)
  2716. /* degenerate case for 32-bit fields */
  2717. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2718. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2719. ((_var) = (_val))
  2720. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2721. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2722. ((_var) = (_val))
  2723. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2724. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2725. ((_var) = (_val))
  2726. /* degenerate case for 32-bit fields */
  2727. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2728. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2729. ((_var) = (_val))
  2730. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2731. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2732. ((_var) = (_val))
  2733. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2734. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2735. ((_var) = (_val))
  2736. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2737. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2738. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2739. do { \
  2740. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2741. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2742. } while (0)
  2743. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2744. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2745. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2746. do { \
  2747. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2748. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2749. } while (0)
  2750. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2751. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2752. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2753. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2754. do { \
  2755. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2756. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2757. } while (0)
  2758. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2759. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2760. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2761. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2762. do { \
  2763. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2764. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2765. } while (0)
  2766. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2767. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2768. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2769. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2770. do { \
  2771. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2772. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2773. } while (0)
  2774. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2775. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2776. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2777. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2778. do { \
  2779. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2780. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2781. } while (0)
  2782. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2783. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2784. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2785. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2786. do { \
  2787. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2788. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2789. } while (0)
  2790. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2791. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2792. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2793. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2794. do { \
  2795. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2796. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2797. } while (0)
  2798. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2799. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2800. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2801. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2802. do { \
  2803. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2804. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2805. } while (0)
  2806. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2807. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2808. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2809. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2810. do { \
  2811. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2812. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2813. } while (0)
  2814. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2815. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2816. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2817. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2818. do { \
  2819. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2820. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2821. } while (0)
  2822. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2823. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2824. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2825. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2826. do { \
  2827. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2828. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2829. } while (0)
  2830. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2831. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2832. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2833. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2834. do { \
  2835. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2836. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2837. } while (0)
  2838. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2839. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2840. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2841. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2842. do { \
  2843. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2844. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2845. } while (0)
  2846. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2847. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2848. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2849. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2850. do { \
  2851. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2852. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2853. } while (0)
  2854. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2855. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2856. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2857. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2858. do { \
  2859. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2860. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2861. } while (0)
  2862. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2863. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2864. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2865. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2866. do { \
  2867. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2868. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2869. } while (0)
  2870. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2871. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2872. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2873. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2874. do { \
  2875. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2876. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2877. } while (0)
  2878. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2879. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2880. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2881. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2882. do { \
  2883. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2884. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2885. } while (0)
  2886. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2887. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2888. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2889. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2890. do { \
  2891. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2892. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2893. } while (0)
  2894. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2895. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2896. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2897. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2898. do { \
  2899. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2900. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2901. } while (0)
  2902. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2903. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2904. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2905. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2906. do { \
  2907. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2908. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2909. } while (0)
  2910. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2911. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2912. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2913. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2914. do { \
  2915. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2916. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2917. } while (0)
  2918. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2919. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2920. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2921. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2922. do { \
  2923. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2924. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2925. } while (0)
  2926. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2927. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2928. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2929. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2930. do { \
  2931. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2932. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2933. } while (0)
  2934. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2935. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2936. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2937. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2938. do { \
  2939. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2940. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2941. } while (0)
  2942. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2943. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2944. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2945. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2946. do { \
  2947. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2948. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2949. } while (0)
  2950. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2951. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2952. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2953. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2954. do { \
  2955. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2956. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2957. } while (0)
  2958. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2959. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2960. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2961. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2962. do { \
  2963. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2964. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2965. } while (0)
  2966. /**
  2967. * @brief host -> target FW statistics retrieve
  2968. *
  2969. * @details
  2970. * The following field definitions describe the format of the HTT host
  2971. * to target FW stats retrieve message. The message specifies the type of
  2972. * stats host wants to retrieve.
  2973. *
  2974. * |31 24|23 16|15 8|7 0|
  2975. * |-----------------------------------------------------------|
  2976. * | stats types request bitmask | msg type |
  2977. * |-----------------------------------------------------------|
  2978. * | stats types reset bitmask | reserved |
  2979. * |-----------------------------------------------------------|
  2980. * | stats type | config value |
  2981. * |-----------------------------------------------------------|
  2982. * | cookie LSBs |
  2983. * |-----------------------------------------------------------|
  2984. * | cookie MSBs |
  2985. * |-----------------------------------------------------------|
  2986. * Header fields:
  2987. * - MSG_TYPE
  2988. * Bits 7:0
  2989. * Purpose: identifies this is a stats upload request message
  2990. * Value: 0x3
  2991. * - UPLOAD_TYPES
  2992. * Bits 31:8
  2993. * Purpose: identifies which types of FW statistics to upload
  2994. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2995. * - RESET_TYPES
  2996. * Bits 31:8
  2997. * Purpose: identifies which types of FW statistics to reset
  2998. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2999. * - CFG_VAL
  3000. * Bits 23:0
  3001. * Purpose: give an opaque configuration value to the specified stats type
  3002. * Value: stats-type specific configuration value
  3003. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3004. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3005. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3006. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3007. * - CFG_STAT_TYPE
  3008. * Bits 31:24
  3009. * Purpose: specify which stats type (if any) the config value applies to
  3010. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3011. * a valid configuration specification
  3012. * - COOKIE_LSBS
  3013. * Bits 31:0
  3014. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3015. * message with its preceding host->target stats request message.
  3016. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3017. * - COOKIE_MSBS
  3018. * Bits 31:0
  3019. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3020. * message with its preceding host->target stats request message.
  3021. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3022. */
  3023. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3024. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3025. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3026. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3027. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3028. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3029. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3030. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3031. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3032. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3033. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3034. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3035. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3036. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3037. do { \
  3038. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3039. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3040. } while (0)
  3041. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3042. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3043. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3044. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3045. do { \
  3046. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3047. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3048. } while (0)
  3049. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3050. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3051. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3052. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3053. do { \
  3054. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3055. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3056. } while (0)
  3057. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3058. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3059. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3060. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3061. do { \
  3062. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3063. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3064. } while (0)
  3065. /**
  3066. * @brief host -> target HTT out-of-band sync request
  3067. *
  3068. * @details
  3069. * The HTT SYNC tells the target to suspend processing of subsequent
  3070. * HTT host-to-target messages until some other target agent locally
  3071. * informs the target HTT FW that the current sync counter is equal to
  3072. * or greater than (in a modulo sense) the sync counter specified in
  3073. * the SYNC message.
  3074. * This allows other host-target components to synchronize their operation
  3075. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3076. * security key has been downloaded to and activated by the target.
  3077. * In the absence of any explicit synchronization counter value
  3078. * specification, the target HTT FW will use zero as the default current
  3079. * sync value.
  3080. *
  3081. * |31 24|23 16|15 8|7 0|
  3082. * |-----------------------------------------------------------|
  3083. * | reserved | sync count | msg type |
  3084. * |-----------------------------------------------------------|
  3085. * Header fields:
  3086. * - MSG_TYPE
  3087. * Bits 7:0
  3088. * Purpose: identifies this as a sync message
  3089. * Value: 0x4
  3090. * - SYNC_COUNT
  3091. * Bits 15:8
  3092. * Purpose: specifies what sync value the HTT FW will wait for from
  3093. * an out-of-band specification to resume its operation
  3094. * Value: in-band sync counter value to compare against the out-of-band
  3095. * counter spec.
  3096. * The HTT target FW will suspend its host->target message processing
  3097. * as long as
  3098. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3099. */
  3100. #define HTT_H2T_SYNC_MSG_SZ 4
  3101. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3102. #define HTT_H2T_SYNC_COUNT_S 8
  3103. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3104. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3105. HTT_H2T_SYNC_COUNT_S)
  3106. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3107. do { \
  3108. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3109. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3110. } while (0)
  3111. /**
  3112. * @brief HTT aggregation configuration
  3113. */
  3114. #define HTT_AGGR_CFG_MSG_SZ 4
  3115. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3116. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3117. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3118. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3119. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3120. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3121. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3122. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3123. do { \
  3124. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3125. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3126. } while (0)
  3127. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3128. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3129. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3130. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3131. do { \
  3132. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3133. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3134. } while (0)
  3135. /**
  3136. * @brief host -> target HTT configure max amsdu info per vdev
  3137. *
  3138. * @details
  3139. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3140. *
  3141. * |31 21|20 16|15 8|7 0|
  3142. * |-----------------------------------------------------------|
  3143. * | reserved | vdev id | max amsdu | msg type |
  3144. * |-----------------------------------------------------------|
  3145. * Header fields:
  3146. * - MSG_TYPE
  3147. * Bits 7:0
  3148. * Purpose: identifies this as a aggr cfg ex message
  3149. * Value: 0xa
  3150. * - MAX_NUM_AMSDU_SUBFRM
  3151. * Bits 15:8
  3152. * Purpose: max MSDUs per A-MSDU
  3153. * - VDEV_ID
  3154. * Bits 20:16
  3155. * Purpose: ID of the vdev to which this limit is applied
  3156. */
  3157. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3158. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3159. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3160. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3161. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3162. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3163. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3164. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3165. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3166. do { \
  3167. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3168. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3169. } while (0)
  3170. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3171. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3172. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3173. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3174. do { \
  3175. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3176. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3177. } while (0)
  3178. /**
  3179. * @brief HTT WDI_IPA Config Message
  3180. *
  3181. * @details
  3182. * The HTT WDI_IPA config message is created/sent by host at driver
  3183. * init time. It contains information about data structures used on
  3184. * WDI_IPA TX and RX path.
  3185. * TX CE ring is used for pushing packet metadata from IPA uC
  3186. * to WLAN FW
  3187. * TX Completion ring is used for generating TX completions from
  3188. * WLAN FW to IPA uC
  3189. * RX Indication ring is used for indicating RX packets from FW
  3190. * to IPA uC
  3191. * RX Ring2 is used as either completion ring or as second
  3192. * indication ring. when Ring2 is used as completion ring, IPA uC
  3193. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3194. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3195. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3196. * indicated in RX Indication ring. Please see WDI_IPA specification
  3197. * for more details.
  3198. * |31 24|23 16|15 8|7 0|
  3199. * |----------------+----------------+----------------+----------------|
  3200. * | tx pkt pool size | Rsvd | msg_type |
  3201. * |-------------------------------------------------------------------|
  3202. * | tx comp ring base (bits 31:0) |
  3203. #if HTT_PADDR64
  3204. * | tx comp ring base (bits 63:32) |
  3205. #endif
  3206. * |-------------------------------------------------------------------|
  3207. * | tx comp ring size |
  3208. * |-------------------------------------------------------------------|
  3209. * | tx comp WR_IDX physical address (bits 31:0) |
  3210. #if HTT_PADDR64
  3211. * | tx comp WR_IDX physical address (bits 63:32) |
  3212. #endif
  3213. * |-------------------------------------------------------------------|
  3214. * | tx CE WR_IDX physical address (bits 31:0) |
  3215. #if HTT_PADDR64
  3216. * | tx CE WR_IDX physical address (bits 63:32) |
  3217. #endif
  3218. * |-------------------------------------------------------------------|
  3219. * | rx indication ring base (bits 31:0) |
  3220. #if HTT_PADDR64
  3221. * | rx indication ring base (bits 63:32) |
  3222. #endif
  3223. * |-------------------------------------------------------------------|
  3224. * | rx indication ring size |
  3225. * |-------------------------------------------------------------------|
  3226. * | rx ind RD_IDX physical address (bits 31:0) |
  3227. #if HTT_PADDR64
  3228. * | rx ind RD_IDX physical address (bits 63:32) |
  3229. #endif
  3230. * |-------------------------------------------------------------------|
  3231. * | rx ind WR_IDX physical address (bits 31:0) |
  3232. #if HTT_PADDR64
  3233. * | rx ind WR_IDX physical address (bits 63:32) |
  3234. #endif
  3235. * |-------------------------------------------------------------------|
  3236. * |-------------------------------------------------------------------|
  3237. * | rx ring2 base (bits 31:0) |
  3238. #if HTT_PADDR64
  3239. * | rx ring2 base (bits 63:32) |
  3240. #endif
  3241. * |-------------------------------------------------------------------|
  3242. * | rx ring2 size |
  3243. * |-------------------------------------------------------------------|
  3244. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3245. #if HTT_PADDR64
  3246. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3247. #endif
  3248. * |-------------------------------------------------------------------|
  3249. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3250. #if HTT_PADDR64
  3251. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3252. #endif
  3253. * |-------------------------------------------------------------------|
  3254. *
  3255. * Header fields:
  3256. * Header fields:
  3257. * - MSG_TYPE
  3258. * Bits 7:0
  3259. * Purpose: Identifies this as WDI_IPA config message
  3260. * value: = 0x8
  3261. * - TX_PKT_POOL_SIZE
  3262. * Bits 15:0
  3263. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3264. * WDI_IPA TX path
  3265. * For systems using 32-bit format for bus addresses:
  3266. * - TX_COMP_RING_BASE_ADDR
  3267. * Bits 31:0
  3268. * Purpose: TX Completion Ring base address in DDR
  3269. * - TX_COMP_RING_SIZE
  3270. * Bits 31:0
  3271. * Purpose: TX Completion Ring size (must be power of 2)
  3272. * - TX_COMP_WR_IDX_ADDR
  3273. * Bits 31:0
  3274. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3275. * updates the Write Index for WDI_IPA TX completion ring
  3276. * - TX_CE_WR_IDX_ADDR
  3277. * Bits 31:0
  3278. * Purpose: DDR address where IPA uC
  3279. * updates the WR Index for TX CE ring
  3280. * (needed for fusion platforms)
  3281. * - RX_IND_RING_BASE_ADDR
  3282. * Bits 31:0
  3283. * Purpose: RX Indication Ring base address in DDR
  3284. * - RX_IND_RING_SIZE
  3285. * Bits 31:0
  3286. * Purpose: RX Indication Ring size
  3287. * - RX_IND_RD_IDX_ADDR
  3288. * Bits 31:0
  3289. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3290. * RX indication ring
  3291. * - RX_IND_WR_IDX_ADDR
  3292. * Bits 31:0
  3293. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3294. * updates the Write Index for WDI_IPA RX indication ring
  3295. * - RX_RING2_BASE_ADDR
  3296. * Bits 31:0
  3297. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3298. * - RX_RING2_SIZE
  3299. * Bits 31:0
  3300. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3301. * - RX_RING2_RD_IDX_ADDR
  3302. * Bits 31:0
  3303. * Purpose: If Second RX ring is Indication ring, DDR address where
  3304. * IPA uC updates the Read Index for Ring2.
  3305. * If Second RX ring is completion ring, this is NOT used
  3306. * - RX_RING2_WR_IDX_ADDR
  3307. * Bits 31:0
  3308. * Purpose: If Second RX ring is Indication ring, DDR address where
  3309. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3310. * If second RX ring is completion ring, DDR address where
  3311. * IPA uC updates the Write Index for Ring 2.
  3312. * For systems using 64-bit format for bus addresses:
  3313. * - TX_COMP_RING_BASE_ADDR_LO
  3314. * Bits 31:0
  3315. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3316. * - TX_COMP_RING_BASE_ADDR_HI
  3317. * Bits 31:0
  3318. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3319. * - TX_COMP_RING_SIZE
  3320. * Bits 31:0
  3321. * Purpose: TX Completion Ring size (must be power of 2)
  3322. * - TX_COMP_WR_IDX_ADDR_LO
  3323. * Bits 31:0
  3324. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3325. * Lower 4 bytes of DDR address where WIFI FW
  3326. * updates the Write Index for WDI_IPA TX completion ring
  3327. * - TX_COMP_WR_IDX_ADDR_HI
  3328. * Bits 31:0
  3329. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3330. * Higher 4 bytes of DDR address where WIFI FW
  3331. * updates the Write Index for WDI_IPA TX completion ring
  3332. * - TX_CE_WR_IDX_ADDR_LO
  3333. * Bits 31:0
  3334. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3335. * updates the WR Index for TX CE ring
  3336. * (needed for fusion platforms)
  3337. * - TX_CE_WR_IDX_ADDR_HI
  3338. * Bits 31:0
  3339. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3340. * updates the WR Index for TX CE ring
  3341. * (needed for fusion platforms)
  3342. * - RX_IND_RING_BASE_ADDR_LO
  3343. * Bits 31:0
  3344. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3345. * - RX_IND_RING_BASE_ADDR_HI
  3346. * Bits 31:0
  3347. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3348. * - RX_IND_RING_SIZE
  3349. * Bits 31:0
  3350. * Purpose: RX Indication Ring size
  3351. * - RX_IND_RD_IDX_ADDR_LO
  3352. * Bits 31:0
  3353. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3354. * for WDI_IPA RX indication ring
  3355. * - RX_IND_RD_IDX_ADDR_HI
  3356. * Bits 31:0
  3357. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3358. * for WDI_IPA RX indication ring
  3359. * - RX_IND_WR_IDX_ADDR_LO
  3360. * Bits 31:0
  3361. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3362. * Lower 4 bytes of DDR address where WIFI FW
  3363. * updates the Write Index for WDI_IPA RX indication ring
  3364. * - RX_IND_WR_IDX_ADDR_HI
  3365. * Bits 31:0
  3366. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3367. * Higher 4 bytes of DDR address where WIFI FW
  3368. * updates the Write Index for WDI_IPA RX indication ring
  3369. * - RX_RING2_BASE_ADDR_LO
  3370. * Bits 31:0
  3371. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3372. * - RX_RING2_BASE_ADDR_HI
  3373. * Bits 31:0
  3374. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3375. * - RX_RING2_SIZE
  3376. * Bits 31:0
  3377. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3378. * - RX_RING2_RD_IDX_ADDR_LO
  3379. * Bits 31:0
  3380. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3381. * DDR address where IPA uC updates the Read Index for Ring2.
  3382. * If Second RX ring is completion ring, this is NOT used
  3383. * - RX_RING2_RD_IDX_ADDR_HI
  3384. * Bits 31:0
  3385. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3386. * DDR address where IPA uC updates the Read Index for Ring2.
  3387. * If Second RX ring is completion ring, this is NOT used
  3388. * - RX_RING2_WR_IDX_ADDR_LO
  3389. * Bits 31:0
  3390. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3391. * DDR address where WIFI FW updates the Write Index
  3392. * for WDI_IPA RX ring2
  3393. * If second RX ring is completion ring, lower 4 bytes of
  3394. * DDR address where IPA uC updates the Write Index for Ring 2.
  3395. * - RX_RING2_WR_IDX_ADDR_HI
  3396. * Bits 31:0
  3397. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3398. * DDR address where WIFI FW updates the Write Index
  3399. * for WDI_IPA RX ring2
  3400. * If second RX ring is completion ring, higher 4 bytes of
  3401. * DDR address where IPA uC updates the Write Index for Ring 2.
  3402. */
  3403. #if HTT_PADDR64
  3404. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3405. #else
  3406. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3407. #endif
  3408. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3409. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3410. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3411. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3412. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3413. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3414. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3415. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3416. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3417. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3418. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3419. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3420. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3421. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3422. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3423. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3424. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3425. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3426. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3427. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3428. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3429. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3430. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3431. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3432. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3433. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3434. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3435. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3436. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3437. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3438. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3439. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3440. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3441. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3442. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3443. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3444. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3445. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3446. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3447. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3448. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3449. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3450. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3451. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3452. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3453. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3454. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3455. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3456. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3457. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3458. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3459. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3460. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3461. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3462. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3463. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3464. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3465. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3466. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3467. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3468. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3469. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3470. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3471. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3472. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3473. do { \
  3474. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3475. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3476. } while (0)
  3477. /* for systems using 32-bit format for bus addr */
  3478. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3479. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3480. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3481. do { \
  3482. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3483. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3484. } while (0)
  3485. /* for systems using 64-bit format for bus addr */
  3486. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3487. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3488. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3489. do { \
  3490. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3491. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3492. } while (0)
  3493. /* for systems using 64-bit format for bus addr */
  3494. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3495. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3496. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3497. do { \
  3498. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3499. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3500. } while (0)
  3501. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3502. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3503. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3504. do { \
  3505. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3506. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3507. } while (0)
  3508. /* for systems using 32-bit format for bus addr */
  3509. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3510. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3511. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3512. do { \
  3513. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3514. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3515. } while (0)
  3516. /* for systems using 64-bit format for bus addr */
  3517. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3518. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3519. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3520. do { \
  3521. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3522. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3523. } while (0)
  3524. /* for systems using 64-bit format for bus addr */
  3525. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3526. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3527. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3528. do { \
  3529. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3530. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3531. } while (0)
  3532. /* for systems using 32-bit format for bus addr */
  3533. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3534. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3535. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3536. do { \
  3537. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3538. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3539. } while (0)
  3540. /* for systems using 64-bit format for bus addr */
  3541. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3542. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3543. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3544. do { \
  3545. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3546. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3547. } while (0)
  3548. /* for systems using 64-bit format for bus addr */
  3549. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3550. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3551. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3552. do { \
  3553. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3554. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3555. } while (0)
  3556. /* for systems using 32-bit format for bus addr */
  3557. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3558. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3559. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3560. do { \
  3561. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3562. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3563. } while (0)
  3564. /* for systems using 64-bit format for bus addr */
  3565. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3566. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3567. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3568. do { \
  3569. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3570. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3571. } while (0)
  3572. /* for systems using 64-bit format for bus addr */
  3573. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3574. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3575. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3576. do { \
  3577. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3578. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3579. } while (0)
  3580. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3581. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3582. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3583. do { \
  3584. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3585. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3586. } while (0)
  3587. /* for systems using 32-bit format for bus addr */
  3588. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3589. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3590. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3591. do { \
  3592. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3593. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3594. } while (0)
  3595. /* for systems using 64-bit format for bus addr */
  3596. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3597. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3598. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3599. do { \
  3600. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3601. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3602. } while (0)
  3603. /* for systems using 64-bit format for bus addr */
  3604. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3605. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3606. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3607. do { \
  3608. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3609. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3610. } while (0)
  3611. /* for systems using 32-bit format for bus addr */
  3612. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3613. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3614. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3615. do { \
  3616. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3617. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3618. } while (0)
  3619. /* for systems using 64-bit format for bus addr */
  3620. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3621. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3622. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3623. do { \
  3624. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3625. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3626. } while (0)
  3627. /* for systems using 64-bit format for bus addr */
  3628. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3629. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3630. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3631. do { \
  3632. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3633. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3634. } while (0)
  3635. /* for systems using 32-bit format for bus addr */
  3636. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3637. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3638. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3639. do { \
  3640. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3641. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3642. } while (0)
  3643. /* for systems using 64-bit format for bus addr */
  3644. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3645. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3646. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3647. do { \
  3648. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3649. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3650. } while (0)
  3651. /* for systems using 64-bit format for bus addr */
  3652. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3653. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3654. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3655. do { \
  3656. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3657. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3658. } while (0)
  3659. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3660. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3661. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3662. do { \
  3663. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3664. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3665. } while (0)
  3666. /* for systems using 32-bit format for bus addr */
  3667. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3668. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3669. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3670. do { \
  3671. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3672. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3673. } while (0)
  3674. /* for systems using 64-bit format for bus addr */
  3675. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3676. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3677. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3678. do { \
  3679. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3680. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3681. } while (0)
  3682. /* for systems using 64-bit format for bus addr */
  3683. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3684. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3685. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3686. do { \
  3687. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3688. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3689. } while (0)
  3690. /* for systems using 32-bit format for bus addr */
  3691. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3692. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3693. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3694. do { \
  3695. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3696. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3697. } while (0)
  3698. /* for systems using 64-bit format for bus addr */
  3699. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3700. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3701. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3702. do { \
  3703. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3704. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3705. } while (0)
  3706. /* for systems using 64-bit format for bus addr */
  3707. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3708. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3709. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3710. do { \
  3711. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3712. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3713. } while (0)
  3714. /*
  3715. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3716. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3717. * addresses are stored in a XXX-bit field.
  3718. * This macro is used to define both htt_wdi_ipa_config32_t and
  3719. * htt_wdi_ipa_config64_t structs.
  3720. */
  3721. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3722. _paddr__tx_comp_ring_base_addr_, \
  3723. _paddr__tx_comp_wr_idx_addr_, \
  3724. _paddr__tx_ce_wr_idx_addr_, \
  3725. _paddr__rx_ind_ring_base_addr_, \
  3726. _paddr__rx_ind_rd_idx_addr_, \
  3727. _paddr__rx_ind_wr_idx_addr_, \
  3728. _paddr__rx_ring2_base_addr_,\
  3729. _paddr__rx_ring2_rd_idx_addr_,\
  3730. _paddr__rx_ring2_wr_idx_addr_) \
  3731. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3732. { \
  3733. /* DWORD 0: flags and meta-data */ \
  3734. A_UINT32 \
  3735. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3736. reserved: 8, \
  3737. tx_pkt_pool_size: 16;\
  3738. /* DWORD 1 */\
  3739. _paddr__tx_comp_ring_base_addr_;\
  3740. /* DWORD 2 (or 3)*/\
  3741. A_UINT32 tx_comp_ring_size;\
  3742. /* DWORD 3 (or 4)*/\
  3743. _paddr__tx_comp_wr_idx_addr_;\
  3744. /* DWORD 4 (or 6)*/\
  3745. _paddr__tx_ce_wr_idx_addr_;\
  3746. /* DWORD 5 (or 8)*/\
  3747. _paddr__rx_ind_ring_base_addr_;\
  3748. /* DWORD 6 (or 10)*/\
  3749. A_UINT32 rx_ind_ring_size;\
  3750. /* DWORD 7 (or 11)*/\
  3751. _paddr__rx_ind_rd_idx_addr_;\
  3752. /* DWORD 8 (or 13)*/\
  3753. _paddr__rx_ind_wr_idx_addr_;\
  3754. /* DWORD 9 (or 15)*/\
  3755. _paddr__rx_ring2_base_addr_;\
  3756. /* DWORD 10 (or 17) */\
  3757. A_UINT32 rx_ring2_size;\
  3758. /* DWORD 11 (or 18) */\
  3759. _paddr__rx_ring2_rd_idx_addr_;\
  3760. /* DWORD 12 (or 20) */\
  3761. _paddr__rx_ring2_wr_idx_addr_;\
  3762. } POSTPACK
  3763. /* define a htt_wdi_ipa_config32_t type */
  3764. 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));
  3765. /* define a htt_wdi_ipa_config64_t type */
  3766. 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));
  3767. #if HTT_PADDR64
  3768. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3769. #else
  3770. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3771. #endif
  3772. enum htt_wdi_ipa_op_code {
  3773. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3774. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3775. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3776. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3777. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3778. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3779. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3780. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3781. /* keep this last */
  3782. HTT_WDI_IPA_OPCODE_MAX
  3783. };
  3784. /**
  3785. * @brief HTT WDI_IPA Operation Request Message
  3786. *
  3787. * @details
  3788. * HTT WDI_IPA Operation Request message is sent by host
  3789. * to either suspend or resume WDI_IPA TX or RX path.
  3790. * |31 24|23 16|15 8|7 0|
  3791. * |----------------+----------------+----------------+----------------|
  3792. * | op_code | Rsvd | msg_type |
  3793. * |-------------------------------------------------------------------|
  3794. *
  3795. * Header fields:
  3796. * - MSG_TYPE
  3797. * Bits 7:0
  3798. * Purpose: Identifies this as WDI_IPA Operation Request message
  3799. * value: = 0x9
  3800. * - OP_CODE
  3801. * Bits 31:16
  3802. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3803. * value: = enum htt_wdi_ipa_op_code
  3804. */
  3805. PREPACK struct htt_wdi_ipa_op_request_t
  3806. {
  3807. /* DWORD 0: flags and meta-data */
  3808. A_UINT32
  3809. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3810. reserved: 8,
  3811. op_code: 16;
  3812. } POSTPACK;
  3813. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3814. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3815. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3816. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3817. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3818. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3819. do { \
  3820. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3821. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3822. } while (0)
  3823. /*
  3824. * @brief host -> target HTT_SRING_SETUP message
  3825. *
  3826. * @details
  3827. * After target is booted up, Host can send SRING setup message for
  3828. * each host facing LMAC SRING. Target setups up HW registers based
  3829. * on setup message and confirms back to Host if response_required is set.
  3830. * Host should wait for confirmation message before sending new SRING
  3831. * setup message
  3832. *
  3833. * The message would appear as follows:
  3834. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3835. * |--------------- +-----------------+----------------+------------------|
  3836. * | ring_type | ring_id | pdev_id | msg_type |
  3837. * |----------------------------------------------------------------------|
  3838. * | ring_base_addr_lo |
  3839. * |----------------------------------------------------------------------|
  3840. * | ring_base_addr_hi |
  3841. * |----------------------------------------------------------------------|
  3842. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3843. * |----------------------------------------------------------------------|
  3844. * | ring_head_offset32_remote_addr_lo |
  3845. * |----------------------------------------------------------------------|
  3846. * | ring_head_offset32_remote_addr_hi |
  3847. * |----------------------------------------------------------------------|
  3848. * | ring_tail_offset32_remote_addr_lo |
  3849. * |----------------------------------------------------------------------|
  3850. * | ring_tail_offset32_remote_addr_hi |
  3851. * |----------------------------------------------------------------------|
  3852. * | ring_msi_addr_lo |
  3853. * |----------------------------------------------------------------------|
  3854. * | ring_msi_addr_hi |
  3855. * |----------------------------------------------------------------------|
  3856. * | ring_msi_data |
  3857. * |----------------------------------------------------------------------|
  3858. * | intr_timer_th |IM| intr_batch_counter_th |
  3859. * |----------------------------------------------------------------------|
  3860. * | reserved |RR|PTCF| intr_low_threshold |
  3861. * |----------------------------------------------------------------------|
  3862. * Where
  3863. * IM = sw_intr_mode
  3864. * RR = response_required
  3865. * PTCF = prefetch_timer_cfg
  3866. *
  3867. * The message is interpreted as follows:
  3868. * dword0 - b'0:7 - msg_type: This will be set to
  3869. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3870. * b'8:15 - pdev_id:
  3871. * 0 (for rings at SOC/UMAC level),
  3872. * 1/2/3 mac id (for rings at LMAC level)
  3873. * b'16:23 - ring_id: identify which ring is to setup,
  3874. * more details can be got from enum htt_srng_ring_id
  3875. * b'24:31 - ring_type: identify type of host rings,
  3876. * more details can be got from enum htt_srng_ring_type
  3877. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3878. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3879. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3880. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3881. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3882. * SW_TO_HW_RING.
  3883. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3884. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3885. * Lower 32 bits of memory address of the remote variable
  3886. * storing the 4-byte word offset that identifies the head
  3887. * element within the ring.
  3888. * (The head offset variable has type A_UINT32.)
  3889. * Valid for HW_TO_SW and SW_TO_SW rings.
  3890. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3891. * Upper 32 bits of memory address of the remote variable
  3892. * storing the 4-byte word offset that identifies the head
  3893. * element within the ring.
  3894. * (The head offset variable has type A_UINT32.)
  3895. * Valid for HW_TO_SW and SW_TO_SW rings.
  3896. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3897. * Lower 32 bits of memory address of the remote variable
  3898. * storing the 4-byte word offset that identifies the tail
  3899. * element within the ring.
  3900. * (The tail offset variable has type A_UINT32.)
  3901. * Valid for HW_TO_SW and SW_TO_SW rings.
  3902. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3903. * Upper 32 bits of memory address of the remote variable
  3904. * storing the 4-byte word offset that identifies the tail
  3905. * element within the ring.
  3906. * (The tail offset variable has type A_UINT32.)
  3907. * Valid for HW_TO_SW and SW_TO_SW rings.
  3908. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3909. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3910. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3911. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3912. * dword10 - b'0:31 - ring_msi_data: MSI data
  3913. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3914. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3915. * dword11 - b'0:14 - intr_batch_counter_th:
  3916. * batch counter threshold is in units of 4-byte words.
  3917. * HW internally maintains and increments batch count.
  3918. * (see SRING spec for detail description).
  3919. * When batch count reaches threshold value, an interrupt
  3920. * is generated by HW.
  3921. * b'15 - sw_intr_mode:
  3922. * This configuration shall be static.
  3923. * Only programmed at power up.
  3924. * 0: generate pulse style sw interrupts
  3925. * 1: generate level style sw interrupts
  3926. * b'16:31 - intr_timer_th:
  3927. * The timer init value when timer is idle or is
  3928. * initialized to start downcounting.
  3929. * In 8us units (to cover a range of 0 to 524 ms)
  3930. * dword12 - b'0:15 - intr_low_threshold:
  3931. * Used only by Consumer ring to generate ring_sw_int_p.
  3932. * Ring entries low threshold water mark, that is used
  3933. * in combination with the interrupt timer as well as
  3934. * the the clearing of the level interrupt.
  3935. * b'16:18 - prefetch_timer_cfg:
  3936. * Used only by Consumer ring to set timer mode to
  3937. * support Application prefetch handling.
  3938. * The external tail offset/pointer will be updated
  3939. * at following intervals:
  3940. * 3'b000: (Prefetch feature disabled; used only for debug)
  3941. * 3'b001: 1 usec
  3942. * 3'b010: 4 usec
  3943. * 3'b011: 8 usec (default)
  3944. * 3'b100: 16 usec
  3945. * Others: Reserverd
  3946. * b'19 - response_required:
  3947. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3948. * b'20:31 - reserved: reserved for future use
  3949. */
  3950. PREPACK struct htt_sring_setup_t {
  3951. A_UINT32 msg_type: 8,
  3952. pdev_id: 8,
  3953. ring_id: 8,
  3954. ring_type: 8;
  3955. A_UINT32 ring_base_addr_lo;
  3956. A_UINT32 ring_base_addr_hi;
  3957. A_UINT32 ring_size: 16,
  3958. ring_entry_size: 8,
  3959. ring_misc_cfg_flag: 8;
  3960. A_UINT32 ring_head_offset32_remote_addr_lo;
  3961. A_UINT32 ring_head_offset32_remote_addr_hi;
  3962. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3963. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3964. A_UINT32 ring_msi_addr_lo;
  3965. A_UINT32 ring_msi_addr_hi;
  3966. A_UINT32 ring_msi_data;
  3967. A_UINT32 intr_batch_counter_th: 15,
  3968. sw_intr_mode: 1,
  3969. intr_timer_th: 16;
  3970. A_UINT32 intr_low_threshold: 16,
  3971. prefetch_timer_cfg: 3,
  3972. response_required: 1,
  3973. reserved1: 12;
  3974. } POSTPACK;
  3975. enum htt_srng_ring_type {
  3976. HTT_HW_TO_SW_RING = 0,
  3977. HTT_SW_TO_HW_RING,
  3978. HTT_SW_TO_SW_RING,
  3979. /* Insert new ring types above this line */
  3980. };
  3981. enum htt_srng_ring_id {
  3982. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  3983. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  3984. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3985. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3986. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  3987. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  3988. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  3989. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  3990. /* Add Other SRING which can't be directly configured by host software above this line */
  3991. };
  3992. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  3993. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  3994. #define HTT_SRING_SETUP_PDEV_ID_S 8
  3995. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  3996. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  3997. HTT_SRING_SETUP_PDEV_ID_S)
  3998. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  3999. do { \
  4000. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4001. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4002. } while (0)
  4003. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4004. #define HTT_SRING_SETUP_RING_ID_S 16
  4005. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4006. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4007. HTT_SRING_SETUP_RING_ID_S)
  4008. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4009. do { \
  4010. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4011. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4012. } while (0)
  4013. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4014. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4015. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4016. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4017. HTT_SRING_SETUP_RING_TYPE_S)
  4018. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4019. do { \
  4020. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4021. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4022. } while (0)
  4023. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4024. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4025. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4026. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4027. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4028. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4029. do { \
  4030. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4031. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4032. } while (0)
  4033. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4034. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4035. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4036. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4037. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4038. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4039. do { \
  4040. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4041. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4042. } while (0)
  4043. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4044. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4045. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4046. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4047. HTT_SRING_SETUP_RING_SIZE_S)
  4048. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4049. do { \
  4050. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4051. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4052. } while (0)
  4053. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4054. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4055. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4056. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4057. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4058. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4059. do { \
  4060. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4061. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4062. } while (0)
  4063. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4064. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4065. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4066. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4067. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4068. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4069. do { \
  4070. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4071. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4072. } while (0)
  4073. /* This control bit is applicable to only Producer, which updates Ring ID field
  4074. * of each descriptor before pushing into the ring.
  4075. * 0: updates ring_id(default)
  4076. * 1: ring_id updating disabled */
  4077. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4078. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4079. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4080. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4081. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4082. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4083. do { \
  4084. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4085. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4086. } while (0)
  4087. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4088. * of each descriptor before pushing into the ring.
  4089. * 0: updates Loopcnt(default)
  4090. * 1: Loopcnt updating disabled */
  4091. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4092. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4093. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4094. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4095. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4096. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4097. do { \
  4098. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4099. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4100. } while (0)
  4101. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4102. * into security_id port of GXI/AXI. */
  4103. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4104. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4105. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4106. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4107. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4108. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4109. do { \
  4110. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4111. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4112. } while (0)
  4113. /* During MSI write operation, SRNG drives value of this register bit into
  4114. * swap bit of GXI/AXI. */
  4115. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4116. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4117. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4118. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4119. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4120. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4121. do { \
  4122. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4123. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4124. } while (0)
  4125. /* During Pointer write operation, SRNG drives value of this register bit into
  4126. * swap bit of GXI/AXI. */
  4127. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4128. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4129. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4130. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4131. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4132. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4133. do { \
  4134. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4135. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4136. } while (0)
  4137. /* During any data or TLV write operation, SRNG drives value of this register
  4138. * bit into swap bit of GXI/AXI. */
  4139. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4140. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4141. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4142. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4143. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4144. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4145. do { \
  4146. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4147. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4148. } while (0)
  4149. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4150. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4151. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4152. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4153. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4154. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4155. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4156. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4157. do { \
  4158. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4159. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4160. } while (0)
  4161. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4162. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4163. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4164. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4165. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4166. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4167. do { \
  4168. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4169. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4170. } while (0)
  4171. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4172. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4173. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4174. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4175. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4176. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4177. do { \
  4178. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4179. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4180. } while (0)
  4181. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4182. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4183. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4184. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4185. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4186. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4187. do { \
  4188. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4189. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4190. } while (0)
  4191. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4192. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4193. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4194. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4195. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4196. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4197. do { \
  4198. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4199. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4200. } while (0)
  4201. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4202. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4203. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4204. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4205. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4206. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4207. do { \
  4208. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4209. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4210. } while (0)
  4211. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4212. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4213. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4214. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4215. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4216. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4217. do { \
  4218. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4219. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4220. } while (0)
  4221. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4222. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4223. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4224. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4225. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4226. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4227. do { \
  4228. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4229. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4230. } while (0)
  4231. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4232. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4233. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4234. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4235. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4236. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4237. do { \
  4238. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4239. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4240. } while (0)
  4241. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4242. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4243. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4244. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4245. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4246. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4247. do { \
  4248. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4249. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4250. } while (0)
  4251. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4252. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4253. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4254. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4255. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4256. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4257. do { \
  4258. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4259. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4260. } while (0)
  4261. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4262. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4263. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4264. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4265. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4266. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4267. do { \
  4268. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4269. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4270. } while (0)
  4271. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4272. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4273. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4274. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4275. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4276. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4277. do { \
  4278. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4279. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4280. } while (0)
  4281. /**
  4282. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4283. *
  4284. * @details
  4285. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4286. * configure RXDMA rings.
  4287. * The configuration is per ring based and includes both packet subtypes
  4288. * and PPDU/MPDU TLVs.
  4289. *
  4290. * The message would appear as follows:
  4291. *
  4292. * |31 26|25|24|23 16|15 8|7 0|
  4293. * |-----------------+----------------+----------------+---------------|
  4294. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  4295. * |-------------------------------------------------------------------|
  4296. * | rsvd2 | ring_buffer_size |
  4297. * |-------------------------------------------------------------------|
  4298. * | packet_type_enable_flags_0 |
  4299. * |-------------------------------------------------------------------|
  4300. * | packet_type_enable_flags_1 |
  4301. * |-------------------------------------------------------------------|
  4302. * | packet_type_enable_flags_2 |
  4303. * |-------------------------------------------------------------------|
  4304. * | packet_type_enable_flags_3 |
  4305. * |-------------------------------------------------------------------|
  4306. * | tlv_filter_in_flags |
  4307. * |-------------------------------------------------------------------|
  4308. * Where:
  4309. * PS = pkt_swap
  4310. * SS = status_swap
  4311. * The message is interpreted as follows:
  4312. * dword0 - b'0:7 - msg_type: This will be set to
  4313. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4314. * b'8:15 - pdev_id:
  4315. * 0 (for rings at SOC/UMAC level),
  4316. * 1/2/3 mac id (for rings at LMAC level)
  4317. * b'16:23 - ring_id : Identify the ring to configure.
  4318. * More details can be got from enum htt_srng_ring_id
  4319. * b'24 - status_swap: 1 is to swap status TLV
  4320. * b'25 - pkt_swap: 1 is to swap packet TLV
  4321. * b'26:31 - rsvd1: reserved for future use
  4322. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4323. * in byte units.
  4324. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4325. * - b'16:31 - rsvd2: Reserved for future use
  4326. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4327. * Enable MGMT packet from 0b0000 to 0b1001
  4328. * bits from low to high: FP, MD, MO - 3 bits
  4329. * FP: Filter_Pass
  4330. * MD: Monitor_Direct
  4331. * MO: Monitor_Other
  4332. * 10 mgmt subtypes * 3 bits -> 30 bits
  4333. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4334. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4335. * Enable MGMT packet from 0b1010 to 0b1111
  4336. * bits from low to high: FP, MD, MO - 3 bits
  4337. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4338. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4339. * Enable CTRL packet from 0b0000 to 0b1001
  4340. * bits from low to high: FP, MD, MO - 3 bits
  4341. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4342. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4343. * Enable CTRL packet from 0b1010 to 0b1111,
  4344. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4345. * bits from low to high: FP, MD, MO - 3 bits
  4346. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4347. * dword6 - b'0:31 - tlv_filter_in_flags:
  4348. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4349. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4350. */
  4351. PREPACK struct htt_rx_ring_selection_cfg_t {
  4352. A_UINT32 msg_type: 8,
  4353. pdev_id: 8,
  4354. ring_id: 8,
  4355. status_swap: 1,
  4356. pkt_swap: 1,
  4357. rsvd1: 6;
  4358. A_UINT32 ring_buffer_size: 16,
  4359. rsvd2: 16;
  4360. A_UINT32 packet_type_enable_flags_0;
  4361. A_UINT32 packet_type_enable_flags_1;
  4362. A_UINT32 packet_type_enable_flags_2;
  4363. A_UINT32 packet_type_enable_flags_3;
  4364. A_UINT32 tlv_filter_in_flags;
  4365. } POSTPACK;
  4366. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4367. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4368. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4369. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4370. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4371. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4372. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4373. do { \
  4374. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4375. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4376. } while (0)
  4377. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4378. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4379. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4380. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4381. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4382. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4383. do { \
  4384. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4385. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4386. } while (0)
  4387. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4388. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4389. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4390. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4391. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4392. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4393. do { \
  4394. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4395. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4396. } while (0)
  4397. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4398. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4399. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4400. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4401. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4402. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4403. do { \
  4404. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4405. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4406. } while (0)
  4407. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4408. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4409. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4410. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4411. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4412. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4413. do { \
  4414. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4415. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4416. } while (0)
  4417. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4418. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4419. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4420. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4421. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4422. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4423. do { \
  4424. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4425. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4426. } while (0)
  4427. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4428. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4429. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4430. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4431. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4432. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4433. do { \
  4434. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4435. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4436. } while (0)
  4437. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4438. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4439. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4440. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4441. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4442. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4443. do { \
  4444. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4445. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4446. } while (0)
  4447. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4448. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4449. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4450. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4451. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4452. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4453. do { \
  4454. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4455. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4456. } while (0)
  4457. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4458. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4459. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4460. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4461. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4462. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4463. do { \
  4464. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4465. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4466. } while (0)
  4467. /*
  4468. * Subtype based MGMT frames enable bits.
  4469. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4470. */
  4471. /* association request */
  4472. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4473. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4474. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4475. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4476. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4477. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4478. /* association response */
  4479. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4482. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4484. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4485. /* Reassociation request */
  4486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4487. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4489. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4492. /* Reassociation response */
  4493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4494. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4495. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4497. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4499. /* Probe request */
  4500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4502. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4505. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4506. /* Probe response */
  4507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4512. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4513. /* Timing Advertisement */
  4514. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4515. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4516. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4517. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4519. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4520. /* Reserved */
  4521. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4522. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4523. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4524. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4525. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4526. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4527. /* Beacon */
  4528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000001
  4529. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4530. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000001
  4531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4532. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x00000001
  4533. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4534. /* ATIM */
  4535. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x00000001
  4536. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4537. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x00000001
  4538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4539. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x00000001
  4540. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4541. /* Disassociation */
  4542. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4543. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4544. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4545. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4546. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4547. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4548. /* Authentication */
  4549. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4550. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4552. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4554. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4555. /* Deauthentication */
  4556. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4557. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4558. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4559. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4560. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4561. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4562. /* Action */
  4563. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4564. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4565. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4566. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4567. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4568. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4569. /* Action No Ack */
  4570. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4571. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4572. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4573. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4574. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4575. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4576. /* Reserved */
  4577. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4578. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4579. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4580. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4581. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4582. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4583. /*
  4584. * Subtype based CTRL frames enable bits.
  4585. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4586. */
  4587. /* Reserved */
  4588. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4589. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4590. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4591. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4592. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4594. /* Reserved */
  4595. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4596. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4599. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4601. /* Reserved */
  4602. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4608. /* Reserved */
  4609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4612. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4615. /* Reserved */
  4616. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4617. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4622. /* Reserved */
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4629. /* Reserved */
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4636. /* Control Wrapper */
  4637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4639. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4643. /* Block Ack Request */
  4644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4645. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4646. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4648. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4649. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4650. /* Block Ack*/
  4651. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4655. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4657. /* PS-POLL */
  4658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4659. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4662. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4663. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4664. /* RTS */
  4665. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4666. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4667. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4668. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4669. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4670. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4671. /* CTS */
  4672. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4673. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4674. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4675. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4676. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4677. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4678. /* ACK */
  4679. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4680. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4681. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4683. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4684. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4685. /* CF-END */
  4686. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4687. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4689. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4690. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4691. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4692. /* CF-END + CF-ACK */
  4693. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4695. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4696. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4697. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4698. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4699. /* Multicast data */
  4700. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4701. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4702. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4703. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4704. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4705. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4706. /* Unicast data */
  4707. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4708. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4709. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4710. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4711. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4712. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4713. /* NULL data */
  4714. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4715. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4716. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4717. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4718. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4719. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4720. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4721. do { \
  4722. HTT_CHECK_SET_VAL(httsym, value); \
  4723. (word) |= (value) << httsym##_S; \
  4724. } while (0)
  4725. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4726. (((word) & httsym##_M) >> httsym##_S)
  4727. #define htt_rx_ring_pkt_enable_subtype_set( \
  4728. word, flag, mode, type, subtype, val) \
  4729. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4730. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4731. #define htt_rx_ring_pkt_enable_subtype_get( \
  4732. word, flag, mode, type, subtype) \
  4733. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4734. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4735. /* Definition to filter in TLVs */
  4736. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4737. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4738. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4739. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4740. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4741. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4742. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4743. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4744. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4745. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4746. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4747. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4748. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4749. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4750. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4751. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4752. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4753. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4754. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4755. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4756. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4757. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4758. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4759. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4760. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4761. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4762. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4763. do { \
  4764. HTT_CHECK_SET_VAL(httsym, enable); \
  4765. (word) |= (enable) << httsym##_S; \
  4766. } while (0)
  4767. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4768. (((word) & httsym##_M) >> httsym##_S)
  4769. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4770. HTT_RX_RING_TLV_ENABLE_SET( \
  4771. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4772. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4773. HTT_RX_RING_TLV_ENABLE_GET( \
  4774. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4775. /**
  4776. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4777. * host --> target Receive Flow Steering configuration message definition.
  4778. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4779. * The reason for this is we want RFS to be configured and ready before MAC
  4780. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4781. *
  4782. * |31 24|23 16|15 9|8|7 0|
  4783. * |----------------+----------------+----------------+----------------|
  4784. * | reserved |E| msg type |
  4785. * |-------------------------------------------------------------------|
  4786. * Where E = RFS enable flag
  4787. *
  4788. * The RFS_CONFIG message consists of a single 4-byte word.
  4789. *
  4790. * Header fields:
  4791. * - MSG_TYPE
  4792. * Bits 7:0
  4793. * Purpose: identifies this as a RFS config msg
  4794. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4795. * - RFS_CONFIG
  4796. * Bit 8
  4797. * Purpose: Tells target whether to enable (1) or disable (0)
  4798. * flow steering feature when sending rx indication messages to host
  4799. */
  4800. #define HTT_H2T_RFS_CONFIG_M 0x100
  4801. #define HTT_H2T_RFS_CONFIG_S 8
  4802. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4803. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4804. HTT_H2T_RFS_CONFIG_S)
  4805. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4806. do { \
  4807. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4808. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4809. } while (0)
  4810. #define HTT_RFS_CFG_REQ_BYTES 4
  4811. /**
  4812. * @brief host -> target FW extended statistics retrieve
  4813. *
  4814. * @details
  4815. * The following field definitions describe the format of the HTT host
  4816. * to target FW extended stats retrieve message.
  4817. * The message specifies the type of stats the host wants to retrieve.
  4818. *
  4819. * |31 24|23 16|15 8|7 0|
  4820. * |-----------------------------------------------------------|
  4821. * | reserved | stats type | pdev_mask | msg type |
  4822. * |-----------------------------------------------------------|
  4823. * | config param [0] |
  4824. * |-----------------------------------------------------------|
  4825. * | config param [1] |
  4826. * |-----------------------------------------------------------|
  4827. * | config param [2] |
  4828. * |-----------------------------------------------------------|
  4829. * | config param [3] |
  4830. * |-----------------------------------------------------------|
  4831. * | reserved |
  4832. * |-----------------------------------------------------------|
  4833. * | cookie LSBs |
  4834. * |-----------------------------------------------------------|
  4835. * | cookie MSBs |
  4836. * |-----------------------------------------------------------|
  4837. * Header fields:
  4838. * - MSG_TYPE
  4839. * Bits 7:0
  4840. * Purpose: identifies this is a extended stats upload request message
  4841. * Value: 0x10
  4842. * - PDEV_MASK
  4843. * Bits 8:15
  4844. * Purpose: identifies the mask of PDEVs to retrieve stats from
  4845. * Value: This is a overloaded field, refer to usage and interpretation of
  4846. * PDEV in interface document.
  4847. * Bit 8 : Reserved for SOC stats
  4848. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4849. * Indicates MACID_MASK in DBS
  4850. * - STATS_TYPE
  4851. * Bits 23:16
  4852. * Purpose: identifies which FW statistics to upload
  4853. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  4854. * - Reserved
  4855. * Bits 31:24
  4856. * - CONFIG_PARAM [0]
  4857. * Bits 31:0
  4858. * Purpose: give an opaque configuration value to the specified stats type
  4859. * Value: stats-type specific configuration value
  4860. * Refer to htt_stats.h for interpretation for each stats sub_type
  4861. * - CONFIG_PARAM [1]
  4862. * Bits 31:0
  4863. * Purpose: give an opaque configuration value to the specified stats type
  4864. * Value: stats-type specific configuration value
  4865. * Refer to htt_stats.h for interpretation for each stats sub_type
  4866. * - CONFIG_PARAM [2]
  4867. * Bits 31:0
  4868. * Purpose: give an opaque configuration value to the specified stats type
  4869. * Value: stats-type specific configuration value
  4870. * Refer to htt_stats.h for interpretation for each stats sub_type
  4871. * - CONFIG_PARAM [3]
  4872. * Bits 31:0
  4873. * Purpose: give an opaque configuration value to the specified stats type
  4874. * Value: stats-type specific configuration value
  4875. * Refer to htt_stats.h for interpretation for each stats sub_type
  4876. * - Reserved [31:0] for future use.
  4877. * - COOKIE_LSBS
  4878. * Bits 31:0
  4879. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4880. * message with its preceding host->target stats request message.
  4881. * Value: LSBs of the opaque cookie specified by the host-side requestor
  4882. * - COOKIE_MSBS
  4883. * Bits 31:0
  4884. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4885. * message with its preceding host->target stats request message.
  4886. * Value: MSBs of the opaque cookie specified by the host-side requestor
  4887. */
  4888. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  4889. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  4890. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  4891. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  4892. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  4893. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  4894. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  4895. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  4896. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  4897. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  4898. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  4899. do { \
  4900. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  4901. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  4902. } while (0)
  4903. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  4904. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  4905. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  4906. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  4907. do { \
  4908. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  4909. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  4910. } while (0)
  4911. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  4912. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  4913. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  4914. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  4915. do { \
  4916. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  4917. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  4918. } while (0)
  4919. /**
  4920. * @brief host -> target FW PPDU_STATS request message
  4921. *
  4922. * @details
  4923. * The following field definitions describe the format of the HTT host
  4924. * to target FW for PPDU_STATS_CFG msg.
  4925. * The message allows the host to configure the PPDU_STATS_IND messages
  4926. * produced by the target.
  4927. *
  4928. * |31 24|23 16|15 8|7 0|
  4929. * |-----------------------------------------------------------|
  4930. * | REQ bit mask | pdev_mask | msg type |
  4931. * |-----------------------------------------------------------|
  4932. * Header fields:
  4933. * - MSG_TYPE
  4934. * Bits 7:0
  4935. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  4936. * Value: 0x11
  4937. * - PDEV_MASK
  4938. * Bits 8:15
  4939. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  4940. * Value: This is a overloaded field, refer to usage and interpretation of
  4941. * PDEV in interface document.
  4942. * Bit 8 : Reserved for SOC stats
  4943. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4944. * Indicates MACID_MASK in DBS
  4945. * - REQ_TLV_BIT_MASK
  4946. * Bits 16:31
  4947. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  4948. * needs to be included in the target's PPDU_STATS_IND messages.
  4949. * Value: refer htt_ppdu_stats_tlv_tag_t
  4950. *
  4951. */
  4952. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  4953. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  4954. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  4955. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  4956. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  4957. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  4958. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  4959. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  4960. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  4961. do { \
  4962. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  4963. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  4964. } while (0)
  4965. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  4966. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  4967. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  4968. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  4969. do { \
  4970. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  4971. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  4972. } while (0)
  4973. /*=== target -> host messages ===============================================*/
  4974. enum htt_t2h_msg_type {
  4975. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  4976. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  4977. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  4978. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  4979. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  4980. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  4981. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  4982. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  4983. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  4984. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  4985. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  4986. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  4987. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  4988. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  4989. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  4990. /* only used for HL, add HTT MSG for HTT CREDIT update */
  4991. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  4992. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  4993. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  4994. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  4995. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  4996. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  4997. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  4998. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  4999. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  5000. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  5001. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  5002. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  5003. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  5004. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  5005. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  5006. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  5007. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  5008. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  5009. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  5010. HTT_T2H_MSG_TYPE_TEST,
  5011. /* keep this last */
  5012. HTT_T2H_NUM_MSGS
  5013. };
  5014. /*
  5015. * HTT target to host message type -
  5016. * stored in bits 7:0 of the first word of the message
  5017. */
  5018. #define HTT_T2H_MSG_TYPE_M 0xff
  5019. #define HTT_T2H_MSG_TYPE_S 0
  5020. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  5021. do { \
  5022. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  5023. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  5024. } while (0)
  5025. #define HTT_T2H_MSG_TYPE_GET(word) \
  5026. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5027. /**
  5028. * @brief target -> host version number confirmation message definition
  5029. *
  5030. * |31 24|23 16|15 8|7 0|
  5031. * |----------------+----------------+----------------+----------------|
  5032. * | reserved | major number | minor number | msg type |
  5033. * |-------------------------------------------------------------------|
  5034. * : option request TLV (optional) |
  5035. * :...................................................................:
  5036. *
  5037. * The VER_CONF message may consist of a single 4-byte word, or may be
  5038. * extended with TLVs that specify HTT options selected by the target.
  5039. * The following option TLVs may be appended to the VER_CONF message:
  5040. * - LL_BUS_ADDR_SIZE
  5041. * - HL_SUPPRESS_TX_COMPL_IND
  5042. * - MAX_TX_QUEUE_GROUPS
  5043. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5044. * may be appended to the VER_CONF message (but only one TLV of each type).
  5045. *
  5046. * Header fields:
  5047. * - MSG_TYPE
  5048. * Bits 7:0
  5049. * Purpose: identifies this as a version number confirmation message
  5050. * Value: 0x0
  5051. * - VER_MINOR
  5052. * Bits 15:8
  5053. * Purpose: Specify the minor number of the HTT message library version
  5054. * in use by the target firmware.
  5055. * The minor number specifies the specific revision within a range
  5056. * of fundamentally compatible HTT message definition revisions.
  5057. * Compatible revisions involve adding new messages or perhaps
  5058. * adding new fields to existing messages, in a backwards-compatible
  5059. * manner.
  5060. * Incompatible revisions involve changing the message type values,
  5061. * or redefining existing messages.
  5062. * Value: minor number
  5063. * - VER_MAJOR
  5064. * Bits 15:8
  5065. * Purpose: Specify the major number of the HTT message library version
  5066. * in use by the target firmware.
  5067. * The major number specifies the family of minor revisions that are
  5068. * fundamentally compatible with each other, but not with prior or
  5069. * later families.
  5070. * Value: major number
  5071. */
  5072. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5073. #define HTT_VER_CONF_MINOR_S 8
  5074. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5075. #define HTT_VER_CONF_MAJOR_S 16
  5076. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5077. do { \
  5078. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5079. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5080. } while (0)
  5081. #define HTT_VER_CONF_MINOR_GET(word) \
  5082. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5083. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5084. do { \
  5085. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5086. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5087. } while (0)
  5088. #define HTT_VER_CONF_MAJOR_GET(word) \
  5089. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5090. #define HTT_VER_CONF_BYTES 4
  5091. /**
  5092. * @brief - target -> host HTT Rx In order indication message
  5093. *
  5094. * @details
  5095. *
  5096. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5097. * |----------------+-------------------+---------------------+---------------|
  5098. * | peer ID | P| F| O| ext TID | msg type |
  5099. * |--------------------------------------------------------------------------|
  5100. * | MSDU count | Reserved | vdev id |
  5101. * |--------------------------------------------------------------------------|
  5102. * | MSDU 0 bus address (bits 31:0) |
  5103. #if HTT_PADDR64
  5104. * | MSDU 0 bus address (bits 63:32) |
  5105. #endif
  5106. * |--------------------------------------------------------------------------|
  5107. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5108. * |--------------------------------------------------------------------------|
  5109. * | MSDU 1 bus address (bits 31:0) |
  5110. #if HTT_PADDR64
  5111. * | MSDU 1 bus address (bits 63:32) |
  5112. #endif
  5113. * |--------------------------------------------------------------------------|
  5114. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5115. * |--------------------------------------------------------------------------|
  5116. */
  5117. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5118. *
  5119. * @details
  5120. * bits
  5121. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5122. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5123. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5124. * | | frag | | | | fail |chksum fail|
  5125. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5126. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5127. */
  5128. struct htt_rx_in_ord_paddr_ind_hdr_t
  5129. {
  5130. A_UINT32 /* word 0 */
  5131. msg_type: 8,
  5132. ext_tid: 5,
  5133. offload: 1,
  5134. frag: 1,
  5135. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5136. peer_id: 16;
  5137. A_UINT32 /* word 1 */
  5138. vap_id: 8,
  5139. reserved_1: 8,
  5140. msdu_cnt: 16;
  5141. };
  5142. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5143. {
  5144. A_UINT32 dma_addr;
  5145. A_UINT32
  5146. length: 16,
  5147. fw_desc: 8,
  5148. msdu_info:8;
  5149. };
  5150. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5151. {
  5152. A_UINT32 dma_addr_lo;
  5153. A_UINT32 dma_addr_hi;
  5154. A_UINT32
  5155. length: 16,
  5156. fw_desc: 8,
  5157. msdu_info:8;
  5158. };
  5159. #if HTT_PADDR64
  5160. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5161. #else
  5162. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5163. #endif
  5164. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5165. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5166. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5167. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5168. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5169. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5170. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5171. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5172. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5173. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5174. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5175. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5176. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5177. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5178. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5179. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5180. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5181. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5182. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5183. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5184. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5185. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5186. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5187. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5188. /* for systems using 64-bit format for bus addresses */
  5189. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5190. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5191. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5192. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5193. /* for systems using 32-bit format for bus addresses */
  5194. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5195. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5196. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5197. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5198. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5199. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5200. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5201. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5202. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5203. do { \
  5204. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5205. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5206. } while (0)
  5207. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5208. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5209. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5210. do { \
  5211. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5212. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5213. } while (0)
  5214. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5215. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5216. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5217. do { \
  5218. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5219. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5220. } while (0)
  5221. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5222. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5223. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5224. do { \
  5225. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5226. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5227. } while (0)
  5228. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5229. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5230. /* for systems using 64-bit format for bus addresses */
  5231. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5232. do { \
  5233. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5234. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5235. } while (0)
  5236. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5237. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5238. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5239. do { \
  5240. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5241. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5242. } while (0)
  5243. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5244. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5245. /* for systems using 32-bit format for bus addresses */
  5246. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5247. do { \
  5248. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5249. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5250. } while (0)
  5251. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5252. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5253. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5254. do { \
  5255. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5256. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5257. } while (0)
  5258. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5259. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5260. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5261. do { \
  5262. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5263. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5264. } while (0)
  5265. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5266. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5267. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5268. do { \
  5269. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5270. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5271. } while (0)
  5272. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5273. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5274. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5275. do { \
  5276. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5277. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5278. } while (0)
  5279. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5280. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5281. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5282. do { \
  5283. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5284. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5285. } while (0)
  5286. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5287. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5288. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5289. do { \
  5290. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5291. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5292. } while (0)
  5293. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5294. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5295. /* definitions used within target -> host rx indication message */
  5296. PREPACK struct htt_rx_ind_hdr_prefix_t
  5297. {
  5298. A_UINT32 /* word 0 */
  5299. msg_type: 8,
  5300. ext_tid: 5,
  5301. release_valid: 1,
  5302. flush_valid: 1,
  5303. reserved0: 1,
  5304. peer_id: 16;
  5305. A_UINT32 /* word 1 */
  5306. flush_start_seq_num: 6,
  5307. flush_end_seq_num: 6,
  5308. release_start_seq_num: 6,
  5309. release_end_seq_num: 6,
  5310. num_mpdu_ranges: 8;
  5311. } POSTPACK;
  5312. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5313. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5314. #define HTT_TGT_RSSI_INVALID 0x80
  5315. PREPACK struct htt_rx_ppdu_desc_t
  5316. {
  5317. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5318. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5319. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5320. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5321. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5322. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5323. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5324. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5325. A_UINT32 /* word 0 */
  5326. rssi_cmb: 8,
  5327. timestamp_submicrosec: 8,
  5328. phy_err_code: 8,
  5329. phy_err: 1,
  5330. legacy_rate: 4,
  5331. legacy_rate_sel: 1,
  5332. end_valid: 1,
  5333. start_valid: 1;
  5334. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5335. union {
  5336. A_UINT32 /* word 1 */
  5337. rssi0_pri20: 8,
  5338. rssi0_ext20: 8,
  5339. rssi0_ext40: 8,
  5340. rssi0_ext80: 8;
  5341. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5342. } u0;
  5343. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5344. union {
  5345. A_UINT32 /* word 2 */
  5346. rssi1_pri20: 8,
  5347. rssi1_ext20: 8,
  5348. rssi1_ext40: 8,
  5349. rssi1_ext80: 8;
  5350. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5351. } u1;
  5352. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5353. union {
  5354. A_UINT32 /* word 3 */
  5355. rssi2_pri20: 8,
  5356. rssi2_ext20: 8,
  5357. rssi2_ext40: 8,
  5358. rssi2_ext80: 8;
  5359. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5360. } u2;
  5361. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5362. union {
  5363. A_UINT32 /* word 4 */
  5364. rssi3_pri20: 8,
  5365. rssi3_ext20: 8,
  5366. rssi3_ext40: 8,
  5367. rssi3_ext80: 8;
  5368. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5369. } u3;
  5370. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5371. A_UINT32 tsf32; /* word 5 */
  5372. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5373. A_UINT32 timestamp_microsec; /* word 6 */
  5374. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5375. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5376. A_UINT32 /* word 7 */
  5377. vht_sig_a1: 24,
  5378. preamble_type: 8;
  5379. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5380. A_UINT32 /* word 8 */
  5381. vht_sig_a2: 24,
  5382. reserved0: 8;
  5383. } POSTPACK;
  5384. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5385. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5386. PREPACK struct htt_rx_ind_hdr_suffix_t
  5387. {
  5388. A_UINT32 /* word 0 */
  5389. fw_rx_desc_bytes: 16,
  5390. reserved0: 16;
  5391. } POSTPACK;
  5392. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5393. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5394. PREPACK struct htt_rx_ind_hdr_t
  5395. {
  5396. struct htt_rx_ind_hdr_prefix_t prefix;
  5397. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5398. struct htt_rx_ind_hdr_suffix_t suffix;
  5399. } POSTPACK;
  5400. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5401. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5402. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5403. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5404. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5405. /*
  5406. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5407. * the offset into the HTT rx indication message at which the
  5408. * FW rx PPDU descriptor resides
  5409. */
  5410. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5411. /*
  5412. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5413. * the offset into the HTT rx indication message at which the
  5414. * header suffix (FW rx MSDU byte count) resides
  5415. */
  5416. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5417. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5418. /*
  5419. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5420. * the offset into the HTT rx indication message at which the per-MSDU
  5421. * information starts
  5422. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5423. * per-MSDU information portion of the message. The per-MSDU info itself
  5424. * starts at byte 12.
  5425. */
  5426. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5427. /**
  5428. * @brief target -> host rx indication message definition
  5429. *
  5430. * @details
  5431. * The following field definitions describe the format of the rx indication
  5432. * message sent from the target to the host.
  5433. * The message consists of three major sections:
  5434. * 1. a fixed-length header
  5435. * 2. a variable-length list of firmware rx MSDU descriptors
  5436. * 3. one or more 4-octet MPDU range information elements
  5437. * The fixed length header itself has two sub-sections
  5438. * 1. the message meta-information, including identification of the
  5439. * sender and type of the received data, and a 4-octet flush/release IE
  5440. * 2. the firmware rx PPDU descriptor
  5441. *
  5442. * The format of the message is depicted below.
  5443. * in this depiction, the following abbreviations are used for information
  5444. * elements within the message:
  5445. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5446. * elements associated with the PPDU start are valid.
  5447. * Specifically, the following fields are valid only if SV is set:
  5448. * RSSI (all variants), L, legacy rate, preamble type, service,
  5449. * VHT-SIG-A
  5450. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5451. * elements associated with the PPDU end are valid.
  5452. * Specifically, the following fields are valid only if EV is set:
  5453. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5454. * - L - Legacy rate selector - if legacy rates are used, this flag
  5455. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5456. * (L == 0) PHY.
  5457. * - P - PHY error flag - boolean indication of whether the rx frame had
  5458. * a PHY error
  5459. *
  5460. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5461. * |----------------+-------------------+---------------------+---------------|
  5462. * | peer ID | |RV|FV| ext TID | msg type |
  5463. * |--------------------------------------------------------------------------|
  5464. * | num | release | release | flush | flush |
  5465. * | MPDU | end | start | end | start |
  5466. * | ranges | seq num | seq num | seq num | seq num |
  5467. * |==========================================================================|
  5468. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5469. * |V|V| | rate | | | timestamp | RSSI |
  5470. * |--------------------------------------------------------------------------|
  5471. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5472. * |--------------------------------------------------------------------------|
  5473. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5474. * |--------------------------------------------------------------------------|
  5475. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5476. * |--------------------------------------------------------------------------|
  5477. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5478. * |--------------------------------------------------------------------------|
  5479. * | TSF LSBs |
  5480. * |--------------------------------------------------------------------------|
  5481. * | microsec timestamp |
  5482. * |--------------------------------------------------------------------------|
  5483. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5484. * |--------------------------------------------------------------------------|
  5485. * | service | HT-SIG / VHT-SIG-A2 |
  5486. * |==========================================================================|
  5487. * | reserved | FW rx desc bytes |
  5488. * |--------------------------------------------------------------------------|
  5489. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5490. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5491. * |--------------------------------------------------------------------------|
  5492. * : : :
  5493. * |--------------------------------------------------------------------------|
  5494. * | alignment | MSDU Rx |
  5495. * | padding | desc Bn |
  5496. * |--------------------------------------------------------------------------|
  5497. * | reserved | MPDU range status | MPDU count |
  5498. * |--------------------------------------------------------------------------|
  5499. * : reserved : MPDU range status : MPDU count :
  5500. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5501. *
  5502. * Header fields:
  5503. * - MSG_TYPE
  5504. * Bits 7:0
  5505. * Purpose: identifies this as an rx indication message
  5506. * Value: 0x1
  5507. * - EXT_TID
  5508. * Bits 12:8
  5509. * Purpose: identify the traffic ID of the rx data, including
  5510. * special "extended" TID values for multicast, broadcast, and
  5511. * non-QoS data frames
  5512. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5513. * - FLUSH_VALID (FV)
  5514. * Bit 13
  5515. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5516. * is valid
  5517. * Value:
  5518. * 1 -> flush IE is valid and needs to be processed
  5519. * 0 -> flush IE is not valid and should be ignored
  5520. * - REL_VALID (RV)
  5521. * Bit 13
  5522. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5523. * is valid
  5524. * Value:
  5525. * 1 -> release IE is valid and needs to be processed
  5526. * 0 -> release IE is not valid and should be ignored
  5527. * - PEER_ID
  5528. * Bits 31:16
  5529. * Purpose: Identify, by ID, which peer sent the rx data
  5530. * Value: ID of the peer who sent the rx data
  5531. * - FLUSH_SEQ_NUM_START
  5532. * Bits 5:0
  5533. * Purpose: Indicate the start of a series of MPDUs to flush
  5534. * Not all MPDUs within this series are necessarily valid - the host
  5535. * must check each sequence number within this range to see if the
  5536. * corresponding MPDU is actually present.
  5537. * This field is only valid if the FV bit is set.
  5538. * Value:
  5539. * The sequence number for the first MPDUs to check to flush.
  5540. * The sequence number is masked by 0x3f.
  5541. * - FLUSH_SEQ_NUM_END
  5542. * Bits 11:6
  5543. * Purpose: Indicate the end of a series of MPDUs to flush
  5544. * Value:
  5545. * The sequence number one larger than the sequence number of the
  5546. * last MPDU to check to flush.
  5547. * The sequence number is masked by 0x3f.
  5548. * Not all MPDUs within this series are necessarily valid - the host
  5549. * must check each sequence number within this range to see if the
  5550. * corresponding MPDU is actually present.
  5551. * This field is only valid if the FV bit is set.
  5552. * - REL_SEQ_NUM_START
  5553. * Bits 17:12
  5554. * Purpose: Indicate the start of a series of MPDUs to release.
  5555. * All MPDUs within this series are present and valid - the host
  5556. * need not check each sequence number within this range to see if
  5557. * the corresponding MPDU is actually present.
  5558. * This field is only valid if the RV bit is set.
  5559. * Value:
  5560. * The sequence number for the first MPDUs to check to release.
  5561. * The sequence number is masked by 0x3f.
  5562. * - REL_SEQ_NUM_END
  5563. * Bits 23:18
  5564. * Purpose: Indicate the end of a series of MPDUs to release.
  5565. * Value:
  5566. * The sequence number one larger than the sequence number of the
  5567. * last MPDU to check to release.
  5568. * The sequence number is masked by 0x3f.
  5569. * All MPDUs within this series are present and valid - the host
  5570. * need not check each sequence number within this range to see if
  5571. * the corresponding MPDU is actually present.
  5572. * This field is only valid if the RV bit is set.
  5573. * - NUM_MPDU_RANGES
  5574. * Bits 31:24
  5575. * Purpose: Indicate how many ranges of MPDUs are present.
  5576. * Each MPDU range consists of a series of contiguous MPDUs within the
  5577. * rx frame sequence which all have the same MPDU status.
  5578. * Value: 1-63 (typically a small number, like 1-3)
  5579. *
  5580. * Rx PPDU descriptor fields:
  5581. * - RSSI_CMB
  5582. * Bits 7:0
  5583. * Purpose: Combined RSSI from all active rx chains, across the active
  5584. * bandwidth.
  5585. * Value: RSSI dB units w.r.t. noise floor
  5586. * - TIMESTAMP_SUBMICROSEC
  5587. * Bits 15:8
  5588. * Purpose: high-resolution timestamp
  5589. * Value:
  5590. * Sub-microsecond time of PPDU reception.
  5591. * This timestamp ranges from [0,MAC clock MHz).
  5592. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5593. * to form a high-resolution, large range rx timestamp.
  5594. * - PHY_ERR_CODE
  5595. * Bits 23:16
  5596. * Purpose:
  5597. * If the rx frame processing resulted in a PHY error, indicate what
  5598. * type of rx PHY error occurred.
  5599. * Value:
  5600. * This field is valid if the "P" (PHY_ERR) flag is set.
  5601. * TBD: document/specify the values for this field
  5602. * - PHY_ERR
  5603. * Bit 24
  5604. * Purpose: indicate whether the rx PPDU had a PHY error
  5605. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5606. * - LEGACY_RATE
  5607. * Bits 28:25
  5608. * Purpose:
  5609. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5610. * specify which rate was used.
  5611. * Value:
  5612. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5613. * flag.
  5614. * If LEGACY_RATE_SEL is 0:
  5615. * 0x8: OFDM 48 Mbps
  5616. * 0x9: OFDM 24 Mbps
  5617. * 0xA: OFDM 12 Mbps
  5618. * 0xB: OFDM 6 Mbps
  5619. * 0xC: OFDM 54 Mbps
  5620. * 0xD: OFDM 36 Mbps
  5621. * 0xE: OFDM 18 Mbps
  5622. * 0xF: OFDM 9 Mbps
  5623. * If LEGACY_RATE_SEL is 1:
  5624. * 0x8: CCK 11 Mbps long preamble
  5625. * 0x9: CCK 5.5 Mbps long preamble
  5626. * 0xA: CCK 2 Mbps long preamble
  5627. * 0xB: CCK 1 Mbps long preamble
  5628. * 0xC: CCK 11 Mbps short preamble
  5629. * 0xD: CCK 5.5 Mbps short preamble
  5630. * 0xE: CCK 2 Mbps short preamble
  5631. * - LEGACY_RATE_SEL
  5632. * Bit 29
  5633. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5634. * Value:
  5635. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5636. * used a legacy rate.
  5637. * 0 -> OFDM, 1 -> CCK
  5638. * - END_VALID
  5639. * Bit 30
  5640. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5641. * the start of the PPDU are valid. Specifically, the following
  5642. * fields are only valid if END_VALID is set:
  5643. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5644. * TIMESTAMP_SUBMICROSEC
  5645. * Value:
  5646. * 0 -> rx PPDU desc end fields are not valid
  5647. * 1 -> rx PPDU desc end fields are valid
  5648. * - START_VALID
  5649. * Bit 31
  5650. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5651. * the end of the PPDU are valid. Specifically, the following
  5652. * fields are only valid if START_VALID is set:
  5653. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5654. * VHT-SIG-A
  5655. * Value:
  5656. * 0 -> rx PPDU desc start fields are not valid
  5657. * 1 -> rx PPDU desc start fields are valid
  5658. * - RSSI0_PRI20
  5659. * Bits 7:0
  5660. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5661. * Value: RSSI dB units w.r.t. noise floor
  5662. *
  5663. * - RSSI0_EXT20
  5664. * Bits 7:0
  5665. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5666. * (if the rx bandwidth was >= 40 MHz)
  5667. * Value: RSSI dB units w.r.t. noise floor
  5668. * - RSSI0_EXT40
  5669. * Bits 7:0
  5670. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5671. * (if the rx bandwidth was >= 80 MHz)
  5672. * Value: RSSI dB units w.r.t. noise floor
  5673. * - RSSI0_EXT80
  5674. * Bits 7:0
  5675. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5676. * (if the rx bandwidth was >= 160 MHz)
  5677. * Value: RSSI dB units w.r.t. noise floor
  5678. *
  5679. * - RSSI1_PRI20
  5680. * Bits 7:0
  5681. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5682. * Value: RSSI dB units w.r.t. noise floor
  5683. * - RSSI1_EXT20
  5684. * Bits 7:0
  5685. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5686. * (if the rx bandwidth was >= 40 MHz)
  5687. * Value: RSSI dB units w.r.t. noise floor
  5688. * - RSSI1_EXT40
  5689. * Bits 7:0
  5690. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5691. * (if the rx bandwidth was >= 80 MHz)
  5692. * Value: RSSI dB units w.r.t. noise floor
  5693. * - RSSI1_EXT80
  5694. * Bits 7:0
  5695. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5696. * (if the rx bandwidth was >= 160 MHz)
  5697. * Value: RSSI dB units w.r.t. noise floor
  5698. *
  5699. * - RSSI2_PRI20
  5700. * Bits 7:0
  5701. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5702. * Value: RSSI dB units w.r.t. noise floor
  5703. * - RSSI2_EXT20
  5704. * Bits 7:0
  5705. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5706. * (if the rx bandwidth was >= 40 MHz)
  5707. * Value: RSSI dB units w.r.t. noise floor
  5708. * - RSSI2_EXT40
  5709. * Bits 7:0
  5710. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5711. * (if the rx bandwidth was >= 80 MHz)
  5712. * Value: RSSI dB units w.r.t. noise floor
  5713. * - RSSI2_EXT80
  5714. * Bits 7:0
  5715. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5716. * (if the rx bandwidth was >= 160 MHz)
  5717. * Value: RSSI dB units w.r.t. noise floor
  5718. *
  5719. * - RSSI3_PRI20
  5720. * Bits 7:0
  5721. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5722. * Value: RSSI dB units w.r.t. noise floor
  5723. * - RSSI3_EXT20
  5724. * Bits 7:0
  5725. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5726. * (if the rx bandwidth was >= 40 MHz)
  5727. * Value: RSSI dB units w.r.t. noise floor
  5728. * - RSSI3_EXT40
  5729. * Bits 7:0
  5730. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5731. * (if the rx bandwidth was >= 80 MHz)
  5732. * Value: RSSI dB units w.r.t. noise floor
  5733. * - RSSI3_EXT80
  5734. * Bits 7:0
  5735. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5736. * (if the rx bandwidth was >= 160 MHz)
  5737. * Value: RSSI dB units w.r.t. noise floor
  5738. *
  5739. * - TSF32
  5740. * Bits 31:0
  5741. * Purpose: specify the time the rx PPDU was received, in TSF units
  5742. * Value: 32 LSBs of the TSF
  5743. * - TIMESTAMP_MICROSEC
  5744. * Bits 31:0
  5745. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5746. * Value: PPDU rx time, in microseconds
  5747. * - VHT_SIG_A1
  5748. * Bits 23:0
  5749. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5750. * from the rx PPDU
  5751. * Value:
  5752. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5753. * VHT-SIG-A1 data.
  5754. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5755. * first 24 bits of the HT-SIG data.
  5756. * Otherwise, this field is invalid.
  5757. * Refer to the the 802.11 protocol for the definition of the
  5758. * HT-SIG and VHT-SIG-A1 fields
  5759. * - VHT_SIG_A2
  5760. * Bits 23:0
  5761. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5762. * from the rx PPDU
  5763. * Value:
  5764. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5765. * VHT-SIG-A2 data.
  5766. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5767. * last 24 bits of the HT-SIG data.
  5768. * Otherwise, this field is invalid.
  5769. * Refer to the the 802.11 protocol for the definition of the
  5770. * HT-SIG and VHT-SIG-A2 fields
  5771. * - PREAMBLE_TYPE
  5772. * Bits 31:24
  5773. * Purpose: indicate the PHY format of the received burst
  5774. * Value:
  5775. * 0x4: Legacy (OFDM/CCK)
  5776. * 0x8: HT
  5777. * 0x9: HT with TxBF
  5778. * 0xC: VHT
  5779. * 0xD: VHT with TxBF
  5780. * - SERVICE
  5781. * Bits 31:24
  5782. * Purpose: TBD
  5783. * Value: TBD
  5784. *
  5785. * Rx MSDU descriptor fields:
  5786. * - FW_RX_DESC_BYTES
  5787. * Bits 15:0
  5788. * Purpose: Indicate how many bytes in the Rx indication are used for
  5789. * FW Rx descriptors
  5790. *
  5791. * Payload fields:
  5792. * - MPDU_COUNT
  5793. * Bits 7:0
  5794. * Purpose: Indicate how many sequential MPDUs share the same status.
  5795. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5796. * - MPDU_STATUS
  5797. * Bits 15:8
  5798. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5799. * received successfully.
  5800. * Value:
  5801. * 0x1: success
  5802. * 0x2: FCS error
  5803. * 0x3: duplicate error
  5804. * 0x4: replay error
  5805. * 0x5: invalid peer
  5806. */
  5807. /* header fields */
  5808. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5809. #define HTT_RX_IND_EXT_TID_S 8
  5810. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5811. #define HTT_RX_IND_FLUSH_VALID_S 13
  5812. #define HTT_RX_IND_REL_VALID_M 0x4000
  5813. #define HTT_RX_IND_REL_VALID_S 14
  5814. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5815. #define HTT_RX_IND_PEER_ID_S 16
  5816. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5817. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5818. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5819. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5820. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5821. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5822. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5823. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5824. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5825. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5826. /* rx PPDU descriptor fields */
  5827. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5828. #define HTT_RX_IND_RSSI_CMB_S 0
  5829. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5830. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5831. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5832. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5833. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5834. #define HTT_RX_IND_PHY_ERR_S 24
  5835. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5836. #define HTT_RX_IND_LEGACY_RATE_S 25
  5837. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5838. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  5839. #define HTT_RX_IND_END_VALID_M 0x40000000
  5840. #define HTT_RX_IND_END_VALID_S 30
  5841. #define HTT_RX_IND_START_VALID_M 0x80000000
  5842. #define HTT_RX_IND_START_VALID_S 31
  5843. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  5844. #define HTT_RX_IND_RSSI_PRI20_S 0
  5845. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  5846. #define HTT_RX_IND_RSSI_EXT20_S 8
  5847. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  5848. #define HTT_RX_IND_RSSI_EXT40_S 16
  5849. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  5850. #define HTT_RX_IND_RSSI_EXT80_S 24
  5851. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  5852. #define HTT_RX_IND_VHT_SIG_A1_S 0
  5853. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  5854. #define HTT_RX_IND_VHT_SIG_A2_S 0
  5855. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  5856. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  5857. #define HTT_RX_IND_SERVICE_M 0xff000000
  5858. #define HTT_RX_IND_SERVICE_S 24
  5859. /* rx MSDU descriptor fields */
  5860. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  5861. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  5862. /* payload fields */
  5863. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  5864. #define HTT_RX_IND_MPDU_COUNT_S 0
  5865. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  5866. #define HTT_RX_IND_MPDU_STATUS_S 8
  5867. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  5868. do { \
  5869. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  5870. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  5871. } while (0)
  5872. #define HTT_RX_IND_EXT_TID_GET(word) \
  5873. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  5874. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  5875. do { \
  5876. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  5877. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  5878. } while (0)
  5879. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  5880. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  5881. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  5882. do { \
  5883. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  5884. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  5885. } while (0)
  5886. #define HTT_RX_IND_REL_VALID_GET(word) \
  5887. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  5888. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  5889. do { \
  5890. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  5891. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  5892. } while (0)
  5893. #define HTT_RX_IND_PEER_ID_GET(word) \
  5894. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  5895. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  5896. do { \
  5897. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  5898. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  5899. } while (0)
  5900. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  5901. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  5902. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  5903. do { \
  5904. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  5905. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  5906. } while (0)
  5907. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  5908. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  5909. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  5910. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  5911. do { \
  5912. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  5913. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  5914. } while (0)
  5915. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  5916. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  5917. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  5918. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  5919. do { \
  5920. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  5921. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  5922. } while (0)
  5923. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  5924. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  5925. HTT_RX_IND_REL_SEQ_NUM_START_S)
  5926. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  5927. do { \
  5928. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  5929. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  5930. } while (0)
  5931. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  5932. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  5933. HTT_RX_IND_REL_SEQ_NUM_END_S)
  5934. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  5935. do { \
  5936. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  5937. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  5938. } while (0)
  5939. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  5940. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  5941. HTT_RX_IND_NUM_MPDU_RANGES_S)
  5942. /* FW rx PPDU descriptor fields */
  5943. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  5944. do { \
  5945. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  5946. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  5947. } while (0)
  5948. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  5949. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  5950. HTT_RX_IND_RSSI_CMB_S)
  5951. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  5952. do { \
  5953. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  5954. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  5955. } while (0)
  5956. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  5957. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  5958. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  5959. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  5960. do { \
  5961. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  5962. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  5963. } while (0)
  5964. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  5965. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  5966. HTT_RX_IND_PHY_ERR_CODE_S)
  5967. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  5968. do { \
  5969. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  5970. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  5971. } while (0)
  5972. #define HTT_RX_IND_PHY_ERR_GET(word) \
  5973. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  5974. HTT_RX_IND_PHY_ERR_S)
  5975. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  5976. do { \
  5977. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  5978. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  5979. } while (0)
  5980. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  5981. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  5982. HTT_RX_IND_LEGACY_RATE_S)
  5983. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  5984. do { \
  5985. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  5986. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  5987. } while (0)
  5988. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  5989. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  5990. HTT_RX_IND_LEGACY_RATE_SEL_S)
  5991. #define HTT_RX_IND_END_VALID_SET(word, value) \
  5992. do { \
  5993. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  5994. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  5995. } while (0)
  5996. #define HTT_RX_IND_END_VALID_GET(word) \
  5997. (((word) & HTT_RX_IND_END_VALID_M) >> \
  5998. HTT_RX_IND_END_VALID_S)
  5999. #define HTT_RX_IND_START_VALID_SET(word, value) \
  6000. do { \
  6001. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  6002. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  6003. } while (0)
  6004. #define HTT_RX_IND_START_VALID_GET(word) \
  6005. (((word) & HTT_RX_IND_START_VALID_M) >> \
  6006. HTT_RX_IND_START_VALID_S)
  6007. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  6008. do { \
  6009. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  6010. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  6011. } while (0)
  6012. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  6013. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  6014. HTT_RX_IND_RSSI_PRI20_S)
  6015. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  6016. do { \
  6017. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  6018. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  6019. } while (0)
  6020. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  6021. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  6022. HTT_RX_IND_RSSI_EXT20_S)
  6023. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  6024. do { \
  6025. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6026. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6027. } while (0)
  6028. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6029. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6030. HTT_RX_IND_RSSI_EXT40_S)
  6031. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6032. do { \
  6033. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6034. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6035. } while (0)
  6036. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6037. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6038. HTT_RX_IND_RSSI_EXT80_S)
  6039. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6040. do { \
  6041. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6042. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6043. } while (0)
  6044. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6045. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6046. HTT_RX_IND_VHT_SIG_A1_S)
  6047. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6048. do { \
  6049. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6050. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6051. } while (0)
  6052. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6053. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6054. HTT_RX_IND_VHT_SIG_A2_S)
  6055. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6056. do { \
  6057. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6058. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6059. } while (0)
  6060. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6061. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6062. HTT_RX_IND_PREAMBLE_TYPE_S)
  6063. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6064. do { \
  6065. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6066. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6067. } while (0)
  6068. #define HTT_RX_IND_SERVICE_GET(word) \
  6069. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6070. HTT_RX_IND_SERVICE_S)
  6071. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6072. do { \
  6073. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6074. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6075. } while (0)
  6076. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6077. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6078. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6079. do { \
  6080. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6081. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6082. } while (0)
  6083. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6084. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6085. #define HTT_RX_IND_HL_BYTES \
  6086. (HTT_RX_IND_HDR_BYTES + \
  6087. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  6088. 4 /* single MPDU range information element */)
  6089. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6090. /* Could we use one macro entry? */
  6091. #define HTT_WORD_SET(word, field, value) \
  6092. do { \
  6093. HTT_CHECK_SET_VAL(field, value); \
  6094. (word) |= ((value) << field ## _S); \
  6095. } while (0)
  6096. #define HTT_WORD_GET(word, field) \
  6097. (((word) & field ## _M) >> field ## _S)
  6098. PREPACK struct hl_htt_rx_ind_base {
  6099. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6100. } POSTPACK;
  6101. /*
  6102. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6103. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6104. * HL host needed info. The field is just after the msdu fw rx desc.
  6105. */
  6106. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6107. struct htt_rx_ind_hl_rx_desc_t {
  6108. A_UINT8 ver;
  6109. A_UINT8 len;
  6110. struct {
  6111. A_UINT8
  6112. first_msdu: 1,
  6113. last_msdu: 1,
  6114. c3_failed: 1,
  6115. c4_failed: 1,
  6116. ipv6: 1,
  6117. tcp: 1,
  6118. udp: 1,
  6119. reserved: 1;
  6120. } flags;
  6121. };
  6122. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6123. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6124. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6125. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6126. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6127. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6128. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6129. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6130. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6131. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6132. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6133. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6134. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6135. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6136. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6137. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6138. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6139. /* This structure is used in HL, the basic descriptor information
  6140. * used by host. the structure is translated by FW from HW desc
  6141. * or generated by FW. But in HL monitor mode, the host would use
  6142. * the same structure with LL.
  6143. */
  6144. PREPACK struct hl_htt_rx_desc_base {
  6145. A_UINT32
  6146. seq_num:12,
  6147. encrypted:1,
  6148. chan_info_present:1,
  6149. resv0:2,
  6150. mcast_bcast:1,
  6151. fragment:1,
  6152. key_id_oct:8,
  6153. resv1:6;
  6154. A_UINT32
  6155. pn_31_0;
  6156. union {
  6157. struct {
  6158. A_UINT16 pn_47_32;
  6159. A_UINT16 pn_63_48;
  6160. } pn16;
  6161. A_UINT32 pn_63_32;
  6162. } u0;
  6163. A_UINT32
  6164. pn_95_64;
  6165. A_UINT32
  6166. pn_127_96;
  6167. } POSTPACK;
  6168. /*
  6169. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6170. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6171. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6172. * Please see htt_chan_change_t for description of the fields.
  6173. */
  6174. PREPACK struct htt_chan_info_t
  6175. {
  6176. A_UINT32 primary_chan_center_freq_mhz: 16,
  6177. contig_chan1_center_freq_mhz: 16;
  6178. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6179. phy_mode: 8,
  6180. reserved: 8;
  6181. } POSTPACK;
  6182. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6183. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6184. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6185. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6186. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6187. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6188. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6189. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6190. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6191. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6192. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6193. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6194. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6195. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6196. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6197. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6198. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6199. /* Channel information */
  6200. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6201. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6202. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6203. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6204. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6205. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6206. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6207. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6208. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6209. do { \
  6210. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6211. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6212. } while (0)
  6213. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6214. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6215. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6216. do { \
  6217. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6218. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6219. } while (0)
  6220. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6221. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6222. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6223. do { \
  6224. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6225. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6226. } while (0)
  6227. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6228. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6229. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6230. do { \
  6231. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6232. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6233. } while (0)
  6234. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6235. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6236. /*
  6237. * @brief target -> host rx reorder flush message definition
  6238. *
  6239. * @details
  6240. * The following field definitions describe the format of the rx flush
  6241. * message sent from the target to the host.
  6242. * The message consists of a 4-octet header, followed by one or more
  6243. * 4-octet payload information elements.
  6244. *
  6245. * |31 24|23 8|7 0|
  6246. * |--------------------------------------------------------------|
  6247. * | TID | peer ID | msg type |
  6248. * |--------------------------------------------------------------|
  6249. * | seq num end | seq num start | MPDU status | reserved |
  6250. * |--------------------------------------------------------------|
  6251. * First DWORD:
  6252. * - MSG_TYPE
  6253. * Bits 7:0
  6254. * Purpose: identifies this as an rx flush message
  6255. * Value: 0x2
  6256. * - PEER_ID
  6257. * Bits 23:8 (only bits 18:8 actually used)
  6258. * Purpose: identify which peer's rx data is being flushed
  6259. * Value: (rx) peer ID
  6260. * - TID
  6261. * Bits 31:24 (only bits 27:24 actually used)
  6262. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6263. * Value: traffic identifier
  6264. * Second DWORD:
  6265. * - MPDU_STATUS
  6266. * Bits 15:8
  6267. * Purpose:
  6268. * Indicate whether the flushed MPDUs should be discarded or processed.
  6269. * Value:
  6270. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6271. * stages of rx processing
  6272. * other: discard the MPDUs
  6273. * It is anticipated that flush messages will always have
  6274. * MPDU status == 1, but the status flag is included for
  6275. * flexibility.
  6276. * - SEQ_NUM_START
  6277. * Bits 23:16
  6278. * Purpose:
  6279. * Indicate the start of a series of consecutive MPDUs being flushed.
  6280. * Not all MPDUs within this range are necessarily valid - the host
  6281. * must check each sequence number within this range to see if the
  6282. * corresponding MPDU is actually present.
  6283. * Value:
  6284. * The sequence number for the first MPDU in the sequence.
  6285. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6286. * - SEQ_NUM_END
  6287. * Bits 30:24
  6288. * Purpose:
  6289. * Indicate the end of a series of consecutive MPDUs being flushed.
  6290. * Value:
  6291. * The sequence number one larger than the sequence number of the
  6292. * last MPDU being flushed.
  6293. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6294. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6295. * are to be released for further rx processing.
  6296. * Not all MPDUs within this range are necessarily valid - the host
  6297. * must check each sequence number within this range to see if the
  6298. * corresponding MPDU is actually present.
  6299. */
  6300. /* first DWORD */
  6301. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6302. #define HTT_RX_FLUSH_PEER_ID_S 8
  6303. #define HTT_RX_FLUSH_TID_M 0xff000000
  6304. #define HTT_RX_FLUSH_TID_S 24
  6305. /* second DWORD */
  6306. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6307. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6308. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6309. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6310. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6311. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6312. #define HTT_RX_FLUSH_BYTES 8
  6313. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6314. do { \
  6315. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6316. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6317. } while (0)
  6318. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6319. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6320. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6321. do { \
  6322. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6323. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6324. } while (0)
  6325. #define HTT_RX_FLUSH_TID_GET(word) \
  6326. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6327. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6328. do { \
  6329. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6330. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6331. } while (0)
  6332. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6333. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6334. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6335. do { \
  6336. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6337. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6338. } while (0)
  6339. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6340. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6341. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6342. do { \
  6343. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6344. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6345. } while (0)
  6346. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6347. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6348. /*
  6349. * @brief target -> host rx pn check indication message
  6350. *
  6351. * @details
  6352. * The following field definitions describe the format of the Rx PN check
  6353. * indication message sent from the target to the host.
  6354. * The message consists of a 4-octet header, followed by the start and
  6355. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6356. * IE is one octet containing the sequence number that failed the PN
  6357. * check.
  6358. *
  6359. * |31 24|23 8|7 0|
  6360. * |--------------------------------------------------------------|
  6361. * | TID | peer ID | msg type |
  6362. * |--------------------------------------------------------------|
  6363. * | Reserved | PN IE count | seq num end | seq num start|
  6364. * |--------------------------------------------------------------|
  6365. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6366. * |--------------------------------------------------------------|
  6367. * First DWORD:
  6368. * - MSG_TYPE
  6369. * Bits 7:0
  6370. * Purpose: Identifies this as an rx pn check indication message
  6371. * Value: 0x2
  6372. * - PEER_ID
  6373. * Bits 23:8 (only bits 18:8 actually used)
  6374. * Purpose: identify which peer
  6375. * Value: (rx) peer ID
  6376. * - TID
  6377. * Bits 31:24 (only bits 27:24 actually used)
  6378. * Purpose: identify traffic identifier
  6379. * Value: traffic identifier
  6380. * Second DWORD:
  6381. * - SEQ_NUM_START
  6382. * Bits 7:0
  6383. * Purpose:
  6384. * Indicates the starting sequence number of the MPDU in this
  6385. * series of MPDUs that went though PN check.
  6386. * Value:
  6387. * The sequence number for the first MPDU in the sequence.
  6388. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6389. * - SEQ_NUM_END
  6390. * Bits 15:8
  6391. * Purpose:
  6392. * Indicates the ending sequence number of the MPDU in this
  6393. * series of MPDUs that went though PN check.
  6394. * Value:
  6395. * The sequence number one larger then the sequence number of the last
  6396. * MPDU being flushed.
  6397. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6398. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6399. * for invalid PN numbers and are ready to be released for further processing.
  6400. * Not all MPDUs within this range are necessarily valid - the host
  6401. * must check each sequence number within this range to see if the
  6402. * corresponding MPDU is actually present.
  6403. * - PN_IE_COUNT
  6404. * Bits 23:16
  6405. * Purpose:
  6406. * Used to determine the variable number of PN information elements in this
  6407. * message
  6408. *
  6409. * PN information elements:
  6410. * - PN_IE_x-
  6411. * Purpose:
  6412. * Each PN information element contains the sequence number of the MPDU that
  6413. * has failed the target PN check.
  6414. * Value:
  6415. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6416. * that failed the PN check.
  6417. */
  6418. /* first DWORD */
  6419. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6420. #define HTT_RX_PN_IND_PEER_ID_S 8
  6421. #define HTT_RX_PN_IND_TID_M 0xff000000
  6422. #define HTT_RX_PN_IND_TID_S 24
  6423. /* second DWORD */
  6424. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6425. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6426. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6427. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6428. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6429. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6430. #define HTT_RX_PN_IND_BYTES 8
  6431. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6432. do { \
  6433. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6434. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6435. } while (0)
  6436. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6437. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6438. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6439. do { \
  6440. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6441. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6442. } while (0)
  6443. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6444. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6445. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6446. do { \
  6447. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6448. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6449. } while (0)
  6450. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6451. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  6452. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6453. do { \
  6454. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6455. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6456. } while (0)
  6457. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6458. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6459. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6460. do { \
  6461. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6462. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6463. } while (0)
  6464. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6465. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6466. /*
  6467. * @brief target -> host rx offload deliver message for LL system
  6468. *
  6469. * @details
  6470. * In a low latency system this message is sent whenever the offload
  6471. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6472. * The DMA of the actual packets into host memory is done before sending out
  6473. * this message. This message indicates only how many MSDUs to reap. The
  6474. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6475. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6476. * DMA'd by the MAC directly into host memory these packets do not contain
  6477. * the MAC descriptors in the header portion of the packet. Instead they contain
  6478. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6479. * message, the packets are delivered directly to the NW stack without going
  6480. * through the regular reorder buffering and PN checking path since it has
  6481. * already been done in target.
  6482. *
  6483. * |31 24|23 16|15 8|7 0|
  6484. * |-----------------------------------------------------------------------|
  6485. * | Total MSDU count | reserved | msg type |
  6486. * |-----------------------------------------------------------------------|
  6487. *
  6488. * @brief target -> host rx offload deliver message for HL system
  6489. *
  6490. * @details
  6491. * In a high latency system this message is sent whenever the offload manager
  6492. * flushes out the packets it has coalesced in its coalescing buffer. The
  6493. * actual packets are also carried along with this message. When the host
  6494. * receives this message, it is expected to deliver these packets to the NW
  6495. * stack directly instead of routing them through the reorder buffering and
  6496. * PN checking path since it has already been done in target.
  6497. *
  6498. * |31 24|23 16|15 8|7 0|
  6499. * |-----------------------------------------------------------------------|
  6500. * | Total MSDU count | reserved | msg type |
  6501. * |-----------------------------------------------------------------------|
  6502. * | peer ID | MSDU length |
  6503. * |-----------------------------------------------------------------------|
  6504. * | MSDU payload | FW Desc | tid | vdev ID |
  6505. * |-----------------------------------------------------------------------|
  6506. * | MSDU payload contd. |
  6507. * |-----------------------------------------------------------------------|
  6508. * | peer ID | MSDU length |
  6509. * |-----------------------------------------------------------------------|
  6510. * | MSDU payload | FW Desc | tid | vdev ID |
  6511. * |-----------------------------------------------------------------------|
  6512. * | MSDU payload contd. |
  6513. * |-----------------------------------------------------------------------|
  6514. *
  6515. */
  6516. /* first DWORD */
  6517. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6518. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6519. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6520. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6521. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6522. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6523. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6524. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6525. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6526. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6527. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6528. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6529. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6530. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6531. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6532. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6533. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6534. do { \
  6535. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6536. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6537. } while (0)
  6538. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6539. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6540. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6541. do { \
  6542. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6543. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6544. } while (0)
  6545. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6546. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6547. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6548. do { \
  6549. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6550. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6551. } while (0)
  6552. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6553. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6554. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6555. do { \
  6556. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6557. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6558. } while (0)
  6559. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6560. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6561. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6562. do { \
  6563. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6564. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6565. } while (0)
  6566. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6567. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6568. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6569. do { \
  6570. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6571. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6572. } while (0)
  6573. /**
  6574. * @brief target -> host rx peer map/unmap message definition
  6575. *
  6576. * @details
  6577. * The following diagram shows the format of the rx peer map message sent
  6578. * from the target to the host. This layout assumes the target operates
  6579. * as little-endian.
  6580. *
  6581. * This message always contains a SW peer ID. The main purpose of the
  6582. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6583. * with, so that the host can use that peer ID to determine which peer
  6584. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6585. * other purposes, such as identifying during tx completions which peer
  6586. * the tx frames in question were transmitted to.
  6587. *
  6588. * In certain generations of chips, the peer map message also contains
  6589. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6590. * to identify which peer the frame needs to be forwarded to (i.e. the
  6591. * peer assocated with the Destination MAC Address within the packet),
  6592. * and particularly which vdev needs to transmit the frame (for cases
  6593. * of inter-vdev rx --> tx forwarding).
  6594. * This DA-based peer ID that is provided for certain rx frames
  6595. * (the rx frames that need to be re-transmitted as tx frames)
  6596. * is the ID that the HW uses for referring to the peer in question,
  6597. * rather than the peer ID that the SW+FW use to refer to the peer.
  6598. *
  6599. *
  6600. * |31 24|23 16|15 8|7 0|
  6601. * |-----------------------------------------------------------------------|
  6602. * | SW peer ID | VDEV ID | msg type |
  6603. * |-----------------------------------------------------------------------|
  6604. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6605. * |-----------------------------------------------------------------------|
  6606. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6607. * |-----------------------------------------------------------------------|
  6608. *
  6609. *
  6610. * The following diagram shows the format of the rx peer unmap message sent
  6611. * from the target to the host.
  6612. *
  6613. * |31 24|23 16|15 8|7 0|
  6614. * |-----------------------------------------------------------------------|
  6615. * | SW peer ID | VDEV ID | msg type |
  6616. * |-----------------------------------------------------------------------|
  6617. *
  6618. * The following field definitions describe the format of the rx peer map
  6619. * and peer unmap messages sent from the target to the host.
  6620. * - MSG_TYPE
  6621. * Bits 7:0
  6622. * Purpose: identifies this as an rx peer map or peer unmap message
  6623. * Value: peer map -> 0x3, peer unmap -> 0x4
  6624. * - VDEV_ID
  6625. * Bits 15:8
  6626. * Purpose: Indicates which virtual device the peer is associated
  6627. * with.
  6628. * Value: vdev ID (used in the host to look up the vdev object)
  6629. * - PEER_ID (a.k.a. SW_PEER_ID)
  6630. * Bits 31:16
  6631. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6632. * freeing (unmap)
  6633. * Value: (rx) peer ID
  6634. * - MAC_ADDR_L32 (peer map only)
  6635. * Bits 31:0
  6636. * Purpose: Identifies which peer node the peer ID is for.
  6637. * Value: lower 4 bytes of peer node's MAC address
  6638. * - MAC_ADDR_U16 (peer map only)
  6639. * Bits 15:0
  6640. * Purpose: Identifies which peer node the peer ID is for.
  6641. * Value: upper 2 bytes of peer node's MAC address
  6642. * - HW_PEER_ID
  6643. * Bits 31:16
  6644. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6645. * address, so for rx frames marked for rx --> tx forwarding, the
  6646. * host can determine from the HW peer ID provided as meta-data with
  6647. * the rx frame which peer the frame is supposed to be forwarded to.
  6648. * Value: ID used by the MAC HW to identify the peer
  6649. */
  6650. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6651. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6652. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6653. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6654. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6655. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6656. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6657. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6658. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6659. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6660. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6661. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6662. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6663. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6664. do { \
  6665. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6666. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6667. } while (0)
  6668. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6669. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6670. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6671. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6672. do { \
  6673. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6674. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6675. } while (0)
  6676. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6677. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6678. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  6679. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  6680. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  6681. do { \
  6682. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  6683. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  6684. } while (0)
  6685. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  6686. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  6687. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6688. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  6689. #define HTT_RX_PEER_MAP_BYTES 12
  6690. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6691. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6692. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  6693. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  6694. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6695. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6696. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6697. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6698. #define HTT_RX_PEER_UNMAP_BYTES 4
  6699. /**
  6700. * @brief target -> host rx peer map V2 message definition
  6701. *
  6702. * @details
  6703. * The following diagram shows the format of the rx peer map v2 message sent
  6704. * from the target to the host. This layout assumes the target operates
  6705. * as little-endian.
  6706. *
  6707. * This message always contains a SW peer ID. The main purpose of the
  6708. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6709. * with, so that the host can use that peer ID to determine which peer
  6710. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6711. * other purposes, such as identifying during tx completions which peer
  6712. * the tx frames in question were transmitted to.
  6713. *
  6714. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  6715. * is used during rx --> tx frame forwarding to identify which peer the
  6716. * frame needs to be forwarded to (i.e. the peer assocated with the
  6717. * Destination MAC Address within the packet), and particularly which vdev
  6718. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  6719. * This DA-based peer ID that is provided for certain rx frames
  6720. * (the rx frames that need to be re-transmitted as tx frames)
  6721. * is the ID that the HW uses for referring to the peer in question,
  6722. * rather than the peer ID that the SW+FW use to refer to the peer.
  6723. *
  6724. *
  6725. * |31 24|23 16|15 8|7 0|
  6726. * |-----------------------------------------------------------------------|
  6727. * | SW peer ID | VDEV ID | msg type |
  6728. * |-----------------------------------------------------------------------|
  6729. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6730. * |-----------------------------------------------------------------------|
  6731. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6732. * |-----------------------------------------------------------------------|
  6733. * | Reserved_17_31 | Next Hop | AST Hash Value |
  6734. * |-----------------------------------------------------------------------|
  6735. * | Reserved_0 |
  6736. * |-----------------------------------------------------------------------|
  6737. * | Reserved_1 |
  6738. * |-----------------------------------------------------------------------|
  6739. * | Reserved_2 |
  6740. * |-----------------------------------------------------------------------|
  6741. * | Reserved_3 |
  6742. * |-----------------------------------------------------------------------|
  6743. *
  6744. *
  6745. * The following field definitions describe the format of the rx peer map v2
  6746. * messages sent from the target to the host.
  6747. * - MSG_TYPE
  6748. * Bits 7:0
  6749. * Purpose: identifies this as an rx peer map v2 message
  6750. * Value: peer map v2 -> 0x1e
  6751. * - VDEV_ID
  6752. * Bits 15:8
  6753. * Purpose: Indicates which virtual device the peer is associated with.
  6754. * Value: vdev ID (used in the host to look up the vdev object)
  6755. * - SW_PEER_ID
  6756. * Bits 31:16
  6757. * Purpose: The peer ID (index) that WAL is allocating
  6758. * Value: (rx) peer ID
  6759. * - MAC_ADDR_L32
  6760. * Bits 31:0
  6761. * Purpose: Identifies which peer node the peer ID is for.
  6762. * Value: lower 4 bytes of peer node's MAC address
  6763. * - MAC_ADDR_U16
  6764. * Bits 15:0
  6765. * Purpose: Identifies which peer node the peer ID is for.
  6766. * Value: upper 2 bytes of peer node's MAC address
  6767. * - HW_PEER_ID
  6768. * Bits 31:16
  6769. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6770. * address, so for rx frames marked for rx --> tx forwarding, the
  6771. * host can determine from the HW peer ID provided as meta-data with
  6772. * the rx frame which peer the frame is supposed to be forwarded to.
  6773. * Value: ID used by the MAC HW to identify the peer
  6774. * - AST_HASH_VALUE
  6775. * Bits 15:0
  6776. * Purpose: Indicates AST Hash value is required for the TCL AST index
  6777. * override feature.
  6778. * - NEXT_HOP
  6779. * Bit 16
  6780. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  6781. * (Wireless Distribution System).
  6782. */
  6783. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  6784. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  6785. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  6786. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  6787. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  6788. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  6789. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  6790. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  6791. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  6792. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  6793. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  6794. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  6795. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  6796. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  6797. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  6798. do { \
  6799. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  6800. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  6801. } while (0)
  6802. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  6803. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  6804. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  6805. do { \
  6806. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  6807. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  6808. } while (0)
  6809. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  6810. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  6811. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  6812. do { \
  6813. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  6814. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  6815. } while (0)
  6816. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  6817. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  6818. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  6819. do { \
  6820. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  6821. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  6822. } while (0)
  6823. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  6824. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  6825. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  6826. do { \
  6827. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  6828. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  6829. } while (0)
  6830. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  6831. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  6832. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6833. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  6834. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  6835. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  6836. #define HTT_RX_PEER_MAP_V2_BYTES 32
  6837. /**
  6838. * @brief target -> host rx peer unmap V2 message definition
  6839. *
  6840. *
  6841. * The following diagram shows the format of the rx peer unmap message sent
  6842. * from the target to the host.
  6843. *
  6844. * |31 24|23 16|15 8|7 0|
  6845. * |-----------------------------------------------------------------------|
  6846. * | SW peer ID | VDEV ID | msg type |
  6847. * |-----------------------------------------------------------------------|
  6848. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6849. * |-----------------------------------------------------------------------|
  6850. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  6851. * |-----------------------------------------------------------------------|
  6852. * | Peer Delete Duration |
  6853. * |-----------------------------------------------------------------------|
  6854. * | Reserved_0 |
  6855. * |-----------------------------------------------------------------------|
  6856. * | Reserved_1 |
  6857. * |-----------------------------------------------------------------------|
  6858. * | Reserved_2 |
  6859. * |-----------------------------------------------------------------------|
  6860. *
  6861. *
  6862. * The following field definitions describe the format of the rx peer unmap
  6863. * messages sent from the target to the host.
  6864. * - MSG_TYPE
  6865. * Bits 7:0
  6866. * Purpose: identifies this as an rx peer unmap v2 message
  6867. * Value: peer unmap v2 -> 0x1f
  6868. * - VDEV_ID
  6869. * Bits 15:8
  6870. * Purpose: Indicates which virtual device the peer is associated
  6871. * with.
  6872. * Value: vdev ID (used in the host to look up the vdev object)
  6873. * - SW_PEER_ID
  6874. * Bits 31:16
  6875. * Purpose: The peer ID (index) that WAL is freeing
  6876. * Value: (rx) peer ID
  6877. * - MAC_ADDR_L32
  6878. * Bits 31:0
  6879. * Purpose: Identifies which peer node the peer ID is for.
  6880. * Value: lower 4 bytes of peer node's MAC address
  6881. * - MAC_ADDR_U16
  6882. * Bits 15:0
  6883. * Purpose: Identifies which peer node the peer ID is for.
  6884. * Value: upper 2 bytes of peer node's MAC address
  6885. * - NEXT_HOP
  6886. * Bits 16
  6887. * Purpose: Bit indicates next_hop AST entry used for WDS
  6888. * (Wireless Distribution System).
  6889. * - PEER_DELETE_DURATION
  6890. * Bits 31:0
  6891. * Purpose: Time taken to delete peer, in msec,
  6892. * Used for monitoring / debugging PEER delete response delay
  6893. */
  6894. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  6895. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  6896. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  6897. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  6898. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  6899. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  6900. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  6901. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  6902. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  6903. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  6904. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  6905. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  6906. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  6907. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  6908. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  6909. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  6910. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  6911. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  6912. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  6913. do { \
  6914. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  6915. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  6916. } while (0)
  6917. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  6918. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  6919. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6920. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  6921. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  6922. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  6923. /**
  6924. * @brief target -> host message specifying security parameters
  6925. *
  6926. * @details
  6927. * The following diagram shows the format of the security specification
  6928. * message sent from the target to the host.
  6929. * This security specification message tells the host whether a PN check is
  6930. * necessary on rx data frames, and if so, how large the PN counter is.
  6931. * This message also tells the host about the security processing to apply
  6932. * to defragmented rx frames - specifically, whether a Message Integrity
  6933. * Check is required, and the Michael key to use.
  6934. *
  6935. * |31 24|23 16|15|14 8|7 0|
  6936. * |-----------------------------------------------------------------------|
  6937. * | peer ID | U| security type | msg type |
  6938. * |-----------------------------------------------------------------------|
  6939. * | Michael Key K0 |
  6940. * |-----------------------------------------------------------------------|
  6941. * | Michael Key K1 |
  6942. * |-----------------------------------------------------------------------|
  6943. * | WAPI RSC Low0 |
  6944. * |-----------------------------------------------------------------------|
  6945. * | WAPI RSC Low1 |
  6946. * |-----------------------------------------------------------------------|
  6947. * | WAPI RSC Hi0 |
  6948. * |-----------------------------------------------------------------------|
  6949. * | WAPI RSC Hi1 |
  6950. * |-----------------------------------------------------------------------|
  6951. *
  6952. * The following field definitions describe the format of the security
  6953. * indication message sent from the target to the host.
  6954. * - MSG_TYPE
  6955. * Bits 7:0
  6956. * Purpose: identifies this as a security specification message
  6957. * Value: 0xb
  6958. * - SEC_TYPE
  6959. * Bits 14:8
  6960. * Purpose: specifies which type of security applies to the peer
  6961. * Value: htt_sec_type enum value
  6962. * - UNICAST
  6963. * Bit 15
  6964. * Purpose: whether this security is applied to unicast or multicast data
  6965. * Value: 1 -> unicast, 0 -> multicast
  6966. * - PEER_ID
  6967. * Bits 31:16
  6968. * Purpose: The ID number for the peer the security specification is for
  6969. * Value: peer ID
  6970. * - MICHAEL_KEY_K0
  6971. * Bits 31:0
  6972. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  6973. * Value: Michael Key K0 (if security type is TKIP)
  6974. * - MICHAEL_KEY_K1
  6975. * Bits 31:0
  6976. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  6977. * Value: Michael Key K1 (if security type is TKIP)
  6978. * - WAPI_RSC_LOW0
  6979. * Bits 31:0
  6980. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  6981. * Value: WAPI RSC Low0 (if security type is WAPI)
  6982. * - WAPI_RSC_LOW1
  6983. * Bits 31:0
  6984. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  6985. * Value: WAPI RSC Low1 (if security type is WAPI)
  6986. * - WAPI_RSC_HI0
  6987. * Bits 31:0
  6988. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  6989. * Value: WAPI RSC Hi0 (if security type is WAPI)
  6990. * - WAPI_RSC_HI1
  6991. * Bits 31:0
  6992. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  6993. * Value: WAPI RSC Hi1 (if security type is WAPI)
  6994. */
  6995. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  6996. #define HTT_SEC_IND_SEC_TYPE_S 8
  6997. #define HTT_SEC_IND_UNICAST_M 0x00008000
  6998. #define HTT_SEC_IND_UNICAST_S 15
  6999. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  7000. #define HTT_SEC_IND_PEER_ID_S 16
  7001. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  7002. do { \
  7003. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  7004. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  7005. } while (0)
  7006. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  7007. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  7008. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  7009. do { \
  7010. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  7011. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  7012. } while (0)
  7013. #define HTT_SEC_IND_UNICAST_GET(word) \
  7014. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  7015. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  7016. do { \
  7017. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  7018. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  7019. } while (0)
  7020. #define HTT_SEC_IND_PEER_ID_GET(word) \
  7021. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  7022. #define HTT_SEC_IND_BYTES 28
  7023. /**
  7024. * @brief target -> host rx ADDBA / DELBA message definitions
  7025. *
  7026. * @details
  7027. * The following diagram shows the format of the rx ADDBA message sent
  7028. * from the target to the host:
  7029. *
  7030. * |31 20|19 16|15 8|7 0|
  7031. * |---------------------------------------------------------------------|
  7032. * | peer ID | TID | window size | msg type |
  7033. * |---------------------------------------------------------------------|
  7034. *
  7035. * The following diagram shows the format of the rx DELBA message sent
  7036. * from the target to the host:
  7037. *
  7038. * |31 20|19 16|15 8|7 0|
  7039. * |---------------------------------------------------------------------|
  7040. * | peer ID | TID | reserved | msg type |
  7041. * |---------------------------------------------------------------------|
  7042. *
  7043. * The following field definitions describe the format of the rx ADDBA
  7044. * and DELBA messages sent from the target to the host.
  7045. * - MSG_TYPE
  7046. * Bits 7:0
  7047. * Purpose: identifies this as an rx ADDBA or DELBA message
  7048. * Value: ADDBA -> 0x5, DELBA -> 0x6
  7049. * - WIN_SIZE
  7050. * Bits 15:8 (ADDBA only)
  7051. * Purpose: Specifies the length of the block ack window (max = 64).
  7052. * Value:
  7053. * block ack window length specified by the received ADDBA
  7054. * management message.
  7055. * - TID
  7056. * Bits 19:16
  7057. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  7058. * Value:
  7059. * TID specified by the received ADDBA or DELBA management message.
  7060. * - PEER_ID
  7061. * Bits 31:20
  7062. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  7063. * Value:
  7064. * ID (hash value) used by the host for fast, direct lookup of
  7065. * host SW peer info, including rx reorder states.
  7066. */
  7067. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7068. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7069. #define HTT_RX_ADDBA_TID_M 0xf0000
  7070. #define HTT_RX_ADDBA_TID_S 16
  7071. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7072. #define HTT_RX_ADDBA_PEER_ID_S 20
  7073. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7074. do { \
  7075. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7076. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7077. } while (0)
  7078. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7079. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7080. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7081. do { \
  7082. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7083. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7084. } while (0)
  7085. #define HTT_RX_ADDBA_TID_GET(word) \
  7086. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7087. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7088. do { \
  7089. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7090. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7091. } while (0)
  7092. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7093. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7094. #define HTT_RX_ADDBA_BYTES 4
  7095. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7096. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7097. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7098. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7099. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7100. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7101. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7102. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7103. #define HTT_RX_DELBA_BYTES 4
  7104. /**
  7105. * @brief tx queue group information element definition
  7106. *
  7107. * @details
  7108. * The following diagram shows the format of the tx queue group
  7109. * information element, which can be included in target --> host
  7110. * messages to specify the number of tx "credits" (tx descriptors
  7111. * for LL, or tx buffers for HL) available to a particular group
  7112. * of host-side tx queues, and which host-side tx queues belong to
  7113. * the group.
  7114. *
  7115. * |31|30 24|23 16|15|14|13 0|
  7116. * |------------------------------------------------------------------------|
  7117. * | X| reserved | tx queue grp ID | A| S| credit count |
  7118. * |------------------------------------------------------------------------|
  7119. * | vdev ID mask | AC mask |
  7120. * |------------------------------------------------------------------------|
  7121. *
  7122. * The following definitions describe the fields within the tx queue group
  7123. * information element:
  7124. * - credit_count
  7125. * Bits 13:1
  7126. * Purpose: specify how many tx credits are available to the tx queue group
  7127. * Value: An absolute or relative, positive or negative credit value
  7128. * The 'A' bit specifies whether the value is absolute or relative.
  7129. * The 'S' bit specifies whether the value is positive or negative.
  7130. * A negative value can only be relative, not absolute.
  7131. * An absolute value replaces any prior credit value the host has for
  7132. * the tx queue group in question.
  7133. * A relative value is added to the prior credit value the host has for
  7134. * the tx queue group in question.
  7135. * - sign
  7136. * Bit 14
  7137. * Purpose: specify whether the credit count is positive or negative
  7138. * Value: 0 -> positive, 1 -> negative
  7139. * - absolute
  7140. * Bit 15
  7141. * Purpose: specify whether the credit count is absolute or relative
  7142. * Value: 0 -> relative, 1 -> absolute
  7143. * - txq_group_id
  7144. * Bits 23:16
  7145. * Purpose: indicate which tx queue group's credit and/or membership are
  7146. * being specified
  7147. * Value: 0 to max_tx_queue_groups-1
  7148. * - reserved
  7149. * Bits 30:16
  7150. * Value: 0x0
  7151. * - eXtension
  7152. * Bit 31
  7153. * Purpose: specify whether another tx queue group info element follows
  7154. * Value: 0 -> no more tx queue group information elements
  7155. * 1 -> another tx queue group information element immediately follows
  7156. * - ac_mask
  7157. * Bits 15:0
  7158. * Purpose: specify which Access Categories belong to the tx queue group
  7159. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7160. * the tx queue group.
  7161. * The AC bit-mask values are obtained by left-shifting by the
  7162. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7163. * - vdev_id_mask
  7164. * Bits 31:16
  7165. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7166. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7167. * belong to the tx queue group.
  7168. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7169. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7170. */
  7171. PREPACK struct htt_txq_group {
  7172. A_UINT32
  7173. credit_count: 14,
  7174. sign: 1,
  7175. absolute: 1,
  7176. tx_queue_group_id: 8,
  7177. reserved0: 7,
  7178. extension: 1;
  7179. A_UINT32
  7180. ac_mask: 16,
  7181. vdev_id_mask: 16;
  7182. } POSTPACK;
  7183. /* first word */
  7184. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7185. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7186. #define HTT_TXQ_GROUP_SIGN_S 14
  7187. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7188. #define HTT_TXQ_GROUP_ABS_S 15
  7189. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7190. #define HTT_TXQ_GROUP_ID_S 16
  7191. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7192. #define HTT_TXQ_GROUP_EXT_S 31
  7193. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7194. /* second word */
  7195. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7196. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7197. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7198. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7199. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7200. do { \
  7201. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7202. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7203. } while (0)
  7204. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7205. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7206. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7207. do { \
  7208. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7209. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7210. } while (0)
  7211. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7212. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7213. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7214. do { \
  7215. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7216. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7217. } while (0)
  7218. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7219. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7220. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7221. do { \
  7222. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7223. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7224. } while (0)
  7225. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7226. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7227. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7228. do { \
  7229. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7230. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7231. } while (0)
  7232. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7233. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7234. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7235. do { \
  7236. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7237. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7238. } while (0)
  7239. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7240. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7241. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7242. do { \
  7243. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7244. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7245. } while (0)
  7246. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7247. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7248. /**
  7249. * @brief target -> host TX completion indication message definition
  7250. *
  7251. * @details
  7252. * The following diagram shows the format of the TX completion indication sent
  7253. * from the target to the host
  7254. *
  7255. * |31 27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7256. * |------------------------------------------------------------|
  7257. * header: | rsvd |TP|A1|A0| num | t_i| tid |status| msg_type |
  7258. * |------------------------------------------------------------|
  7259. * payload: | MSDU1 ID | MSDU0 ID |
  7260. * |------------------------------------------------------------|
  7261. * : MSDU3 ID : MSDU2 ID :
  7262. * |------------------------------------------------------------|
  7263. * | struct htt_tx_compl_ind_append_retries |
  7264. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7265. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7266. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7267. * Where:
  7268. * A0 = append (a.k.a. append0)
  7269. * A1 = append1
  7270. * TP = MSDU tx power presence
  7271. *
  7272. * The following field definitions describe the format of the TX completion
  7273. * indication sent from the target to the host
  7274. * Header fields:
  7275. * - msg_type
  7276. * Bits 7:0
  7277. * Purpose: identifies this as HTT TX completion indication
  7278. * Value: 0x7
  7279. * - status
  7280. * Bits 10:8
  7281. * Purpose: the TX completion status of payload fragmentations descriptors
  7282. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7283. * - tid
  7284. * Bits 14:11
  7285. * Purpose: the tid associated with those fragmentation descriptors. It is
  7286. * valid or not, depending on the tid_invalid bit.
  7287. * Value: 0 to 15
  7288. * - tid_invalid
  7289. * Bits 15:15
  7290. * Purpose: this bit indicates whether the tid field is valid or not
  7291. * Value: 0 indicates valid; 1 indicates invalid
  7292. * - num
  7293. * Bits 23:16
  7294. * Purpose: the number of payload in this indication
  7295. * Value: 1 to 255
  7296. * - append (a.k.a. append0)
  7297. * Bits 24:24
  7298. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7299. * the number of tx retries for one MSDU at the end of this message
  7300. * Value: 0 indicates no appending; 1 indicates appending
  7301. * - append1
  7302. * Bits 25:25
  7303. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7304. * contains the timestamp info for each TX msdu id in payload.
  7305. * The order of the timestamps matches the order of the MSDU IDs.
  7306. * Note that a big-endian host needs to account for the reordering
  7307. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7308. * conversion) when determining which tx timestamp corresponds to
  7309. * which MSDU ID.
  7310. * Value: 0 indicates no appending; 1 indicates appending
  7311. * - msdu_tx_power_presence
  7312. * Bits 26:26
  7313. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7314. * for each MSDU referenced by the TX_COMPL_IND message.
  7315. * The tx power is reported in 0.5 dBm units.
  7316. * The order of the per-MSDU tx power reports matches the order
  7317. * of the MSDU IDs.
  7318. * Note that a big-endian host needs to account for the reordering
  7319. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7320. * conversion) when determining which Tx Power corresponds to
  7321. * which MSDU ID.
  7322. * Value: 0 indicates MSDU tx power reports are not appended,
  7323. * 1 indicates MSDU tx power reports are appended
  7324. * Payload fields:
  7325. * - hmsdu_id
  7326. * Bits 15:0
  7327. * Purpose: this ID is used to track the Tx buffer in host
  7328. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7329. */
  7330. #define HTT_TX_COMPL_IND_STATUS_S 8
  7331. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7332. #define HTT_TX_COMPL_IND_TID_S 11
  7333. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7334. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7335. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7336. #define HTT_TX_COMPL_IND_NUM_S 16
  7337. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7338. #define HTT_TX_COMPL_IND_APPEND_S 24
  7339. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7340. #define HTT_TX_COMPL_IND_APPEND1_S 25
  7341. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  7342. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  7343. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  7344. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7345. do { \
  7346. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7347. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7348. } while (0)
  7349. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7350. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7351. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7352. do { \
  7353. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7354. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7355. } while (0)
  7356. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7357. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7358. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7359. do { \
  7360. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7361. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7362. } while (0)
  7363. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7364. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7365. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7366. do { \
  7367. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7368. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7369. } while (0)
  7370. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7371. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7372. HTT_TX_COMPL_IND_TID_INV_S)
  7373. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7374. do { \
  7375. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7376. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7377. } while (0)
  7378. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7379. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7380. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  7381. do { \
  7382. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  7383. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  7384. } while (0)
  7385. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  7386. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  7387. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  7388. do { \
  7389. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  7390. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  7391. } while (0)
  7392. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  7393. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  7394. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  7395. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7396. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7397. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7398. #define HTT_TX_COMPL_IND_STAT_OK 0
  7399. /* DISCARD:
  7400. * current meaning:
  7401. * MSDUs were queued for transmission but filtered by HW or SW
  7402. * without any over the air attempts
  7403. * legacy meaning (HL Rome):
  7404. * MSDUs were discarded by the target FW without any over the air
  7405. * attempts due to lack of space
  7406. */
  7407. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7408. /* NO_ACK:
  7409. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7410. */
  7411. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7412. /* POSTPONE:
  7413. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7414. * be downloaded again later (in the appropriate order), when they are
  7415. * deliverable.
  7416. */
  7417. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7418. /*
  7419. * The PEER_DEL tx completion status is used for HL cases
  7420. * where the peer the frame is for has been deleted.
  7421. * The host has already discarded its copy of the frame, but
  7422. * it still needs the tx completion to restore its credit.
  7423. */
  7424. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7425. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7426. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7427. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7428. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7429. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7430. PREPACK struct htt_tx_compl_ind_base {
  7431. A_UINT32 hdr;
  7432. A_UINT16 payload[1/*or more*/];
  7433. } POSTPACK;
  7434. PREPACK struct htt_tx_compl_ind_append_retries {
  7435. A_UINT16 msdu_id;
  7436. A_UINT8 tx_retries;
  7437. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  7438. 0: this is the last append_retries struct */
  7439. } POSTPACK;
  7440. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  7441. A_UINT32 timestamp[1/*or more*/];
  7442. } POSTPACK;
  7443. /**
  7444. * @brief target -> host rate-control update indication message
  7445. *
  7446. * @details
  7447. * The following diagram shows the format of the RC Update message
  7448. * sent from the target to the host, while processing the tx-completion
  7449. * of a transmitted PPDU.
  7450. *
  7451. * |31 24|23 16|15 8|7 0|
  7452. * |-------------------------------------------------------------|
  7453. * | peer ID | vdev ID | msg_type |
  7454. * |-------------------------------------------------------------|
  7455. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7456. * |-------------------------------------------------------------|
  7457. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7458. * |-------------------------------------------------------------|
  7459. * | : |
  7460. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7461. * | : |
  7462. * |-------------------------------------------------------------|
  7463. * | : |
  7464. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7465. * | : |
  7466. * |-------------------------------------------------------------|
  7467. * : :
  7468. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7469. *
  7470. */
  7471. typedef struct {
  7472. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7473. A_UINT32 rate_code_flags;
  7474. A_UINT32 flags; /* Encodes information such as excessive
  7475. retransmission, aggregate, some info
  7476. from .11 frame control,
  7477. STBC, LDPC, (SGI and Tx Chain Mask
  7478. are encoded in ptx_rc->flags field),
  7479. AMPDU truncation (BT/time based etc.),
  7480. RTS/CTS attempt */
  7481. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  7482. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  7483. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  7484. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7485. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  7486. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7487. } HTT_RC_TX_DONE_PARAMS;
  7488. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  7489. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7490. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7491. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7492. #define HTT_RC_UPDATE_VDEVID_S 8
  7493. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7494. #define HTT_RC_UPDATE_PEERID_S 16
  7495. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7496. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7497. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7498. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7499. do { \
  7500. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7501. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7502. } while (0)
  7503. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7504. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7505. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7506. do { \
  7507. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7508. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7509. } while (0)
  7510. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7511. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7512. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7513. do { \
  7514. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7515. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7516. } while (0)
  7517. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7518. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7519. /**
  7520. * @brief target -> host rx fragment indication message definition
  7521. *
  7522. * @details
  7523. * The following field definitions describe the format of the rx fragment
  7524. * indication message sent from the target to the host.
  7525. * The rx fragment indication message shares the format of the
  7526. * rx indication message, but not all fields from the rx indication message
  7527. * are relevant to the rx fragment indication message.
  7528. *
  7529. *
  7530. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7531. * |-----------+-------------------+---------------------+-------------|
  7532. * | peer ID | |FV| ext TID | msg type |
  7533. * |-------------------------------------------------------------------|
  7534. * | | flush | flush |
  7535. * | | end | start |
  7536. * | | seq num | seq num |
  7537. * |-------------------------------------------------------------------|
  7538. * | reserved | FW rx desc bytes |
  7539. * |-------------------------------------------------------------------|
  7540. * | | FW MSDU Rx |
  7541. * | | desc B0 |
  7542. * |-------------------------------------------------------------------|
  7543. * Header fields:
  7544. * - MSG_TYPE
  7545. * Bits 7:0
  7546. * Purpose: identifies this as an rx fragment indication message
  7547. * Value: 0xa
  7548. * - EXT_TID
  7549. * Bits 12:8
  7550. * Purpose: identify the traffic ID of the rx data, including
  7551. * special "extended" TID values for multicast, broadcast, and
  7552. * non-QoS data frames
  7553. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7554. * - FLUSH_VALID (FV)
  7555. * Bit 13
  7556. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7557. * is valid
  7558. * Value:
  7559. * 1 -> flush IE is valid and needs to be processed
  7560. * 0 -> flush IE is not valid and should be ignored
  7561. * - PEER_ID
  7562. * Bits 31:16
  7563. * Purpose: Identify, by ID, which peer sent the rx data
  7564. * Value: ID of the peer who sent the rx data
  7565. * - FLUSH_SEQ_NUM_START
  7566. * Bits 5:0
  7567. * Purpose: Indicate the start of a series of MPDUs to flush
  7568. * Not all MPDUs within this series are necessarily valid - the host
  7569. * must check each sequence number within this range to see if the
  7570. * corresponding MPDU is actually present.
  7571. * This field is only valid if the FV bit is set.
  7572. * Value:
  7573. * The sequence number for the first MPDUs to check to flush.
  7574. * The sequence number is masked by 0x3f.
  7575. * - FLUSH_SEQ_NUM_END
  7576. * Bits 11:6
  7577. * Purpose: Indicate the end of a series of MPDUs to flush
  7578. * Value:
  7579. * The sequence number one larger than the sequence number of the
  7580. * last MPDU to check to flush.
  7581. * The sequence number is masked by 0x3f.
  7582. * Not all MPDUs within this series are necessarily valid - the host
  7583. * must check each sequence number within this range to see if the
  7584. * corresponding MPDU is actually present.
  7585. * This field is only valid if the FV bit is set.
  7586. * Rx descriptor fields:
  7587. * - FW_RX_DESC_BYTES
  7588. * Bits 15:0
  7589. * Purpose: Indicate how many bytes in the Rx indication are used for
  7590. * FW Rx descriptors
  7591. * Value: 1
  7592. */
  7593. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7594. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7595. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7596. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7597. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7598. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7599. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7600. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7601. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7602. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7603. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7604. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7605. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7606. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7607. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7608. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7609. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7610. #define HTT_RX_FRAG_IND_BYTES \
  7611. (4 /* msg hdr */ + \
  7612. 4 /* flush spec */ + \
  7613. 4 /* (unused) FW rx desc bytes spec */ + \
  7614. 4 /* FW rx desc */)
  7615. /**
  7616. * @brief target -> host test message definition
  7617. *
  7618. * @details
  7619. * The following field definitions describe the format of the test
  7620. * message sent from the target to the host.
  7621. * The message consists of a 4-octet header, followed by a variable
  7622. * number of 32-bit integer values, followed by a variable number
  7623. * of 8-bit character values.
  7624. *
  7625. * |31 16|15 8|7 0|
  7626. * |-----------------------------------------------------------|
  7627. * | num chars | num ints | msg type |
  7628. * |-----------------------------------------------------------|
  7629. * | int 0 |
  7630. * |-----------------------------------------------------------|
  7631. * | int 1 |
  7632. * |-----------------------------------------------------------|
  7633. * | ... |
  7634. * |-----------------------------------------------------------|
  7635. * | char 3 | char 2 | char 1 | char 0 |
  7636. * |-----------------------------------------------------------|
  7637. * | | | ... | char 4 |
  7638. * |-----------------------------------------------------------|
  7639. * - MSG_TYPE
  7640. * Bits 7:0
  7641. * Purpose: identifies this as a test message
  7642. * Value: HTT_MSG_TYPE_TEST
  7643. * - NUM_INTS
  7644. * Bits 15:8
  7645. * Purpose: indicate how many 32-bit integers follow the message header
  7646. * - NUM_CHARS
  7647. * Bits 31:16
  7648. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7649. */
  7650. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7651. #define HTT_RX_TEST_NUM_INTS_S 8
  7652. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7653. #define HTT_RX_TEST_NUM_CHARS_S 16
  7654. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7655. do { \
  7656. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7657. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7658. } while (0)
  7659. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7660. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7661. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7662. do { \
  7663. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7664. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7665. } while (0)
  7666. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7667. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7668. /**
  7669. * @brief target -> host packet log message
  7670. *
  7671. * @details
  7672. * The following field definitions describe the format of the packet log
  7673. * message sent from the target to the host.
  7674. * The message consists of a 4-octet header,followed by a variable number
  7675. * of 32-bit character values.
  7676. *
  7677. * |31 16|15 12|11 10|9 8|7 0|
  7678. * |------------------------------------------------------------------|
  7679. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  7680. * |------------------------------------------------------------------|
  7681. * | payload |
  7682. * |------------------------------------------------------------------|
  7683. * - MSG_TYPE
  7684. * Bits 7:0
  7685. * Purpose: identifies this as a pktlog message
  7686. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  7687. * - mac_id
  7688. * Bits 9:8
  7689. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  7690. * Value: 0-3
  7691. * - pdev_id
  7692. * Bits 11:10
  7693. * Purpose: pdev_id
  7694. * Value: 0-3
  7695. * 0 (for rings at SOC level),
  7696. * 1/2/3 PDEV -> 0/1/2
  7697. * - payload_size
  7698. * Bits 31:16
  7699. * Purpose: explicitly specify the payload size
  7700. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  7701. */
  7702. PREPACK struct htt_pktlog_msg {
  7703. A_UINT32 header;
  7704. A_UINT32 payload[1/* or more */];
  7705. } POSTPACK;
  7706. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  7707. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  7708. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  7709. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  7710. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  7711. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  7712. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  7713. do { \
  7714. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  7715. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  7716. } while (0)
  7717. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  7718. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  7719. HTT_T2H_PKTLOG_MAC_ID_S)
  7720. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  7721. do { \
  7722. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  7723. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  7724. } while (0)
  7725. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  7726. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  7727. HTT_T2H_PKTLOG_PDEV_ID_S)
  7728. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  7729. do { \
  7730. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  7731. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  7732. } while (0)
  7733. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  7734. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  7735. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  7736. /*
  7737. * Rx reorder statistics
  7738. * NB: all the fields must be defined in 4 octets size.
  7739. */
  7740. struct rx_reorder_stats {
  7741. /* Non QoS MPDUs received */
  7742. A_UINT32 deliver_non_qos;
  7743. /* MPDUs received in-order */
  7744. A_UINT32 deliver_in_order;
  7745. /* Flush due to reorder timer expired */
  7746. A_UINT32 deliver_flush_timeout;
  7747. /* Flush due to move out of window */
  7748. A_UINT32 deliver_flush_oow;
  7749. /* Flush due to DELBA */
  7750. A_UINT32 deliver_flush_delba;
  7751. /* MPDUs dropped due to FCS error */
  7752. A_UINT32 fcs_error;
  7753. /* MPDUs dropped due to monitor mode non-data packet */
  7754. A_UINT32 mgmt_ctrl;
  7755. /* Unicast-data MPDUs dropped due to invalid peer */
  7756. A_UINT32 invalid_peer;
  7757. /* MPDUs dropped due to duplication (non aggregation) */
  7758. A_UINT32 dup_non_aggr;
  7759. /* MPDUs dropped due to processed before */
  7760. A_UINT32 dup_past;
  7761. /* MPDUs dropped due to duplicate in reorder queue */
  7762. A_UINT32 dup_in_reorder;
  7763. /* Reorder timeout happened */
  7764. A_UINT32 reorder_timeout;
  7765. /* invalid bar ssn */
  7766. A_UINT32 invalid_bar_ssn;
  7767. /* reorder reset due to bar ssn */
  7768. A_UINT32 ssn_reset;
  7769. /* Flush due to delete peer */
  7770. A_UINT32 deliver_flush_delpeer;
  7771. /* Flush due to offload*/
  7772. A_UINT32 deliver_flush_offload;
  7773. /* Flush due to out of buffer*/
  7774. A_UINT32 deliver_flush_oob;
  7775. /* MPDUs dropped due to PN check fail */
  7776. A_UINT32 pn_fail;
  7777. /* MPDUs dropped due to unable to allocate memory */
  7778. A_UINT32 store_fail;
  7779. /* Number of times the tid pool alloc succeeded */
  7780. A_UINT32 tid_pool_alloc_succ;
  7781. /* Number of times the MPDU pool alloc succeeded */
  7782. A_UINT32 mpdu_pool_alloc_succ;
  7783. /* Number of times the MSDU pool alloc succeeded */
  7784. A_UINT32 msdu_pool_alloc_succ;
  7785. /* Number of times the tid pool alloc failed */
  7786. A_UINT32 tid_pool_alloc_fail;
  7787. /* Number of times the MPDU pool alloc failed */
  7788. A_UINT32 mpdu_pool_alloc_fail;
  7789. /* Number of times the MSDU pool alloc failed */
  7790. A_UINT32 msdu_pool_alloc_fail;
  7791. /* Number of times the tid pool freed */
  7792. A_UINT32 tid_pool_free;
  7793. /* Number of times the MPDU pool freed */
  7794. A_UINT32 mpdu_pool_free;
  7795. /* Number of times the MSDU pool freed */
  7796. A_UINT32 msdu_pool_free;
  7797. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  7798. A_UINT32 msdu_queued;
  7799. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  7800. A_UINT32 msdu_recycled;
  7801. /* Number of MPDUs with invalid peer but A2 found in AST */
  7802. A_UINT32 invalid_peer_a2_in_ast;
  7803. /* Number of MPDUs with invalid peer but A3 found in AST */
  7804. A_UINT32 invalid_peer_a3_in_ast;
  7805. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  7806. A_UINT32 invalid_peer_bmc_mpdus;
  7807. /* Number of MSDUs with err attention word */
  7808. A_UINT32 rxdesc_err_att;
  7809. /* Number of MSDUs with flag of peer_idx_invalid */
  7810. A_UINT32 rxdesc_err_peer_idx_inv;
  7811. /* Number of MSDUs with flag of peer_idx_timeout */
  7812. A_UINT32 rxdesc_err_peer_idx_to;
  7813. /* Number of MSDUs with flag of overflow */
  7814. A_UINT32 rxdesc_err_ov;
  7815. /* Number of MSDUs with flag of msdu_length_err */
  7816. A_UINT32 rxdesc_err_msdu_len;
  7817. /* Number of MSDUs with flag of mpdu_length_err */
  7818. A_UINT32 rxdesc_err_mpdu_len;
  7819. /* Number of MSDUs with flag of tkip_mic_err */
  7820. A_UINT32 rxdesc_err_tkip_mic;
  7821. /* Number of MSDUs with flag of decrypt_err */
  7822. A_UINT32 rxdesc_err_decrypt;
  7823. /* Number of MSDUs with flag of fcs_err */
  7824. A_UINT32 rxdesc_err_fcs;
  7825. /* Number of Unicast (bc_mc bit is not set in attention word)
  7826. * frames with invalid peer handler
  7827. */
  7828. A_UINT32 rxdesc_uc_msdus_inv_peer;
  7829. /* Number of unicast frame directly (direct bit is set in attention word)
  7830. * to DUT with invalid peer handler
  7831. */
  7832. A_UINT32 rxdesc_direct_msdus_inv_peer;
  7833. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  7834. * frames with invalid peer handler
  7835. */
  7836. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  7837. /* Number of MSDUs dropped due to no first MSDU flag */
  7838. A_UINT32 rxdesc_no_1st_msdu;
  7839. /* Number of MSDUs droped due to ring overflow */
  7840. A_UINT32 msdu_drop_ring_ov;
  7841. /* Number of MSDUs dropped due to FC mismatch */
  7842. A_UINT32 msdu_drop_fc_mismatch;
  7843. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  7844. A_UINT32 msdu_drop_mgmt_remote_ring;
  7845. /* Number of MSDUs dropped due to errors not reported in attention word */
  7846. A_UINT32 msdu_drop_misc;
  7847. /* Number of MSDUs go to offload before reorder */
  7848. A_UINT32 offload_msdu_wal;
  7849. /* Number of data frame dropped by offload after reorder */
  7850. A_UINT32 offload_msdu_reorder;
  7851. /* Number of MPDUs with sequence number in the past and within the BA window */
  7852. A_UINT32 dup_past_within_window;
  7853. /* Number of MPDUs with sequence number in the past and outside the BA window */
  7854. A_UINT32 dup_past_outside_window;
  7855. /* Number of MSDUs with decrypt/MIC error */
  7856. A_UINT32 rxdesc_err_decrypt_mic;
  7857. /* Number of data MSDUs received on both local and remote rings */
  7858. A_UINT32 data_msdus_on_both_rings;
  7859. /* MPDUs never filled */
  7860. A_UINT32 holes_not_filled;
  7861. };
  7862. /*
  7863. * Rx Remote buffer statistics
  7864. * NB: all the fields must be defined in 4 octets size.
  7865. */
  7866. struct rx_remote_buffer_mgmt_stats {
  7867. /* Total number of MSDUs reaped for Rx processing */
  7868. A_UINT32 remote_reaped;
  7869. /* MSDUs recycled within firmware */
  7870. A_UINT32 remote_recycled;
  7871. /* MSDUs stored by Data Rx */
  7872. A_UINT32 data_rx_msdus_stored;
  7873. /* Number of HTT indications from WAL Rx MSDU */
  7874. A_UINT32 wal_rx_ind;
  7875. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  7876. A_UINT32 wal_rx_ind_unconsumed;
  7877. /* Number of HTT indications from Data Rx MSDU */
  7878. A_UINT32 data_rx_ind;
  7879. /* Number of unconsumed HTT indications from Data Rx MSDU */
  7880. A_UINT32 data_rx_ind_unconsumed;
  7881. /* Number of HTT indications from ATHBUF */
  7882. A_UINT32 athbuf_rx_ind;
  7883. /* Number of remote buffers requested for refill */
  7884. A_UINT32 refill_buf_req;
  7885. /* Number of remote buffers filled by the host */
  7886. A_UINT32 refill_buf_rsp;
  7887. /* Number of times MAC hw_index = f/w write_index */
  7888. A_INT32 mac_no_bufs;
  7889. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  7890. A_INT32 fw_indices_equal;
  7891. /* Number of times f/w finds no buffers to post */
  7892. A_INT32 host_no_bufs;
  7893. };
  7894. /*
  7895. * TXBF MU/SU packets and NDPA statistics
  7896. * NB: all the fields must be defined in 4 octets size.
  7897. */
  7898. struct rx_txbf_musu_ndpa_pkts_stats {
  7899. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  7900. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  7901. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  7902. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  7903. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  7904. A_UINT32 reserved[3]; /* must be set to 0x0 */
  7905. };
  7906. /*
  7907. * htt_dbg_stats_status -
  7908. * present - The requested stats have been delivered in full.
  7909. * This indicates that either the stats information was contained
  7910. * in its entirety within this message, or else this message
  7911. * completes the delivery of the requested stats info that was
  7912. * partially delivered through earlier STATS_CONF messages.
  7913. * partial - The requested stats have been delivered in part.
  7914. * One or more subsequent STATS_CONF messages with the same
  7915. * cookie value will be sent to deliver the remainder of the
  7916. * information.
  7917. * error - The requested stats could not be delivered, for example due
  7918. * to a shortage of memory to construct a message holding the
  7919. * requested stats.
  7920. * invalid - The requested stat type is either not recognized, or the
  7921. * target is configured to not gather the stats type in question.
  7922. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7923. * series_done - This special value indicates that no further stats info
  7924. * elements are present within a series of stats info elems
  7925. * (within a stats upload confirmation message).
  7926. */
  7927. enum htt_dbg_stats_status {
  7928. HTT_DBG_STATS_STATUS_PRESENT = 0,
  7929. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  7930. HTT_DBG_STATS_STATUS_ERROR = 2,
  7931. HTT_DBG_STATS_STATUS_INVALID = 3,
  7932. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  7933. };
  7934. /**
  7935. * @brief target -> host statistics upload
  7936. *
  7937. * @details
  7938. * The following field definitions describe the format of the HTT target
  7939. * to host stats upload confirmation message.
  7940. * The message contains a cookie echoed from the HTT host->target stats
  7941. * upload request, which identifies which request the confirmation is
  7942. * for, and a series of tag-length-value stats information elements.
  7943. * The tag-length header for each stats info element also includes a
  7944. * status field, to indicate whether the request for the stat type in
  7945. * question was fully met, partially met, unable to be met, or invalid
  7946. * (if the stat type in question is disabled in the target).
  7947. * A special value of all 1's in this status field is used to indicate
  7948. * the end of the series of stats info elements.
  7949. *
  7950. *
  7951. * |31 16|15 8|7 5|4 0|
  7952. * |------------------------------------------------------------|
  7953. * | reserved | msg type |
  7954. * |------------------------------------------------------------|
  7955. * | cookie LSBs |
  7956. * |------------------------------------------------------------|
  7957. * | cookie MSBs |
  7958. * |------------------------------------------------------------|
  7959. * | stats entry length | reserved | S |stat type|
  7960. * |------------------------------------------------------------|
  7961. * | |
  7962. * | type-specific stats info |
  7963. * | |
  7964. * |------------------------------------------------------------|
  7965. * | stats entry length | reserved | S |stat type|
  7966. * |------------------------------------------------------------|
  7967. * | |
  7968. * | type-specific stats info |
  7969. * | |
  7970. * |------------------------------------------------------------|
  7971. * | n/a | reserved | 111 | n/a |
  7972. * |------------------------------------------------------------|
  7973. * Header fields:
  7974. * - MSG_TYPE
  7975. * Bits 7:0
  7976. * Purpose: identifies this is a statistics upload confirmation message
  7977. * Value: 0x9
  7978. * - COOKIE_LSBS
  7979. * Bits 31:0
  7980. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7981. * message with its preceding host->target stats request message.
  7982. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7983. * - COOKIE_MSBS
  7984. * Bits 31:0
  7985. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7986. * message with its preceding host->target stats request message.
  7987. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7988. *
  7989. * Stats Information Element tag-length header fields:
  7990. * - STAT_TYPE
  7991. * Bits 4:0
  7992. * Purpose: identifies the type of statistics info held in the
  7993. * following information element
  7994. * Value: htt_dbg_stats_type
  7995. * - STATUS
  7996. * Bits 7:5
  7997. * Purpose: indicate whether the requested stats are present
  7998. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  7999. * the completion of the stats entry series
  8000. * - LENGTH
  8001. * Bits 31:16
  8002. * Purpose: indicate the stats information size
  8003. * Value: This field specifies the number of bytes of stats information
  8004. * that follows the element tag-length header.
  8005. * It is expected but not required that this length is a multiple of
  8006. * 4 bytes. Even if the length is not an integer multiple of 4, the
  8007. * subsequent stats entry header will begin on a 4-byte aligned
  8008. * boundary.
  8009. */
  8010. #define HTT_T2H_STATS_COOKIE_SIZE 8
  8011. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  8012. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  8013. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  8014. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  8015. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  8016. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  8017. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  8018. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  8019. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  8020. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  8021. do { \
  8022. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  8023. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  8024. } while (0)
  8025. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  8026. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  8027. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  8028. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  8029. do { \
  8030. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  8031. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  8032. } while (0)
  8033. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  8034. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  8035. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  8036. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  8037. do { \
  8038. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  8039. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  8040. } while (0)
  8041. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  8042. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  8043. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  8044. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  8045. #define HTT_MAX_AGGR 64
  8046. #define HTT_HL_MAX_AGGR 18
  8047. /**
  8048. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  8049. *
  8050. * @details
  8051. * The following field definitions describe the format of the HTT host
  8052. * to target frag_desc/msdu_ext bank configuration message.
  8053. * The message contains the based address and the min and max id of the
  8054. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  8055. * MSDU_EXT/FRAG_DESC.
  8056. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  8057. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  8058. * the hardware does the mapping/translation.
  8059. *
  8060. * Total banks that can be configured is configured to 16.
  8061. *
  8062. * This should be called before any TX has be initiated by the HTT
  8063. *
  8064. * |31 16|15 8|7 5|4 0|
  8065. * |------------------------------------------------------------|
  8066. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  8067. * |------------------------------------------------------------|
  8068. * | BANK0_BASE_ADDRESS (bits 31:0) |
  8069. #if HTT_PADDR64
  8070. * | BANK0_BASE_ADDRESS (bits 63:32) |
  8071. #endif
  8072. * |------------------------------------------------------------|
  8073. * | ... |
  8074. * |------------------------------------------------------------|
  8075. * | BANK15_BASE_ADDRESS (bits 31:0) |
  8076. #if HTT_PADDR64
  8077. * | BANK15_BASE_ADDRESS (bits 63:32) |
  8078. #endif
  8079. * |------------------------------------------------------------|
  8080. * | BANK0_MAX_ID | BANK0_MIN_ID |
  8081. * |------------------------------------------------------------|
  8082. * | ... |
  8083. * |------------------------------------------------------------|
  8084. * | BANK15_MAX_ID | BANK15_MIN_ID |
  8085. * |------------------------------------------------------------|
  8086. * Header fields:
  8087. * - MSG_TYPE
  8088. * Bits 7:0
  8089. * Value: 0x6
  8090. * for systems with 64-bit format for bus addresses:
  8091. * - BANKx_BASE_ADDRESS_LO
  8092. * Bits 31:0
  8093. * Purpose: Provide a mechanism to specify the base address of the
  8094. * MSDU_EXT bank physical/bus address.
  8095. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8096. * - BANKx_BASE_ADDRESS_HI
  8097. * Bits 31:0
  8098. * Purpose: Provide a mechanism to specify the base address of the
  8099. * MSDU_EXT bank physical/bus address.
  8100. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8101. * for systems with 32-bit format for bus addresses:
  8102. * - BANKx_BASE_ADDRESS
  8103. * Bits 31:0
  8104. * Purpose: Provide a mechanism to specify the base address of the
  8105. * MSDU_EXT bank physical/bus address.
  8106. * Value: MSDU_EXT bank physical / bus address
  8107. * - BANKx_MIN_ID
  8108. * Bits 15:0
  8109. * Purpose: Provide a mechanism to specify the min index that needs to
  8110. * mapped.
  8111. * - BANKx_MAX_ID
  8112. * Bits 31:16
  8113. * Purpose: Provide a mechanism to specify the max index that needs to
  8114. * mapped.
  8115. *
  8116. */
  8117. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8118. * safe value.
  8119. * @note MAX supported banks is 16.
  8120. */
  8121. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8122. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8123. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8124. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8125. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8126. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8127. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8128. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8129. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8130. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8131. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8132. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8133. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8134. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8135. do { \
  8136. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8137. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8138. } while (0)
  8139. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8140. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8141. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8142. do { \
  8143. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  8144. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  8145. } while (0)
  8146. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8147. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8148. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8149. do { \
  8150. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8151. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8152. } while (0)
  8153. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8154. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8155. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8156. do { \
  8157. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8158. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8159. } while (0)
  8160. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8161. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8162. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8163. do { \
  8164. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8165. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8166. } while (0)
  8167. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8168. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8169. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8170. do { \
  8171. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8172. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8173. } while (0)
  8174. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8175. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  8176. /*
  8177. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  8178. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  8179. * addresses are stored in a XXX-bit field.
  8180. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  8181. * htt_tx_frag_desc64_bank_cfg_t structs.
  8182. */
  8183. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  8184. _paddr_bits_, \
  8185. _paddr__bank_base_address_) \
  8186. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  8187. /** word 0 \
  8188. * msg_type: 8, \
  8189. * pdev_id: 2, \
  8190. * swap: 1, \
  8191. * reserved0: 5, \
  8192. * num_banks: 8, \
  8193. * desc_size: 8; \
  8194. */ \
  8195. A_UINT32 word0; \
  8196. /* \
  8197. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  8198. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  8199. * the second A_UINT32). \
  8200. */ \
  8201. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8202. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8203. } POSTPACK
  8204. /* define htt_tx_frag_desc32_bank_cfg_t */
  8205. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  8206. /* define htt_tx_frag_desc64_bank_cfg_t */
  8207. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  8208. /*
  8209. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  8210. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  8211. */
  8212. #if HTT_PADDR64
  8213. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  8214. #else
  8215. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  8216. #endif
  8217. /**
  8218. * @brief target -> host HTT TX Credit total count update message definition
  8219. *
  8220. *|31 16|15|14 9| 8 |7 0 |
  8221. *|---------------------+--+----------+-------+----------|
  8222. *|cur htt credit delta | Q| reserved | sign | msg type |
  8223. *|------------------------------------------------------|
  8224. *
  8225. * Header fields:
  8226. * - MSG_TYPE
  8227. * Bits 7:0
  8228. * Purpose: identifies this as a htt tx credit delta update message
  8229. * Value: 0xe
  8230. * - SIGN
  8231. * Bits 8
  8232. * identifies whether credit delta is positive or negative
  8233. * Value:
  8234. * - 0x0: credit delta is positive, rebalance in some buffers
  8235. * - 0x1: credit delta is negative, rebalance out some buffers
  8236. * - reserved
  8237. * Bits 14:9
  8238. * Value: 0x0
  8239. * - TXQ_GRP
  8240. * Bit 15
  8241. * Purpose: indicates whether any tx queue group information elements
  8242. * are appended to the tx credit update message
  8243. * Value: 0 -> no tx queue group information element is present
  8244. * 1 -> a tx queue group information element immediately follows
  8245. * - DELTA_COUNT
  8246. * Bits 31:16
  8247. * Purpose: Specify current htt credit delta absolute count
  8248. */
  8249. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8250. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8251. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8252. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8253. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8254. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8255. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8256. do { \
  8257. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8258. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8259. } while (0)
  8260. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8261. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8262. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8263. do { \
  8264. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8265. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8266. } while (0)
  8267. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8268. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8269. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8270. do { \
  8271. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8272. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8273. } while (0)
  8274. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8275. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8276. #define HTT_TX_CREDIT_MSG_BYTES 4
  8277. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8278. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8279. /**
  8280. * @brief HTT WDI_IPA Operation Response Message
  8281. *
  8282. * @details
  8283. * HTT WDI_IPA Operation Response message is sent by target
  8284. * to host confirming suspend or resume operation.
  8285. * |31 24|23 16|15 8|7 0|
  8286. * |----------------+----------------+----------------+----------------|
  8287. * | op_code | Rsvd | msg_type |
  8288. * |-------------------------------------------------------------------|
  8289. * | Rsvd | Response len |
  8290. * |-------------------------------------------------------------------|
  8291. * | |
  8292. * | Response-type specific info |
  8293. * | |
  8294. * | |
  8295. * |-------------------------------------------------------------------|
  8296. * Header fields:
  8297. * - MSG_TYPE
  8298. * Bits 7:0
  8299. * Purpose: Identifies this as WDI_IPA Operation Response message
  8300. * value: = 0x13
  8301. * - OP_CODE
  8302. * Bits 31:16
  8303. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  8304. * value: = enum htt_wdi_ipa_op_code
  8305. * - RSP_LEN
  8306. * Bits 16:0
  8307. * Purpose: length for the response-type specific info
  8308. * value: = length in bytes for response-type specific info
  8309. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8310. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8311. */
  8312. PREPACK struct htt_wdi_ipa_op_response_t
  8313. {
  8314. /* DWORD 0: flags and meta-data */
  8315. A_UINT32
  8316. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8317. reserved1: 8,
  8318. op_code: 16;
  8319. A_UINT32
  8320. rsp_len: 16,
  8321. reserved2: 16;
  8322. } POSTPACK;
  8323. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8324. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8325. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8326. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8327. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8328. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8329. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8330. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8331. do { \
  8332. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8333. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8334. } while (0)
  8335. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8336. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8337. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8338. do { \
  8339. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8340. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8341. } while (0)
  8342. enum htt_phy_mode {
  8343. htt_phy_mode_11a = 0,
  8344. htt_phy_mode_11g = 1,
  8345. htt_phy_mode_11b = 2,
  8346. htt_phy_mode_11g_only = 3,
  8347. htt_phy_mode_11na_ht20 = 4,
  8348. htt_phy_mode_11ng_ht20 = 5,
  8349. htt_phy_mode_11na_ht40 = 6,
  8350. htt_phy_mode_11ng_ht40 = 7,
  8351. htt_phy_mode_11ac_vht20 = 8,
  8352. htt_phy_mode_11ac_vht40 = 9,
  8353. htt_phy_mode_11ac_vht80 = 10,
  8354. htt_phy_mode_11ac_vht20_2g = 11,
  8355. htt_phy_mode_11ac_vht40_2g = 12,
  8356. htt_phy_mode_11ac_vht80_2g = 13,
  8357. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8358. htt_phy_mode_11ac_vht160 = 15,
  8359. htt_phy_mode_max,
  8360. };
  8361. /**
  8362. * @brief target -> host HTT channel change indication
  8363. * @details
  8364. * Specify when a channel change occurs.
  8365. * This allows the host to precisely determine which rx frames arrived
  8366. * on the old channel and which rx frames arrived on the new channel.
  8367. *
  8368. *|31 |7 0 |
  8369. *|-------------------------------------------+----------|
  8370. *| reserved | msg type |
  8371. *|------------------------------------------------------|
  8372. *| primary_chan_center_freq_mhz |
  8373. *|------------------------------------------------------|
  8374. *| contiguous_chan1_center_freq_mhz |
  8375. *|------------------------------------------------------|
  8376. *| contiguous_chan2_center_freq_mhz |
  8377. *|------------------------------------------------------|
  8378. *| phy_mode |
  8379. *|------------------------------------------------------|
  8380. *
  8381. * Header fields:
  8382. * - MSG_TYPE
  8383. * Bits 7:0
  8384. * Purpose: identifies this as a htt channel change indication message
  8385. * Value: 0x15
  8386. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8387. * Bits 31:0
  8388. * Purpose: identify the (center of the) new 20 MHz primary channel
  8389. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8390. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8391. * Bits 31:0
  8392. * Purpose: identify the (center of the) contiguous frequency range
  8393. * comprising the new channel.
  8394. * For example, if the new channel is a 80 MHz channel extending
  8395. * 60 MHz beyond the primary channel, this field would be 30 larger
  8396. * than the primary channel center frequency field.
  8397. * Value: center frequency of the contiguous frequency range comprising
  8398. * the full channel in MHz units
  8399. * (80+80 channels also use the CONTIG_CHAN2 field)
  8400. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8401. * Bits 31:0
  8402. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8403. * within a VHT 80+80 channel.
  8404. * This field is only relevant for VHT 80+80 channels.
  8405. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8406. * channel (arbitrary value for cases besides VHT 80+80)
  8407. * - PHY_MODE
  8408. * Bits 31:0
  8409. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8410. * and band
  8411. * Value: htt_phy_mode enum value
  8412. */
  8413. PREPACK struct htt_chan_change_t
  8414. {
  8415. /* DWORD 0: flags and meta-data */
  8416. A_UINT32
  8417. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8418. reserved1: 24;
  8419. A_UINT32 primary_chan_center_freq_mhz;
  8420. A_UINT32 contig_chan1_center_freq_mhz;
  8421. A_UINT32 contig_chan2_center_freq_mhz;
  8422. A_UINT32 phy_mode;
  8423. } POSTPACK;
  8424. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8425. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8426. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8427. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8428. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8429. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8430. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8431. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8432. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8433. do { \
  8434. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  8435. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8436. } while (0)
  8437. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8438. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8439. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8440. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8441. do { \
  8442. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  8443. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8444. } while (0)
  8445. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8446. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8447. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8448. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8449. do { \
  8450. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  8451. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8452. } while (0)
  8453. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8454. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8455. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8456. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8457. do { \
  8458. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  8459. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8460. } while (0)
  8461. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8462. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8463. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8464. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8465. /**
  8466. * @brief rx offload packet error message
  8467. *
  8468. * @details
  8469. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8470. * of target payload like mic err.
  8471. *
  8472. * |31 24|23 16|15 8|7 0|
  8473. * |----------------+----------------+----------------+----------------|
  8474. * | tid | vdev_id | msg_sub_type | msg_type |
  8475. * |-------------------------------------------------------------------|
  8476. * : (sub-type dependent content) :
  8477. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8478. * Header fields:
  8479. * - msg_type
  8480. * Bits 7:0
  8481. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8482. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8483. * - msg_sub_type
  8484. * Bits 15:8
  8485. * Purpose: Identifies which type of rx error is reported by this message
  8486. * value: htt_rx_ofld_pkt_err_type
  8487. * - vdev_id
  8488. * Bits 23:16
  8489. * Purpose: Identifies which vdev received the erroneous rx frame
  8490. * value:
  8491. * - tid
  8492. * Bits 31:24
  8493. * Purpose: Identifies the traffic type of the rx frame
  8494. * value:
  8495. *
  8496. * - The payload fields used if the sub-type == MIC error are shown below.
  8497. * Note - MIC err is per MSDU, while PN is per MPDU.
  8498. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8499. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8500. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8501. * instead of sending separate HTT messages for each wrong MSDU within
  8502. * the MPDU.
  8503. *
  8504. * |31 24|23 16|15 8|7 0|
  8505. * |----------------+----------------+----------------+----------------|
  8506. * | Rsvd | key_id | peer_id |
  8507. * |-------------------------------------------------------------------|
  8508. * | receiver MAC addr 31:0 |
  8509. * |-------------------------------------------------------------------|
  8510. * | Rsvd | receiver MAC addr 47:32 |
  8511. * |-------------------------------------------------------------------|
  8512. * | transmitter MAC addr 31:0 |
  8513. * |-------------------------------------------------------------------|
  8514. * | Rsvd | transmitter MAC addr 47:32 |
  8515. * |-------------------------------------------------------------------|
  8516. * | PN 31:0 |
  8517. * |-------------------------------------------------------------------|
  8518. * | Rsvd | PN 47:32 |
  8519. * |-------------------------------------------------------------------|
  8520. * - peer_id
  8521. * Bits 15:0
  8522. * Purpose: identifies which peer is frame is from
  8523. * value:
  8524. * - key_id
  8525. * Bits 23:16
  8526. * Purpose: identifies key_id of rx frame
  8527. * value:
  8528. * - RA_31_0 (receiver MAC addr 31:0)
  8529. * Bits 31:0
  8530. * Purpose: identifies by MAC address which vdev received the frame
  8531. * value: MAC address lower 4 bytes
  8532. * - RA_47_32 (receiver MAC addr 47:32)
  8533. * Bits 15:0
  8534. * Purpose: identifies by MAC address which vdev received the frame
  8535. * value: MAC address upper 2 bytes
  8536. * - TA_31_0 (transmitter MAC addr 31:0)
  8537. * Bits 31:0
  8538. * Purpose: identifies by MAC address which peer transmitted the frame
  8539. * value: MAC address lower 4 bytes
  8540. * - TA_47_32 (transmitter MAC addr 47:32)
  8541. * Bits 15:0
  8542. * Purpose: identifies by MAC address which peer transmitted the frame
  8543. * value: MAC address upper 2 bytes
  8544. * - PN_31_0
  8545. * Bits 31:0
  8546. * Purpose: Identifies pn of rx frame
  8547. * value: PN lower 4 bytes
  8548. * - PN_47_32
  8549. * Bits 15:0
  8550. * Purpose: Identifies pn of rx frame
  8551. * value:
  8552. * TKIP or CCMP: PN upper 2 bytes
  8553. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8554. */
  8555. enum htt_rx_ofld_pkt_err_type {
  8556. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8557. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8558. };
  8559. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8560. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8561. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8562. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8563. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8564. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8565. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8566. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8567. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8568. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8569. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8570. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8571. do { \
  8572. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8573. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8574. } while (0)
  8575. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8576. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8577. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8578. do { \
  8579. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8580. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8581. } while (0)
  8582. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8583. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8584. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8585. do { \
  8586. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8587. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8588. } while (0)
  8589. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8590. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8591. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8592. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8593. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8594. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8595. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8596. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8597. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8598. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8599. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8600. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8601. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8602. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8603. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8604. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8605. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8606. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8607. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8608. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8609. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8610. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8611. do { \
  8612. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8613. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8614. } while (0)
  8615. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8616. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8617. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8618. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8619. do { \
  8620. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8621. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8622. } while (0)
  8623. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8624. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8625. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8626. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8627. do { \
  8628. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8629. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8630. } while (0)
  8631. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8632. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8633. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8634. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8635. do { \
  8636. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8637. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8638. } while (0)
  8639. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8640. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8641. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8642. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8643. do { \
  8644. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8645. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8646. } while (0)
  8647. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8648. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8649. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8650. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8651. do { \
  8652. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8653. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8654. } while (0)
  8655. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8656. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8657. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8658. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8659. do { \
  8660. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8661. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8662. } while (0)
  8663. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8664. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8665. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8666. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8667. do { \
  8668. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8669. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8670. } while (0)
  8671. /**
  8672. * @brief peer rate report message
  8673. *
  8674. * @details
  8675. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8676. * justified rate of all the peers.
  8677. *
  8678. * |31 24|23 16|15 8|7 0|
  8679. * |----------------+----------------+----------------+----------------|
  8680. * | peer_count | | msg_type |
  8681. * |-------------------------------------------------------------------|
  8682. * : Payload (variant number of peer rate report) :
  8683. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8684. * Header fields:
  8685. * - msg_type
  8686. * Bits 7:0
  8687. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8688. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8689. * - reserved
  8690. * Bits 15:8
  8691. * Purpose:
  8692. * value:
  8693. * - peer_count
  8694. * Bits 31:16
  8695. * Purpose: Specify how many peer rate report elements are present in the payload.
  8696. * value:
  8697. *
  8698. * Payload:
  8699. * There are variant number of peer rate report follow the first 32 bits.
  8700. * The peer rate report is defined as follows.
  8701. *
  8702. * |31 20|19 16|15 0|
  8703. * |-----------------------+---------+---------------------------------|-
  8704. * | reserved | phy | peer_id | \
  8705. * |-------------------------------------------------------------------| -> report #0
  8706. * | rate | /
  8707. * |-----------------------+---------+---------------------------------|-
  8708. * | reserved | phy | peer_id | \
  8709. * |-------------------------------------------------------------------| -> report #1
  8710. * | rate | /
  8711. * |-----------------------+---------+---------------------------------|-
  8712. * | reserved | phy | peer_id | \
  8713. * |-------------------------------------------------------------------| -> report #2
  8714. * | rate | /
  8715. * |-------------------------------------------------------------------|-
  8716. * : :
  8717. * : :
  8718. * : :
  8719. * :-------------------------------------------------------------------:
  8720. *
  8721. * - peer_id
  8722. * Bits 15:0
  8723. * Purpose: identify the peer
  8724. * value:
  8725. * - phy
  8726. * Bits 19:16
  8727. * Purpose: identify which phy is in use
  8728. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8729. * Please see enum htt_peer_report_phy_type for detail.
  8730. * - reserved
  8731. * Bits 31:20
  8732. * Purpose:
  8733. * value:
  8734. * - rate
  8735. * Bits 31:0
  8736. * Purpose: represent the justified rate of the peer specified by peer_id
  8737. * value:
  8738. */
  8739. enum htt_peer_rate_report_phy_type {
  8740. HTT_PEER_RATE_REPORT_11B = 0,
  8741. HTT_PEER_RATE_REPORT_11A_G,
  8742. HTT_PEER_RATE_REPORT_11N,
  8743. HTT_PEER_RATE_REPORT_11AC,
  8744. };
  8745. #define HTT_PEER_RATE_REPORT_SIZE 8
  8746. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8747. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8748. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8749. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8750. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8751. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8752. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8753. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8754. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8755. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8756. do { \
  8757. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8758. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8759. } while (0)
  8760. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8761. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8762. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8763. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8764. do { \
  8765. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8766. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8767. } while (0)
  8768. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8769. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8770. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8771. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8772. do { \
  8773. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8774. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8775. } while (0)
  8776. /**
  8777. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8778. *
  8779. * @details
  8780. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  8781. * a flow of descriptors.
  8782. *
  8783. * This message is in TLV format and indicates the parameters to be setup a
  8784. * flow in the host. Each entry indicates that a particular flow ID is ready to
  8785. * receive descriptors from a specified pool.
  8786. *
  8787. * The message would appear as follows:
  8788. *
  8789. * |31 24|23 16|15 8|7 0|
  8790. * |----------------+----------------+----------------+----------------|
  8791. * header | reserved | num_flows | msg_type |
  8792. * |-------------------------------------------------------------------|
  8793. * | |
  8794. * : payload :
  8795. * | |
  8796. * |-------------------------------------------------------------------|
  8797. *
  8798. * The header field is one DWORD long and is interpreted as follows:
  8799. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  8800. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  8801. * this message
  8802. * b'16-31 - reserved: These bits are reserved for future use
  8803. *
  8804. * Payload:
  8805. * The payload would contain multiple objects of the following structure. Each
  8806. * object represents a flow.
  8807. *
  8808. * |31 24|23 16|15 8|7 0|
  8809. * |----------------+----------------+----------------+----------------|
  8810. * header | reserved | num_flows | msg_type |
  8811. * |-------------------------------------------------------------------|
  8812. * payload0| flow_type |
  8813. * |-------------------------------------------------------------------|
  8814. * | flow_id |
  8815. * |-------------------------------------------------------------------|
  8816. * | reserved0 | flow_pool_id |
  8817. * |-------------------------------------------------------------------|
  8818. * | reserved1 | flow_pool_size |
  8819. * |-------------------------------------------------------------------|
  8820. * | reserved2 |
  8821. * |-------------------------------------------------------------------|
  8822. * payload1| flow_type |
  8823. * |-------------------------------------------------------------------|
  8824. * | flow_id |
  8825. * |-------------------------------------------------------------------|
  8826. * | reserved0 | flow_pool_id |
  8827. * |-------------------------------------------------------------------|
  8828. * | reserved1 | flow_pool_size |
  8829. * |-------------------------------------------------------------------|
  8830. * | reserved2 |
  8831. * |-------------------------------------------------------------------|
  8832. * | . |
  8833. * | . |
  8834. * | . |
  8835. * |-------------------------------------------------------------------|
  8836. *
  8837. * Each payload is 5 DWORDS long and is interpreted as follows:
  8838. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  8839. * this flow is associated. It can be VDEV, peer,
  8840. * or tid (AC). Based on enum htt_flow_type.
  8841. *
  8842. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8843. * object. For flow_type vdev it is set to the
  8844. * vdevid, for peer it is peerid and for tid, it is
  8845. * tid_num.
  8846. *
  8847. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  8848. * in the host for this flow
  8849. * b'16:31 - reserved0: This field in reserved for the future. In case
  8850. * we have a hierarchical implementation (HCM) of
  8851. * pools, it can be used to indicate the ID of the
  8852. * parent-pool.
  8853. *
  8854. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  8855. * Descriptors for this flow will be
  8856. * allocated from this pool in the host.
  8857. * b'16:31 - reserved1: This field in reserved for the future. In case
  8858. * we have a hierarchical implementation of pools,
  8859. * it can be used to indicate the max number of
  8860. * descriptors in the pool. The b'0:15 can be used
  8861. * to indicate min number of descriptors in the
  8862. * HCM scheme.
  8863. *
  8864. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  8865. * we have a hierarchical implementation of pools,
  8866. * b'0:15 can be used to indicate the
  8867. * priority-based borrowing (PBB) threshold of
  8868. * the flow's pool. The b'16:31 are still left
  8869. * reserved.
  8870. */
  8871. enum htt_flow_type {
  8872. FLOW_TYPE_VDEV = 0,
  8873. /* Insert new flow types above this line */
  8874. };
  8875. PREPACK struct htt_flow_pool_map_payload_t {
  8876. A_UINT32 flow_type;
  8877. A_UINT32 flow_id;
  8878. A_UINT32 flow_pool_id:16,
  8879. reserved0:16;
  8880. A_UINT32 flow_pool_size:16,
  8881. reserved1:16;
  8882. A_UINT32 reserved2;
  8883. } POSTPACK;
  8884. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  8885. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  8886. (sizeof(struct htt_flow_pool_map_payload_t))
  8887. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  8888. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  8889. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  8890. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  8891. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  8892. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  8893. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  8894. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  8895. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  8896. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  8897. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  8898. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  8899. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  8900. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  8901. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  8902. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  8903. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  8904. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  8905. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  8906. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  8907. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  8908. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  8909. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  8910. do { \
  8911. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  8912. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  8913. } while (0)
  8914. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  8915. do { \
  8916. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  8917. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  8918. } while (0)
  8919. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  8920. do { \
  8921. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  8922. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  8923. } while (0)
  8924. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  8925. do { \
  8926. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  8927. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  8928. } while (0)
  8929. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  8930. do { \
  8931. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  8932. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  8933. } while (0)
  8934. /**
  8935. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  8936. *
  8937. * @details
  8938. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  8939. * down a flow of descriptors.
  8940. * This message indicates that for the flow (whose ID is provided) is wanting
  8941. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  8942. * pool of descriptors from where descriptors are being allocated for this
  8943. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  8944. * be unmapped by the host.
  8945. *
  8946. * The message would appear as follows:
  8947. *
  8948. * |31 24|23 16|15 8|7 0|
  8949. * |----------------+----------------+----------------+----------------|
  8950. * | reserved0 | msg_type |
  8951. * |-------------------------------------------------------------------|
  8952. * | flow_type |
  8953. * |-------------------------------------------------------------------|
  8954. * | flow_id |
  8955. * |-------------------------------------------------------------------|
  8956. * | reserved1 | flow_pool_id |
  8957. * |-------------------------------------------------------------------|
  8958. *
  8959. * The message is interpreted as follows:
  8960. * dword0 - b'0:7 - msg_type: This will be set to
  8961. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  8962. * b'8:31 - reserved0: Reserved for future use
  8963. *
  8964. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  8965. * this flow is associated. It can be VDEV, peer,
  8966. * or tid (AC). Based on enum htt_flow_type.
  8967. *
  8968. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8969. * object. For flow_type vdev it is set to the
  8970. * vdevid, for peer it is peerid and for tid, it is
  8971. * tid_num.
  8972. *
  8973. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  8974. * used in the host for this flow
  8975. * b'16:31 - reserved0: This field in reserved for the future.
  8976. *
  8977. */
  8978. PREPACK struct htt_flow_pool_unmap_t {
  8979. A_UINT32 msg_type:8,
  8980. reserved0:24;
  8981. A_UINT32 flow_type;
  8982. A_UINT32 flow_id;
  8983. A_UINT32 flow_pool_id:16,
  8984. reserved1:16;
  8985. } POSTPACK;
  8986. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  8987. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  8988. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  8989. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  8990. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  8991. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  8992. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  8993. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  8994. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  8995. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  8996. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  8997. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  8998. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  8999. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  9000. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  9001. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  9002. do { \
  9003. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  9004. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  9005. } while (0)
  9006. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  9007. do { \
  9008. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  9009. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  9010. } while (0)
  9011. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  9012. do { \
  9013. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  9014. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  9015. } while (0)
  9016. /**
  9017. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  9018. *
  9019. * @details
  9020. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  9021. * SRNG ring setup is done
  9022. *
  9023. * This message indicates whether the last setup operation is successful.
  9024. * It will be sent to host when host set respose_required bit in
  9025. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  9026. * The message would appear as follows:
  9027. *
  9028. * |31 24|23 16|15 8|7 0|
  9029. * |--------------- +----------------+----------------+----------------|
  9030. * | setup_status | ring_id | pdev_id | msg_type |
  9031. * |-------------------------------------------------------------------|
  9032. *
  9033. * The message is interpreted as follows:
  9034. * dword0 - b'0:7 - msg_type: This will be set to
  9035. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  9036. * b'8:15 - pdev_id:
  9037. * 0 (for rings at SOC/UMAC level),
  9038. * 1/2/3 mac id (for rings at LMAC level)
  9039. * b'16:23 - ring_id: Identify the ring which is set up
  9040. * More details can be got from enum htt_srng_ring_id
  9041. * b'24:31 - setup_status: Indicate status of setup operation
  9042. * Refer to htt_ring_setup_status
  9043. */
  9044. PREPACK struct htt_sring_setup_done_t {
  9045. A_UINT32 msg_type: 8,
  9046. pdev_id: 8,
  9047. ring_id: 8,
  9048. setup_status: 8;
  9049. } POSTPACK;
  9050. enum htt_ring_setup_status {
  9051. htt_ring_setup_status_ok = 0,
  9052. htt_ring_setup_status_error,
  9053. };
  9054. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  9055. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  9056. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  9057. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  9058. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  9059. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  9060. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  9061. do { \
  9062. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  9063. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  9064. } while (0)
  9065. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  9066. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  9067. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  9068. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  9069. HTT_SRING_SETUP_DONE_RING_ID_S)
  9070. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  9071. do { \
  9072. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  9073. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  9074. } while (0)
  9075. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  9076. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  9077. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  9078. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  9079. HTT_SRING_SETUP_DONE_STATUS_S)
  9080. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  9081. do { \
  9082. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  9083. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  9084. } while (0)
  9085. /**
  9086. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9087. *
  9088. * @details
  9089. * HTT TX map flow entry with tqm flow pointer
  9090. * Sent from firmware to host to add tqm flow pointer in corresponding
  9091. * flow search entry. Flow metadata is replayed back to host as part of this
  9092. * struct to enable host to find the specific flow search entry
  9093. *
  9094. * The message would appear as follows:
  9095. *
  9096. * |31 28|27 18|17 14|13 8|7 0|
  9097. * |-------+------------------------------------------+----------------|
  9098. * | rsvd0 | fse_hsh_idx | msg_type |
  9099. * |-------------------------------------------------------------------|
  9100. * | rsvd1 | tid | peer_id |
  9101. * |-------------------------------------------------------------------|
  9102. * | tqm_flow_pntr_lo |
  9103. * |-------------------------------------------------------------------|
  9104. * | tqm_flow_pntr_hi |
  9105. * |-------------------------------------------------------------------|
  9106. * | fse_meta_data |
  9107. * |-------------------------------------------------------------------|
  9108. *
  9109. * The message is interpreted as follows:
  9110. *
  9111. * dword0 - b'0:7 - msg_type: This will be set to
  9112. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9113. *
  9114. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9115. * for this flow entry
  9116. *
  9117. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9118. *
  9119. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9120. *
  9121. * dword1 - b'14:17 - tid
  9122. *
  9123. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9124. *
  9125. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9126. *
  9127. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9128. *
  9129. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9130. * given by host
  9131. */
  9132. PREPACK struct htt_tx_map_flow_info {
  9133. A_UINT32
  9134. msg_type: 8,
  9135. fse_hsh_idx: 20,
  9136. rsvd0: 4;
  9137. A_UINT32
  9138. peer_id: 14,
  9139. tid: 4,
  9140. rsvd1: 14;
  9141. A_UINT32 tqm_flow_pntr_lo;
  9142. A_UINT32 tqm_flow_pntr_hi;
  9143. struct htt_tx_flow_metadata fse_meta_data;
  9144. } POSTPACK;
  9145. /* DWORD 0 */
  9146. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9147. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9148. /* DWORD 1 */
  9149. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9150. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9151. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9152. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9153. /* DWORD 0 */
  9154. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9155. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9156. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9157. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9158. do { \
  9159. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9160. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9161. } while (0)
  9162. /* DWORD 1 */
  9163. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9164. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9165. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9166. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9167. do { \
  9168. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9169. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9170. } while (0)
  9171. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9172. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9173. HTT_TX_MAP_FLOW_INFO_TID_S)
  9174. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9175. do { \
  9176. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  9177. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  9178. } while (0)
  9179. /*
  9180. * htt_dbg_ext_stats_status -
  9181. * present - The requested stats have been delivered in full.
  9182. * This indicates that either the stats information was contained
  9183. * in its entirety within this message, or else this message
  9184. * completes the delivery of the requested stats info that was
  9185. * partially delivered through earlier STATS_CONF messages.
  9186. * partial - The requested stats have been delivered in part.
  9187. * One or more subsequent STATS_CONF messages with the same
  9188. * cookie value will be sent to deliver the remainder of the
  9189. * information.
  9190. * error - The requested stats could not be delivered, for example due
  9191. * to a shortage of memory to construct a message holding the
  9192. * requested stats.
  9193. * invalid - The requested stat type is either not recognized, or the
  9194. * target is configured to not gather the stats type in question.
  9195. */
  9196. enum htt_dbg_ext_stats_status {
  9197. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  9198. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  9199. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  9200. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  9201. };
  9202. /**
  9203. * @brief target -> host ppdu stats upload
  9204. *
  9205. * @details
  9206. * The following field definitions describe the format of the HTT target
  9207. * to host ppdu stats indication message.
  9208. *
  9209. *
  9210. * |31 16|15 12|11 10|9 8|7 0 |
  9211. * |----------------------------------------------------------------------|
  9212. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  9213. * |----------------------------------------------------------------------|
  9214. * | ppdu_id |
  9215. * |----------------------------------------------------------------------|
  9216. * | Timestamp in us |
  9217. * |----------------------------------------------------------------------|
  9218. * | reserved |
  9219. * |----------------------------------------------------------------------|
  9220. * | type-specific stats info |
  9221. * | (see htt_ppdu_stats.h) |
  9222. * |----------------------------------------------------------------------|
  9223. * Header fields:
  9224. * - MSG_TYPE
  9225. * Bits 7:0
  9226. * Purpose: Identifies this is a PPDU STATS indication
  9227. * message.
  9228. * Value: 0x1d
  9229. * - mac_id
  9230. * Bits 9:8
  9231. * Purpose: mac_id of this ppdu_id
  9232. * Value: 0-3
  9233. * - pdev_id
  9234. * Bits 11:10
  9235. * Purpose: pdev_id of this ppdu_id
  9236. * Value: 0-3
  9237. * 0 (for rings at SOC level),
  9238. * 1/2/3 PDEV -> 0/1/2
  9239. * - payload_size
  9240. * Bits 31:16
  9241. * Purpose: total tlv size
  9242. * Value: payload_size in bytes
  9243. */
  9244. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  9245. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  9246. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  9247. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  9248. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  9249. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  9250. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  9251. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  9252. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  9253. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  9254. do { \
  9255. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  9256. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  9257. } while (0)
  9258. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  9259. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  9260. HTT_T2H_PPDU_STATS_MAC_ID_S)
  9261. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  9262. do { \
  9263. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  9264. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  9265. } while (0)
  9266. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  9267. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  9268. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  9269. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  9270. do { \
  9271. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  9272. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  9273. } while (0)
  9274. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  9275. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  9276. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  9277. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  9278. do { \
  9279. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  9280. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  9281. } while (0)
  9282. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  9283. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  9284. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  9285. /**
  9286. * @brief target -> host extended statistics upload
  9287. *
  9288. * @details
  9289. * The following field definitions describe the format of the HTT target
  9290. * to host stats upload confirmation message.
  9291. * The message contains a cookie echoed from the HTT host->target stats
  9292. * upload request, which identifies which request the confirmation is
  9293. * for, and a single stats can span over multiple HTT stats indication
  9294. * due to the HTT message size limitation so every HTT ext stats indication
  9295. * will have tag-length-value stats information elements.
  9296. * The tag-length header for each HTT stats IND message also includes a
  9297. * status field, to indicate whether the request for the stat type in
  9298. * question was fully met, partially met, unable to be met, or invalid
  9299. * (if the stat type in question is disabled in the target).
  9300. * A Done bit 1's indicate the end of the of stats info elements.
  9301. *
  9302. *
  9303. * |31 16|15 12|11|10 8|7 5|4 0|
  9304. * |--------------------------------------------------------------|
  9305. * | reserved | msg type |
  9306. * |--------------------------------------------------------------|
  9307. * | cookie LSBs |
  9308. * |--------------------------------------------------------------|
  9309. * | cookie MSBs |
  9310. * |--------------------------------------------------------------|
  9311. * | stats entry length | rsvd | D| S | stat type |
  9312. * |--------------------------------------------------------------|
  9313. * | type-specific stats info |
  9314. * | (see htt_stats.h) |
  9315. * |--------------------------------------------------------------|
  9316. * Header fields:
  9317. * - MSG_TYPE
  9318. * Bits 7:0
  9319. * Purpose: Identifies this is a extended statistics upload confirmation
  9320. * message.
  9321. * Value: 0x1c
  9322. * - COOKIE_LSBS
  9323. * Bits 31:0
  9324. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9325. * message with its preceding host->target stats request message.
  9326. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9327. * - COOKIE_MSBS
  9328. * Bits 31:0
  9329. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9330. * message with its preceding host->target stats request message.
  9331. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9332. *
  9333. * Stats Information Element tag-length header fields:
  9334. * - STAT_TYPE
  9335. * Bits 7:0
  9336. * Purpose: identifies the type of statistics info held in the
  9337. * following information element
  9338. * Value: htt_dbg_ext_stats_type
  9339. * - STATUS
  9340. * Bits 10:8
  9341. * Purpose: indicate whether the requested stats are present
  9342. * Value: htt_dbg_ext_stats_status
  9343. * - DONE
  9344. * Bits 11
  9345. * Purpose:
  9346. * Indicates the completion of the stats entry, this will be the last
  9347. * stats conf HTT segment for the requested stats type.
  9348. * Value:
  9349. * 0 -> the stats retrieval is ongoing
  9350. * 1 -> the stats retrieval is complete
  9351. * - LENGTH
  9352. * Bits 31:16
  9353. * Purpose: indicate the stats information size
  9354. * Value: This field specifies the number of bytes of stats information
  9355. * that follows the element tag-length header.
  9356. * It is expected but not required that this length is a multiple of
  9357. * 4 bytes.
  9358. */
  9359. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9360. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9361. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9362. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9363. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9364. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9365. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9366. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9367. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9368. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9369. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9370. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9371. do { \
  9372. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  9373. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9374. } while (0)
  9375. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9376. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9377. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9378. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9379. do { \
  9380. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  9381. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9382. } while (0)
  9383. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9384. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9385. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9386. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9387. do { \
  9388. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  9389. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  9390. } while (0)
  9391. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9392. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9393. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9394. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9395. do { \
  9396. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  9397. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9398. } while (0)
  9399. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9400. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9401. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9402. typedef enum {
  9403. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9404. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9405. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9406. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9407. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9408. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  9409. /* Reserved from 128 - 255 for target internal use.*/
  9410. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  9411. } HTT_PEER_TYPE;
  9412. /** 2 word representation of MAC addr */
  9413. typedef struct {
  9414. /** upper 4 bytes of MAC address */
  9415. A_UINT32 mac_addr31to0;
  9416. /** lower 2 bytes of MAC address */
  9417. A_UINT32 mac_addr47to32;
  9418. } htt_mac_addr;
  9419. /** macro to convert MAC address from char array to HTT word format */
  9420. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  9421. (phtt_mac_addr)->mac_addr31to0 = \
  9422. (((c_macaddr)[0] << 0) | \
  9423. ((c_macaddr)[1] << 8) | \
  9424. ((c_macaddr)[2] << 16) | \
  9425. ((c_macaddr)[3] << 24)); \
  9426. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  9427. } while (0)
  9428. /**
  9429. * @brief target -> host monitor mac header indication message
  9430. *
  9431. * @details
  9432. * The following diagram shows the format of the monitor mac header message
  9433. * sent from the target to the host.
  9434. * This message is primarily sent when promiscuous rx mode is enabled.
  9435. * One message is sent per rx PPDU.
  9436. *
  9437. * |31 24|23 16|15 8|7 0|
  9438. * |-------------------------------------------------------------|
  9439. * | peer_id | reserved0 | msg_type |
  9440. * |-------------------------------------------------------------|
  9441. * | reserved1 | num_mpdu |
  9442. * |-------------------------------------------------------------|
  9443. * | struct hw_rx_desc |
  9444. * | (see wal_rx_desc.h) |
  9445. * |-------------------------------------------------------------|
  9446. * | struct ieee80211_frame_addr4 |
  9447. * | (see ieee80211_defs.h) |
  9448. * |-------------------------------------------------------------|
  9449. * | struct ieee80211_frame_addr4 |
  9450. * | (see ieee80211_defs.h) |
  9451. * |-------------------------------------------------------------|
  9452. * | ...... |
  9453. * |-------------------------------------------------------------|
  9454. *
  9455. * Header fields:
  9456. * - msg_type
  9457. * Bits 7:0
  9458. * Purpose: Identifies this is a monitor mac header indication message.
  9459. * Value: 0x20
  9460. * - peer_id
  9461. * Bits 31:16
  9462. * Purpose: Software peer id given by host during association,
  9463. * During promiscuous mode, the peer ID will be invalid (0xFF)
  9464. * for rx PPDUs received from unassociated peers.
  9465. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  9466. * - num_mpdu
  9467. * Bits 15:0
  9468. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  9469. * delivered within the message.
  9470. * Value: 1 to 32
  9471. * num_mpdu is limited to a maximum value of 32, due to buffer
  9472. * size limits. For PPDUs with more than 32 MPDUs, only the
  9473. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  9474. * the PPDU will be provided.
  9475. */
  9476. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  9477. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  9478. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  9479. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  9480. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  9481. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  9482. do { \
  9483. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  9484. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  9485. } while (0)
  9486. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  9487. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  9488. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  9489. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  9490. do { \
  9491. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  9492. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  9493. } while (0)
  9494. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  9495. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  9496. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  9497. /**
  9498. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  9499. *
  9500. * @details
  9501. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  9502. * the flow pool associated with the specified ID is resized
  9503. *
  9504. * The message would appear as follows:
  9505. *
  9506. * |31 16|15 8|7 0|
  9507. * |---------------------------------+----------------+----------------|
  9508. * | reserved0 | Msg type |
  9509. * |-------------------------------------------------------------------|
  9510. * | flow pool new size | flow pool ID |
  9511. * |-------------------------------------------------------------------|
  9512. *
  9513. * The message is interpreted as follows:
  9514. * b'0:7 - msg_type: This will be set to
  9515. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  9516. *
  9517. * b'0:15 - flow pool ID: Existing flow pool ID
  9518. *
  9519. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  9520. *
  9521. */
  9522. PREPACK struct htt_flow_pool_resize_t {
  9523. A_UINT32 msg_type:8,
  9524. reserved0:24;
  9525. A_UINT32 flow_pool_id:16,
  9526. flow_pool_new_size:16;
  9527. } POSTPACK;
  9528. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  9529. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  9530. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  9531. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  9532. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  9533. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  9534. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  9535. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  9536. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  9537. do { \
  9538. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  9539. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  9540. } while (0)
  9541. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  9542. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  9543. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  9544. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  9545. do { \
  9546. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  9547. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  9548. } while (0)
  9549. #endif