htt.h 404 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035
  1. /*
  2. * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <a_types.h> /* A_UINT32 */
  34. #include <a_osapi.h> /* PREPACK, POSTPACK */
  35. #ifdef ATHR_WIN_NWF
  36. #pragma warning(disable:4214) /*bit field types other than int */
  37. #endif
  38. #include "wlan_defs.h"
  39. #include <htt_common.h>
  40. /*
  41. * Unless explicitly specified to use 64 bits to represent physical addresses
  42. * (or more precisely, bus addresses), default to 32 bits.
  43. */
  44. #ifndef HTT_PADDR64
  45. #define HTT_PADDR64 0
  46. #endif
  47. #ifndef offsetof
  48. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  49. #endif
  50. /*
  51. * HTT version history:
  52. * 1.0 initial numbered version
  53. * 1.1 modifications to STATS messages.
  54. * These modifications are not backwards compatible, but since the
  55. * STATS messages themselves are non-essential (they are for debugging),
  56. * the 1.1 version of the HTT message library as a whole is compatible
  57. * with the 1.0 version.
  58. * 1.2 reset mask IE added to STATS_REQ message
  59. * 1.3 stat config IE added to STATS_REQ message
  60. *----
  61. * 2.0 FW rx PPDU desc added to RX_IND message
  62. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  63. *----
  64. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  65. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  66. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  67. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  68. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  69. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  70. * 3.5 Added flush and fail stats in rx_reorder stats structure
  71. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  72. * 3.7 Made changes to support EOS Mac_core 3.0
  73. * 3.8 Added txq_group information element definition;
  74. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  75. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  76. * Allow buffer addresses in bus-address format to be stored as
  77. * either 32 bits or 64 bits.
  78. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  79. * messages to specify which HTT options to use.
  80. * Initial TLV options cover:
  81. * - whether to use 32 or 64 bits to represent LL bus addresses
  82. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  83. * - how many tx queue groups to use
  84. * 3.11 Expand rx debug stats:
  85. * - Expand the rx_reorder_stats struct with stats about successful and
  86. * failed rx buffer allcoations.
  87. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  88. * the supply, allocation, use, and recycling of rx buffers for the
  89. * "remote ring" of rx buffers in host member in LL systems.
  90. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  91. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  92. * 3.13 Add constants + macros to support 64-bit address format for the
  93. * tx fragments descriptor, the rx ring buffer, and the rx ring
  94. * index shadow register.
  95. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  96. * - Add htt_tx_msdu_desc_ext_t struct def.
  97. * - Add TLV to specify whether the target supports the HTT tx MSDU
  98. * extension descriptor.
  99. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  100. * "extension" bit, to specify whether a HTT tx MSDU extension
  101. * descriptor is present.
  102. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  103. * (This allows the host to obtain key information about the MSDU
  104. * from a memory location already in the cache, rather than taking a
  105. * cache miss for each MSDU by reading the HW rx descs.)
  106. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  107. * whether a copy-engine classification result is appended to TX_FRM.
  108. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  109. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  110. * tx frames in the target after the peer has already been deleted.
  111. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  112. * 3.20 Expand rx_reorder_stats.
  113. * 3.21 Add optional rx channel spec to HL RX_IND.
  114. * 3.22 Expand rx_reorder_stats
  115. * (distinguish duplicates within vs. outside block ack window)
  116. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  117. * The justified rate is calculated by two steps. The first is to multiply
  118. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  119. * by a low pass filter.
  120. * This change allows HL download scheduling to consider the WLAN rate
  121. * that will be used for transmitting the downloaded frames.
  122. * 3.24 Expand rx_reorder_stats
  123. * (add counter for decrypt / MIC errors)
  124. * 3.25 Expand rx_reorder_stats
  125. * (add counter of frames received into both local + remote rings)
  126. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  127. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  128. * 3.27 Add a new interface for flow-control. The following t2h messages have
  129. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  130. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  131. * 3.28 Add a new interface for ring interface change. The following two h2t
  132. * and one t2h messages have been included:
  133. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  134. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  135. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  136. * information elements passed from the host to a Lithium target,
  137. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  138. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  139. * targets).
  140. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  141. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  142. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  143. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  144. * sharing stats
  145. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  146. * 3.34 Add HW_PEER_ID field to PEER_MAP
  147. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  148. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  149. * not yet in use)
  150. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  151. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  152. * 3.38 Add holes_no_filled field to rx_reorder_stats
  153. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  154. */
  155. #define HTT_CURRENT_VERSION_MAJOR 3
  156. #define HTT_CURRENT_VERSION_MINOR 39
  157. #define HTT_NUM_TX_FRAG_DESC 1024
  158. #define HTT_WIFI_IP_VERSION(x, y) ((x) == (y))
  159. #define HTT_CHECK_SET_VAL(field, val) \
  160. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  161. /* macros to assist in sign-extending fields from HTT messages */
  162. #define HTT_SIGN_BIT_MASK(field) \
  163. ((field ## _M + (1 << field ## _S)) >> 1)
  164. #define HTT_SIGN_BIT(_val, field) \
  165. (_val & HTT_SIGN_BIT_MASK(field))
  166. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  167. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  168. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  169. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  170. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  171. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  172. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  173. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  174. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  175. /*
  176. * TEMPORARY:
  177. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  178. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  179. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  180. * updated.
  181. */
  182. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  183. /*
  184. * TEMPORARY:
  185. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  186. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  187. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  188. * updated.
  189. */
  190. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  191. /* HTT Access Category values */
  192. enum HTT_AC_WMM {
  193. /* WMM Access Categories */
  194. HTT_AC_WMM_BE = 0x0,
  195. HTT_AC_WMM_BK = 0x1,
  196. HTT_AC_WMM_VI = 0x2,
  197. HTT_AC_WMM_VO = 0x3,
  198. /* extension Access Categories */
  199. HTT_AC_EXT_NON_QOS = 0x4,
  200. HTT_AC_EXT_UCAST_MGMT = 0x5,
  201. HTT_AC_EXT_MCAST_DATA = 0x6,
  202. HTT_AC_EXT_MCAST_MGMT = 0x7,
  203. };
  204. enum HTT_AC_WMM_MASK {
  205. /* WMM Access Categories */
  206. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  207. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  208. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  209. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  210. /* extension Access Categories */
  211. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  212. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  213. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  214. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  215. };
  216. #define HTT_AC_MASK_WMM \
  217. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  218. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  219. #define HTT_AC_MASK_EXT \
  220. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  221. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  222. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  223. /*
  224. * htt_dbg_stats_type -
  225. * bit positions for each stats type within a stats type bitmask
  226. * The bitmask contains 24 bits.
  227. */
  228. enum htt_dbg_stats_type {
  229. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  230. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  231. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  232. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  233. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  234. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  235. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  236. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  237. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  238. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  239. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  240. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  241. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  242. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  243. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  244. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  245. /* bits 16-23 currently reserved */
  246. /* keep this last */
  247. HTT_DBG_NUM_STATS
  248. };
  249. /*=== HTT option selection TLVs ===
  250. * Certain HTT messages have alternatives or options.
  251. * For such cases, the host and target need to agree on which option to use.
  252. * Option specification TLVs can be appended to the VERSION_REQ and
  253. * VERSION_CONF messages to select options other than the default.
  254. * These TLVs are entirely optional - if they are not provided, there is a
  255. * well-defined default for each option. If they are provided, they can be
  256. * provided in any order. Each TLV can be present or absent independent of
  257. * the presence / absence of other TLVs.
  258. *
  259. * The HTT option selection TLVs use the following format:
  260. * |31 16|15 8|7 0|
  261. * |---------------------------------+----------------+----------------|
  262. * | value (payload) | length | tag |
  263. * |-------------------------------------------------------------------|
  264. * The value portion need not be only 2 bytes; it can be extended by any
  265. * integer number of 4-byte units. The total length of the TLV, including
  266. * the tag and length fields, must be a multiple of 4 bytes. The length
  267. * field specifies the total TLV size in 4-byte units. Thus, the typical
  268. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  269. * field, would store 0x1 in its length field, to show that the TLV occupies
  270. * a single 4-byte unit.
  271. */
  272. /*--- TLV header format - applies to all HTT option TLVs ---*/
  273. enum HTT_OPTION_TLV_TAGS {
  274. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  275. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  276. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  277. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  278. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  279. };
  280. PREPACK struct htt_option_tlv_header_t {
  281. A_UINT8 tag;
  282. A_UINT8 length;
  283. } POSTPACK;
  284. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  285. #define HTT_OPTION_TLV_TAG_S 0
  286. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  287. #define HTT_OPTION_TLV_LENGTH_S 8
  288. /*
  289. * value0 - 16 bit value field stored in word0
  290. * The TLV's value field may be longer than 2 bytes, in which case
  291. * the remainder of the value is stored in word1, word2, etc.
  292. */
  293. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  294. #define HTT_OPTION_TLV_VALUE0_S 16
  295. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  296. do { \
  297. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  298. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  299. } while (0)
  300. #define HTT_OPTION_TLV_TAG_GET(word) \
  301. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  302. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  303. do { \
  304. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  305. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  306. } while (0)
  307. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  308. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  309. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  310. do { \
  311. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  312. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  313. } while (0)
  314. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  315. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  316. /*--- format of specific HTT option TLVs ---*/
  317. /*
  318. * HTT option TLV for specifying LL bus address size
  319. * Some chips require bus addresses used by the target to access buffers
  320. * within the host's memory to be 32 bits; others require bus addresses
  321. * used by the target to access buffers within the host's memory to be
  322. * 64 bits.
  323. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  324. * a suffix to the VERSION_CONF message to specify which bus address format
  325. * the target requires.
  326. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  327. * default to providing bus addresses to the target in 32-bit format.
  328. */
  329. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  330. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  331. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  332. };
  333. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  334. struct htt_option_tlv_header_t hdr;
  335. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  336. } POSTPACK;
  337. /*
  338. * HTT option TLV for specifying whether HL systems should indicate
  339. * over-the-air tx completion for individual frames, or should instead
  340. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  341. * requests an OTA tx completion for a particular tx frame.
  342. * This option does not apply to LL systems, where the TX_COMPL_IND
  343. * is mandatory.
  344. * This option is primarily intended for HL systems in which the tx frame
  345. * downloads over the host --> target bus are as slow as or slower than
  346. * the transmissions over the WLAN PHY. For cases where the bus is faster
  347. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  348. * and consquently will send one TX_COMPL_IND message that covers several
  349. * tx frames. For cases where the WLAN PHY is faster than the bus,
  350. * the target will end up transmitting very short A-MPDUs, and consequently
  351. * sending many TX_COMPL_IND messages, which each cover a very small number
  352. * of tx frames.
  353. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  354. * a suffix to the VERSION_REQ message to request whether the host desires to
  355. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  356. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  357. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  358. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  359. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  360. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  361. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  362. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  363. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  364. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  365. * TLV.
  366. */
  367. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  368. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  369. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  370. };
  371. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  372. struct htt_option_tlv_header_t hdr;
  373. A_UINT16 hl_suppress_tx_compl_ind;/*HL_SUPPRESS_TX_COMPL_IND enum*/
  374. } POSTPACK;
  375. /*
  376. * HTT option TLV for specifying how many tx queue groups the target
  377. * may establish.
  378. * This TLV specifies the maximum value the target may send in the
  379. * txq_group_id field of any TXQ_GROUP information elements sent by
  380. * the target to the host. This allows the host to pre-allocate an
  381. * appropriate number of tx queue group structs.
  382. *
  383. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  384. * a suffix to the VERSION_REQ message to specify whether the host supports
  385. * tx queue groups at all, and if so if there is any limit on the number of
  386. * tx queue groups that the host supports.
  387. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  388. * a suffix to the VERSION_CONF message. If the host has specified in the
  389. * VER_REQ message a limit on the number of tx queue groups the host can
  390. * supprt, the target shall limit its specification of the maximum tx groups
  391. * to be no larger than this host-specified limit.
  392. *
  393. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  394. * shall preallocate 4 tx queue group structs, and the target shall not
  395. * specify a txq_group_id larger than 3.
  396. */
  397. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  398. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  399. /*
  400. * values 1 through N specify the max number of tx queue groups
  401. * the sender supports
  402. */
  403. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  404. };
  405. /* TEMPORARY backwards-compatibility alias for a typo fix -
  406. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  407. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  408. * to support the old name (with the typo) until all references to the
  409. * old name are replaced with the new name.
  410. */
  411. #define htt_option_tlv_mac_tx_queue_groups_t \
  412. htt_option_tlv_max_tx_queue_groups_t
  413. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  414. struct htt_option_tlv_header_t hdr;
  415. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  416. } POSTPACK;
  417. /*
  418. * HTT option TLV for specifying whether the target supports an extended
  419. * version of the HTT tx descriptor. If the target provides this TLV
  420. * and specifies in the TLV that the target supports an extended version
  421. * of the HTT tx descriptor, the target must check the "extension" bit in
  422. * the HTT tx descriptor, and if the extension bit is set, to expect a
  423. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  424. * descriptor. Furthermore, the target must provide room for the HTT
  425. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  426. * This option is intended for systems where the host needs to explicitly
  427. * control the transmission parameters such as tx power for individual
  428. * tx frames.
  429. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  430. * as a suffix to the VERSION_CONF message to explicitly specify whether
  431. * the target supports the HTT tx MSDU extension descriptor.
  432. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  433. * by the host as lack of target support for the HTT tx MSDU extension
  434. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  435. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  436. * the HTT tx MSDU extension descriptor.
  437. * The host is not required to provide the HTT tx MSDU extension descriptor
  438. * just because the target supports it; the target must check the
  439. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  440. * extension descriptor is present.
  441. */
  442. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  443. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  444. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  445. };
  446. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  447. struct htt_option_tlv_header_t hdr;
  448. A_UINT16 tx_msdu_desc_ext_support;/*SUPPORT_TX_MSDU_DESC_EXT enum*/
  449. } POSTPACK;
  450. /*=== host -> target messages ===============================================*/
  451. enum htt_h2t_msg_type {
  452. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  453. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  454. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  455. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  456. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  457. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  458. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  459. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  460. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  461. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  462. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /*per vdev amsdu subfrm limit*/
  463. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  464. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  465. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  466. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  467. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  468. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  469. /* keep this last */
  470. HTT_H2T_NUM_MSGS
  471. };
  472. /*
  473. * HTT host to target message type -
  474. * stored in bits 7:0 of the first word of the message
  475. */
  476. #define HTT_H2T_MSG_TYPE_M 0xff
  477. #define HTT_H2T_MSG_TYPE_S 0
  478. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  479. do { \
  480. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  481. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  482. } while (0)
  483. #define HTT_H2T_MSG_TYPE_GET(word) \
  484. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  485. /**
  486. * @brief host -> target version number request message definition
  487. *
  488. * |31 24|23 16|15 8|7 0|
  489. * |----------------+----------------+----------------+----------------|
  490. * | reserved | msg type |
  491. * |-------------------------------------------------------------------|
  492. * : option request TLV (optional) |
  493. * :...................................................................:
  494. *
  495. * The VER_REQ message may consist of a single 4-byte word, or may be
  496. * extended with TLVs that specify which HTT options the host is requesting
  497. * from the target.
  498. * The following option TLVs may be appended to the VER_REQ message:
  499. * - HL_SUPPRESS_TX_COMPL_IND
  500. * - HL_MAX_TX_QUEUE_GROUPS
  501. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  502. * may be appended to the VER_REQ message (but only one TLV of each type).
  503. *
  504. * Header fields:
  505. * - MSG_TYPE
  506. * Bits 7:0
  507. * Purpose: identifies this as a version number request message
  508. * Value: 0x0
  509. */
  510. #define HTT_VER_REQ_BYTES 4
  511. /* TBDXXX: figure out a reasonable number */
  512. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  513. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  514. /**
  515. * @brief HTT tx MSDU descriptor
  516. *
  517. * @details
  518. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  519. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  520. * the target firmware needs for the FW's tx processing, particularly
  521. * for creating the HW msdu descriptor.
  522. * The same HTT tx descriptor is used for HL and LL systems, though
  523. * a few fields within the tx descriptor are used only by LL or
  524. * only by HL.
  525. * The HTT tx descriptor is defined in two manners: by a struct with
  526. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  527. * definitions.
  528. * The target should use the struct def, for simplicitly and clarity,
  529. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  530. * neutral. Specifically, the host shall use the get/set macros built
  531. * around the mask + shift defs.
  532. */
  533. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  534. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  535. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  536. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  537. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  538. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  539. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  540. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  541. #define HTT_TX_VDEV_ID_WORD 0
  542. #define HTT_TX_VDEV_ID_MASK 0x3f
  543. #define HTT_TX_VDEV_ID_SHIFT 16
  544. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  545. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  546. #define HTT_TX_MSDU_LEN_DWORD 1
  547. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  548. /*
  549. * HTT_VAR_PADDR macros
  550. * Allow physical / bus addresses to be either a single 32-bit value,
  551. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  552. */
  553. /*
  554. * Note that in this macro A_UINT32 has been converted to
  555. * uint32_t only to address checkpath errors caused by declaring
  556. * var_name as A_UINT32.
  557. */
  558. #define HTT_VAR_PADDR32(var_name) uint32_t (var_name)
  559. #define HTT_VAR_PADDR64_LE(var_name) \
  560. struct { \
  561. /* little-endian: lo precedes hi */ \
  562. A_UINT32 lo; \
  563. A_UINT32 hi; \
  564. } var_name
  565. /*
  566. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  567. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  568. * addresses are stored in a XXX-bit field.
  569. * This macro is used to define both htt_tx_msdu_desc32_t and
  570. * htt_tx_msdu_desc64_t structs.
  571. */
  572. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  573. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  574. { \
  575. /* DWORD 0: flags and meta-data */ \
  576. A_UINT32 \
  577. msg_type:8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  578. \
  579. /* pkt_subtype - \
  580. * Detailed specification of the tx frame contents, extending the \
  581. * general specification provided by pkt_type. \
  582. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  583. *pkt_type | pkt_subtype \
  584. *============================================================== \
  585. *802.3 | bit 0:3 - Reserved \
  586. * | bit 4: 0x0 - Copy-Engine Classification Results \
  587. * | not appended to the HTT message \
  588. * | 0x1 - Copy-Engine Classification Results \
  589. * | appended to the HTT message in the \
  590. * | format: \
  591. * | [HTT tx desc, frame header, \
  592. * | CE classification results] \
  593. * | The CE classification results begin \
  594. * | at the next 4-byte boundary after \
  595. * | the frame header. \
  596. *------------+------------------------------------------------- \
  597. *Eth2 | bit 0:3 - Reserved \
  598. * | bit 4: 0x0 - Copy-Engine Classification Results \
  599. * | not appended to the HTT message \
  600. * | 0x1 - Copy-Engine Classification Results \
  601. * | appended to the HTT message. \
  602. * | See the above specification of the \
  603. * | CE classification results location. \
  604. *------------+------------------------------------------------- \
  605. *native WiFi | bit 0:3 - Reserved \
  606. * | bit 4: 0x0 - Copy-Engine Classification Results \
  607. * | not appended to the HTT message \
  608. * | 0x1 - Copy-Engine Classification Results \
  609. * | appended to the HTT message. \
  610. * | See the above specification of the \
  611. * | CE classification results location. \
  612. *------------+------------------------------------------------- \
  613. *mgmt | 0x0 - 802.11 MAC header absent \
  614. * | 0x1 - 802.11 MAC header present \
  615. *------------+------------------------------------------------- \
  616. *raw | bit 0: 0x0 - 802.11 MAC header absent \
  617. * | 0x1 - 802.11 MAC header present \
  618. * | bit 1: 0x0 - allow aggregation \
  619. * | 0x1 - don't allow aggregation \
  620. * | bit 2: 0x0 - perform encryption \
  621. * | 0x1 - don't perform encryption \
  622. * | bit 3: 0x0 - perform tx classification / queuing \
  623. * | 0x1 - don't perform tx classification; \
  624. * | insert the frame into the "misc" \
  625. * | tx queue \
  626. * | bit 4: 0x0 - Copy-Engine Classification Results \
  627. * | not appended to the HTT message \
  628. * | 0x1 - Copy-Engine Classification Results \
  629. * | appended to the HTT message. \
  630. * | See the above specification of the \
  631. * | CE classification results location. \
  632. */ \
  633. pkt_subtype:5, \
  634. \
  635. /* pkt_type - \
  636. * General specification of the tx frame contents. \
  637. * The htt_pkt_type enum should be used to specify \
  638. * and check the value of this field. \
  639. */ \
  640. pkt_type:3, \
  641. \
  642. /* vdev_id - \
  643. * ID for the vdev that is sending this tx frame. \
  644. * For certain non-standard packet types, e.g. pkt_type == raw \
  645. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  646. * This field is used primarily for determining where to queue \
  647. * broadcast and multicast frames. \
  648. */ \
  649. vdev_id:6, \
  650. /* ext_tid - \
  651. * The extended traffic ID. \
  652. * If the TID is unknown, the extended TID is set to \
  653. * HTT_TX_EXT_TID_INVALID. \
  654. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  655. * value of the QoS TID. \
  656. * If the tx frame is non-QoS data, then the extended TID is set to \
  657. * HTT_TX_EXT_TID_NON_QOS. \
  658. * If the tx frame is multicast or broadcast, then the extended TID \
  659. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  660. */ \
  661. ext_tid:5, \
  662. \
  663. /* postponed - \
  664. * This flag indicates whether the tx frame has been downloaded to \
  665. * the target before but discarded by the target, and now is being \
  666. * downloaded again; or if this is a new frame that is being \
  667. * downloaded for the first time. \
  668. * This flag allows the target to determine the correct order for \
  669. * transmitting new vs. old frames. \
  670. * value: 0 -> new frame, 1 -> re-send of a previously
  671. * sent frame \
  672. * This flag only applies to HL systems, since in LL systems, \
  673. * the tx flow control is handled entirely within the target. \
  674. */ \
  675. postponed:1, \
  676. \
  677. /* extension - \
  678. * This flag indicates whether a HTT tx MSDU extension descriptor\
  679. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor.\
  680. * \
  681. * 0x0 - no extension MSDU descriptor is present \
  682. * 0x1 - an extension MSDU descriptor immediately follows the \
  683. * regular MSDU descriptor \
  684. */ \
  685. extension:1, \
  686. \
  687. /* cksum_offload - \
  688. * This flag indicates whether checksum offload is enabled or not \
  689. * for this frame. Target FW use this flag to turn on HW checksumming \
  690. * 0x0 - No checksum offload \
  691. * 0x1 - L3 header checksum only \
  692. * 0x2 - L4 checksum only \
  693. * 0x3 - L3 header checksum + L4 checksum \
  694. */ \
  695. cksum_offload:2, \
  696. \
  697. /* tx_comp_req - \
  698. * This flag indicates whether Tx Completion \
  699. * from fw is required or not. \
  700. * This flag is only relevant if tx completion is not \
  701. * universally enabled. \
  702. * For all LL systems, tx completion is mandatory, \
  703. * so this flag will be irrelevant. \
  704. * For HL systems tx completion is optional, but HL systems in which \
  705. * the bus throughput exceeds the WLAN throughput will \
  706. * probably want to always use tx completion, and thus \
  707. * would not check this flag. \
  708. * This flag is required when tx completions are not used universally, \
  709. * but are still required for certain tx frames for which \
  710. * an OTA delivery acknowledgment is needed by the host. \
  711. * In practice, this would be for HL systems in which the \
  712. * bus throughput is less than the WLAN throughput. \
  713. * \
  714. * 0x0 - Tx Completion Indication from Fw not required \
  715. * 0x1 - Tx Completion Indication from Fw is required \
  716. */ \
  717. tx_compl_req:1; \
  718. \
  719. \
  720. /* DWORD 1: MSDU length and ID */ \
  721. A_UINT32 \
  722. len:16, /* MSDU length, in bytes */ \
  723. id:16; /* MSDU ID used to identify the MSDU to the host, \
  724. * and this id is used to calculate fragmentation \
  725. * descriptor pointer inside the target based on \
  726. * the base address, configured inside the target. \
  727. */ \
  728. \
  729. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  730. /* frags_desc_ptr - \
  731. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  732. * where the tx frame's fragments reside in memory. \
  733. * This field only applies to LL systems, since in HL systems the \
  734. * (degenerate single-fragment) fragmentation descriptor is created \
  735. * within the target. \
  736. */ \
  737. _paddr__frags_desc_ptr_; \
  738. \
  739. /* DWORD 3 (or 4): peerid, chanfreq */ \
  740. /* \
  741. * Peer ID : Target can use this value to know which peer-id packet \
  742. * destined to. \
  743. * It's intended to be specified by host in case of NAWDS. \
  744. */ \
  745. A_UINT16 peerid; \
  746. \
  747. /* \
  748. * Channel frequency: This identifies the desired channel \
  749. * frequency (in mhz) for tx frames. This is used by FW to help \
  750. * determine when it is safe to transmit or drop frames for \
  751. * off-channel operation. \
  752. * The default value of zero indicates to FW that the \
  753. * corresponding VDEV's home channel (if there is one) is \
  754. * the desired channel frequency. \
  755. */ \
  756. A_UINT16 chanfreq; \
  757. \
  758. /* Reason reserved is commented is increasing the htt
  759. * structure size leads to some wierd issues.
  760. * A_UINT32 reserved_dword3_bits0_31; \
  761. */ \
  762. } POSTPACK
  763. /* define a htt_tx_msdu_desc32_t type */
  764. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  765. /* define a htt_tx_msdu_desc64_t type */
  766. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  767. /*
  768. * Make htt_tx_msdu_desc_t be an alias for either
  769. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  770. */
  771. #if HTT_PADDR64
  772. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  773. #else
  774. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  775. #endif
  776. /* decriptor information for Management frame*/
  777. /*
  778. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  779. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  780. */
  781. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  782. extern A_UINT32 mgmt_hdr_len;
  783. PREPACK struct htt_mgmt_tx_desc_t {
  784. A_UINT32 msg_type;
  785. #if HTT_PADDR64
  786. A_UINT64 frag_paddr; /* DMAble address of the data */
  787. #else
  788. A_UINT32 frag_paddr; /* DMAble address of the data */
  789. #endif
  790. A_UINT32 desc_id; /* returned to host during completion
  791. * to free the meory*/
  792. A_UINT32 len; /* Fragment length */
  793. A_UINT32 vdev_id; /* virtual device ID */
  794. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  795. } POSTPACK;
  796. PREPACK struct htt_mgmt_tx_compl_ind {
  797. A_UINT32 desc_id;
  798. A_UINT32 status;
  799. } POSTPACK;
  800. /*
  801. * This SDU header size comes from the summation of the following:
  802. * 1. Max of:
  803. * a. Native WiFi header, for native WiFi frames: 24 bytes
  804. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  805. * b. 802.11 header, for raw frames: 36 bytes
  806. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  807. * QoS header, HT header)
  808. * c. 802.3 header, for ethernet frames: 14 bytes
  809. * (destination address, source address, ethertype / length)
  810. * 2. Max of:
  811. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  812. * b. IPv6 header, up through the Traffic Class: 2 bytes
  813. * 3. 802.1Q VLAN header: 4 bytes
  814. * 4. LLC/SNAP header: 8 bytes
  815. */
  816. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  817. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  818. #define HTT_TX_HDR_SIZE_ETHERNET 14
  819. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  820. A_COMPILE_TIME_ASSERT(htt_encap_hdr_size_max_check_nwifi,
  821. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >=
  822. HTT_TX_HDR_SIZE_NATIVE_WIFI);
  823. A_COMPILE_TIME_ASSERT(htt_encap_hdr_size_max_check_enet,
  824. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >=
  825. HTT_TX_HDR_SIZE_ETHERNET);
  826. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  827. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  828. #define HTT_TX_HDR_SIZE_802_1Q 4
  829. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  830. #define HTT_COMMON_TX_FRM_HDR_LEN \
  831. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  832. HTT_TX_HDR_SIZE_802_1Q + \
  833. HTT_TX_HDR_SIZE_LLC_SNAP)
  834. #define HTT_HL_TX_FRM_HDR_LEN \
  835. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  836. #define HTT_LL_TX_FRM_HDR_LEN \
  837. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  838. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  839. /* dword 0 */
  840. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  841. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  842. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  843. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  844. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  845. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  846. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  847. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  848. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  849. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  850. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  851. #define HTT_TX_DESC_PKT_TYPE_S 13
  852. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  853. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  854. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  855. #define HTT_TX_DESC_VDEV_ID_S 16
  856. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  857. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  858. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  859. #define HTT_TX_DESC_EXT_TID_S 22
  860. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  861. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  862. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  863. #define HTT_TX_DESC_POSTPONED_S 27
  864. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  865. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  866. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  867. #define HTT_TX_DESC_EXTENSION_S 28
  868. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  869. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  870. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  871. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  872. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  873. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  874. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  875. #define HTT_TX_DESC_TX_COMP_S 31
  876. /* dword 1 */
  877. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  878. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  879. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  880. #define HTT_TX_DESC_FRM_LEN_S 0
  881. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  882. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  883. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  884. #define HTT_TX_DESC_FRM_ID_S 16
  885. /* dword 2 */
  886. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  887. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  888. /* for systems using 64-bit format for bus addresses */
  889. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  890. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  891. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  892. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  893. /* for systems using 32-bit format for bus addresses */
  894. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  895. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  896. /* dword 3 */
  897. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  898. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  899. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  900. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  901. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  902. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  903. #if HTT_PADDR64
  904. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  905. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  906. #else
  907. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  908. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  909. #endif
  910. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  911. #define HTT_TX_DESC_PEER_ID_S 0
  912. /*
  913. * TEMPORARY:
  914. * The original definitions for the PEER_ID fields contained typos
  915. * (with _DESC_PADDR appended to this PEER_ID field name).
  916. * Retain deprecated original names for PEER_ID fields until all code that
  917. * refers to them has been updated.
  918. */
  919. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  920. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  921. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  922. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  923. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  924. HTT_TX_DESC_PEER_ID_M
  925. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  926. HTT_TX_DESC_PEER_ID_S
  927. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  928. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  929. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  930. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  931. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  932. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  933. #if HTT_PADDR64
  934. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  935. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  936. #else
  937. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  938. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  939. #endif
  940. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  941. #define HTT_TX_DESC_CHAN_FREQ_S 16
  942. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  943. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  944. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  945. do { \
  946. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  947. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  948. } while (0)
  949. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  950. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  951. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  952. do { \
  953. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  954. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  955. } while (0)
  956. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  957. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  958. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  959. do { \
  960. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  961. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  962. } while (0)
  963. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  964. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  965. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  966. do { \
  967. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  968. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  969. } while (0)
  970. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  971. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  972. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  973. do { \
  974. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  975. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  976. } while (0)
  977. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  978. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  979. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  980. do { \
  981. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  982. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  983. } while (0)
  984. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  985. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  986. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  987. do { \
  988. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  989. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  990. } while (0)
  991. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  992. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  993. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  994. do { \
  995. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  996. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  997. } while (0)
  998. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  999. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1000. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1001. do { \
  1002. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1003. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1004. } while (0)
  1005. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1006. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1007. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1008. do { \
  1009. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1010. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1011. } while (0)
  1012. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1013. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1014. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1015. do { \
  1016. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1017. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1018. } while (0)
  1019. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1020. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1021. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1022. do { \
  1023. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1024. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1025. } while (0)
  1026. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1027. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1028. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1029. do { \
  1030. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1031. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1032. } while (0)
  1033. /* enums used in the HTT tx MSDU extension descriptor */
  1034. enum {
  1035. htt_tx_guard_interval_regular = 0,
  1036. htt_tx_guard_interval_short = 1,
  1037. };
  1038. enum {
  1039. htt_tx_preamble_type_ofdm = 0,
  1040. htt_tx_preamble_type_cck = 1,
  1041. htt_tx_preamble_type_ht = 2,
  1042. htt_tx_preamble_type_vht = 3,
  1043. };
  1044. enum {
  1045. htt_tx_bandwidth_5MHz = 0,
  1046. htt_tx_bandwidth_10MHz = 1,
  1047. htt_tx_bandwidth_20MHz = 2,
  1048. htt_tx_bandwidth_40MHz = 3,
  1049. htt_tx_bandwidth_80MHz = 4,
  1050. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1051. };
  1052. /**
  1053. * @brief HTT tx MSDU extension descriptor
  1054. * @details
  1055. * If the target supports HTT tx MSDU extension descriptors, the host has
  1056. * the option of appending the following struct following the regular
  1057. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1058. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1059. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1060. * tx specs for each frame.
  1061. */
  1062. PREPACK struct htt_tx_msdu_desc_ext_t {
  1063. /* DWORD 0: flags */
  1064. A_UINT32 valid_pwr:1,/* bit 0:if set, tx pwr spec is valid */
  1065. valid_mcs_mask:1,/* bit 1:if set, tx MCS mask spec is valid */
  1066. valid_nss_mask:1,/* bit 2:if set, tx Nss mask spec is valid */
  1067. valid_guard_interval:1,/* bit 3:if set, tx guard intv spec is valid */
  1068. valid_preamble_type_mask:1,/* 4:if set, tx preamble mask is valid */
  1069. valid_chainmask:1,/* bit 5:if set, tx chainmask spec is valid */
  1070. valid_retries:1,/* bit 6:if set, tx retries spec is valid */
  1071. valid_bandwidth:1,/* bit 7:if set, tx bandwidth spec is valid */
  1072. valid_expire_tsf:1,/* bit 8:if set, tx expire TSF spec is valid */
  1073. is_dsrc:1, /* bit 9:if set, MSDU is a DSRC frame */
  1074. reserved0_31_7:22; /* bits 31:10 - unused, set to 0x0 */
  1075. /* DWORD 1:tx power, tx rate, tx BW */
  1076. A_UINT32
  1077. /* pwr -
  1078. * Specify what power the tx frame needs to be transmitted at.
  1079. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1080. * The value needs to be appropriately sign-extended when extracting
  1081. * the value from the message and storing it in a variable that is
  1082. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1083. * automatically handles this sign-extension.)
  1084. * If the transmission uses multiple tx chains, this power spec is
  1085. * the total transmit power, assuming incoherent combination of
  1086. * per-chain power to produce the total power.
  1087. */
  1088. pwr:8,
  1089. /* mcs_mask -
  1090. * Specify the allowable values for MCS index (modulation and coding)
  1091. * to use for transmitting the frame.
  1092. *
  1093. * For HT / VHT preamble types, this mask directly corresponds to
  1094. * the HT or VHT MCS indices that are allowed. For each bit N set
  1095. * within the mask, MCS index N is allowed for transmitting the frame.
  1096. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1097. * rates versus OFDM rates, so the host has the option of specifying
  1098. * that the target must transmit the frame with CCK or OFDM rates
  1099. * (not HT or VHT), but leaving the decision to the target whether
  1100. * to use CCK or OFDM.
  1101. *
  1102. * For CCK and OFDM, the bits within this mask are interpreted as
  1103. * follows:
  1104. * bit 0 -> CCK 1 Mbps rate is allowed
  1105. * bit 1 -> CCK 2 Mbps rate is allowed
  1106. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1107. * bit 3 -> CCK 11 Mbps rate is allowed
  1108. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1109. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1110. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1111. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1112. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1113. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1114. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1115. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1116. *
  1117. * The MCS index specification needs to be compatible with the
  1118. * bandwidth mask specification. For example, a MCS index == 9
  1119. * specification is inconsistent with a preamble type == VHT,
  1120. * Nss == 1, and channel bandwidth == 20 MHz.
  1121. *
  1122. * Furthermore, the host has only a limited ability to specify to
  1123. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1124. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1125. */
  1126. mcs_mask:12,
  1127. /* nss_mask -
  1128. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1129. * Each bit in this mask corresponds to a Nss value:
  1130. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1131. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1132. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1133. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1134. * The values in the Nss mask must be suitable for the recipient, e.g.
  1135. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1136. * recipient which only supports 2x2 MIMO.
  1137. */
  1138. nss_mask:4,
  1139. /* guard_interval -
  1140. * Specify a htt_tx_guard_interval enum value to indicate whether
  1141. * the transmission should use a regular guard interval or a
  1142. * short guard interval.
  1143. */
  1144. guard_interval:1,
  1145. /* preamble_type_mask -
  1146. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1147. * may choose from for transmitting this frame.
  1148. * The bits in this mask correspond to the values in the
  1149. * htt_tx_preamble_type enum. For example, to allow the target
  1150. * to transmit the frame as either CCK or OFDM, this field would
  1151. * be set to
  1152. * (1 << htt_tx_preamble_type_ofdm) |
  1153. * (1 << htt_tx_preamble_type_cck)
  1154. */
  1155. preamble_type_mask:4,
  1156. reserved1_31_29:3; /* unused, set to 0x0 */
  1157. /* DWORD 2: tx chain mask, tx retries */
  1158. A_UINT32
  1159. /* chain_mask - specify which chains to transmit from */
  1160. chain_mask:4,
  1161. /* retry_limit -
  1162. * Specify the maximum number of transmissions, including the
  1163. * initial transmission, to attempt before giving up if no ack
  1164. * is received.
  1165. * If the tx rate is specified, then all retries shall use the
  1166. * same rate as the initial transmission.
  1167. * If no tx rate is specified, the target can choose whether to
  1168. * retain the original rate during the retransmissions, or to
  1169. * fall back to a more robust rate.
  1170. */
  1171. retry_limit:4,
  1172. /* bandwidth_mask -
  1173. * Specify what channel widths may be used for the transmission.
  1174. * A value of zero indicates "don't care" - the target may choose
  1175. * the transmission bandwidth.
  1176. * The bits within this mask correspond to the htt_tx_bandwidth
  1177. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1178. * The bandwidth_mask must be consistent with the
  1179. * preamble_type_mask * and mcs_mask specs, if they are
  1180. * provided. For example,
  1181. * 80 MHz and 160 MHz can only be enabled in the mask
  1182. * if preamble_type == VHT.
  1183. */
  1184. bandwidth_mask:6,
  1185. reserved2_31_14:18; /* unused, set to 0x0 */
  1186. /* DWORD 3: tx expiry time (TSF) LSBs */
  1187. A_UINT32 expire_tsf_lo;
  1188. /* DWORD 4: tx expiry time (TSF) MSBs */
  1189. A_UINT32 expire_tsf_hi;
  1190. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1191. } POSTPACK;
  1192. /* DWORD 0 */
  1193. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1194. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1195. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1196. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1197. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1198. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1199. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1200. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1201. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1202. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1203. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1204. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1205. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1206. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1207. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1208. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1209. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1210. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1211. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1213. /* DWORD 1 */
  1214. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1215. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1216. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1217. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1218. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1219. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1220. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1221. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1222. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1223. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1224. /* DWORD 2 */
  1225. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1226. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1227. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1228. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1229. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1230. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1231. /* DWORD 0 */
  1232. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1233. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1234. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1235. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1236. do { \
  1237. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1238. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1239. } while (0)
  1240. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1241. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1242. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1243. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1244. do { \
  1245. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1246. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1247. } while (0)
  1248. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1249. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1250. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1251. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1252. do { \
  1253. HTT_CHECK_SET_VAL( \
  1254. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1255. ((_var) |= ((_val) \
  1256. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1257. } while (0)
  1258. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1259. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >>\
  1260. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1261. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1262. do { \
  1263. HTT_CHECK_SET_VAL( \
  1264. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1265. ((_var) |= ((_val) \
  1266. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1267. } while (0)
  1268. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1269. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1270. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1271. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1272. do { \
  1273. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1274. ((_var) |= ((_val) << \
  1275. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1276. } while (0)
  1277. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1278. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1279. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1280. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1281. do { \
  1282. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1283. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1284. } while (0)
  1285. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1286. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1287. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1288. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1289. do { \
  1290. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1291. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1292. } while (0)
  1293. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1294. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1295. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1296. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1297. do { \
  1298. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1299. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1300. } while (0)
  1301. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1302. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1303. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1304. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1305. do { \
  1306. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1307. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1308. } while (0)
  1309. /* DWORD 1 */
  1310. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1311. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1312. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1313. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1314. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1315. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1316. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1317. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1318. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1319. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1320. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1321. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1322. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1323. do { \
  1324. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1325. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1326. } while (0)
  1327. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1328. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1329. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1330. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1331. do { \
  1332. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1333. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1334. } while (0)
  1335. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1336. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1337. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1338. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1339. do { \
  1340. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1341. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1342. } while (0)
  1343. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1344. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1345. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1346. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1347. do { \
  1348. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK,\
  1349. _val); \
  1350. ((_var) |= ((_val) << \
  1351. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1352. } while (0)
  1353. /* DWORD 2 */
  1354. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1355. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1356. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1357. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1358. do { \
  1359. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1360. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1361. } while (0)
  1362. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1363. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1364. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1365. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1366. do { \
  1367. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1368. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1369. } while (0)
  1370. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1371. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1372. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1373. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1374. do { \
  1375. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1376. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1377. } while (0)
  1378. typedef enum {
  1379. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1380. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1381. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1382. } htt_11ax_ltf_subtype_t;
  1383. typedef enum {
  1384. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1385. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1386. HTT_TX_MSDU_EXT2_DESC_PREAM_HT,
  1387. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1388. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1389. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1390. } htt_tx_ext2_preamble_type_t;
  1391. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1392. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1393. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1394. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1395. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1396. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1397. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1398. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1399. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1400. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1401. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1402. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1403. /**
  1404. * @brief HTT tx MSDU extension descriptor v2
  1405. * @details
  1406. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1407. * is received as tcl_exit_base->host_meta_info in firmware.
  1408. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1409. * are already part of tcl_exit_base.
  1410. */
  1411. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1412. /* DWORD 0: flags */
  1413. A_UINT32
  1414. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1415. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1416. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1417. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1418. valid_retries : 1, /* if set, tx retries spec is valid */
  1419. /* if set, tx dyn_bw and bw_mask are valid */
  1420. valid_bw_info : 1,
  1421. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1422. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1423. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1424. valid_key_flags : 1, /* if set, key flags is valid */
  1425. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1426. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1427. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1428. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1429. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1430. * 1 = ENCRYPT,
  1431. * 2 ~ 3 - Reserved
  1432. */
  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. /* 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. ltf_subtype_11ax : 2,
  1453. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1454. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1455. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1456. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1457. */
  1458. reserved0_31 : 1;
  1459. /* DWORD 1: tx power, tx rate */
  1460. A_UINT32
  1461. /* unit of the power field is 0.5 dbm
  1462. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1463. * signed value ranging from -64dbm to 63.5 dbm
  1464. */
  1465. power : 8,
  1466. /* mcs bit mask of 0 ~ 11
  1467. * Setting more than one MCS isn't currently
  1468. * supported by the target (but is supported
  1469. * in the interface in case in the future
  1470. * the target supports specifications of
  1471. * a limited set of MCS values.
  1472. */
  1473. mcs_mask : 12,
  1474. /* Nss bit mask 0 ~ 7
  1475. * Setting more than one Nss isn't currently
  1476. * supported by the target (but is supported
  1477. * in the interface in case in the future
  1478. * the target supports specifications of
  1479. * a limited set of Nss values.
  1480. */
  1481. nss_mask : 8,
  1482. /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1483. pream_type : 3,
  1484. reserved1_31 : 1;
  1485. /* DWORD 2: tx chain mask, tx retries */
  1486. A_UINT32
  1487. /* chain_mask - specify which chains to transmit from */
  1488. chain_mask : 8,
  1489. /* Key Index and related flags - used in mesh mode
  1490. * TODO: Update Enum values for key_flags
  1491. */
  1492. key_flags : 8,
  1493. /*
  1494. * Channel frequency: This identifies the desired channel
  1495. * frequency (in MHz) for tx frames. This is used by FW to help
  1496. * determine when it is safe to transmit or drop frames for
  1497. * off-channel operation.
  1498. * The default value of zero indicates to FW that the corresponding
  1499. * VDEV's home channel (if there is one) is the desired channel
  1500. * frequency.
  1501. */
  1502. chanfreq : 16;
  1503. /* DWORD 3: tx expiry time (TSF) LSBs */
  1504. A_UINT32 expire_tsf_lo;
  1505. /* DWORD 4: tx expiry time (TSF) MSBs */
  1506. A_UINT32 expire_tsf_hi;
  1507. } POSTPACK;
  1508. /* DWORD 0 */
  1509. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1510. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1511. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1512. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1513. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1514. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1515. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1516. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1517. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1518. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1519. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1520. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1521. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1522. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1523. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1524. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1525. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1526. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1527. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1528. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1529. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1530. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1531. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1532. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1533. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1534. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1535. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1536. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1537. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1538. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1539. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1540. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1541. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1542. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1543. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1544. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1545. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1546. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1547. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1548. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1549. /* DWORD 1 */
  1550. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1551. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1552. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1553. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1554. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1555. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1556. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1557. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1558. /* DWORD 2 */
  1559. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1560. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1561. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1562. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1563. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1564. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1565. /* DWORD 0 */
  1566. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1567. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1568. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1569. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1570. do { \
  1571. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1572. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S));\
  1573. } while (0)
  1574. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1575. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1576. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1577. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1578. do { \
  1579. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK,\
  1580. _val); \
  1581. ((_var) |= \
  1582. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1583. } while (0)
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1585. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1586. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1587. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1588. do { \
  1589. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK,\
  1590. _val); \
  1591. ((_var) |= \
  1592. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1593. } while (0)
  1594. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1595. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1596. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1597. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1598. do { \
  1599. HTT_CHECK_SET_VAL( \
  1600. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1601. ((_var) |= ((_val) \
  1602. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1603. } while (0)
  1604. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1605. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1606. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1607. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1608. do { \
  1609. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES,\
  1610. _val); \
  1611. ((_var) |= ((_val) << \
  1612. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1613. } while (0)
  1614. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1615. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1616. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1617. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1618. do { \
  1619. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO,\
  1620. _val); \
  1621. ((_var) |= \
  1622. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1623. } while (0)
  1624. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1625. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >>\
  1626. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1627. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1628. do { \
  1629. HTT_CHECK_SET_VAL( \
  1630. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1631. ((_var) |= ((_val) \
  1632. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1633. } while (0)
  1634. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1635. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1636. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1637. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1638. do { \
  1639. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK,\
  1640. _val); \
  1641. ((_var) |= \
  1642. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1643. } while (0)
  1644. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1645. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1646. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1647. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1648. do { \
  1649. HTT_CHECK_SET_VAL( \
  1650. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1651. ((_var) |= \
  1652. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1653. } while (0)
  1654. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1655. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1656. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1657. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1658. do { \
  1659. HTT_CHECK_SET_VAL( \
  1660. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1661. ((_var) |= \
  1662. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1663. } while (0)
  1664. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1665. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1666. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1667. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1668. do { \
  1669. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME,\
  1670. _val); \
  1671. ((_var) |= ((_val) << \
  1672. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1673. } while (0)
  1674. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1675. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1676. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1677. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1678. do { \
  1679. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ,\
  1680. _val); \
  1681. ((_var) |= ((_val) << \
  1682. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S));\
  1683. } while (0)
  1684. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1685. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1686. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1687. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1688. do { \
  1689. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val);\
  1690. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S));\
  1691. } while (0)
  1692. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1693. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1694. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1695. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1696. do { \
  1697. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val);\
  1698. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S));\
  1699. } while (0)
  1700. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1701. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1702. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1703. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1704. do { \
  1705. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val);\
  1706. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S));\
  1707. } while (0)
  1708. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1709. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1710. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1711. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1712. do { \
  1713. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val);\
  1714. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S));\
  1715. } while (0)
  1716. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1717. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1718. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1719. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1720. do { \
  1721. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val);\
  1722. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S));\
  1723. } while (0)
  1724. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1725. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1726. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1727. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1728. do { \
  1729. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX,\
  1730. _val); \
  1731. ((_var) |= ((_val) << \
  1732. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1733. } while (0)
  1734. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1735. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1736. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1737. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1738. do { \
  1739. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1740. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S));\
  1741. } while (0)
  1742. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1743. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1744. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1745. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1746. do { \
  1747. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val);\
  1748. ((_var) |= ((_val) << \
  1749. 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. /* DWORD 2 */
  1786. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1787. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1788. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1789. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1790. do { \
  1791. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val);\
  1792. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S));\
  1793. } while (0)
  1794. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1795. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1796. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1797. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1798. do { \
  1799. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val);\
  1800. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S));\
  1801. } while (0)
  1802. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1803. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1804. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1805. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1806. do { \
  1807. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val);\
  1808. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S));\
  1809. } while (0)
  1810. typedef enum {
  1811. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1812. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1813. } htt_tcl_metadata_type;
  1814. /**
  1815. * @brief HTT TCL command number format
  1816. * @details
  1817. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1818. * available to firmware as tcl_exit_base->tcl_status_number.
  1819. * For regular / multicast packets host will send vdev and mac id and for
  1820. * NAWDS packets, host will send peer id.
  1821. * A_UINT32 is used to avoid endianness conversion problems.
  1822. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1823. */
  1824. typedef struct {
  1825. A_UINT32
  1826. type: 1, /* vdev_id based or peer_id based */
  1827. rsvd: 31;
  1828. } htt_tx_tcl_vdev_or_peer_t;
  1829. typedef struct {
  1830. A_UINT32
  1831. type: 1, /* vdev_id based or peer_id based */
  1832. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1833. vdev_id: 8,
  1834. pdev_id: 2,
  1835. host_inspected:1,
  1836. rsvd: 19;
  1837. } htt_tx_tcl_vdev_metadata;
  1838. typedef struct {
  1839. A_UINT32
  1840. type: 1, /* vdev_id based or peer_id based */
  1841. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1842. peer_id: 14,
  1843. rsvd: 16;
  1844. } htt_tx_tcl_peer_metadata;
  1845. PREPACK struct htt_tx_tcl_metadata {
  1846. union {
  1847. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1848. htt_tx_tcl_vdev_metadata vdev_meta;
  1849. htt_tx_tcl_peer_metadata peer_meta;
  1850. };
  1851. } POSTPACK;
  1852. /* DWORD 0 */
  1853. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1854. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1855. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1856. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1857. /* VDEV metadata */
  1858. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1859. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1860. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1861. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1862. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1863. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1864. /* PEER metadata */
  1865. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1866. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1867. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1868. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1869. HTT_TX_TCL_METADATA_TYPE_S)
  1870. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1871. do { \
  1872. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val);\
  1873. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S));\
  1874. } while (0)
  1875. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1876. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1877. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1878. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1879. do { \
  1880. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val);\
  1881. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S));\
  1882. } while (0)
  1883. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1884. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1885. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1886. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1887. do { \
  1888. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val);\
  1889. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S));\
  1890. } while (0)
  1891. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1892. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1893. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1894. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1895. do { \
  1896. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val);\
  1897. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S));\
  1898. } while (0)
  1899. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1900. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1901. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1902. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1903. do { \
  1904. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED,\
  1905. _val); \
  1906. ((_var) |= ((_val) <<\
  1907. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1908. } while (0)
  1909. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1910. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1911. HTT_TX_TCL_METADATA_PEER_ID_S)
  1912. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1913. do { \
  1914. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val);\
  1915. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S));\
  1916. } while (0)
  1917. typedef enum {
  1918. HTT_TX_FW2WBM_TX_STATUS_OK,
  1919. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1920. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1921. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1922. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1923. HTT_TX_FW2WBM_TX_STATUS_MAX
  1924. } htt_tx_fw2wbm_tx_status_t;
  1925. typedef enum {
  1926. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1927. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1928. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1929. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1930. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1931. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1932. } htt_tx_fw2wbm_reinject_reason_t;
  1933. /**
  1934. * @brief HTT TX WBM Completion from firmware to host
  1935. * @details
  1936. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1937. * DWORD 3 and 4 for software based completions (Exception frames and
  1938. * TQM bypass frames)
  1939. * For software based completions, wbm_release_ring->release_source_module will
  1940. * be set to release_source_fw
  1941. */
  1942. PREPACK struct htt_tx_wbm_completion {
  1943. A_UINT32
  1944. sch_cmd_id: 24,
  1945. /* If set, this packet was queued via exception path */
  1946. exception_frame: 1,
  1947. rsvd0_31_25: 7;
  1948. A_UINT32
  1949. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1950. * reception of an ACK or BA, this field indicates
  1951. * the RSSI of the received ACK or BA frame.
  1952. * When the frame is removed as result of a direct
  1953. * remove command from the SW, this field is set
  1954. * to 0x0 (which is never a valid value when real
  1955. * RSSI is available).
  1956. * Units: dB w.r.t noise floor
  1957. */
  1958. /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1959. tx_status: 4,
  1960. /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1961. reinject_reason: 4,
  1962. rsvd1_31_16: 16;
  1963. } POSTPACK;
  1964. /* DWORD 0 */
  1965. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1966. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1967. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1968. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1969. /* DWORD 1 */
  1970. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1971. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1972. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1973. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1974. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1975. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  1976. /* DWORD 0 */
  1977. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  1978. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  1979. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  1980. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  1981. do { \
  1982. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val);\
  1983. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S));\
  1984. } while (0)
  1985. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  1986. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  1987. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  1988. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  1989. do { \
  1990. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val);\
  1991. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S));\
  1992. } while (0)
  1993. /* DWORD 1 */
  1994. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  1995. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  1996. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  1997. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  1998. do { \
  1999. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val);\
  2000. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S));\
  2001. } while (0)
  2002. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2003. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2004. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2005. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2006. do { \
  2007. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val);\
  2008. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S));\
  2009. } while (0)
  2010. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2011. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2012. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2013. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2014. do { \
  2015. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val);\
  2016. ((_var) |= ((_val) << \
  2017. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2018. } while (0)
  2019. typedef enum {
  2020. TX_FLOW_PRIORITY_BE,
  2021. TX_FLOW_PRIORITY_HIGH,
  2022. TX_FLOW_PRIORITY_LOW,
  2023. } htt_tx_flow_priority_t;
  2024. typedef enum {
  2025. TX_FLOW_LATENCY_SENSITIVE,
  2026. TX_FLOW_LATENCY_INSENSITIVE,
  2027. } htt_tx_flow_latency_t;
  2028. typedef enum {
  2029. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2030. TX_FLOW_INTERACTIVE_TRAFFIC,
  2031. TX_FLOW_PERIODIC_TRAFFIC,
  2032. TX_FLOW_BURSTY_TRAFFIC,
  2033. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2034. } htt_tx_flow_traffic_pattern_t;
  2035. /**
  2036. * @brief HTT TX Flow search metadata format
  2037. * @details
  2038. * Host will set this metadata in flow table's flow search entry along with
  2039. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2040. * firmware and TQM ring if the flow search entry wins.
  2041. * This metadata is available to firmware in that first MSDU's
  2042. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2043. * to one of the available flows for specific tid and returns the tqm flow
  2044. * pointer as part of htt_tx_map_flow_info message.
  2045. */
  2046. PREPACK struct htt_tx_flow_metadata {
  2047. A_UINT32
  2048. rsvd0_1_0: 2,
  2049. tid: 4,
  2050. /* Takes enum values of htt_tx_flow_priority_t */
  2051. priority: 3,
  2052. /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2053. traffic_pattern: 3,
  2054. /* If set, tid field in this struct is the final tid.
  2055. * Else choose final tid based on latency, priority.
  2056. */
  2057. tid_override: 1,
  2058. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2059. /* Takes enum values of htt_tx_flow_latency_t */
  2060. latency_sensitive: 2,
  2061. /* Used by host to map flow metadata with flow entry */
  2062. host_flow_identifier: 16;
  2063. } POSTPACK;
  2064. /* DWORD 0 */
  2065. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2066. #define HTT_TX_FLOW_METADATA_TID_S 2
  2067. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2068. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2069. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2070. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2071. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2072. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2073. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2074. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2075. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2076. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2077. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2078. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2079. /* DWORD 0 */
  2080. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2081. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2082. HTT_TX_FLOW_METADATA_TID_S)
  2083. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2084. do { \
  2085. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2086. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2087. } while (0)
  2088. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2089. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2090. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2091. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2092. do { \
  2093. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2094. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S));\
  2095. } while (0)
  2096. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2097. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2098. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2099. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2100. do { \
  2101. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val);\
  2102. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S));\
  2103. } while (0)
  2104. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2105. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2106. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2107. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2108. do { \
  2109. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val);\
  2110. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S));\
  2111. } while (0)
  2112. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2113. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2114. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2115. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2116. do { \
  2117. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val);\
  2118. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S));\
  2119. } while (0)
  2120. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2121. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2122. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2123. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2124. do { \
  2125. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2126. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S));\
  2127. } while (0)
  2128. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2129. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2130. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2131. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2132. do { \
  2133. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val);\
  2134. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S));\
  2135. } while (0)
  2136. /**
  2137. * @brief for HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and
  2138. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2139. *
  2140. * @details
  2141. * HTT wds entry from source port learning
  2142. * Host will learn wds entries from rx and send this message to firmware
  2143. * to enable firmware to configure/delete AST entries for wds clients.
  2144. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2145. * and when SA's entry is deleted, firmware removes this AST entry
  2146. *
  2147. * The message would appear as follows:
  2148. *
  2149. * |31 30|29 |17 16|15 8|7 0|
  2150. * |----------------+----------------+----------------+----------------|
  2151. * | rsvd0 |PDVID| vdev_id | msg_type |
  2152. * |-------------------------------------------------------------------|
  2153. * | sa_addr_31_0 |
  2154. * |-------------------------------------------------------------------|
  2155. * | | ta_peer_id | sa_addr_47_32 |
  2156. * |-------------------------------------------------------------------|
  2157. * Where PDVID = pdev_id
  2158. *
  2159. * The message is interpreted as follows:
  2160. *
  2161. * dword0 - b'0:7 - msg_type: This will be set to
  2162. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2163. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2164. *
  2165. * dword0 - b'8:15 - vdev_id
  2166. *
  2167. * dword0 - b'16:17 - pdev_id
  2168. *
  2169. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2170. *
  2171. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2172. *
  2173. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2174. *
  2175. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2176. */
  2177. PREPACK struct htt_wds_entry {
  2178. A_UINT32
  2179. msg_type: 8,
  2180. vdev_id: 8,
  2181. pdev_id: 2,
  2182. rsvd0: 14;
  2183. A_UINT32 sa_addr_31_0;
  2184. A_UINT32
  2185. sa_addr_47_32: 16,
  2186. ta_peer_id: 14,
  2187. rsvd2: 2;
  2188. } POSTPACK;
  2189. /* DWORD 0 */
  2190. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2191. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2192. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2193. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2194. /* DWORD 2 */
  2195. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2196. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2197. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2198. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2199. /* DWORD 0 */
  2200. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2201. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2202. HTT_WDS_ENTRY_VDEV_ID_S)
  2203. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2204. do { \
  2205. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2206. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2207. } while (0)
  2208. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2209. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2210. HTT_WDS_ENTRY_PDEV_ID_S)
  2211. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2212. do { \
  2213. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2214. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2215. } while (0)
  2216. /* DWORD 2 */
  2217. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2218. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2219. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2220. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2221. do { \
  2222. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2223. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2224. } while (0)
  2225. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2226. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2227. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2228. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2229. do { \
  2230. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2231. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2232. } while (0)
  2233. /**
  2234. * @brief MAC DMA rx ring setup specification
  2235. * @details
  2236. * To allow for dynamic rx ring reconfiguration and to avoid race
  2237. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2238. * it uses. Instead, it sends this message to the target, indicating how
  2239. * the rx ring used by the host should be set up and maintained.
  2240. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2241. * specifications.
  2242. *
  2243. * |31 16|15 8|7 0|
  2244. * |---------------------------------------------------------------|
  2245. * header: | reserved | num rings | msg type |
  2246. * |---------------------------------------------------------------|
  2247. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2248. #if HTT_PADDR64
  2249. * | FW_IDX shadow register physical address (bits 63:32) |
  2250. #endif
  2251. * |---------------------------------------------------------------|
  2252. * | rx ring base physical address (bits 31:0) |
  2253. #if HTT_PADDR64
  2254. * | rx ring base physical address (bits 63:32) |
  2255. #endif
  2256. * |---------------------------------------------------------------|
  2257. * | rx ring buffer size | rx ring length |
  2258. * |---------------------------------------------------------------|
  2259. * | FW_IDX initial value | enabled flags |
  2260. * |---------------------------------------------------------------|
  2261. * | MSDU payload offset | 802.11 header offset |
  2262. * |---------------------------------------------------------------|
  2263. * | PPDU end offset | PPDU start offset |
  2264. * |---------------------------------------------------------------|
  2265. * | MPDU end offset | MPDU start offset |
  2266. * |---------------------------------------------------------------|
  2267. * | MSDU end offset | MSDU start offset |
  2268. * |---------------------------------------------------------------|
  2269. * | frag info offset | rx attention offset |
  2270. * |---------------------------------------------------------------|
  2271. * payload 2, if present, has the same format as payload 1
  2272. * Header fields:
  2273. * - MSG_TYPE
  2274. * Bits 7:0
  2275. * Purpose: identifies this as an rx ring configuration message
  2276. * Value: 0x2
  2277. * - NUM_RINGS
  2278. * Bits 15:8
  2279. * Purpose: indicates whether the host is setting up one rx ring or two
  2280. * Value: 1 or 2
  2281. * Payload:
  2282. * for systems using 64-bit format for bus addresses:
  2283. * - IDX_SHADOW_REG_PADDR_LO
  2284. * Bits 31:0
  2285. * Value: lower 4 bytes of physical address of the host's
  2286. * FW_IDX shadow register
  2287. * - IDX_SHADOW_REG_PADDR_HI
  2288. * Bits 31:0
  2289. * Value: upper 4 bytes of physical address of the host's
  2290. * FW_IDX shadow register
  2291. * - RING_BASE_PADDR_LO
  2292. * Bits 31:0
  2293. * Value: lower 4 bytes of physical address of the host's rx ring
  2294. * - RING_BASE_PADDR_HI
  2295. * Bits 31:0
  2296. * Value: uppper 4 bytes of physical address of the host's rx ring
  2297. * for systems using 32-bit format for bus addresses:
  2298. * - IDX_SHADOW_REG_PADDR
  2299. * Bits 31:0
  2300. * Value: physical address of the host's FW_IDX shadow register
  2301. * - RING_BASE_PADDR
  2302. * Bits 31:0
  2303. * Value: physical address of the host's rx ring
  2304. * - RING_LEN
  2305. * Bits 15:0
  2306. * Value: number of elements in the rx ring
  2307. * - RING_BUF_SZ
  2308. * Bits 31:16
  2309. * Value: size of the buffers referenced by the rx ring, in byte units
  2310. * - ENABLED_FLAGS
  2311. * Bits 15:0
  2312. * Value: 1-bit flags to show whether different rx fields are enabled
  2313. * bit 0: 802.11 header enabled (1) or disabled (0)
  2314. * bit 1: MSDU payload enabled (1) or disabled (0)
  2315. * bit 2: PPDU start enabled (1) or disabled (0)
  2316. * bit 3: PPDU end enabled (1) or disabled (0)
  2317. * bit 4: MPDU start enabled (1) or disabled (0)
  2318. * bit 5: MPDU end enabled (1) or disabled (0)
  2319. * bit 6: MSDU start enabled (1) or disabled (0)
  2320. * bit 7: MSDU end enabled (1) or disabled (0)
  2321. * bit 8: rx attention enabled (1) or disabled (0)
  2322. * bit 9: frag info enabled (1) or disabled (0)
  2323. * bit 10: unicast rx enabled (1) or disabled (0)
  2324. * bit 11: multicast rx enabled (1) or disabled (0)
  2325. * bit 12: ctrl rx enabled (1) or disabled (0)
  2326. * bit 13: mgmt rx enabled (1) or disabled (0)
  2327. * bit 14: null rx enabled (1) or disabled (0)
  2328. * bit 15: phy data rx enabled (1) or disabled (0)
  2329. * - IDX_INIT_VAL
  2330. * Bits 31:16
  2331. * Purpose: Specify the initial value for the FW_IDX.
  2332. * Value: the number of buffers initially present in the host's rx ring
  2333. * - OFFSET_802_11_HDR
  2334. * Bits 15:0
  2335. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2336. * - OFFSET_MSDU_PAYLOAD
  2337. * Bits 31:16
  2338. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2339. * - OFFSET_PPDU_START
  2340. * Bits 15:0
  2341. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2342. * - OFFSET_PPDU_END
  2343. * Bits 31:16
  2344. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2345. * - OFFSET_MPDU_START
  2346. * Bits 15:0
  2347. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2348. * - OFFSET_MPDU_END
  2349. * Bits 31:16
  2350. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2351. * - OFFSET_MSDU_START
  2352. * Bits 15:0
  2353. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2354. * - OFFSET_MSDU_END
  2355. * Bits 31:16
  2356. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2357. * - OFFSET_RX_ATTN
  2358. * Bits 15:0
  2359. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2360. * - OFFSET_FRAG_INFO
  2361. * Bits 31:16
  2362. * Value: offset in QUAD-bytes of frag info table
  2363. */
  2364. /* header fields */
  2365. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2366. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2367. /* payload fields */
  2368. /* for systems using a 64-bit format for bus addresses */
  2369. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2370. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2371. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2372. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2373. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2374. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2375. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2376. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2377. /* for systems using a 32-bit format for bus addresses */
  2378. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2379. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2380. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2381. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2382. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2383. #define HTT_RX_RING_CFG_LEN_S 0
  2384. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2385. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2386. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2387. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2388. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2389. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2390. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2391. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2392. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2393. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2394. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2395. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2396. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2397. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2398. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2399. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2400. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2401. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2402. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2403. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2404. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2405. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2406. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2407. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2408. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2409. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2410. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2411. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2412. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2413. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2414. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2415. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2416. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2417. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2418. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2419. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2420. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2421. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2422. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2423. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2424. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2425. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2426. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2427. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2428. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2429. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2430. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2431. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2432. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2433. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2434. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2435. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2436. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2437. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2438. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2439. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2440. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2441. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2442. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2443. #if HTT_PADDR64
  2444. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2445. #else
  2446. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2447. #endif
  2448. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2449. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2450. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2451. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2452. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2453. do { \
  2454. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2455. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2456. } while (0)
  2457. /* degenerate case for 32-bit fields */
  2458. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2459. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2460. ((_var) = (_val))
  2461. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2462. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2463. ((_var) = (_val))
  2464. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2465. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2466. ((_var) = (_val))
  2467. /* degenerate case for 32-bit fields */
  2468. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2469. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) ((_var) = (_val))
  2470. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2471. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) ((_var) = (_val))
  2472. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2473. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) ((_var) = (_val))
  2474. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2475. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2476. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2477. do { \
  2478. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2479. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2480. } while (0)
  2481. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2482. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2483. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2484. do { \
  2485. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2486. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2487. } while (0)
  2488. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2489. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2490. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2491. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2492. do { \
  2493. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2494. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2495. } while (0)
  2496. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2497. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2498. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2499. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2500. do { \
  2501. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2502. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2503. } while (0)
  2504. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2505. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2506. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2507. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2508. do { \
  2509. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2510. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2511. } while (0)
  2512. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2513. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2514. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2515. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2516. do { \
  2517. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2518. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2519. } while (0)
  2520. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2521. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2522. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2523. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2524. do { \
  2525. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2526. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2527. } while (0)
  2528. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2529. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2530. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2531. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2532. do { \
  2533. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2534. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2535. } while (0)
  2536. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2537. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2538. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2539. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2540. do { \
  2541. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2542. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2543. } while (0)
  2544. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2545. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2546. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2547. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2548. do { \
  2549. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2550. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2551. } while (0)
  2552. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2553. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2554. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2555. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2556. do { \
  2557. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2558. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2559. } while (0)
  2560. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2561. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2562. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2563. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2564. do { \
  2565. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2566. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2567. } while (0)
  2568. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2569. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2570. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2571. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2572. do { \
  2573. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2574. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2575. } while (0)
  2576. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2577. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2578. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2579. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2580. do { \
  2581. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2582. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2583. } while (0)
  2584. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2585. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2586. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2587. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2588. do { \
  2589. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2590. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2591. } while (0)
  2592. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2593. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2594. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2595. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2596. do { \
  2597. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2598. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2599. } while (0)
  2600. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2601. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2602. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2603. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2604. do { \
  2605. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2606. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2607. } while (0)
  2608. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2609. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2610. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2611. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2612. do { \
  2613. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2614. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2615. } while (0)
  2616. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2617. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2618. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2619. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2620. do { \
  2621. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2622. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2623. } while (0)
  2624. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2625. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2626. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2627. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2628. do { \
  2629. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2630. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2631. } while (0)
  2632. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2633. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2634. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2635. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2636. do { \
  2637. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2638. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2639. } while (0)
  2640. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2641. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2642. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2643. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2644. do { \
  2645. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2646. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2647. } while (0)
  2648. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2649. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2650. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2651. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2652. do { \
  2653. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2654. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2655. } while (0)
  2656. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2657. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2658. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2659. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2660. do { \
  2661. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2662. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2663. } while (0)
  2664. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2665. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2666. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2667. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2668. do { \
  2669. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2670. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2671. } while (0)
  2672. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2673. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2674. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2675. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2676. do { \
  2677. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2678. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2679. } while (0)
  2680. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2681. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2682. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2683. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2684. do { \
  2685. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2686. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2687. } while (0)
  2688. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2689. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2690. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2691. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2692. do { \
  2693. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2694. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2695. } while (0)
  2696. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2697. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2698. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2699. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2700. do { \
  2701. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2702. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2703. } while (0)
  2704. /**
  2705. * @brief host -> target FW statistics retrieve
  2706. *
  2707. * @details
  2708. * The following field definitions describe the format of the HTT host
  2709. * to target FW stats retrieve message. The message specifies the type of
  2710. * stats host wants to retrieve.
  2711. *
  2712. * |31 24|23 16|15 8|7 0|
  2713. * |-----------------------------------------------------------|
  2714. * | stats types request bitmask | msg type |
  2715. * |-----------------------------------------------------------|
  2716. * | stats types reset bitmask | reserved |
  2717. * |-----------------------------------------------------------|
  2718. * | stats type | config value |
  2719. * |-----------------------------------------------------------|
  2720. * | cookie LSBs |
  2721. * |-----------------------------------------------------------|
  2722. * | cookie MSBs |
  2723. * |-----------------------------------------------------------|
  2724. * Header fields:
  2725. * - MSG_TYPE
  2726. * Bits 7:0
  2727. * Purpose: identifies this is a stats upload request message
  2728. * Value: 0x3
  2729. * - UPLOAD_TYPES
  2730. * Bits 31:8
  2731. * Purpose: identifies which types of FW statistics to upload
  2732. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2733. * - RESET_TYPES
  2734. * Bits 31:8
  2735. * Purpose: identifies which types of FW statistics to reset
  2736. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2737. * - CFG_VAL
  2738. * Bits 23:0
  2739. * Purpose: give an opaque configuration value to the specified stats type
  2740. * Value: stats-type specific configuration value
  2741. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  2742. * bits 7:0 - how many per-MPDU byte counts to include in a record
  2743. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  2744. * bits 23:16 - how many per-MSDU byte counts to include in a record
  2745. * - CFG_STAT_TYPE
  2746. * Bits 31:24
  2747. * Purpose: specify which stats type (if any) the config value applies to
  2748. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  2749. * a valid configuration specification
  2750. * - COOKIE_LSBS
  2751. * Bits 31:0
  2752. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2753. * message with its preceding host->target stats request message.
  2754. * Value: LSBs of the opaque cookie specified by the host-side requestor
  2755. * - COOKIE_MSBS
  2756. * Bits 31:0
  2757. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2758. * message with its preceding host->target stats request message.
  2759. * Value: MSBs of the opaque cookie specified by the host-side requestor
  2760. */
  2761. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  2762. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  2763. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  2764. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  2765. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  2766. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  2767. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  2768. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  2769. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  2770. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  2771. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  2772. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  2773. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  2774. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  2775. do { \
  2776. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  2777. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  2778. } while (0)
  2779. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  2780. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  2781. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  2782. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  2783. do { \
  2784. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  2785. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  2786. } while (0)
  2787. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  2788. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  2789. HTT_H2T_STATS_REQ_CFG_VAL_S)
  2790. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  2791. do { \
  2792. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  2793. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  2794. } while (0)
  2795. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  2796. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  2797. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  2798. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  2799. do { \
  2800. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  2801. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  2802. } while (0)
  2803. /**
  2804. * @brief host -> target HTT out-of-band sync request
  2805. *
  2806. * @details
  2807. * The HTT SYNC tells the target to suspend processing of subsequent
  2808. * HTT host-to-target messages until some other target agent locally
  2809. * informs the target HTT FW that the current sync counter is equal to
  2810. * or greater than (in a modulo sense) the sync counter specified in
  2811. * the SYNC message.
  2812. * This allows other host-target components to synchronize their operation
  2813. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  2814. * security key has been downloaded to and activated by the target.
  2815. * In the absence of any explicit synchronization counter value
  2816. * specification, the target HTT FW will use zero as the default current
  2817. * sync value.
  2818. *
  2819. * |31 24|23 16|15 8|7 0|
  2820. * |-----------------------------------------------------------|
  2821. * | reserved | sync count | msg type |
  2822. * |-----------------------------------------------------------|
  2823. * Header fields:
  2824. * - MSG_TYPE
  2825. * Bits 7:0
  2826. * Purpose: identifies this as a sync message
  2827. * Value: 0x4
  2828. * - SYNC_COUNT
  2829. * Bits 15:8
  2830. * Purpose: specifies what sync value the HTT FW will wait for from
  2831. * an out-of-band specification to resume its operation
  2832. * Value: in-band sync counter value to compare against the out-of-band
  2833. * counter spec.
  2834. * The HTT target FW will suspend its host->target message processing
  2835. * as long as
  2836. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  2837. */
  2838. #define HTT_H2T_SYNC_MSG_SZ 4
  2839. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  2840. #define HTT_H2T_SYNC_COUNT_S 8
  2841. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  2842. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  2843. HTT_H2T_SYNC_COUNT_S)
  2844. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  2845. do { \
  2846. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  2847. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  2848. } while (0)
  2849. /**
  2850. * @brief HTT aggregation configuration
  2851. */
  2852. #define HTT_AGGR_CFG_MSG_SZ 4
  2853. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  2854. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  2855. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  2856. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  2857. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  2858. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  2859. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  2860. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  2861. do { \
  2862. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  2863. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  2864. } while (0)
  2865. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  2866. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  2867. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  2868. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  2869. do { \
  2870. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  2871. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  2872. } while (0)
  2873. /**
  2874. * @brief host -> target HTT configure max amsdu info per vdev
  2875. *
  2876. * @details
  2877. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  2878. *
  2879. * |31 21|20 16|15 8|7 0|
  2880. * |-----------------------------------------------------------|
  2881. * | reserved | vdev id | max amsdu | msg type |
  2882. * |-----------------------------------------------------------|
  2883. * Header fields:
  2884. * - MSG_TYPE
  2885. * Bits 7:0
  2886. * Purpose: identifies this as a aggr cfg ex message
  2887. * Value: 0xa
  2888. * - MAX_NUM_AMSDU_SUBFRM
  2889. * Bits 15:8
  2890. * Purpose: max MSDUs per A-MSDU
  2891. * - VDEV_ID
  2892. * Bits 20:16
  2893. * Purpose: ID of the vdev to which this limit is applied
  2894. */
  2895. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  2896. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  2897. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  2898. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  2899. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  2900. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  2901. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  2902. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  2903. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  2904. do { \
  2905. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  2906. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  2907. } while (0)
  2908. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  2909. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  2910. HTT_AGGR_CFG_EX_VDEV_ID_S)
  2911. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  2912. do { \
  2913. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  2914. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  2915. } while (0)
  2916. /**
  2917. * @brief HTT WDI_IPA Config Message
  2918. *
  2919. * @details
  2920. * The HTT WDI_IPA config message is created/sent by host at driver
  2921. * init time. It contains information about data structures used on
  2922. * WDI_IPA TX and RX path.
  2923. * TX CE ring is used for pushing packet metadata from IPA uC
  2924. * to WLAN FW
  2925. * TX Completion ring is used for generating TX completions from
  2926. * WLAN FW to IPA uC
  2927. * RX Indication ring is used for indicating RX packets from FW
  2928. * to IPA uC
  2929. * RX Ring2 is used as either completion ring or as second
  2930. * indication ring. when Ring2 is used as completion ring, IPA uC
  2931. * puts completed RX packet meta data to Ring2. when Ring2 is used
  2932. * as second indication ring, RX packets for LTE-WLAN aggregation are
  2933. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  2934. * indicated in RX Indication ring. Please see WDI_IPA specification
  2935. * for more details.
  2936. * |31 24|23 16|15 8|7 0|
  2937. * |----------------+----------------+----------------+----------------|
  2938. * | tx pkt pool size | Rsvd | msg_type |
  2939. * |-------------------------------------------------------------------|
  2940. * | tx comp ring base (bits 31:0) |
  2941. #if HTT_PADDR64
  2942. * | tx comp ring base (bits 63:32) |
  2943. #endif
  2944. * |-------------------------------------------------------------------|
  2945. * | tx comp ring size |
  2946. * |-------------------------------------------------------------------|
  2947. * | tx comp WR_IDX physical address (bits 31:0) |
  2948. #if HTT_PADDR64
  2949. * | tx comp WR_IDX physical address (bits 63:32) |
  2950. #endif
  2951. * |-------------------------------------------------------------------|
  2952. * | tx CE WR_IDX physical address (bits 31:0) |
  2953. #if HTT_PADDR64
  2954. * | tx CE WR_IDX physical address (bits 63:32) |
  2955. #endif
  2956. * |-------------------------------------------------------------------|
  2957. * | rx indication ring base (bits 31:0) |
  2958. #if HTT_PADDR64
  2959. * | rx indication ring base (bits 63:32) |
  2960. #endif
  2961. * |-------------------------------------------------------------------|
  2962. * | rx indication ring size |
  2963. * |-------------------------------------------------------------------|
  2964. * | rx ind RD_IDX physical address (bits 31:0) |
  2965. #if HTT_PADDR64
  2966. * | rx ind RD_IDX physical address (bits 63:32) |
  2967. #endif
  2968. * |-------------------------------------------------------------------|
  2969. * | rx ind WR_IDX physical address (bits 31:0) |
  2970. #if HTT_PADDR64
  2971. * | rx ind WR_IDX physical address (bits 63:32) |
  2972. #endif
  2973. * |-------------------------------------------------------------------|
  2974. * |-------------------------------------------------------------------|
  2975. * | rx ring2 base (bits 31:0) |
  2976. #if HTT_PADDR64
  2977. * | rx ring2 base (bits 63:32) |
  2978. #endif
  2979. * |-------------------------------------------------------------------|
  2980. * | rx ring2 size |
  2981. * |-------------------------------------------------------------------|
  2982. * | rx ring2 RD_IDX physical address (bits 31:0) |
  2983. #if HTT_PADDR64
  2984. * | rx ring2 RD_IDX physical address (bits 63:32) |
  2985. #endif
  2986. * |-------------------------------------------------------------------|
  2987. * | rx ring2 WR_IDX physical address (bits 31:0) |
  2988. #if HTT_PADDR64
  2989. * | rx ring2 WR_IDX physical address (bits 63:32) |
  2990. #endif
  2991. * |-------------------------------------------------------------------|
  2992. *
  2993. * Header fields:
  2994. * Header fields:
  2995. * - MSG_TYPE
  2996. * Bits 7:0
  2997. * Purpose: Identifies this as WDI_IPA config message
  2998. * value: = 0x8
  2999. * - TX_PKT_POOL_SIZE
  3000. * Bits 15:0
  3001. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3002. * WDI_IPA TX path
  3003. * For systems using 32-bit format for bus addresses:
  3004. * - TX_COMP_RING_BASE_ADDR
  3005. * Bits 31:0
  3006. * Purpose: TX Completion Ring base address in DDR
  3007. * - TX_COMP_RING_SIZE
  3008. * Bits 31:0
  3009. * Purpose: TX Completion Ring size (must be power of 2)
  3010. * - TX_COMP_WR_IDX_ADDR
  3011. * Bits 31:0
  3012. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3013. * updates the Write Index for WDI_IPA TX completion ring
  3014. * - TX_CE_WR_IDX_ADDR
  3015. * Bits 31:0
  3016. * Purpose: DDR address where IPA uC
  3017. * updates the WR Index for TX CE ring
  3018. * (needed for fusion platforms)
  3019. * - RX_IND_RING_BASE_ADDR
  3020. * Bits 31:0
  3021. * Purpose: RX Indication Ring base address in DDR
  3022. * - RX_IND_RING_SIZE
  3023. * Bits 31:0
  3024. * Purpose: RX Indication Ring size
  3025. * - RX_IND_RD_IDX_ADDR
  3026. * Bits 31:0
  3027. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3028. * RX indication ring
  3029. * - RX_IND_WR_IDX_ADDR
  3030. * Bits 31:0
  3031. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3032. * updates the Write Index for WDI_IPA RX indication ring
  3033. * - RX_RING2_BASE_ADDR
  3034. * Bits 31:0
  3035. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3036. * - RX_RING2_SIZE
  3037. * Bits 31:0
  3038. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3039. * - RX_RING2_RD_IDX_ADDR
  3040. * Bits 31:0
  3041. * Purpose: If Second RX ring is Indication ring, DDR address where
  3042. * IPA uC updates the Read Index for Ring2.
  3043. * If Second RX ring is completion ring, this is NOT used
  3044. * - RX_RING2_WR_IDX_ADDR
  3045. * Bits 31:0
  3046. * Purpose: If Second RX ring is Indication ring, DDR address where
  3047. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3048. * If second RX ring is completion ring, DDR address where
  3049. * IPA uC updates the Write Index for Ring 2.
  3050. * For systems using 64-bit format for bus addresses:
  3051. * - TX_COMP_RING_BASE_ADDR_LO
  3052. * Bits 31:0
  3053. * Purpose: Lower 4 bytes of TX Completion Ring base physical
  3054. * address in DDR
  3055. * - TX_COMP_RING_BASE_ADDR_HI
  3056. * Bits 31:0
  3057. * Purpose: Higher 4 bytes of TX Completion Ring base physical
  3058. * address in DDR
  3059. * - TX_COMP_RING_SIZE
  3060. * Bits 31:0
  3061. * Purpose: TX Completion Ring size (must be power of 2)
  3062. * - TX_COMP_WR_IDX_ADDR_LO
  3063. * Bits 31:0
  3064. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3065. * Lower 4 bytes of DDR address where WIFI FW
  3066. * updates the Write Index for WDI_IPA TX completion ring
  3067. * - TX_COMP_WR_IDX_ADDR_HI
  3068. * Bits 31:0
  3069. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3070. * Higher 4 bytes of DDR address where WIFI FW
  3071. * updates the Write Index for WDI_IPA TX completion ring
  3072. * - TX_CE_WR_IDX_ADDR_LO
  3073. * Bits 31:0
  3074. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3075. * updates the WR Index for TX CE ring
  3076. * (needed for fusion platforms)
  3077. * - TX_CE_WR_IDX_ADDR_HI
  3078. * Bits 31:0
  3079. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3080. * updates the WR Index for TX CE ring
  3081. * (needed for fusion platforms)
  3082. * - RX_IND_RING_BASE_ADDR_LO
  3083. * Bits 31:0
  3084. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3085. * - RX_IND_RING_BASE_ADDR_HI
  3086. * Bits 31:0
  3087. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3088. * - RX_IND_RING_SIZE
  3089. * Bits 31:0
  3090. * Purpose: RX Indication Ring size
  3091. * - RX_IND_RD_IDX_ADDR_LO
  3092. * Bits 31:0
  3093. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the
  3094. * Read Index for WDI_IPA RX indication ring
  3095. * - RX_IND_RD_IDX_ADDR_HI
  3096. * Bits 31:0
  3097. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the
  3098. * Read Index for WDI_IPA RX indication ring
  3099. * - RX_IND_WR_IDX_ADDR_LO
  3100. * Bits 31:0
  3101. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3102. * Lower 4 bytes of DDR address where WIFI FW
  3103. * updates the Write Index for WDI_IPA RX indication ring
  3104. * - RX_IND_WR_IDX_ADDR_HI
  3105. * Bits 31:0
  3106. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3107. * Higher 4 bytes of DDR address where WIFI FW
  3108. * updates the Write Index for WDI_IPA RX indication ring
  3109. * - RX_RING2_BASE_ADDR_LO
  3110. * Bits 31:0
  3111. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)
  3112. * base address in DDR
  3113. * - RX_RING2_BASE_ADDR_HI
  3114. * Bits 31:0
  3115. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)
  3116. * base address in DDR
  3117. * - RX_RING2_SIZE
  3118. * Bits 31:0
  3119. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3120. * - RX_RING2_RD_IDX_ADDR_LO
  3121. * Bits 31:0
  3122. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3123. * DDR address where IPA uC updates the Read Index for Ring2.
  3124. * If Second RX ring is completion ring, this is NOT used
  3125. * - RX_RING2_RD_IDX_ADDR_HI
  3126. * Bits 31:0
  3127. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3128. * DDR address where IPA uC updates the Read Index for Ring2.
  3129. * If Second RX ring is completion ring, this is NOT used
  3130. * - RX_RING2_WR_IDX_ADDR_LO
  3131. * Bits 31:0
  3132. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3133. * DDR address where WIFI FW updates the Write Index
  3134. * for WDI_IPA RX ring2
  3135. * If second RX ring is completion ring, lower 4 bytes of
  3136. * DDR address where IPA uC updates the Write Index for Ring 2.
  3137. * - RX_RING2_WR_IDX_ADDR_HI
  3138. * Bits 31:0
  3139. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3140. * DDR address where WIFI FW updates the Write Index
  3141. * for WDI_IPA RX ring2
  3142. * If second RX ring is completion ring, higher 4 bytes of
  3143. * DDR address where IPA uC updates the Write Index for Ring 2.
  3144. */
  3145. #if HTT_PADDR64
  3146. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3147. #else
  3148. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3149. #endif
  3150. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3151. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3152. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3153. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3154. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3155. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3156. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3157. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3158. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3159. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3160. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3161. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3162. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3163. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3164. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3165. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3166. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3167. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3168. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3169. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3170. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3171. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3172. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3173. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3174. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3175. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3176. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3177. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3178. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3179. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3180. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3181. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3182. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3183. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3184. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3185. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3186. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3187. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3188. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3189. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3190. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3191. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3192. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3193. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3194. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3195. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3196. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3197. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3198. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3199. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3200. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3201. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3202. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3203. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3204. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3205. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3206. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3207. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3208. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3209. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3210. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3211. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3212. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3213. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> \
  3214. HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3215. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3216. do { \
  3217. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3218. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3219. } while (0)
  3220. /* for systems using 32-bit format for bus addr */
  3221. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3222. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> \
  3223. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3224. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3225. do { \
  3226. HTT_CHECK_SET_VAL( \
  3227. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val);\
  3228. ((_var) |= \
  3229. ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3230. } while (0)
  3231. /* for systems using 64-bit format for bus addr */
  3232. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3233. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> \
  3234. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3235. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3236. do { \
  3237. HTT_CHECK_SET_VAL( \
  3238. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val);\
  3239. ((_var) |= \
  3240. ((_val) << \
  3241. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3242. } while (0)
  3243. /* for systems using 64-bit format for bus addr */
  3244. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3245. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> \
  3246. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3247. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3248. do { \
  3249. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3250. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3251. } while (0)
  3252. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3253. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> \
  3254. HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3255. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3256. do { \
  3257. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3258. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3259. } while (0)
  3260. /* for systems using 32-bit format for bus addr */
  3261. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3262. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> \
  3263. HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3264. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3265. do { \
  3266. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3267. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3268. } while (0)
  3269. /* for systems using 64-bit format for bus addr */
  3270. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3271. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> \
  3272. HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3273. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3274. do { \
  3275. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3276. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3277. } while (0)
  3278. /* for systems using 64-bit format for bus addr */
  3279. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3280. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> \
  3281. HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3282. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3283. do { \
  3284. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3285. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3286. } while (0)
  3287. /* for systems using 32-bit format for bus addr */
  3288. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3289. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> \
  3290. HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3291. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3292. do { \
  3293. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3294. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3295. } while (0)
  3296. /* for systems using 64-bit format for bus addr */
  3297. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3298. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >>\
  3299. HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3300. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3301. do { \
  3302. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3303. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3304. } while (0)
  3305. /* for systems using 64-bit format for bus addr */
  3306. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3307. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> \
  3308. HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3309. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3310. do { \
  3311. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3312. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3313. } while (0)
  3314. /* for systems using 32-bit format for bus addr */
  3315. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3316. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> \
  3317. HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3318. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3319. do { \
  3320. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3321. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3322. } while (0)
  3323. /* for systems using 64-bit format for bus addr */
  3324. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3325. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> \
  3326. HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3327. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3328. do { \
  3329. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3330. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3331. } while (0)
  3332. /* for systems using 64-bit format for bus addr */
  3333. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3334. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> \
  3335. HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3336. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3337. do { \
  3338. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3339. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3340. } while (0)
  3341. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3342. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> \
  3343. HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3344. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3345. do { \
  3346. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3347. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3348. } while (0)
  3349. /* for systems using 32-bit format for bus addr */
  3350. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3351. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> \
  3352. HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3353. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3354. do { \
  3355. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3356. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3357. } while (0)
  3358. /* for systems using 64-bit format for bus addr */
  3359. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3360. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> \
  3361. HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3362. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3363. do { \
  3364. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3365. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3366. } while (0)
  3367. /* for systems using 64-bit format for bus addr */
  3368. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3369. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> \
  3370. HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3371. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3372. do { \
  3373. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3374. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3375. } while (0)
  3376. /* for systems using 32-bit format for bus addr */
  3377. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3378. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> \
  3379. HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3380. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3381. do { \
  3382. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3383. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3384. } while (0)
  3385. /* for systems using 64-bit format for bus addr */
  3386. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3387. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> \
  3388. HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3389. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3390. do { \
  3391. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3392. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3393. } while (0)
  3394. /* for systems using 64-bit format for bus addr */
  3395. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3396. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> \
  3397. HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3398. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3399. do { \
  3400. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3401. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3402. } while (0)
  3403. /* for systems using 32-bit format for bus addr */
  3404. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3405. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> \
  3406. HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3407. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3408. do { \
  3409. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3410. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3411. } while (0)
  3412. /* for systems using 64-bit format for bus addr */
  3413. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3414. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> \
  3415. HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3416. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3417. do { \
  3418. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3419. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3420. } while (0)
  3421. /* for systems using 64-bit format for bus addr */
  3422. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3423. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> \
  3424. HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3425. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3426. do { \
  3427. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3428. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3429. } while (0)
  3430. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3431. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> \
  3432. HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3433. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3434. do { \
  3435. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3436. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3437. } while (0)
  3438. /* for systems using 32-bit format for bus addr */
  3439. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3440. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> \
  3441. HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3442. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3443. do { \
  3444. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3445. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3446. } while (0)
  3447. /* for systems using 64-bit format for bus addr */
  3448. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3449. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> \
  3450. HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3451. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3452. do { \
  3453. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3454. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3455. } while (0)
  3456. /* for systems using 64-bit format for bus addr */
  3457. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3458. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> \
  3459. HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3460. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3461. do { \
  3462. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3463. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3464. } while (0)
  3465. /* for systems using 32-bit format for bus addr */
  3466. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3467. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> \
  3468. HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3469. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3470. do { \
  3471. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3472. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3473. } while (0)
  3474. /* for systems using 64-bit format for bus addr */
  3475. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3476. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> \
  3477. HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3478. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3479. do { \
  3480. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3481. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3482. } while (0)
  3483. /* for systems using 64-bit format for bus addr */
  3484. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3485. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> \
  3486. HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3487. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3488. do { \
  3489. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3490. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3491. } while (0)
  3492. /*
  3493. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3494. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3495. * addresses are stored in a XXX-bit field.
  3496. * This macro is used to define both htt_wdi_ipa_config32_t and
  3497. * htt_wdi_ipa_config64_t structs.
  3498. */
  3499. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3500. _paddr__tx_comp_ring_base_addr_, \
  3501. _paddr__tx_comp_wr_idx_addr_, \
  3502. _paddr__tx_ce_wr_idx_addr_, \
  3503. _paddr__rx_ind_ring_base_addr_, \
  3504. _paddr__rx_ind_rd_idx_addr_, \
  3505. _paddr__rx_ind_wr_idx_addr_, \
  3506. _paddr__rx_ring2_base_addr_,\
  3507. _paddr__rx_ring2_rd_idx_addr_,\
  3508. _paddr__rx_ring2_wr_idx_addr_) \
  3509. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3510. { \
  3511. /* DWORD 0: flags and meta-data */ \
  3512. A_UINT32 \
  3513. msg_type:8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3514. reserved:8, \
  3515. tx_pkt_pool_size:16;\
  3516. /* DWORD 1 */\
  3517. _paddr__tx_comp_ring_base_addr_;\
  3518. /* DWORD 2 (or 3)*/\
  3519. A_UINT32 tx_comp_ring_size;\
  3520. /* DWORD 3 (or 4)*/\
  3521. _paddr__tx_comp_wr_idx_addr_;\
  3522. /* DWORD 4 (or 6)*/\
  3523. _paddr__tx_ce_wr_idx_addr_;\
  3524. /* DWORD 5 (or 8)*/\
  3525. _paddr__rx_ind_ring_base_addr_;\
  3526. /* DWORD 6 (or 10)*/\
  3527. A_UINT32 rx_ind_ring_size;\
  3528. /* DWORD 7 (or 11)*/\
  3529. _paddr__rx_ind_rd_idx_addr_;\
  3530. /* DWORD 8 (or 13)*/\
  3531. _paddr__rx_ind_wr_idx_addr_;\
  3532. /* DWORD 9 (or 15)*/\
  3533. _paddr__rx_ring2_base_addr_;\
  3534. /* DWORD 10 (or 17) */\
  3535. A_UINT32 rx_ring2_size;\
  3536. /* DWORD 11 (or 18) */\
  3537. _paddr__rx_ring2_rd_idx_addr_;\
  3538. /* DWORD 12 (or 20) */\
  3539. _paddr__rx_ring2_wr_idx_addr_;\
  3540. } POSTPACK
  3541. /* define a htt_wdi_ipa_config32_t type */
  3542. TEMPLATE_HTT_WDI_IPA_CONFIG_T(32, HTT_VAR_PADDR32(tx_comp_ring_base_addr),
  3543. HTT_VAR_PADDR32(tx_comp_wr_idx_addr),
  3544. HTT_VAR_PADDR32(tx_ce_wr_idx_addr),
  3545. HTT_VAR_PADDR32(rx_ind_ring_base_addr),
  3546. HTT_VAR_PADDR32(rx_ind_rd_idx_addr),
  3547. HTT_VAR_PADDR32(rx_ind_wr_idx_addr),
  3548. HTT_VAR_PADDR32(rx_ring2_base_addr),
  3549. HTT_VAR_PADDR32(rx_ring2_rd_idx_addr),
  3550. HTT_VAR_PADDR32(rx_ring2_wr_idx_addr));
  3551. /* define a htt_wdi_ipa_config64_t type */
  3552. TEMPLATE_HTT_WDI_IPA_CONFIG_T(64, HTT_VAR_PADDR64_LE(tx_comp_ring_base_addr),
  3553. HTT_VAR_PADDR64_LE(tx_comp_wr_idx_addr),
  3554. HTT_VAR_PADDR64_LE(tx_ce_wr_idx_addr),
  3555. HTT_VAR_PADDR64_LE(rx_ind_ring_base_addr),
  3556. HTT_VAR_PADDR64_LE(rx_ind_rd_idx_addr),
  3557. HTT_VAR_PADDR64_LE(rx_ind_wr_idx_addr),
  3558. HTT_VAR_PADDR64_LE(rx_ring2_base_addr),
  3559. HTT_VAR_PADDR64_LE(rx_ring2_rd_idx_addr),
  3560. HTT_VAR_PADDR64_LE(rx_ring2_wr_idx_addr));
  3561. #if HTT_PADDR64
  3562. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3563. #else
  3564. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3565. #endif
  3566. enum htt_wdi_ipa_op_code {
  3567. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3568. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3569. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3570. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3571. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3572. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3573. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3574. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3575. /* keep this last */
  3576. HTT_WDI_IPA_OPCODE_MAX
  3577. };
  3578. /**
  3579. * @brief HTT WDI_IPA Operation Request Message
  3580. *
  3581. * @details
  3582. * HTT WDI_IPA Operation Request message is sent by host
  3583. * to either suspend or resume WDI_IPA TX or RX path.
  3584. * |31 24|23 16|15 8|7 0|
  3585. * |----------------+----------------+----------------+----------------|
  3586. * | op_code | Rsvd | msg_type |
  3587. * |-------------------------------------------------------------------|
  3588. *
  3589. * Header fields:
  3590. * - MSG_TYPE
  3591. * Bits 7:0
  3592. * Purpose: Identifies this as WDI_IPA Operation Request message
  3593. * value: = 0x9
  3594. * - OP_CODE
  3595. * Bits 31:16
  3596. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3597. * value: = enum htt_wdi_ipa_op_code
  3598. */
  3599. PREPACK struct htt_wdi_ipa_op_request_t {
  3600. /* DWORD 0: flags and meta-data */
  3601. A_UINT32
  3602. msg_type:8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ */
  3603. reserved:8,
  3604. op_code:16;
  3605. } POSTPACK;
  3606. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3607. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3608. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3609. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3610. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> \
  3611. HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3612. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3613. do { \
  3614. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3615. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3616. } while (0)
  3617. /**
  3618. * @brief WLAN_WDI_IPA_GET_SHARING_STATS_REQ
  3619. * |31 24|23 16|15 8|7 0|
  3620. * |----------------+----------------+----------------+----------------|
  3621. * | reserved | reset_stats |
  3622. * |-------------------------------------------------------------------|
  3623. * Header fields:
  3624. * - RESET_STATS
  3625. * Bits 7:0
  3626. * Purpose: when 1, FW clears sharing stats
  3627. * - RESERVED
  3628. * Bits 31:8
  3629. * Purpose: reserved bits
  3630. */
  3631. PREPACK struct htt_wdi_ipa_get_sharing_stats_t {
  3632. A_UINT32
  3633. reset_stats:8, /* reset stat countis after response */
  3634. reserved:24;
  3635. } POSTPACK;
  3636. #define HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_SZ \
  3637. (sizeof(struct htt_wdi_ipa_get_sharing_stats_t))
  3638. #define HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_M 0x000000ff
  3639. #define HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_S 0
  3640. #define HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_GET(_var) \
  3641. (((_var) & HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_M) >>\
  3642. HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_S)
  3643. #define HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_SET(_var, _val)\
  3644. do { \
  3645. HTT_CHECK_SET_VAL( \
  3646. HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS,\
  3647. _val); \
  3648. ((_var) |= ((_val) << \
  3649. HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_S)); \
  3650. } while (0)
  3651. /**
  3652. * @brief WLAN_WDI_IPA_SET_QUOTA_REQ
  3653. *
  3654. * |31 24|23 16|15 8|7 0|
  3655. * |----------------+----------------+----------------+----------------|
  3656. * | reserved | set_quota |
  3657. * |-------------------------------------------------------------------|
  3658. * | quota_lo |
  3659. * |-------------------------------------------------------------------|
  3660. * | quota_hi |
  3661. * |-------------------------------------------------------------------|
  3662. * Header fields:
  3663. * - set_quota
  3664. * Bits 7:0
  3665. * Purpose: when 1, FW configures quota and starts quota monitoring.
  3666. * when 0, FW stops.
  3667. * - RESERVED
  3668. * Bits 31:8
  3669. * Purpose: reserved bits
  3670. * - quota_lo
  3671. * Bits 31:0
  3672. * Purpose: bytes of quota to be set, low 32-bit.
  3673. * It is accumulated number of bytes from when quota is configured.
  3674. * - quota_hi
  3675. * Bits 31:0
  3676. * Purpose: bytes of quota to be set, high 32-bit
  3677. */
  3678. PREPACK struct htt_wdi_ipa_set_quota_t {
  3679. A_UINT32
  3680. set_quota:8, /* enable quota monitoring */
  3681. reserved:24;
  3682. A_UINT32 quota_lo; /* quota limit in bytes */
  3683. A_UINT32 quota_hi;
  3684. } POSTPACK;
  3685. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_SZ \
  3686. (sizeof(struct htt_wdi_ipa_set_quota_t))
  3687. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_M 0x000000ff
  3688. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_S 0
  3689. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_GET(_var) \
  3690. (((_var) & HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_M) >> \
  3691. HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_S)
  3692. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_SET(_var, _val) \
  3693. do { \
  3694. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA,\
  3695. _val); \
  3696. ((_var) |= ((_val) << \
  3697. HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_S)); \
  3698. } while (0)
  3699. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_M 0xffffffff
  3700. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_S 0
  3701. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_GET(_var) \
  3702. (((_var) & HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_M) >> \
  3703. HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_S)
  3704. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_SET(_var, _val) \
  3705. do { \
  3706. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO,\
  3707. _val); \
  3708. ((_var) |= ((_val) << \
  3709. HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_S)); \
  3710. } while (0)
  3711. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_M 0xffffffff
  3712. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_S 0
  3713. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_GET(_var) \
  3714. (((_var) & HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_M) >> \
  3715. HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_S)
  3716. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_SET(_var, _val) \
  3717. do { \
  3718. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI,\
  3719. _val); \
  3720. ((_var) |= ((_val) << \
  3721. HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_S)); \
  3722. } while (0)
  3723. /*
  3724. * @brief host -> target HTT_SRING_SETUP message
  3725. *
  3726. * @details
  3727. * After target is booted up, Host can send SRING setup message for
  3728. * each host facing LMAC SRING. Target setups up HW registers based
  3729. * on setup message and confirms back to Host if response_required is set.
  3730. * Host should wait for confirmation message before sending new SRING
  3731. * setup message
  3732. *
  3733. * The message would appear as follows:
  3734. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3735. * |--------------- +-----------------+----------------+------------------|
  3736. * | ring_type | ring_id | pdev_id | msg_type |
  3737. * |----------------------------------------------------------------------|
  3738. * | ring_base_addr_lo |
  3739. * |----------------------------------------------------------------------|
  3740. * | ring_base_addr_hi |
  3741. * |----------------------------------------------------------------------|
  3742. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3743. * |----------------------------------------------------------------------|
  3744. * | ring_head_offset32_remote_addr_lo |
  3745. * |----------------------------------------------------------------------|
  3746. * | ring_head_offset32_remote_addr_hi |
  3747. * |----------------------------------------------------------------------|
  3748. * | ring_tail_offset32_remote_addr_lo |
  3749. * |----------------------------------------------------------------------|
  3750. * | ring_tail_offset32_remote_addr_hi |
  3751. * |----------------------------------------------------------------------|
  3752. * | ring_msi_addr_lo |
  3753. * |----------------------------------------------------------------------|
  3754. * | ring_msi_addr_hi |
  3755. * |----------------------------------------------------------------------|
  3756. * | ring_msi_data |
  3757. * |----------------------------------------------------------------------|
  3758. * | intr_timer_th |IM| intr_batch_counter_th |
  3759. * |----------------------------------------------------------------------|
  3760. * | reserved |RR|PTCF| intr_low_threshold |
  3761. * |----------------------------------------------------------------------|
  3762. * Where
  3763. * IM = sw_intr_mode
  3764. * RR = response_required
  3765. * PTCF = prefetch_timer_cfg
  3766. *
  3767. * The message is interpreted as follows:
  3768. * dword0 - b'0:7 - msg_type: This will be set to
  3769. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3770. * b'8:15 - pdev_id:
  3771. * 0 (for rings at SOC/UMAC level),
  3772. * 1/2/3 mac id (for rings at LMAC level)
  3773. * b'16:23 - ring_id: identify which ring is to setup,
  3774. * more details can be got from enum htt_srng_ring_id
  3775. * b'24:31 - ring_type: identify type of host rings,
  3776. * more details can be got from enum htt_srng_ring_type
  3777. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3778. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3779. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3780. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3781. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3782. * SW_TO_HW_RING.
  3783. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3784. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3785. * Lower 32 bits of memory address of the remote variable
  3786. * storing the 4-byte word offset that identifies the head
  3787. * element within the ring.
  3788. * (The head offset variable has type A_UINT32.)
  3789. * Valid for HW_TO_SW and SW_TO_SW rings.
  3790. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3791. * Upper 32 bits of memory address of the remote variable
  3792. * storing the 4-byte word offset that identifies the head
  3793. * element within the ring.
  3794. * (The head offset variable has type A_UINT32.)
  3795. * Valid for HW_TO_SW and SW_TO_SW rings.
  3796. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3797. * Lower 32 bits of memory address of the remote variable
  3798. * storing the 4-byte word offset that identifies the tail
  3799. * element within the ring.
  3800. * (The tail offset variable has type A_UINT32.)
  3801. * Valid for HW_TO_SW and SW_TO_SW rings.
  3802. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3803. * Upper 32 bits of memory address of the remote variable
  3804. * storing the 4-byte word offset that identifies the tail
  3805. * element within the ring.
  3806. * (The tail offset variable has type A_UINT32.)
  3807. * Valid for HW_TO_SW and SW_TO_SW rings.
  3808. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3809. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3810. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3811. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3812. * dword10 - b'0:31 - ring_msi_data: MSI data
  3813. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3814. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3815. * dword11 - b'0:14 - intr_batch_counter_th:
  3816. * batch counter threshold is in units of 4-byte words.
  3817. * HW internally maintains and increments batch count.
  3818. * (see SRING spec for detail description).
  3819. * When batch count reaches threshold value, an interrupt
  3820. * is generated by HW.
  3821. * b'15 - sw_intr_mode:
  3822. * This configuration shall be static.
  3823. * Only programmed at power up.
  3824. * 0: generate pulse style sw interrupts
  3825. * 1: generate level style sw interrupts
  3826. * b'16:31 - intr_timer_th:
  3827. * The timer init value when timer is idle or is
  3828. * initialized to start downcounting.
  3829. * In 8us units (to cover a range of 0 to 524 ms)
  3830. * dword12 - b'0:15 - intr_low_threshold:
  3831. * Used only by Consumer ring to generate ring_sw_int_p.
  3832. * Ring entries low threshold water mark, that is used
  3833. * in combination with the interrupt timer as well as
  3834. * the the clearing of the level interrupt.
  3835. * b'16:18 - prefetch_timer_cfg:
  3836. * Used only by Consumer ring to set timer mode to
  3837. * support Application prefetch handling.
  3838. * The external tail offset/pointer will be updated
  3839. * at following intervals:
  3840. * 3'b000: (Prefetch feature disabled; used only for debug)
  3841. * 3'b001: 1 usec
  3842. * 3'b010: 4 usec
  3843. * 3'b011: 8 usec (default)
  3844. * 3'b100: 16 usec
  3845. * Others: Reserverd
  3846. * b'19 - response_required:
  3847. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3848. * b'20:31 - reserved: reserved for future use
  3849. */
  3850. PREPACK struct htt_sring_setup_t {
  3851. A_UINT32 msg_type: 8,
  3852. pdev_id: 8,
  3853. ring_id: 8,
  3854. ring_type: 8;
  3855. A_UINT32 ring_base_addr_lo;
  3856. A_UINT32 ring_base_addr_hi;
  3857. A_UINT32 ring_size: 16,
  3858. ring_entry_size: 8,
  3859. ring_misc_cfg_flag: 8;
  3860. A_UINT32 ring_head_offset32_remote_addr_lo;
  3861. A_UINT32 ring_head_offset32_remote_addr_hi;
  3862. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3863. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3864. A_UINT32 ring_msi_addr_lo;
  3865. A_UINT32 ring_msi_addr_hi;
  3866. A_UINT32 ring_msi_data;
  3867. A_UINT32 intr_batch_counter_th: 15,
  3868. sw_intr_mode: 1,
  3869. intr_timer_th: 16;
  3870. A_UINT32 intr_low_threshold: 16,
  3871. prefetch_timer_cfg: 3,
  3872. response_required: 1,
  3873. reserved1: 12;
  3874. } POSTPACK;
  3875. enum htt_srng_ring_type {
  3876. HTT_HW_TO_SW_RING = 0,
  3877. HTT_SW_TO_HW_RING,
  3878. HTT_SW_TO_SW_RING,
  3879. /* Insert new ring types above this line */
  3880. };
  3881. enum htt_srng_ring_id {
  3882. /* Used by FW to feed remote buffers and update remote packets */
  3883. HTT_RXDMA_HOST_BUF_RING = 0,
  3884. /*
  3885. * For getting all PPDU/MPDU/MSDU status deescriptors on host for
  3886. * monitor VAP or packet log purposes
  3887. */
  3888. HTT_RXDMA_MONITOR_STATUS_RING,
  3889. /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3890. HTT_RXDMA_MONITOR_BUF_RING,
  3891. /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3892. HTT_RXDMA_MONITOR_DESC_RING,
  3893. /* Per MPDU indication to host for monitor traffic upload */
  3894. HTT_RXDMA_MONITOR_DEST_RING,
  3895. /* (mobile only) used by host to provide remote RX buffers */
  3896. HTT_HOST1_TO_FW_RXBUF_RING,
  3897. /* (mobile only) second ring used by host to provide remote RX buffers*/
  3898. HTT_HOST2_TO_FW_RXBUF_RING,
  3899. /*
  3900. * Add Other SRING which can't be directly configured by host software
  3901. * above this line
  3902. */
  3903. };
  3904. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  3905. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  3906. #define HTT_SRING_SETUP_PDEV_ID_S 8
  3907. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  3908. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  3909. HTT_SRING_SETUP_PDEV_ID_S)
  3910. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  3911. do { \
  3912. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  3913. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  3914. } while (0)
  3915. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  3916. #define HTT_SRING_SETUP_RING_ID_S 16
  3917. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  3918. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  3919. HTT_SRING_SETUP_RING_ID_S)
  3920. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  3921. do { \
  3922. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  3923. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  3924. } while (0)
  3925. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  3926. #define HTT_SRING_SETUP_RING_TYPE_S 24
  3927. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  3928. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  3929. HTT_SRING_SETUP_RING_TYPE_S)
  3930. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  3931. do { \
  3932. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  3933. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  3934. } while (0)
  3935. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  3936. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  3937. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  3938. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  3939. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  3940. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3941. do { \
  3942. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val);\
  3943. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S));\
  3944. } while (0)
  3945. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  3946. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  3947. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  3948. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  3949. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  3950. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3951. do { \
  3952. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val);\
  3953. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S));\
  3954. } while (0)
  3955. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  3956. #define HTT_SRING_SETUP_RING_SIZE_S 0
  3957. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  3958. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  3959. HTT_SRING_SETUP_RING_SIZE_S)
  3960. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  3961. do { \
  3962. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  3963. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  3964. } while (0)
  3965. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  3966. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  3967. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  3968. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  3969. HTT_SRING_SETUP_ENTRY_SIZE_S)
  3970. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  3971. do { \
  3972. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  3973. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  3974. } while (0)
  3975. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  3976. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  3977. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var)\
  3978. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  3979. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  3980. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  3981. do { \
  3982. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  3983. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  3984. } while (0)
  3985. /* This control bit is applicable to only Producer, which updates Ring ID field
  3986. * of each descriptor before pushing into the ring.
  3987. * 0: updates ring_id(default)
  3988. * 1: ring_id updating disabled
  3989. */
  3990. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  3991. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  3992. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  3993. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  3994. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  3995. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  3996. do { \
  3997. HTT_CHECK_SET_VAL( \
  3998. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val);\
  3999. ((_var) |= ((_val) << \
  4000. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4001. } while (0)
  4002. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4003. * of each descriptor before pushing into the ring.
  4004. * 0: updates Loopcnt(default)
  4005. * 1: Loopcnt updating disabled
  4006. */
  4007. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4008. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4009. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4010. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4011. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4012. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4013. do { \
  4014. HTT_CHECK_SET_VAL( \
  4015. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4016. ((_var) |= ((_val) << \
  4017. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4018. } while (0)
  4019. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4020. * into security_id port of GXI/AXI.
  4021. */
  4022. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4023. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4024. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4025. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4026. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4027. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4028. do { \
  4029. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY,\
  4030. _val); \
  4031. ((_var) |= ((_val) << \
  4032. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S));\
  4033. } while (0)
  4034. /* During MSI write operation, SRNG drives value of this register bit into
  4035. * swap bit of GXI/AXI.
  4036. */
  4037. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4038. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4039. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4040. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4041. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4042. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4043. do { \
  4044. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP,\
  4045. _val); \
  4046. ((_var) |= ((_val) << \
  4047. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4048. } while (0)
  4049. /* During Pointer write operation, SRNG drives value of this register bit into
  4050. * swap bit of GXI/AXI.
  4051. */
  4052. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4053. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4054. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4055. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4056. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4057. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4058. do { \
  4059. HTT_CHECK_SET_VAL( \
  4060. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4061. ((_var) |= ((_val) << \
  4062. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4063. } while (0)
  4064. /* During any data or TLV write operation, SRNG drives value of this register
  4065. * bit into swap bit of GXI/AXI.
  4066. */
  4067. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4068. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4069. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4070. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4071. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4072. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4073. do { \
  4074. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP,\
  4075. _val); \
  4076. ((_var) |= ((_val) << \
  4077. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S));\
  4078. } while (0)
  4079. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4080. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4081. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4082. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4083. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4084. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4085. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4086. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4087. do { \
  4088. HTT_CHECK_SET_VAL( \
  4089. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4090. ((_var) |= ((_val) << \
  4091. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4092. } while (0)
  4093. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4094. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4095. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4096. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >>\
  4097. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4098. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val)\
  4099. do { \
  4100. HTT_CHECK_SET_VAL( \
  4101. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val);\
  4102. ((_var) |= ((_val) << \
  4103. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4104. } while (0)
  4105. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4106. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4107. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4108. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4109. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4110. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4111. do { \
  4112. HTT_CHECK_SET_VAL( \
  4113. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4114. ((_var) |= ((_val) << \
  4115. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S));\
  4116. } while (0)
  4117. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4118. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4119. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4120. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4121. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4122. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4123. do { \
  4124. HTT_CHECK_SET_VAL( \
  4125. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4126. ((_var) |= ((_val) << \
  4127. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4128. } while (0)
  4129. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4130. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4131. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4132. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4133. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4134. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4135. do { \
  4136. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4137. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4138. } while (0)
  4139. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4140. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4141. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4142. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4143. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4144. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4145. do { \
  4146. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4147. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4148. } while (0)
  4149. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4150. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4151. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4152. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4153. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4154. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4155. do { \
  4156. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4157. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4158. } while (0)
  4159. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4160. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4161. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4162. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4163. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4164. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4165. do { \
  4166. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4167. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4168. } while (0)
  4169. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4170. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4171. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4172. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4173. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4174. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4175. do { \
  4176. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4177. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4178. } while (0)
  4179. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4180. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4181. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4182. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4183. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4184. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4185. do { \
  4186. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4187. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4188. } while (0)
  4189. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4190. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4191. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4192. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4193. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4194. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4195. do { \
  4196. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4197. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4198. } while (0)
  4199. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4200. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4201. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4202. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4203. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4204. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4205. do { \
  4206. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4207. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4208. } while (0)
  4209. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4210. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4211. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4212. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4213. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4214. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4215. do { \
  4216. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4217. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4218. } while (0)
  4219. /**
  4220. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4221. *
  4222. * @details
  4223. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4224. * configure RXDMA rings.
  4225. * The configuration is per ring based and includes both packet subtypes
  4226. * and PPDU/MPDU TLVs.
  4227. *
  4228. * The message would appear as follows:
  4229. *
  4230. * |31 26|25|24|23 16|15 8|7 0|
  4231. * |-----------------+----------------+----------------+---------------|
  4232. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  4233. * |-------------------------------------------------------------------|
  4234. * | rsvd2 | ring_buffer_size |
  4235. * |-------------------------------------------------------------------|
  4236. * | packet_type_enable_flags_0 |
  4237. * |-------------------------------------------------------------------|
  4238. * | packet_type_enable_flags_1 |
  4239. * |-------------------------------------------------------------------|
  4240. * | packet_type_enable_flags_2 |
  4241. * |-------------------------------------------------------------------|
  4242. * | packet_type_enable_flags_3 |
  4243. * |-------------------------------------------------------------------|
  4244. * | tlv_filter_in_flags |
  4245. * |-------------------------------------------------------------------|
  4246. * Where:
  4247. * PS = pkt_swap
  4248. * SS = status_swap
  4249. * The message is interpreted as follows:
  4250. * dword0 - b'0:7 - msg_type: This will be set to
  4251. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4252. * b'8:15 - pdev_id:
  4253. * 0 (for rings at SOC/UMAC level),
  4254. * 1/2/3 mac id (for rings at LMAC level)
  4255. * b'16:23 - ring_id : Identify the ring to configure.
  4256. * More details can be got from enum htt_srng_ring_id
  4257. * b'24 - status_swap: 1 is to swap status TLV
  4258. * b'25 - pkt_swap: 1 is to swap packet TLV
  4259. * b'26:31 - rsvd1: reserved for future use
  4260. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4261. * in byte units.
  4262. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4263. * - b'16:31 - rsvd2: Reserved for future use
  4264. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4265. * Enable MGMT packet from 0b0000 to 0b1001
  4266. * bits from low to high: FP, MD, MO - 3 bits
  4267. * FP: Filter_Pass
  4268. * MD: Monitor_Direct
  4269. * MO: Monitor_Other
  4270. * 10 mgmt subtypes * 3 bits -> 30 bits
  4271. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4272. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4273. * Enable MGMT packet from 0b1010 to 0b1111
  4274. * bits from low to high: FP, MD, MO - 3 bits
  4275. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4276. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4277. * Enable CTRL packet from 0b0000 to 0b1001
  4278. * bits from low to high: FP, MD, MO - 3 bits
  4279. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4280. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4281. * Enable CTRL packet from 0b1010 to 0b1111,
  4282. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4283. * bits from low to high: FP, MD, MO - 3 bits
  4284. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4285. * dword6 - b'0:31 - tlv_filter_in_flags:
  4286. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4287. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4288. */
  4289. PREPACK struct htt_rx_ring_selection_cfg_t {
  4290. A_UINT32 msg_type: 8,
  4291. pdev_id: 8,
  4292. ring_id: 8,
  4293. status_swap: 1,
  4294. pkt_swap: 1,
  4295. rsvd1: 6;
  4296. A_UINT32 ring_buffer_size: 16,
  4297. rsvd2: 16;
  4298. A_UINT32 packet_type_enable_flags_0;
  4299. A_UINT32 packet_type_enable_flags_1;
  4300. A_UINT32 packet_type_enable_flags_2;
  4301. A_UINT32 packet_type_enable_flags_3;
  4302. A_UINT32 tlv_filter_in_flags;
  4303. } POSTPACK;
  4304. #define HTT_RX_RING_SELECTION_CFG_SZ \
  4305. (sizeof(struct htt_rx_ring_selection_cfg_t))
  4306. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4307. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4308. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4309. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4310. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4311. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4312. do { \
  4313. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4314. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4315. } while (0)
  4316. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4317. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4318. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4319. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4320. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4321. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4322. do { \
  4323. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4324. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4325. } while (0)
  4326. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4327. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4328. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4329. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4330. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4331. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4332. do { \
  4333. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP,\
  4334. _val); \
  4335. ((_var) |= ((_val) << \
  4336. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4337. } while (0)
  4338. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4339. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4340. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4341. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4342. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4343. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4344. do { \
  4345. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP,\
  4346. _val); \
  4347. ((_var) |= ((_val) << \
  4348. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4349. } while (0)
  4350. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4351. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4352. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4353. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4354. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4355. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4356. do { \
  4357. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE,\
  4358. _val); \
  4359. ((_var) |= ((_val) << \
  4360. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4361. } while (0)
  4362. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4363. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4364. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4365. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4366. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4367. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4368. do { \
  4369. HTT_CHECK_SET_VAL( \
  4370. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, \
  4371. _val); \
  4372. ((_var) |= ((_val) << \
  4373. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4374. } while (0)
  4375. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4376. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4377. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4378. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4379. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4380. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4381. do { \
  4382. HTT_CHECK_SET_VAL( \
  4383. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val);\
  4384. ((_var) |= ((_val) << \
  4385. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4386. } while (0)
  4387. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4388. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4389. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4390. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4391. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4392. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4393. do { \
  4394. HTT_CHECK_SET_VAL( \
  4395. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val);\
  4396. ((_var) |= ((_val) << \
  4397. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4398. } while (0)
  4399. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4400. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4401. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4402. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4403. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4404. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4405. do { \
  4406. HTT_CHECK_SET_VAL( \
  4407. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val);\
  4408. ((_var) |= ((_val) << \
  4409. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4410. } while (0)
  4411. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4412. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4413. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4414. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4415. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4416. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4417. do { \
  4418. HTT_CHECK_SET_VAL( \
  4419. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4420. ((_var) |= ((_val) << \
  4421. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4422. } while (0)
  4423. /*
  4424. * Subtype based MGMT frames enable bits.
  4425. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4426. */
  4427. /* association request */
  4428. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M \
  4429. 0x00000001
  4430. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4431. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M \
  4432. 0x00000002
  4433. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4434. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M \
  4435. 0x00000004
  4436. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4437. /* association response */
  4438. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M \
  4439. 0x00000008
  4440. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4441. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M \
  4442. 0x00000010
  4443. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4444. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M \
  4445. 0x00000020
  4446. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4447. /* Reassociation request */
  4448. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M \
  4449. 0x00000040
  4450. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4451. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M \
  4452. 0x00000080
  4453. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4454. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M \
  4455. 0x00000100
  4456. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4457. /* Reassociation response */
  4458. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M \
  4459. 0x00000200
  4460. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4461. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M \
  4462. 0x00000400
  4463. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4464. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M \
  4465. 0x00000800
  4466. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4467. /* Probe request */
  4468. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M \
  4469. 0x00001000
  4470. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4471. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M \
  4472. 0x00002000
  4473. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4474. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M \
  4475. 0x00004000
  4476. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4477. /* Probe response */
  4478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M \
  4479. 0x00008000
  4480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M \
  4482. 0x00010000
  4483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4484. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M \
  4485. 0x00020000
  4486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4487. /* Timing Advertisement */
  4488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M \
  4489. 0x00040000
  4490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M \
  4492. 0x00080000
  4493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4494. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M \
  4495. 0x00100000
  4496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4497. /* Reserved */
  4498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M \
  4499. 0x00200000
  4500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M \
  4502. 0x00400000
  4503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M \
  4505. 0x00800000
  4506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4507. /* Beacon */
  4508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M \
  4509. 0x01000001
  4510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M \
  4512. 0x02000001
  4513. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4514. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M \
  4515. 0x00000001
  4516. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4517. /* ATIM */
  4518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M \
  4519. 0x00000001
  4520. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4521. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M \
  4522. 0x00000001
  4523. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4524. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M \
  4525. 0x00000001
  4526. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4527. /* Disassociation */
  4528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M \
  4529. 0x00000001
  4530. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M \
  4532. 0x00000002
  4533. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4534. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M \
  4535. 0x00000004
  4536. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4537. /* Authentication */
  4538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M \
  4539. 0x00000008
  4540. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4541. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M \
  4542. 0x00000010
  4543. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4544. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M \
  4545. 0x00000020
  4546. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4547. /* Deauthentication */
  4548. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M \
  4549. 0x00000040
  4550. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M \
  4552. 0x00000080
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4554. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M \
  4555. 0x00000100
  4556. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4557. /* Action */
  4558. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M \
  4559. 0x00000200
  4560. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4561. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M \
  4562. 0x00000400
  4563. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4564. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M \
  4565. 0x00000800
  4566. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4567. /* Action No Ack */
  4568. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M \
  4569. 0x00001000
  4570. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4571. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M \
  4572. 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 \
  4575. 0x00004000
  4576. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4577. /* Reserved */
  4578. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M \
  4579. 0x00008000
  4580. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4581. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M \
  4582. 0x00010000
  4583. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4584. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M \
  4585. 0x00020000
  4586. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4587. /*
  4588. * Subtype based CTRL frames enable bits.
  4589. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4590. */
  4591. /* Reserved */
  4592. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M \
  4593. 0x00000001
  4594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4595. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M \
  4596. 0x00000002
  4597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M \
  4599. 0x00000004
  4600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4601. /* Reserved */
  4602. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M \
  4603. 0x00000008
  4604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M \
  4606. 0x00000010
  4607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M \
  4609. 0x00000020
  4610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4611. /* Reserved */
  4612. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M \
  4613. 0x00000040
  4614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M \
  4616. 0x00000080
  4617. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M \
  4619. 0x00000100
  4620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4621. /* Reserved */
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M \
  4623. 0x00000200
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M \
  4626. 0x00000400
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M \
  4629. 0x00000800
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4631. /* Reserved */
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M \
  4633. 0x00001000
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M \
  4636. 0x00002000
  4637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M \
  4639. 0x00004000
  4640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4641. /* Reserved */
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M \
  4643. 0x00008000
  4644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4645. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M \
  4646. 0x00010000
  4647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4648. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M \
  4649. 0x00020000
  4650. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4651. /* Reserved */
  4652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M \
  4653. 0x00040000
  4654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4655. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M \
  4656. 0x00080000
  4657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M \
  4659. 0x00100000
  4660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4661. /* Control Wrapper */
  4662. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M \
  4663. 0x00200000
  4664. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4665. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M \
  4666. 0x00400000
  4667. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4668. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M \
  4669. 0x00800000
  4670. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4671. /* Block Ack Request */
  4672. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M \
  4673. 0x01000001
  4674. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4675. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M \
  4676. 0x02000001
  4677. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M \
  4679. 0x00000001
  4680. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4681. /* Block Ack*/
  4682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M \
  4683. 0x00000001
  4684. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4685. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M \
  4686. 0x00000001
  4687. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M \
  4689. 0x00000001
  4690. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4691. /* PS-POLL */
  4692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M \
  4693. 0x00000001
  4694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4695. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M \
  4696. 0x00000002
  4697. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4698. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M \
  4699. 0x00000004
  4700. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4701. /* RTS */
  4702. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M \
  4703. 0x00000008
  4704. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4705. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M \
  4706. 0x00000010
  4707. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4708. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M \
  4709. 0x00000020
  4710. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4711. /* CTS */
  4712. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M \
  4713. 0x00000040
  4714. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4715. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M \
  4716. 0x00000080
  4717. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4718. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M \
  4719. 0x00000100
  4720. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4721. /* ACK */
  4722. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M \
  4723. 0x00000200
  4724. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4725. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M \
  4726. 0x00000400
  4727. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4728. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M \
  4729. 0x00000800
  4730. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4731. /* CF-END */
  4732. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M \
  4733. 0x00001000
  4734. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4735. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M \
  4736. 0x00002000
  4737. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4738. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M \
  4739. 0x00004000
  4740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4741. /* CF-END + CF-ACK */
  4742. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M \
  4743. 0x00008000
  4744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M \
  4746. 0x00010000
  4747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M \
  4749. 0x00020000
  4750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4751. /* Multicast data */
  4752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M \
  4753. 0x00040000
  4754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M \
  4756. 0x00080000
  4757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M \
  4759. 0x00100000
  4760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4761. /* Unicast data */
  4762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M \
  4763. 0x00200000
  4764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M \
  4766. 0x00400000
  4767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M \
  4769. 0x00800000
  4770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4771. /* NULL data */
  4772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M \
  4773. 0x01000000
  4774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M \
  4776. 0x02000000
  4777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M \
  4779. 0x04000000
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4782. do { \
  4783. HTT_CHECK_SET_VAL(httsym, value); \
  4784. (word) |= (value) << httsym##_S; \
  4785. } while (0)
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4787. (((word) & httsym##_M) >> httsym##_S)
  4788. #define htt_rx_ring_pkt_enable_subtype_set( \
  4789. word, flag, mode, type, subtype, val) \
  4790. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, \
  4791. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype,\
  4792. val)
  4793. #define htt_rx_ring_pkt_enable_subtype_get( \
  4794. word, flag, mode, type, subtype) \
  4795. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word,\
  4796. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4797. /* Definition to filter in TLVs */
  4798. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4799. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4800. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4801. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4802. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4803. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4804. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4805. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4806. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4807. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4808. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M \
  4809. 0x00000020
  4810. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4811. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4812. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4813. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4814. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4815. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4816. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4817. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4818. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4819. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M \
  4820. 0x00000400
  4821. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4822. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4823. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4824. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M \
  4825. 0x00001000
  4826. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S\
  4827. 12
  4828. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4829. do { \
  4830. HTT_CHECK_SET_VAL(httsym, enable); \
  4831. (word) |= (enable) << httsym##_S; \
  4832. } while (0)
  4833. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4834. (((word) & httsym##_M) >> httsym##_S)
  4835. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4836. HTT_RX_RING_TLV_ENABLE_SET( \
  4837. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4838. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4839. HTT_RX_RING_TLV_ENABLE_GET(word, \
  4840. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4841. /**
  4842. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4843. * host --> target Receive Flow Steering configuration message definition.
  4844. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4845. * The reason for this is we want RFS to be configured and ready before MAC
  4846. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4847. *
  4848. * |31 24|23 16|15 9|8|7 0|
  4849. * |----------------+----------------+----------------+----------------|
  4850. * | reserved |E| msg type |
  4851. * |-------------------------------------------------------------------|
  4852. * Where E = RFS enable flag
  4853. *
  4854. * The RFS_CONFIG message consists of a single 4-byte word.
  4855. *
  4856. * Header fields:
  4857. * - MSG_TYPE
  4858. * Bits 7:0
  4859. * Purpose: identifies this as a RFS config msg
  4860. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4861. * - RFS_CONFIG
  4862. * Bit 8
  4863. * Purpose: Tells target whether to enable (1) or disable (0)
  4864. * flow steering feature when sending rx indication messages to host
  4865. */
  4866. #define HTT_RFS_CFG_REQ_BYTES 4
  4867. #define HTT_H2T_RFS_CONFIG_M 0x100
  4868. #define HTT_H2T_RFS_CONFIG_S 8
  4869. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4870. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4871. HTT_H2T_RFS_CONFIG_S)
  4872. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4873. do { \
  4874. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4875. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4876. } while (0)
  4877. /**
  4878. * @brief host -> target FW extended statistics retrieve
  4879. *
  4880. * @details
  4881. * The following field definitions describe the format of the HTT host
  4882. * to target FW extended stats retrieve message.
  4883. * The message specifies the type of stats the host wants to retrieve.
  4884. *
  4885. * |31 24|23 16|15 8|7 0|
  4886. * |-----------------------------------------------------------|
  4887. * | reserved | stats type | pdev_mask | msg type |
  4888. * |-----------------------------------------------------------|
  4889. * | config param [0] |
  4890. * |-----------------------------------------------------------|
  4891. * | config param [1] |
  4892. * |-----------------------------------------------------------|
  4893. * | config param [2] |
  4894. * |-----------------------------------------------------------|
  4895. * | config param [3] |
  4896. * |-----------------------------------------------------------|
  4897. * | reserved |
  4898. * |-----------------------------------------------------------|
  4899. * | cookie LSBs |
  4900. * |-----------------------------------------------------------|
  4901. * | cookie MSBs |
  4902. * |-----------------------------------------------------------|
  4903. * Header fields:
  4904. * - MSG_TYPE
  4905. * Bits 7:0
  4906. * Purpose: identifies this is a extended stats upload request message
  4907. * Value: 0x10
  4908. * - PDEV_MASK
  4909. * Bits 8:15
  4910. * Purpose: identifies the mask of PDEVs to retrieve stats from
  4911. * Value: This is a overloaded field, refer to usage and interpretation of
  4912. * PDEV in interface document.
  4913. * Bit 8 : Reserved for SOC stats
  4914. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4915. * Indicates MACID_MASK in DBS
  4916. * - STATS_TYPE
  4917. * Bits 23:16
  4918. * Purpose: identifies which FW statistics to upload
  4919. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  4920. * - Reserved
  4921. * Bits 31:24
  4922. * - CONFIG_PARAM [0]
  4923. * Bits 31:0
  4924. * Purpose: give an opaque configuration value to the specified stats type
  4925. * Value: stats-type specific configuration value
  4926. * Refer to htt_stats.h for interpretation for each stats sub_type
  4927. * - CONFIG_PARAM [1]
  4928. * Bits 31:0
  4929. * Purpose: give an opaque configuration value to the specified stats type
  4930. * Value: stats-type specific configuration value
  4931. * Refer to htt_stats.h for interpretation for each stats sub_type
  4932. * - CONFIG_PARAM [2]
  4933. * Bits 31:0
  4934. * Purpose: give an opaque configuration value to the specified stats type
  4935. * Value: stats-type specific configuration value
  4936. * Refer to htt_stats.h for interpretation for each stats sub_type
  4937. * - CONFIG_PARAM [3]
  4938. * Bits 31:0
  4939. * Purpose: give an opaque configuration value to the specified stats type
  4940. * Value: stats-type specific configuration value
  4941. * Refer to htt_stats.h for interpretation for each stats sub_type
  4942. * - Reserved [31:0] for future use.
  4943. * - COOKIE_LSBS
  4944. * Bits 31:0
  4945. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4946. * message with its preceding host->target stats request message.
  4947. * Value: LSBs of the opaque cookie specified by the host-side requestor
  4948. * - COOKIE_MSBS
  4949. * Bits 31:0
  4950. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4951. * message with its preceding host->target stats request message.
  4952. * Value: MSBs of the opaque cookie specified by the host-side requestor
  4953. */
  4954. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  4955. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  4956. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  4957. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  4958. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  4959. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  4960. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  4961. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  4962. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  4963. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  4964. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  4965. do { \
  4966. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  4967. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S));\
  4968. } while (0)
  4969. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  4970. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  4971. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  4972. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  4973. do { \
  4974. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val);\
  4975. ((_var) |= ((_val) << \
  4976. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  4977. } while (0)
  4978. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  4979. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  4980. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  4981. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  4982. do { \
  4983. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, \
  4984. _val); \
  4985. ((_var) |= ((_val) << \
  4986. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  4987. } while (0)
  4988. /*=== target -> host messages ===============================================*/
  4989. enum htt_t2h_msg_type {
  4990. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  4991. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  4992. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  4993. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  4994. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  4995. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  4996. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  4997. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  4998. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  4999. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  5000. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  5001. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  5002. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc,/* no longer used */
  5003. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  5004. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  5005. /* only used for HL, add HTT MSG for HTT CREDIT update */
  5006. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  5007. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  5008. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  5009. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  5010. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  5011. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  5012. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  5013. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  5014. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  5015. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  5016. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  5017. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  5018. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  5019. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  5020. HTT_T2H_MSG_TYPE_TEST,
  5021. /* keep this last */
  5022. HTT_T2H_NUM_MSGS
  5023. };
  5024. /*
  5025. * HTT target to host message type -
  5026. * stored in bits 7:0 of the first word of the message
  5027. */
  5028. #define HTT_T2H_MSG_TYPE_M 0xff
  5029. #define HTT_T2H_MSG_TYPE_S 0
  5030. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  5031. do { \
  5032. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  5033. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  5034. } while (0)
  5035. #define HTT_T2H_MSG_TYPE_GET(word) \
  5036. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5037. /**
  5038. * @brief target -> host version number confirmation message definition
  5039. *
  5040. * |31 24|23 16|15 8|7 0|
  5041. * |----------------+----------------+----------------+----------------|
  5042. * | reserved | major number | minor number | msg type |
  5043. * |-------------------------------------------------------------------|
  5044. * : option request TLV (optional) |
  5045. * :...................................................................:
  5046. *
  5047. * The VER_CONF message may consist of a single 4-byte word, or may be
  5048. * extended with TLVs that specify HTT options selected by the target.
  5049. * The following option TLVs may be appended to the VER_CONF message:
  5050. * - LL_BUS_ADDR_SIZE
  5051. * - HL_SUPPRESS_TX_COMPL_IND
  5052. * - MAX_TX_QUEUE_GROUPS
  5053. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5054. * may be appended to the VER_CONF message (but only one TLV of each type).
  5055. *
  5056. * Header fields:
  5057. * - MSG_TYPE
  5058. * Bits 7:0
  5059. * Purpose: identifies this as a version number confirmation message
  5060. * Value: 0x0
  5061. * - VER_MINOR
  5062. * Bits 15:8
  5063. * Purpose: Specify the minor number of the HTT message library version
  5064. * in use by the target firmware.
  5065. * The minor number specifies the specific revision within a range
  5066. * of fundamentally compatible HTT message definition revisions.
  5067. * Compatible revisions involve adding new messages or perhaps
  5068. * adding new fields to existing messages, in a backwards-compatible
  5069. * manner.
  5070. * Incompatible revisions involve changing the message type values,
  5071. * or redefining existing messages.
  5072. * Value: minor number
  5073. * - VER_MAJOR
  5074. * Bits 15:8
  5075. * Purpose: Specify the major number of the HTT message library version
  5076. * in use by the target firmware.
  5077. * The major number specifies the family of minor revisions that are
  5078. * fundamentally compatible with each other, but not with prior or
  5079. * later families.
  5080. * Value: major number
  5081. */
  5082. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5083. #define HTT_VER_CONF_MINOR_S 8
  5084. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5085. #define HTT_VER_CONF_MAJOR_S 16
  5086. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5087. do { \
  5088. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5089. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5090. } while (0)
  5091. #define HTT_VER_CONF_MINOR_GET(word) \
  5092. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5093. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5094. do { \
  5095. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5096. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5097. } while (0)
  5098. #define HTT_VER_CONF_MAJOR_GET(word) \
  5099. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5100. #define HTT_VER_CONF_BYTES 4
  5101. /**
  5102. * @brief - target -> host HTT Rx In order indication message
  5103. *
  5104. * @details
  5105. *
  5106. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5107. * |----------------+-------------------+---------------------+---------------|
  5108. * | peer ID | P| F| O| ext TID | msg type |
  5109. * |--------------------------------------------------------------------------|
  5110. * | MSDU count | Reserved | vdev id |
  5111. * |--------------------------------------------------------------------------|
  5112. * | MSDU 0 bus address (bits 31:0) |
  5113. #if HTT_PADDR64
  5114. * | MSDU 0 bus address (bits 63:32) |
  5115. #endif
  5116. * |--------------------------------------------------------------------------|
  5117. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5118. * |--------------------------------------------------------------------------|
  5119. * | MSDU 1 bus address (bits 31:0) |
  5120. #if HTT_PADDR64
  5121. * | MSDU 1 bus address (bits 63:32) |
  5122. #endif
  5123. * |--------------------------------------------------------------------------|
  5124. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5125. * |--------------------------------------------------------------------------|
  5126. */
  5127. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5128. *
  5129. * @details
  5130. * bits
  5131. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5132. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5133. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5134. * | | frag | | | | fail |chksum fail|
  5135. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5136. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5137. */
  5138. struct htt_rx_in_ord_paddr_ind_hdr_t {
  5139. A_UINT32 /* word 0 */
  5140. msg_type:8,
  5141. ext_tid:5,
  5142. offload:1,
  5143. frag:1,
  5144. /*
  5145. * Tell host whether to store MSDUs referenced in this message
  5146. * in pktlog
  5147. */
  5148. pktlog:1,
  5149. peer_id:16;
  5150. A_UINT32 /* word 1 */
  5151. vap_id:8,
  5152. reserved_1:8,
  5153. msdu_cnt:16;
  5154. };
  5155. struct htt_rx_in_ord_paddr_ind_msdu32_t {
  5156. A_UINT32 dma_addr;
  5157. A_UINT32
  5158. length:16,
  5159. fw_desc:8,
  5160. msdu_info:8;
  5161. };
  5162. struct htt_rx_in_ord_paddr_ind_msdu64_t {
  5163. A_UINT32 dma_addr_lo;
  5164. A_UINT32 dma_addr_hi;
  5165. A_UINT32
  5166. length:16,
  5167. fw_desc:8,
  5168. msdu_info:8;
  5169. };
  5170. #if HTT_PADDR64
  5171. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5172. #else
  5173. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5174. #endif
  5175. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES \
  5176. (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5177. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS \
  5178. (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5179. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET \
  5180. HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5181. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET \
  5182. HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5183. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 \
  5184. (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5185. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 \
  5186. (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5187. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 \
  5188. (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5189. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 \
  5190. (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5191. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES \
  5192. (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5193. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS \
  5194. (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5195. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5196. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5197. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5198. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5199. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5200. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5201. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5202. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5203. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5204. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5205. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5206. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5207. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5208. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5209. /* for systems using 64-bit format for bus addresses */
  5210. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5211. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5212. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5213. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5214. /* for systems using 32-bit format for bus addresses */
  5215. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5216. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5217. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5218. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5219. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5220. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5221. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5222. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5223. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5224. do { \
  5225. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5226. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5227. } while (0)
  5228. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5229. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> \
  5230. HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5231. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5232. do { \
  5233. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5234. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5235. } while (0)
  5236. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5237. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> \
  5238. HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5239. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5240. do { \
  5241. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5242. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5243. } while (0)
  5244. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5245. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> \
  5246. HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5247. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5248. do { \
  5249. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5250. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5251. } while (0)
  5252. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5253. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> \
  5254. HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5255. /* for systems using 64-bit format for bus addresses */
  5256. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5257. do { \
  5258. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5259. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5260. } while (0)
  5261. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5262. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> \
  5263. HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5264. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5265. do { \
  5266. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5267. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5268. } while (0)
  5269. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5270. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> \
  5271. HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5272. /* for systems using 32-bit format for bus addresses */
  5273. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5274. do { \
  5275. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5276. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5277. } while (0)
  5278. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5279. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> \
  5280. HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5281. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5282. do { \
  5283. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value);\
  5284. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5285. } while (0)
  5286. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5287. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> \
  5288. HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5289. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5290. do { \
  5291. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5292. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5293. } while (0)
  5294. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5295. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> \
  5296. HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5297. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5298. do { \
  5299. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value);\
  5300. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S;\
  5301. } while (0)
  5302. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5303. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> \
  5304. HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5305. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5306. do { \
  5307. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value);\
  5308. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5309. } while (0)
  5310. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5311. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> \
  5312. HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5313. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5314. do { \
  5315. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5316. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5317. } while (0)
  5318. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5319. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> \
  5320. HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5321. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5322. do { \
  5323. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5324. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5325. } while (0)
  5326. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5327. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> \
  5328. HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5329. /* definitions used within target -> host rx indication message */
  5330. PREPACK struct htt_rx_ind_hdr_prefix_t {
  5331. A_UINT32 /* word 0 */
  5332. msg_type:8,
  5333. ext_tid:5,
  5334. release_valid:1,
  5335. flush_valid:1,
  5336. reserved0:1,
  5337. peer_id:16;
  5338. A_UINT32 /* word 1 */
  5339. flush_start_seq_num:6,
  5340. flush_end_seq_num:6,
  5341. release_start_seq_num:6,
  5342. release_end_seq_num:6,
  5343. num_mpdu_ranges:8;
  5344. } POSTPACK;
  5345. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5346. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5347. #define HTT_TGT_RSSI_INVALID 0x80
  5348. PREPACK struct htt_rx_ppdu_desc_t {
  5349. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5350. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5351. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5352. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5353. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5354. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5355. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5356. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5357. A_UINT32 /* word 0 */
  5358. rssi_cmb:8,
  5359. timestamp_submicrosec:8,
  5360. phy_err_code:8,
  5361. phy_err:1,
  5362. legacy_rate:4,
  5363. legacy_rate_sel:1,
  5364. end_valid:1,
  5365. start_valid:1;
  5366. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5367. union {
  5368. A_UINT32 /* word 1 */
  5369. rssi0_pri20:8,
  5370. rssi0_ext20:8,
  5371. rssi0_ext40:8,
  5372. rssi0_ext80:8;
  5373. A_UINT32 rssi0; /* access all 20/40/80 per-b/w RSSIs together */
  5374. } u0;
  5375. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5376. union {
  5377. A_UINT32 /* word 2 */
  5378. rssi1_pri20:8,
  5379. rssi1_ext20:8,
  5380. rssi1_ext40:8,
  5381. rssi1_ext80:8;
  5382. A_UINT32 rssi1; /* access all 20/40/80 per-b/w RSSIs together */
  5383. } u1;
  5384. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5385. union {
  5386. A_UINT32 /* word 3 */
  5387. rssi2_pri20:8,
  5388. rssi2_ext20:8,
  5389. rssi2_ext40:8,
  5390. rssi2_ext80:8;
  5391. A_UINT32 rssi2; /* access all 20/40/80 per-b/w RSSIs together */
  5392. } u2;
  5393. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5394. union {
  5395. A_UINT32 /* word 4 */
  5396. rssi3_pri20:8,
  5397. rssi3_ext20:8,
  5398. rssi3_ext40:8,
  5399. rssi3_ext80:8;
  5400. A_UINT32 rssi3; /* access all 20/40/80 per-b/w RSSIs together */
  5401. } u3;
  5402. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5403. A_UINT32 tsf32; /* word 5 */
  5404. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5405. A_UINT32 timestamp_microsec; /* word 6 */
  5406. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5407. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5408. A_UINT32 /* word 7 */
  5409. vht_sig_a1:24,
  5410. preamble_type:8;
  5411. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5412. A_UINT32 /* word 8 */
  5413. vht_sig_a2:24,
  5414. reserved0:8;
  5415. } POSTPACK;
  5416. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5417. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5418. PREPACK struct htt_rx_ind_hdr_suffix_t {
  5419. A_UINT32 /* word 0 */
  5420. fw_rx_desc_bytes:16,
  5421. reserved0:16;
  5422. } POSTPACK;
  5423. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5424. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5425. PREPACK struct htt_rx_ind_hdr_t {
  5426. struct htt_rx_ind_hdr_prefix_t prefix;
  5427. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5428. struct htt_rx_ind_hdr_suffix_t suffix;
  5429. } POSTPACK;
  5430. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5431. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5432. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5433. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5434. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5435. /*
  5436. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5437. * the offset into the HTT rx indication message at which the
  5438. * FW rx PPDU descriptor resides
  5439. */
  5440. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5441. /*
  5442. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5443. * the offset into the HTT rx indication message at which the
  5444. * header suffix (FW rx MSDU byte count) resides
  5445. */
  5446. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5447. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5448. /*
  5449. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5450. * the offset into the HTT rx indication message at which the per-MSDU
  5451. * information starts
  5452. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5453. * per-MSDU information portion of the message. The per-MSDU info itself
  5454. * starts at byte 12.
  5455. */
  5456. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5457. /**
  5458. * @brief target -> host rx indication message definition
  5459. *
  5460. * @details
  5461. * The following field definitions describe the format of the rx indication
  5462. * message sent from the target to the host.
  5463. * The message consists of three major sections:
  5464. * 1. a fixed-length header
  5465. * 2. a variable-length list of firmware rx MSDU descriptors
  5466. * 3. one or more 4-octet MPDU range information elements
  5467. * The fixed length header itself has two sub-sections
  5468. * 1. the message meta-information, including identification of the
  5469. * sender and type of the received data, and a 4-octet flush/release IE
  5470. * 2. the firmware rx PPDU descriptor
  5471. *
  5472. * The format of the message is depicted below.
  5473. * in this depiction, the following abbreviations are used for information
  5474. * elements within the message:
  5475. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5476. * elements associated with the PPDU start are valid.
  5477. * Specifically, the following fields are valid only if SV is set:
  5478. * RSSI (all variants), L, legacy rate, preamble type, service,
  5479. * VHT-SIG-A
  5480. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5481. * elements associated with the PPDU end are valid.
  5482. * Specifically, the following fields are valid only if EV is set:
  5483. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5484. * - L - Legacy rate selector - if legacy rates are used, this flag
  5485. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5486. * (L == 0) PHY.
  5487. * - P - PHY error flag - boolean indication of whether the rx frame had
  5488. * a PHY error
  5489. *
  5490. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5491. * |----------------+-------------------+---------------------+---------------|
  5492. * | peer ID | |RV|FV| ext TID | msg type |
  5493. * |--------------------------------------------------------------------------|
  5494. * | num | release | release | flush | flush |
  5495. * | MPDU | end | start | end | start |
  5496. * | ranges | seq num | seq num | seq num | seq num |
  5497. * |==========================================================================|
  5498. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5499. * |V|V| | rate | | | timestamp | RSSI |
  5500. * |--------------------------------------------------------------------------|
  5501. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5502. * |--------------------------------------------------------------------------|
  5503. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5504. * |--------------------------------------------------------------------------|
  5505. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5506. * |--------------------------------------------------------------------------|
  5507. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5508. * |--------------------------------------------------------------------------|
  5509. * | TSF LSBs |
  5510. * |--------------------------------------------------------------------------|
  5511. * | microsec timestamp |
  5512. * |--------------------------------------------------------------------------|
  5513. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5514. * |--------------------------------------------------------------------------|
  5515. * | service | HT-SIG / VHT-SIG-A2 |
  5516. * |==========================================================================|
  5517. * | reserved | FW rx desc bytes |
  5518. * |--------------------------------------------------------------------------|
  5519. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5520. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5521. * |--------------------------------------------------------------------------|
  5522. * : : :
  5523. * |--------------------------------------------------------------------------|
  5524. * | alignment | MSDU Rx |
  5525. * | padding | desc Bn |
  5526. * |--------------------------------------------------------------------------|
  5527. * | reserved | MPDU range status | MPDU count |
  5528. * |--------------------------------------------------------------------------|
  5529. * : reserved : MPDU range status : MPDU count :
  5530. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5531. *
  5532. * Header fields:
  5533. * - MSG_TYPE
  5534. * Bits 7:0
  5535. * Purpose: identifies this as an rx indication message
  5536. * Value: 0x1
  5537. * - EXT_TID
  5538. * Bits 12:8
  5539. * Purpose: identify the traffic ID of the rx data, including
  5540. * special "extended" TID values for multicast, broadcast, and
  5541. * non-QoS data frames
  5542. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5543. * - FLUSH_VALID (FV)
  5544. * Bit 13
  5545. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5546. * is valid
  5547. * Value:
  5548. * 1 -> flush IE is valid and needs to be processed
  5549. * 0 -> flush IE is not valid and should be ignored
  5550. * - REL_VALID (RV)
  5551. * Bit 13
  5552. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5553. * is valid
  5554. * Value:
  5555. * 1 -> release IE is valid and needs to be processed
  5556. * 0 -> release IE is not valid and should be ignored
  5557. * - PEER_ID
  5558. * Bits 31:16
  5559. * Purpose: Identify, by ID, which peer sent the rx data
  5560. * Value: ID of the peer who sent the rx data
  5561. * - FLUSH_SEQ_NUM_START
  5562. * Bits 5:0
  5563. * Purpose: Indicate the start of a series of MPDUs to flush
  5564. * Not all MPDUs within this series are necessarily valid - the host
  5565. * must check each sequence number within this range to see if the
  5566. * corresponding MPDU is actually present.
  5567. * This field is only valid if the FV bit is set.
  5568. * Value:
  5569. * The sequence number for the first MPDUs to check to flush.
  5570. * The sequence number is masked by 0x3f.
  5571. * - FLUSH_SEQ_NUM_END
  5572. * Bits 11:6
  5573. * Purpose: Indicate the end of a series of MPDUs to flush
  5574. * Value:
  5575. * The sequence number one larger than the sequence number of the
  5576. * last MPDU to check to flush.
  5577. * The sequence number is masked by 0x3f.
  5578. * Not all MPDUs within this series are necessarily valid - the host
  5579. * must check each sequence number within this range to see if the
  5580. * corresponding MPDU is actually present.
  5581. * This field is only valid if the FV bit is set.
  5582. * - REL_SEQ_NUM_START
  5583. * Bits 17:12
  5584. * Purpose: Indicate the start of a series of MPDUs to release.
  5585. * All MPDUs within this series are present and valid - the host
  5586. * need not check each sequence number within this range to see if
  5587. * the corresponding MPDU is actually present.
  5588. * This field is only valid if the RV bit is set.
  5589. * Value:
  5590. * The sequence number for the first MPDUs to check to release.
  5591. * The sequence number is masked by 0x3f.
  5592. * - REL_SEQ_NUM_END
  5593. * Bits 23:18
  5594. * Purpose: Indicate the end of a series of MPDUs to release.
  5595. * Value:
  5596. * The sequence number one larger than the sequence number of the
  5597. * last MPDU to check to release.
  5598. * The sequence number is masked by 0x3f.
  5599. * All MPDUs within this series are present and valid - the host
  5600. * need not check each sequence number within this range to see if
  5601. * the corresponding MPDU is actually present.
  5602. * This field is only valid if the RV bit is set.
  5603. * - NUM_MPDU_RANGES
  5604. * Bits 31:24
  5605. * Purpose: Indicate how many ranges of MPDUs are present.
  5606. * Each MPDU range consists of a series of contiguous MPDUs within the
  5607. * rx frame sequence which all have the same MPDU status.
  5608. * Value: 1-63 (typically a small number, like 1-3)
  5609. *
  5610. * Rx PPDU descriptor fields:
  5611. * - RSSI_CMB
  5612. * Bits 7:0
  5613. * Purpose: Combined RSSI from all active rx chains, across the active
  5614. * bandwidth.
  5615. * Value: RSSI dB units w.r.t. noise floor
  5616. * - TIMESTAMP_SUBMICROSEC
  5617. * Bits 15:8
  5618. * Purpose: high-resolution timestamp
  5619. * Value:
  5620. * Sub-microsecond time of PPDU reception.
  5621. * This timestamp ranges from [0,MAC clock MHz).
  5622. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5623. * to form a high-resolution, large range rx timestamp.
  5624. * - PHY_ERR_CODE
  5625. * Bits 23:16
  5626. * Purpose:
  5627. * If the rx frame processing resulted in a PHY error, indicate what
  5628. * type of rx PHY error occurred.
  5629. * Value:
  5630. * This field is valid if the "P" (PHY_ERR) flag is set.
  5631. * TBD: document/specify the values for this field
  5632. * - PHY_ERR
  5633. * Bit 24
  5634. * Purpose: indicate whether the rx PPDU had a PHY error
  5635. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5636. * - LEGACY_RATE
  5637. * Bits 28:25
  5638. * Purpose:
  5639. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5640. * specify which rate was used.
  5641. * Value:
  5642. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5643. * flag.
  5644. * If LEGACY_RATE_SEL is 0:
  5645. * 0x8: OFDM 48 Mbps
  5646. * 0x9: OFDM 24 Mbps
  5647. * 0xA: OFDM 12 Mbps
  5648. * 0xB: OFDM 6 Mbps
  5649. * 0xC: OFDM 54 Mbps
  5650. * 0xD: OFDM 36 Mbps
  5651. * 0xE: OFDM 18 Mbps
  5652. * 0xF: OFDM 9 Mbps
  5653. * If LEGACY_RATE_SEL is 1:
  5654. * 0x8: CCK 11 Mbps long preamble
  5655. * 0x9: CCK 5.5 Mbps long preamble
  5656. * 0xA: CCK 2 Mbps long preamble
  5657. * 0xB: CCK 1 Mbps long preamble
  5658. * 0xC: CCK 11 Mbps short preamble
  5659. * 0xD: CCK 5.5 Mbps short preamble
  5660. * 0xE: CCK 2 Mbps short preamble
  5661. * - LEGACY_RATE_SEL
  5662. * Bit 29
  5663. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5664. * Value:
  5665. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5666. * used a legacy rate.
  5667. * 0 -> OFDM, 1 -> CCK
  5668. * - END_VALID
  5669. * Bit 30
  5670. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5671. * the start of the PPDU are valid. Specifically, the following
  5672. * fields are only valid if END_VALID is set:
  5673. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5674. * TIMESTAMP_SUBMICROSEC
  5675. * Value:
  5676. * 0 -> rx PPDU desc end fields are not valid
  5677. * 1 -> rx PPDU desc end fields are valid
  5678. * - START_VALID
  5679. * Bit 31
  5680. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5681. * the end of the PPDU are valid. Specifically, the following
  5682. * fields are only valid if START_VALID is set:
  5683. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5684. * VHT-SIG-A
  5685. * Value:
  5686. * 0 -> rx PPDU desc start fields are not valid
  5687. * 1 -> rx PPDU desc start fields are valid
  5688. * - RSSI0_PRI20
  5689. * Bits 7:0
  5690. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5691. * Value: RSSI dB units w.r.t. noise floor
  5692. *
  5693. * - RSSI0_EXT20
  5694. * Bits 7:0
  5695. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5696. * (if the rx bandwidth was >= 40 MHz)
  5697. * Value: RSSI dB units w.r.t. noise floor
  5698. * - RSSI0_EXT40
  5699. * Bits 7:0
  5700. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5701. * (if the rx bandwidth was >= 80 MHz)
  5702. * Value: RSSI dB units w.r.t. noise floor
  5703. * - RSSI0_EXT80
  5704. * Bits 7:0
  5705. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5706. * (if the rx bandwidth was >= 160 MHz)
  5707. * Value: RSSI dB units w.r.t. noise floor
  5708. *
  5709. * - RSSI1_PRI20
  5710. * Bits 7:0
  5711. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5712. * Value: RSSI dB units w.r.t. noise floor
  5713. * - RSSI1_EXT20
  5714. * Bits 7:0
  5715. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5716. * (if the rx bandwidth was >= 40 MHz)
  5717. * Value: RSSI dB units w.r.t. noise floor
  5718. * - RSSI1_EXT40
  5719. * Bits 7:0
  5720. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5721. * (if the rx bandwidth was >= 80 MHz)
  5722. * Value: RSSI dB units w.r.t. noise floor
  5723. * - RSSI1_EXT80
  5724. * Bits 7:0
  5725. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5726. * (if the rx bandwidth was >= 160 MHz)
  5727. * Value: RSSI dB units w.r.t. noise floor
  5728. *
  5729. * - RSSI2_PRI20
  5730. * Bits 7:0
  5731. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5732. * Value: RSSI dB units w.r.t. noise floor
  5733. * - RSSI2_EXT20
  5734. * Bits 7:0
  5735. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5736. * (if the rx bandwidth was >= 40 MHz)
  5737. * Value: RSSI dB units w.r.t. noise floor
  5738. * - RSSI2_EXT40
  5739. * Bits 7:0
  5740. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5741. * (if the rx bandwidth was >= 80 MHz)
  5742. * Value: RSSI dB units w.r.t. noise floor
  5743. * - RSSI2_EXT80
  5744. * Bits 7:0
  5745. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5746. * (if the rx bandwidth was >= 160 MHz)
  5747. * Value: RSSI dB units w.r.t. noise floor
  5748. *
  5749. * - RSSI3_PRI20
  5750. * Bits 7:0
  5751. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5752. * Value: RSSI dB units w.r.t. noise floor
  5753. * - RSSI3_EXT20
  5754. * Bits 7:0
  5755. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5756. * (if the rx bandwidth was >= 40 MHz)
  5757. * Value: RSSI dB units w.r.t. noise floor
  5758. * - RSSI3_EXT40
  5759. * Bits 7:0
  5760. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5761. * (if the rx bandwidth was >= 80 MHz)
  5762. * Value: RSSI dB units w.r.t. noise floor
  5763. * - RSSI3_EXT80
  5764. * Bits 7:0
  5765. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5766. * (if the rx bandwidth was >= 160 MHz)
  5767. * Value: RSSI dB units w.r.t. noise floor
  5768. *
  5769. * - TSF32
  5770. * Bits 31:0
  5771. * Purpose: specify the time the rx PPDU was received, in TSF units
  5772. * Value: 32 LSBs of the TSF
  5773. * - TIMESTAMP_MICROSEC
  5774. * Bits 31:0
  5775. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5776. * Value: PPDU rx time, in microseconds
  5777. * - VHT_SIG_A1
  5778. * Bits 23:0
  5779. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5780. * from the rx PPDU
  5781. * Value:
  5782. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5783. * VHT-SIG-A1 data.
  5784. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5785. * first 24 bits of the HT-SIG data.
  5786. * Otherwise, this field is invalid.
  5787. * Refer to the the 802.11 protocol for the definition of the
  5788. * HT-SIG and VHT-SIG-A1 fields
  5789. * - VHT_SIG_A2
  5790. * Bits 23:0
  5791. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5792. * from the rx PPDU
  5793. * Value:
  5794. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5795. * VHT-SIG-A2 data.
  5796. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5797. * last 24 bits of the HT-SIG data.
  5798. * Otherwise, this field is invalid.
  5799. * Refer to the the 802.11 protocol for the definition of the
  5800. * HT-SIG and VHT-SIG-A2 fields
  5801. * - PREAMBLE_TYPE
  5802. * Bits 31:24
  5803. * Purpose: indicate the PHY format of the received burst
  5804. * Value:
  5805. * 0x4: Legacy (OFDM/CCK)
  5806. * 0x8: HT
  5807. * 0x9: HT with TxBF
  5808. * 0xC: VHT
  5809. * 0xD: VHT with TxBF
  5810. * - SERVICE
  5811. * Bits 31:24
  5812. * Purpose: TBD
  5813. * Value: TBD
  5814. *
  5815. * Rx MSDU descriptor fields:
  5816. * - FW_RX_DESC_BYTES
  5817. * Bits 15:0
  5818. * Purpose: Indicate how many bytes in the Rx indication are used for
  5819. * FW Rx descriptors
  5820. *
  5821. * Payload fields:
  5822. * - MPDU_COUNT
  5823. * Bits 7:0
  5824. * Purpose: Indicate how many sequential MPDUs share the same status.
  5825. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5826. * - MPDU_STATUS
  5827. * Bits 15:8
  5828. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5829. * received successfully.
  5830. * Value:
  5831. * 0x1: success
  5832. * 0x2: FCS error
  5833. * 0x3: duplicate error
  5834. * 0x4: replay error
  5835. * 0x5: invalid peer
  5836. */
  5837. /* header fields */
  5838. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5839. #define HTT_RX_IND_EXT_TID_S 8
  5840. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5841. #define HTT_RX_IND_FLUSH_VALID_S 13
  5842. #define HTT_RX_IND_REL_VALID_M 0x4000
  5843. #define HTT_RX_IND_REL_VALID_S 14
  5844. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5845. #define HTT_RX_IND_PEER_ID_S 16
  5846. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5847. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5848. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5849. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5850. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5851. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5852. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5853. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5854. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5855. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5856. /* rx PPDU descriptor fields */
  5857. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5858. #define HTT_RX_IND_RSSI_CMB_S 0
  5859. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5860. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5861. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5862. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5863. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5864. #define HTT_RX_IND_PHY_ERR_S 24
  5865. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5866. #define HTT_RX_IND_LEGACY_RATE_S 25
  5867. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5868. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  5869. #define HTT_RX_IND_END_VALID_M 0x40000000
  5870. #define HTT_RX_IND_END_VALID_S 30
  5871. #define HTT_RX_IND_START_VALID_M 0x80000000
  5872. #define HTT_RX_IND_START_VALID_S 31
  5873. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  5874. #define HTT_RX_IND_RSSI_PRI20_S 0
  5875. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  5876. #define HTT_RX_IND_RSSI_EXT20_S 8
  5877. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  5878. #define HTT_RX_IND_RSSI_EXT40_S 16
  5879. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  5880. #define HTT_RX_IND_RSSI_EXT80_S 24
  5881. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  5882. #define HTT_RX_IND_VHT_SIG_A1_S 0
  5883. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  5884. #define HTT_RX_IND_VHT_SIG_A2_S 0
  5885. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  5886. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  5887. #define HTT_RX_IND_SERVICE_M 0xff000000
  5888. #define HTT_RX_IND_SERVICE_S 24
  5889. /* rx MSDU descriptor fields */
  5890. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  5891. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  5892. /* payload fields */
  5893. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  5894. #define HTT_RX_IND_MPDU_COUNT_S 0
  5895. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  5896. #define HTT_RX_IND_MPDU_STATUS_S 8
  5897. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  5898. do { \
  5899. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  5900. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  5901. } while (0)
  5902. #define HTT_RX_IND_EXT_TID_GET(word) \
  5903. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  5904. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  5905. do { \
  5906. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  5907. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  5908. } while (0)
  5909. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  5910. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  5911. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  5912. do { \
  5913. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  5914. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  5915. } while (0)
  5916. #define HTT_RX_IND_REL_VALID_GET(word) \
  5917. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  5918. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  5919. do { \
  5920. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  5921. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  5922. } while (0)
  5923. #define HTT_RX_IND_PEER_ID_GET(word) \
  5924. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  5925. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  5926. do { \
  5927. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  5928. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  5929. } while (0)
  5930. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  5931. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> \
  5932. HTT_RX_IND_FW_RX_DESC_BYTES_S)
  5933. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  5934. do { \
  5935. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  5936. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  5937. } while (0)
  5938. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  5939. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  5940. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  5941. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  5942. do { \
  5943. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  5944. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  5945. } while (0)
  5946. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  5947. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  5948. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  5949. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  5950. do { \
  5951. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  5952. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  5953. } while (0)
  5954. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  5955. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  5956. HTT_RX_IND_REL_SEQ_NUM_START_S)
  5957. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  5958. do { \
  5959. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  5960. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  5961. } while (0)
  5962. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  5963. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  5964. HTT_RX_IND_REL_SEQ_NUM_END_S)
  5965. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  5966. do { \
  5967. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  5968. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  5969. } while (0)
  5970. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  5971. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  5972. HTT_RX_IND_NUM_MPDU_RANGES_S)
  5973. /* FW rx PPDU descriptor fields */
  5974. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  5975. do { \
  5976. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  5977. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  5978. } while (0)
  5979. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  5980. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  5981. HTT_RX_IND_RSSI_CMB_S)
  5982. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  5983. do { \
  5984. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  5985. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  5986. } while (0)
  5987. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  5988. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  5989. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  5990. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  5991. do { \
  5992. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  5993. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  5994. } while (0)
  5995. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  5996. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  5997. HTT_RX_IND_PHY_ERR_CODE_S)
  5998. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  5999. do { \
  6000. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  6001. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  6002. } while (0)
  6003. #define HTT_RX_IND_PHY_ERR_GET(word) \
  6004. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  6005. HTT_RX_IND_PHY_ERR_S)
  6006. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  6007. do { \
  6008. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  6009. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  6010. } while (0)
  6011. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  6012. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  6013. HTT_RX_IND_LEGACY_RATE_S)
  6014. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  6015. do { \
  6016. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  6017. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  6018. } while (0)
  6019. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  6020. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  6021. HTT_RX_IND_LEGACY_RATE_SEL_S)
  6022. #define HTT_RX_IND_END_VALID_SET(word, value) \
  6023. do { \
  6024. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  6025. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  6026. } while (0)
  6027. #define HTT_RX_IND_END_VALID_GET(word) \
  6028. (((word) & HTT_RX_IND_END_VALID_M) >> \
  6029. HTT_RX_IND_END_VALID_S)
  6030. #define HTT_RX_IND_START_VALID_SET(word, value) \
  6031. do { \
  6032. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  6033. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  6034. } while (0)
  6035. #define HTT_RX_IND_START_VALID_GET(word) \
  6036. (((word) & HTT_RX_IND_START_VALID_M) >> \
  6037. HTT_RX_IND_START_VALID_S)
  6038. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  6039. do { \
  6040. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  6041. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  6042. } while (0)
  6043. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  6044. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  6045. HTT_RX_IND_RSSI_PRI20_S)
  6046. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  6047. do { \
  6048. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  6049. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  6050. } while (0)
  6051. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  6052. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  6053. HTT_RX_IND_RSSI_EXT20_S)
  6054. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  6055. do { \
  6056. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6057. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6058. } while (0)
  6059. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6060. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6061. HTT_RX_IND_RSSI_EXT40_S)
  6062. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6063. do { \
  6064. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6065. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6066. } while (0)
  6067. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6068. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6069. HTT_RX_IND_RSSI_EXT80_S)
  6070. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6071. do { \
  6072. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6073. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6074. } while (0)
  6075. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6076. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6077. HTT_RX_IND_VHT_SIG_A1_S)
  6078. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6079. do { \
  6080. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6081. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6082. } while (0)
  6083. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6084. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6085. HTT_RX_IND_VHT_SIG_A2_S)
  6086. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6087. do { \
  6088. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6089. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6090. } while (0)
  6091. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6092. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6093. HTT_RX_IND_PREAMBLE_TYPE_S)
  6094. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6095. do { \
  6096. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6097. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6098. } while (0)
  6099. #define HTT_RX_IND_SERVICE_GET(word) \
  6100. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6101. HTT_RX_IND_SERVICE_S)
  6102. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6103. do { \
  6104. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6105. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6106. } while (0)
  6107. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6108. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6109. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6110. do { \
  6111. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6112. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6113. } while (0)
  6114. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6115. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6116. #define HTT_RX_IND_HL_BYTES \
  6117. (HTT_RX_IND_HDR_BYTES + \
  6118. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  6119. 4 /* single MPDU range information element */)
  6120. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6121. /* Could we use one macro entry? */
  6122. #define HTT_WORD_SET(word, field, value) \
  6123. do { \
  6124. HTT_CHECK_SET_VAL(field, value); \
  6125. (word) |= ((value) << field ## _S); \
  6126. } while (0)
  6127. #define HTT_WORD_GET(word, field) \
  6128. (((word) & field ## _M) >> field ## _S)
  6129. PREPACK struct hl_htt_rx_ind_base {
  6130. /*
  6131. * align with LL case rx indication message,but
  6132. * reduced to 5 words
  6133. */
  6134. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32];
  6135. } POSTPACK;
  6136. /*
  6137. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6138. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6139. * HL host needed info. The field is just after the msdu fw rx desc.
  6140. */
  6141. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6142. (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6143. struct htt_rx_ind_hl_rx_desc_t {
  6144. A_UINT8 ver;
  6145. A_UINT8 len;
  6146. struct {
  6147. A_UINT8
  6148. first_msdu:1,
  6149. last_msdu:1,
  6150. c3_failed:1,
  6151. c4_failed:1,
  6152. ipv6:1,
  6153. tcp:1,
  6154. udp:1,
  6155. reserved:1;
  6156. } flags;
  6157. };
  6158. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6159. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6160. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6161. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6162. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6163. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6164. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6165. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6166. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6167. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6168. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6169. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6170. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6171. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6172. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or ipv4 */
  6173. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6174. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6175. /* This structure is used in HL, the basic descriptor information
  6176. * used by host. the structure is translated by FW from HW desc
  6177. * or generated by FW. But in HL monitor mode, the host would use
  6178. * the same structure with LL.
  6179. */
  6180. PREPACK struct hl_htt_rx_desc_base {
  6181. A_UINT32
  6182. seq_num:12,
  6183. encrypted:1,
  6184. chan_info_present:1,
  6185. resv0:2,
  6186. mcast_bcast:1,
  6187. fragment:1,
  6188. key_id_oct:8,
  6189. resv1:6;
  6190. A_UINT32 pn_31_0;
  6191. union {
  6192. struct {
  6193. A_UINT16 pn_47_32;
  6194. A_UINT16 pn_63_48;
  6195. } pn16;
  6196. A_UINT32 pn_63_32;
  6197. } u0;
  6198. A_UINT32 pn_95_64;
  6199. A_UINT32 pn_127_96;
  6200. } POSTPACK;
  6201. /*
  6202. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6203. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6204. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6205. * Please see htt_chan_change_t for description of the fields.
  6206. */
  6207. PREPACK struct htt_chan_info_t
  6208. {
  6209. A_UINT32
  6210. primary_chan_center_freq_mhz:16,
  6211. contig_chan1_center_freq_mhz:16;
  6212. A_UINT32
  6213. contig_chan2_center_freq_mhz:16,
  6214. phy_mode:8,
  6215. reserved:8;
  6216. } POSTPACK;
  6217. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6218. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6219. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6220. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6221. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6222. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6223. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6224. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6225. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6226. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6227. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6228. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6229. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6230. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6231. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6232. #define HTT_HL_RX_DESC_PN_OFFSET \
  6233. offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6234. #define HTT_HL_RX_DESC_PN_WORD_OFFSET \
  6235. (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6236. /* Channel information */
  6237. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6238. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6239. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6240. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6241. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6242. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6243. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6244. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6245. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6246. do { \
  6247. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6248. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6249. } while (0)
  6250. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6251. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) \
  6252. >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6253. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6254. do { \
  6255. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6256. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6257. } while (0)
  6258. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6259. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) \
  6260. >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6261. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6262. do { \
  6263. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6264. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6265. } while (0)
  6266. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6267. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) \
  6268. >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6269. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6270. do { \
  6271. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6272. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6273. } while (0)
  6274. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6275. (((word) & HTT_CHAN_INFO_PHY_MODE_M) \
  6276. >> HTT_CHAN_INFO_PHY_MODE_S)
  6277. /*
  6278. * @brief target -> host rx reorder flush message definition
  6279. *
  6280. * @details
  6281. * The following field definitions describe the format of the rx flush
  6282. * message sent from the target to the host.
  6283. * The message consists of a 4-octet header, followed by one or more
  6284. * 4-octet payload information elements.
  6285. *
  6286. * |31 24|23 8|7 0|
  6287. * |--------------------------------------------------------------|
  6288. * | TID | peer ID | msg type |
  6289. * |--------------------------------------------------------------|
  6290. * | seq num end | seq num start | MPDU status | reserved |
  6291. * |--------------------------------------------------------------|
  6292. * First DWORD:
  6293. * - MSG_TYPE
  6294. * Bits 7:0
  6295. * Purpose: identifies this as an rx flush message
  6296. * Value: 0x2
  6297. * - PEER_ID
  6298. * Bits 23:8 (only bits 18:8 actually used)
  6299. * Purpose: identify which peer's rx data is being flushed
  6300. * Value: (rx) peer ID
  6301. * - TID
  6302. * Bits 31:24 (only bits 27:24 actually used)
  6303. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6304. * Value: traffic identifier
  6305. * Second DWORD:
  6306. * - MPDU_STATUS
  6307. * Bits 15:8
  6308. * Purpose:
  6309. * Indicate whether the flushed MPDUs should be discarded or processed.
  6310. * Value:
  6311. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6312. * stages of rx processing
  6313. * other: discard the MPDUs
  6314. * It is anticipated that flush messages will always have
  6315. * MPDU status == 1, but the status flag is included for
  6316. * flexibility.
  6317. * - SEQ_NUM_START
  6318. * Bits 23:16
  6319. * Purpose:
  6320. * Indicate the start of a series of consecutive MPDUs being flushed.
  6321. * Not all MPDUs within this range are necessarily valid - the host
  6322. * must check each sequence number within this range to see if the
  6323. * corresponding MPDU is actually present.
  6324. * Value:
  6325. * The sequence number for the first MPDU in the sequence.
  6326. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6327. * - SEQ_NUM_END
  6328. * Bits 30:24
  6329. * Purpose:
  6330. * Indicate the end of a series of consecutive MPDUs being flushed.
  6331. * Value:
  6332. * The sequence number one larger than the sequence number of the
  6333. * last MPDU being flushed.
  6334. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6335. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6336. * are to be released for further rx processing.
  6337. * Not all MPDUs within this range are necessarily valid - the host
  6338. * must check each sequence number within this range to see if the
  6339. * corresponding MPDU is actually present.
  6340. */
  6341. /* first DWORD */
  6342. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6343. #define HTT_RX_FLUSH_PEER_ID_S 8
  6344. #define HTT_RX_FLUSH_TID_M 0xff000000
  6345. #define HTT_RX_FLUSH_TID_S 24
  6346. /* second DWORD */
  6347. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6348. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6349. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6350. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6351. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6352. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6353. #define HTT_RX_FLUSH_BYTES 8
  6354. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6355. do { \
  6356. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6357. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6358. } while (0)
  6359. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6360. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6361. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6362. do { \
  6363. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6364. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6365. } while (0)
  6366. #define HTT_RX_FLUSH_TID_GET(word) \
  6367. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6368. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6369. do { \
  6370. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6371. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6372. } while (0)
  6373. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6374. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6375. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6376. do { \
  6377. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6378. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6379. } while (0)
  6380. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6381. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> \
  6382. HTT_RX_FLUSH_SEQ_NUM_START_S)
  6383. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6384. do { \
  6385. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6386. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6387. } while (0)
  6388. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6389. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6390. /*
  6391. * @brief target -> host rx pn check indication message
  6392. *
  6393. * @details
  6394. * The following field definitions describe the format of the Rx PN check
  6395. * indication message sent from the target to the host.
  6396. * The message consists of a 4-octet header, followed by the start and
  6397. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6398. * IE is one octet containing the sequence number that failed the PN
  6399. * check.
  6400. *
  6401. * |31 24|23 8|7 0|
  6402. * |--------------------------------------------------------------|
  6403. * | TID | peer ID | msg type |
  6404. * |--------------------------------------------------------------|
  6405. * | Reserved | PN IE count | seq num end | seq num start|
  6406. * |--------------------------------------------------------------|
  6407. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6408. * |--------------------------------------------------------------|
  6409. * First DWORD:
  6410. * - MSG_TYPE
  6411. * Bits 7:0
  6412. * Purpose: Identifies this as an rx pn check indication message
  6413. * Value: 0x2
  6414. * - PEER_ID
  6415. * Bits 23:8 (only bits 18:8 actually used)
  6416. * Purpose: identify which peer
  6417. * Value: (rx) peer ID
  6418. * - TID
  6419. * Bits 31:24 (only bits 27:24 actually used)
  6420. * Purpose: identify traffic identifier
  6421. * Value: traffic identifier
  6422. * Second DWORD:
  6423. * - SEQ_NUM_START
  6424. * Bits 7:0
  6425. * Purpose:
  6426. * Indicates the starting sequence number of the MPDU in this
  6427. * series of MPDUs that went though PN check.
  6428. * Value:
  6429. * The sequence number for the first MPDU in the sequence.
  6430. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6431. * - SEQ_NUM_END
  6432. * Bits 15:8
  6433. * Purpose:
  6434. * Indicates the ending sequence number of the MPDU in this
  6435. * series of MPDUs that went though PN check.
  6436. * Value:
  6437. * The sequence number one larger then the sequence number of the last
  6438. * MPDU being flushed.
  6439. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6440. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1]
  6441. * have been checked for invalid PN numbers and are ready
  6442. * to be released for further processing.
  6443. * Not all MPDUs within this range are necessarily valid - the host
  6444. * must check each sequence number within this range to see if the
  6445. * corresponding MPDU is actually present.
  6446. * - PN_IE_COUNT
  6447. * Bits 23:16
  6448. * Purpose:
  6449. * Used to determine the variable number of PN information
  6450. * elements in this message
  6451. *
  6452. * PN information elements:
  6453. * - PN_IE_x-
  6454. * Purpose:
  6455. * Each PN information element contains the sequence number
  6456. * of the MPDU that has failed the target PN check.
  6457. * Value:
  6458. * Contains the 6 LSBs of the 802.11 sequence number
  6459. * corresponding to the MPDU that failed the PN check.
  6460. */
  6461. /* first DWORD */
  6462. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6463. #define HTT_RX_PN_IND_PEER_ID_S 8
  6464. #define HTT_RX_PN_IND_TID_M 0xff000000
  6465. #define HTT_RX_PN_IND_TID_S 24
  6466. /* second DWORD */
  6467. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6468. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6469. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6470. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6471. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6472. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6473. #define HTT_RX_PN_IND_BYTES 8
  6474. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6475. do { \
  6476. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6477. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6478. } while (0)
  6479. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6480. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6481. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6482. do { \
  6483. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6484. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6485. } while (0)
  6486. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6487. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6488. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6489. do { \
  6490. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6491. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6492. } while (0)
  6493. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6494. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> \
  6495. HTT_RX_PN_IND_SEQ_NUM_START_S)
  6496. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6497. do { \
  6498. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6499. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6500. } while (0)
  6501. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6502. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6503. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6504. do { \
  6505. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6506. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6507. } while (0)
  6508. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6509. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6510. /*
  6511. * @brief target -> host rx offload deliver message for LL system
  6512. *
  6513. * @details
  6514. * In a low latency system this message is sent whenever the offload
  6515. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6516. * The DMA of the actual packets into host memory is done before sending out
  6517. * this message. This message indicates only how many MSDUs to reap. The
  6518. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6519. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6520. * DMA'd by the MAC directly into host memory these packets do not contain
  6521. * the MAC descriptors in the header portion of the packet. Instead they contain
  6522. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6523. * message, the packets are delivered directly to the NW stack without going
  6524. * through the regular reorder buffering and PN checking path since it has
  6525. * already been done in target.
  6526. *
  6527. * |31 24|23 16|15 8|7 0|
  6528. * |-----------------------------------------------------------------------|
  6529. * | Total MSDU count | reserved | msg type |
  6530. * |-----------------------------------------------------------------------|
  6531. *
  6532. * @brief target -> host rx offload deliver message for HL system
  6533. *
  6534. * @details
  6535. * In a high latency system this message is sent whenever the offload manager
  6536. * flushes out the packets it has coalesced in its coalescing buffer. The
  6537. * actual packets are also carried along with this message. When the host
  6538. * receives this message, it is expected to deliver these packets to the NW
  6539. * stack directly instead of routing them through the reorder buffering and
  6540. * PN checking path since it has already been done in target.
  6541. *
  6542. * |31 24|23 16|15 8|7 0|
  6543. * |-----------------------------------------------------------------------|
  6544. * | Total MSDU count | reserved | msg type |
  6545. * |-----------------------------------------------------------------------|
  6546. * | peer ID | MSDU length |
  6547. * |-----------------------------------------------------------------------|
  6548. * | MSDU payload | FW Desc | tid | vdev ID |
  6549. * |-----------------------------------------------------------------------|
  6550. * | MSDU payload contd. |
  6551. * |-----------------------------------------------------------------------|
  6552. * | peer ID | MSDU length |
  6553. * |-----------------------------------------------------------------------|
  6554. * | MSDU payload | FW Desc | tid | vdev ID |
  6555. * |-----------------------------------------------------------------------|
  6556. * | MSDU payload contd. |
  6557. * |-----------------------------------------------------------------------|
  6558. *
  6559. */
  6560. /* first DWORD */
  6561. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6562. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6563. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6564. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6565. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6566. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6567. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6568. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6569. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6570. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6571. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6572. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6573. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6574. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6575. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6576. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> \
  6577. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6578. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6579. do { \
  6580. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6581. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6582. } while (0) \
  6583. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6584. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> \
  6585. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6586. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6587. do { \
  6588. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6589. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6590. } while (0) \
  6591. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6592. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> \
  6593. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6594. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6595. do { \
  6596. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6597. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6598. } while (0) \
  6599. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6600. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> \
  6601. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6602. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6603. do { \
  6604. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6605. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6606. } while (0) \
  6607. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6608. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> \
  6609. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6610. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6611. do { \
  6612. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6613. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6614. } while (0) \
  6615. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6616. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> \
  6617. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6618. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6619. do { \
  6620. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6621. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6622. } while (0) \
  6623. /**
  6624. * @brief target -> host rx peer map/unmap message definition
  6625. *
  6626. * @details
  6627. * The following diagram shows the format of the rx peer map message sent
  6628. * from the target to the host. This layout assumes the target operates
  6629. * as little-endian.
  6630. *
  6631. * This message always contains a SW peer ID. The main purpose of the
  6632. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6633. * with, so that the host can use that peer ID to determine which peer
  6634. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6635. * other purposes, such as identifying during tx completions which peer
  6636. * the tx frames in question were transmitted to.
  6637. *
  6638. * In certain generations of chips, the peer map message also contains
  6639. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6640. * to identify which peer the frame needs to be forwarded to (i.e. the
  6641. * peer assocated with the Destination MAC Address within the packet),
  6642. * and particularly which vdev needs to transmit the frame (for cases
  6643. * of inter-vdev rx --> tx forwarding).
  6644. * This DA-based peer ID that is provided for certain rx frames
  6645. * (the rx frames that need to be re-transmitted as tx frames)
  6646. * is the ID that the HW uses for referring to the peer in question,
  6647. * rather than the peer ID that the SW+FW use to refer to the peer.
  6648. *
  6649. *
  6650. * |31 24|23 16|15 8|7 0|
  6651. * |-----------------------------------------------------------------------|
  6652. * | SW peer ID | VDEV ID | msg type |
  6653. * |-----------------------------------------------------------------------|
  6654. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6655. * |-----------------------------------------------------------------------|
  6656. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6657. * |-----------------------------------------------------------------------|
  6658. *
  6659. *
  6660. * The following diagram shows the format of the rx peer unmap message sent
  6661. * from the target to the host.
  6662. *
  6663. * |31 24|23 16|15 8|7 0|
  6664. * |-----------------------------------------------------------------------|
  6665. * | SW peer ID | VDEV ID | msg type |
  6666. * |-----------------------------------------------------------------------|
  6667. *
  6668. * The following field definitions describe the format of the rx peer map
  6669. * and peer unmap messages sent from the target to the host.
  6670. * - MSG_TYPE
  6671. * Bits 7:0
  6672. * Purpose: identifies this as an rx peer map or peer unmap message
  6673. * Value: peer map -> 0x3, peer unmap -> 0x4
  6674. * - VDEV_ID
  6675. * Bits 15:8
  6676. * Purpose: Indicates which virtual device the peer is associated
  6677. * with.
  6678. * Value: vdev ID (used in the host to look up the vdev object)
  6679. * - PEER_ID (a.k.a. SW_PEER_ID)
  6680. * Bits 31:16
  6681. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6682. * freeing (unmap)
  6683. * Value: (rx) peer ID
  6684. * - MAC_ADDR_L32 (peer map only)
  6685. * Bits 31:0
  6686. * Purpose: Identifies which peer node the peer ID is for.
  6687. * Value: lower 4 bytes of peer node's MAC address
  6688. * - MAC_ADDR_U16 (peer map only)
  6689. * Bits 15:0
  6690. * Purpose: Identifies which peer node the peer ID is for.
  6691. * Value: upper 2 bytes of peer node's MAC address
  6692. * - HW_PEER_ID
  6693. * Bits 31:16
  6694. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6695. * address, so for rx frames marked for rx --> tx forwarding, the
  6696. * host can determine from the HW peer ID provided as meta-data with
  6697. * the rx frame which peer the frame is supposed to be forwarded to.
  6698. * Value: ID used by the MAC HW to identify the peer
  6699. */
  6700. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6701. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6702. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6703. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6704. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6705. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6706. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6707. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6708. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6709. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6710. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6711. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6712. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6713. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6714. do { \
  6715. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6716. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6717. } while (0)
  6718. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6719. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6720. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6721. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6722. do { \
  6723. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6724. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6725. } while (0)
  6726. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6727. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6728. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  6729. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  6730. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  6731. do { \
  6732. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  6733. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  6734. } while (0)
  6735. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  6736. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> \
  6737. HTT_RX_PEER_MAP_HW_PEER_ID_S)
  6738. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6739. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  6740. #define HTT_RX_PEER_MAP_BYTES 12
  6741. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6742. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6743. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  6744. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  6745. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6746. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6747. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6748. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6749. #define HTT_RX_PEER_UNMAP_BYTES 4
  6750. /**
  6751. * @brief target -> host message specifying security parameters
  6752. *
  6753. * @details
  6754. * The following diagram shows the format of the security specification
  6755. * message sent from the target to the host.
  6756. * This security specification message tells the host whether a PN check is
  6757. * necessary on rx data frames, and if so, how large the PN counter is.
  6758. * This message also tells the host about the security processing to apply
  6759. * to defragmented rx frames - specifically, whether a Message Integrity
  6760. * Check is required, and the Michael key to use.
  6761. *
  6762. * |31 24|23 16|15|14 8|7 0|
  6763. * |-----------------------------------------------------------------------|
  6764. * | peer ID | U| security type | msg type |
  6765. * |-----------------------------------------------------------------------|
  6766. * | Michael Key K0 |
  6767. * |-----------------------------------------------------------------------|
  6768. * | Michael Key K1 |
  6769. * |-----------------------------------------------------------------------|
  6770. * | WAPI RSC Low0 |
  6771. * |-----------------------------------------------------------------------|
  6772. * | WAPI RSC Low1 |
  6773. * |-----------------------------------------------------------------------|
  6774. * | WAPI RSC Hi0 |
  6775. * |-----------------------------------------------------------------------|
  6776. * | WAPI RSC Hi1 |
  6777. * |-----------------------------------------------------------------------|
  6778. *
  6779. * The following field definitions describe the format of the security
  6780. * indication message sent from the target to the host.
  6781. * - MSG_TYPE
  6782. * Bits 7:0
  6783. * Purpose: identifies this as a security specification message
  6784. * Value: 0xb
  6785. * - SEC_TYPE
  6786. * Bits 14:8
  6787. * Purpose: specifies which type of security applies to the peer
  6788. * Value: htt_sec_type enum value
  6789. * - UNICAST
  6790. * Bit 15
  6791. * Purpose: whether this security is applied to unicast or multicast data
  6792. * Value: 1 -> unicast, 0 -> multicast
  6793. * - PEER_ID
  6794. * Bits 31:16
  6795. * Purpose: The ID number for the peer the security specification is for
  6796. * Value: peer ID
  6797. * - MICHAEL_KEY_K0
  6798. * Bits 31:0
  6799. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  6800. * Value: Michael Key K0 (if security type is TKIP)
  6801. * - MICHAEL_KEY_K1
  6802. * Bits 31:0
  6803. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  6804. * Value: Michael Key K1 (if security type is TKIP)
  6805. * - WAPI_RSC_LOW0
  6806. * Bits 31:0
  6807. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  6808. * Value: WAPI RSC Low0 (if security type is WAPI)
  6809. * - WAPI_RSC_LOW1
  6810. * Bits 31:0
  6811. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  6812. * Value: WAPI RSC Low1 (if security type is WAPI)
  6813. * - WAPI_RSC_HI0
  6814. * Bits 31:0
  6815. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  6816. * Value: WAPI RSC Hi0 (if security type is WAPI)
  6817. * - WAPI_RSC_HI1
  6818. * Bits 31:0
  6819. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  6820. * Value: WAPI RSC Hi1 (if security type is WAPI)
  6821. */
  6822. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  6823. #define HTT_SEC_IND_SEC_TYPE_S 8
  6824. #define HTT_SEC_IND_UNICAST_M 0x00008000
  6825. #define HTT_SEC_IND_UNICAST_S 15
  6826. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  6827. #define HTT_SEC_IND_PEER_ID_S 16
  6828. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  6829. do { \
  6830. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  6831. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  6832. } while (0)
  6833. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  6834. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  6835. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  6836. do { \
  6837. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  6838. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  6839. } while (0)
  6840. #define HTT_SEC_IND_UNICAST_GET(word) \
  6841. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  6842. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  6843. do { \
  6844. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  6845. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  6846. } while (0)
  6847. #define HTT_SEC_IND_PEER_ID_GET(word) \
  6848. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  6849. #define HTT_SEC_IND_BYTES 28
  6850. /**
  6851. * @brief target -> host rx ADDBA / DELBA message definitions
  6852. *
  6853. * @details
  6854. * The following diagram shows the format of the rx ADDBA message sent
  6855. * from the target to the host:
  6856. *
  6857. * |31 20|19 16|15 8|7 0|
  6858. * |---------------------------------------------------------------------|
  6859. * | peer ID | TID | window size | msg type |
  6860. * |---------------------------------------------------------------------|
  6861. *
  6862. * The following diagram shows the format of the rx DELBA message sent
  6863. * from the target to the host:
  6864. *
  6865. * |31 20|19 16|15 8|7 0|
  6866. * |---------------------------------------------------------------------|
  6867. * | peer ID | TID | reserved | msg type |
  6868. * |---------------------------------------------------------------------|
  6869. *
  6870. * The following field definitions describe the format of the rx ADDBA
  6871. * and DELBA messages sent from the target to the host.
  6872. * - MSG_TYPE
  6873. * Bits 7:0
  6874. * Purpose: identifies this as an rx ADDBA or DELBA message
  6875. * Value: ADDBA -> 0x5, DELBA -> 0x6
  6876. * - WIN_SIZE
  6877. * Bits 15:8 (ADDBA only)
  6878. * Purpose: Specifies the length of the block ack window (max = 64).
  6879. * Value:
  6880. * block ack window length specified by the received ADDBA
  6881. * management message.
  6882. * - TID
  6883. * Bits 19:16
  6884. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  6885. * Value:
  6886. * TID specified by the received ADDBA or DELBA management message.
  6887. * - PEER_ID
  6888. * Bits 31:20
  6889. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  6890. * Value:
  6891. * ID (hash value) used by the host for fast, direct lookup of
  6892. * host SW peer info, including rx reorder states.
  6893. */
  6894. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  6895. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  6896. #define HTT_RX_ADDBA_TID_M 0xf0000
  6897. #define HTT_RX_ADDBA_TID_S 16
  6898. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  6899. #define HTT_RX_ADDBA_PEER_ID_S 20
  6900. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  6901. do { \
  6902. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  6903. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  6904. } while (0)
  6905. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  6906. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  6907. #define HTT_RX_ADDBA_TID_SET(word, value) \
  6908. do { \
  6909. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  6910. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  6911. } while (0)
  6912. #define HTT_RX_ADDBA_TID_GET(word) \
  6913. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  6914. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  6915. do { \
  6916. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  6917. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  6918. } while (0)
  6919. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  6920. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  6921. #define HTT_RX_ADDBA_BYTES 4
  6922. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  6923. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  6924. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  6925. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  6926. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  6927. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  6928. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  6929. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  6930. #define HTT_RX_DELBA_BYTES 4
  6931. /**
  6932. * @brief tx queue group information element definition
  6933. *
  6934. * @details
  6935. * The following diagram shows the format of the tx queue group
  6936. * information element, which can be included in target --> host
  6937. * messages to specify the number of tx "credits" (tx descriptors
  6938. * for LL, or tx buffers for HL) available to a particular group
  6939. * of host-side tx queues, and which host-side tx queues belong to
  6940. * the group.
  6941. *
  6942. * |31|30 24|23 16|15|14|13 0|
  6943. * |------------------------------------------------------------------------|
  6944. * | X| reserved | tx queue grp ID | A| S| credit count |
  6945. * |------------------------------------------------------------------------|
  6946. * | vdev ID mask | AC mask |
  6947. * |------------------------------------------------------------------------|
  6948. *
  6949. * The following definitions describe the fields within the tx queue group
  6950. * information element:
  6951. * - credit_count
  6952. * Bits 13:1
  6953. * Purpose: specify how many tx credits are available to the tx queue group
  6954. * Value: An absolute or relative, positive or negative credit value
  6955. * The 'A' bit specifies whether the value is absolute or relative.
  6956. * The 'S' bit specifies whether the value is positive or negative.
  6957. * A negative value can only be relative, not absolute.
  6958. * An absolute value replaces any prior credit value the host has for
  6959. * the tx queue group in question.
  6960. * A relative value is added to the prior credit value the host has for
  6961. * the tx queue group in question.
  6962. * - sign
  6963. * Bit 14
  6964. * Purpose: specify whether the credit count is positive or negative
  6965. * Value: 0 -> positive, 1 -> negative
  6966. * - absolute
  6967. * Bit 15
  6968. * Purpose: specify whether the credit count is absolute or relative
  6969. * Value: 0 -> relative, 1 -> absolute
  6970. * - txq_group_id
  6971. * Bits 23:16
  6972. * Purpose: indicate which tx queue group's credit and/or membership are
  6973. * being specified
  6974. * Value: 0 to max_tx_queue_groups-1
  6975. * - reserved
  6976. * Bits 30:16
  6977. * Value: 0x0
  6978. * - eXtension
  6979. * Bit 31
  6980. * Purpose: specify whether another tx queue group info element follows
  6981. * Value: 0 -> no more tx queue group information elements
  6982. * 1 -> another tx queue group information element immediately follows
  6983. * - ac_mask
  6984. * Bits 15:0
  6985. * Purpose: specify which Access Categories belong to the tx queue group
  6986. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  6987. * the tx queue group.
  6988. * The AC bit-mask values are obtained by left-shifting by the
  6989. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  6990. * - vdev_id_mask
  6991. * Bits 31:16
  6992. * Purpose: specify which vdev's tx queues belong to the tx queue group
  6993. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  6994. * belong to the tx queue group.
  6995. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  6996. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  6997. */
  6998. PREPACK struct htt_txq_group {
  6999. A_UINT32
  7000. credit_count:14,
  7001. sign:1,
  7002. absolute:1,
  7003. tx_queue_group_id:8,
  7004. reserved0:7,
  7005. extension:1;
  7006. A_UINT32
  7007. ac_mask:16,
  7008. vdev_id_mask:16;
  7009. } POSTPACK;
  7010. /* first word */
  7011. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7012. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7013. #define HTT_TXQ_GROUP_SIGN_S 14
  7014. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7015. #define HTT_TXQ_GROUP_ABS_S 15
  7016. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7017. #define HTT_TXQ_GROUP_ID_S 16
  7018. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7019. #define HTT_TXQ_GROUP_EXT_S 31
  7020. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7021. /* second word */
  7022. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7023. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7024. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7025. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7026. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7027. do { \
  7028. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7029. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7030. } while (0)
  7031. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7032. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> \
  7033. HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7034. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7035. do { \
  7036. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7037. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7038. } while (0)
  7039. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7040. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7041. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7042. do { \
  7043. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7044. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7045. } while (0)
  7046. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7047. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7048. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7049. do { \
  7050. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7051. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7052. } while (0)
  7053. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7054. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7055. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7056. do { \
  7057. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7058. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7059. } while (0)
  7060. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7061. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7062. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7063. do { \
  7064. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7065. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7066. } while (0)
  7067. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7068. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7069. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7070. do { \
  7071. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7072. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7073. } while (0)
  7074. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7075. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> \
  7076. HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7077. /**
  7078. * @brief target -> host TX completion indication message definition
  7079. *
  7080. * @details
  7081. * The following diagram shows the format of the TX completion indication sent
  7082. * from the target to the host
  7083. *
  7084. * |31 25| 24|23 16| 15 |14 11|10 8|7 0|
  7085. * |-------------------------------------------------------------|
  7086. * header: | reserved |append| num | t_i| tid |status| msg_type |
  7087. * |-------------------------------------------------------------|
  7088. * payload: | MSDU1 ID | MSDU0 ID |
  7089. * |-------------------------------------------------------------|
  7090. * : MSDU3 ID : MSDU2 ID :
  7091. * |-------------------------------------------------------------|
  7092. * | struct htt_tx_compl_ind_append_retries |
  7093. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7094. *
  7095. * The following field definitions describe the format of the TX completion
  7096. * indication sent from the target to the host
  7097. * Header fields:
  7098. * - msg_type
  7099. * Bits 7:0
  7100. * Purpose: identifies this as HTT TX completion indication
  7101. * Value: 0x7
  7102. * - status
  7103. * Bits 10:8
  7104. * Purpose: the TX completion status of payload fragmentations descriptors
  7105. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7106. * - tid
  7107. * Bits 14:11
  7108. * Purpose: the tid associated with those fragmentation descriptors. It is
  7109. * valid or not, depending on the tid_invalid bit.
  7110. * Value: 0 to 15
  7111. * - tid_invalid
  7112. * Bits 15:15
  7113. * Purpose: this bit indicates whether the tid field is valid or not
  7114. * Value: 0 indicates valid; 1 indicates invalid
  7115. * - num
  7116. * Bits 23:16
  7117. * Purpose: the number of payload in this indication
  7118. * Value: 1 to 255
  7119. * - append
  7120. * Bits 24:24
  7121. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7122. * the number of tx retries for one MSDU at the end of this message
  7123. * Value: 0 indicates no appending; 1 indicates appending
  7124. * Payload fields:
  7125. * - hmsdu_id
  7126. * Bits 15:0
  7127. * Purpose: this ID is used to track the Tx buffer in host
  7128. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7129. */
  7130. #define HTT_TX_COMPL_IND_STATUS_S 8
  7131. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7132. #define HTT_TX_COMPL_IND_TID_S 11
  7133. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7134. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7135. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7136. #define HTT_TX_COMPL_IND_NUM_S 16
  7137. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7138. #define HTT_TX_COMPL_IND_APPEND_S 24
  7139. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7140. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7141. do { \
  7142. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7143. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7144. } while (0)
  7145. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7146. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7147. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7148. do { \
  7149. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7150. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7151. } while (0)
  7152. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7153. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7154. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7155. do { \
  7156. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7157. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7158. } while (0)
  7159. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7160. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7161. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7162. do { \
  7163. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7164. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7165. } while (0)
  7166. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7167. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7168. HTT_TX_COMPL_IND_TID_INV_S)
  7169. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7170. do { \
  7171. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7172. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7173. } while (0)
  7174. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7175. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7176. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7177. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7178. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7179. #define HTT_TX_COMPL_IND_STAT_OK 0
  7180. /* DISCARD:
  7181. * current meaning:
  7182. * MSDUs were queued for transmission but filtered by HW or SW
  7183. * without any over the air attempts
  7184. * legacy meaning (HL Rome):
  7185. * MSDUs were discarded by the target FW without any over the air
  7186. * attempts due to lack of space
  7187. */
  7188. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7189. /* NO_ACK:
  7190. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7191. */
  7192. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7193. /* POSTPONE:
  7194. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7195. * be downloaded again later (in the appropriate order), when they are
  7196. * deliverable.
  7197. */
  7198. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7199. /*
  7200. * The PEER_DEL tx completion status is used for HL cases
  7201. * where the peer the frame is for has been deleted.
  7202. * The host has already discarded its copy of the frame, but
  7203. * it still needs the tx completion to restore its credit.
  7204. */
  7205. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7206. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7207. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7208. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7209. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7210. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7211. PREPACK struct htt_tx_compl_ind_base {
  7212. A_UINT32 hdr;
  7213. A_UINT16 payload[1 /*or more */];
  7214. } POSTPACK;
  7215. PREPACK struct htt_tx_compl_ind_append_retries {
  7216. A_UINT16 msdu_id;
  7217. A_UINT8 tx_retries;
  7218. A_UINT8 flag;/* Bit 0, 1: another append_retries struct is appended
  7219. 0: this is the last append_retries struct */
  7220. } POSTPACK;
  7221. /**
  7222. * @brief target -> host rate-control update indication message
  7223. *
  7224. * @details
  7225. * The following diagram shows the format of the RC Update message
  7226. * sent from the target to the host, while processing the tx-completion
  7227. * of a transmitted PPDU.
  7228. *
  7229. * |31 24|23 16|15 8|7 0|
  7230. * |-------------------------------------------------------------|
  7231. * | peer ID | vdev ID | msg_type |
  7232. * |-------------------------------------------------------------|
  7233. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7234. * |-------------------------------------------------------------|
  7235. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7236. * |-------------------------------------------------------------|
  7237. * | : |
  7238. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7239. * | : |
  7240. * |-------------------------------------------------------------|
  7241. * | : |
  7242. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7243. * | : |
  7244. * |-------------------------------------------------------------|
  7245. * : :
  7246. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7247. *
  7248. */
  7249. typedef struct {
  7250. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7251. A_UINT32 rate_code_flags;
  7252. A_UINT32 flags; /* Encodes information such as excessive
  7253. retransmission, aggregate, some info
  7254. from .11 frame control,
  7255. STBC, LDPC, (SGI and Tx Chain Mask
  7256. are encoded in ptx_rc->flags field),
  7257. AMPDU truncation (BT/time based etc.),
  7258. RTS/CTS attempt */
  7259. A_UINT32 num_enqued;/* # of MPDUs (for non-AMPDU 1) for this rate */
  7260. A_UINT32 num_retries;/* Total # of transmission attempt for this rate */
  7261. A_UINT32 num_failed;/* # of failed MPDUs in A-MPDU, 0 otherwise */
  7262. A_UINT32 ack_rssi;/* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7263. A_UINT32 time_stamp; /* ACK timestamp (helps determine age) */
  7264. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7265. } HTT_RC_TX_DONE_PARAMS;
  7266. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS))/* bytes */
  7267. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7268. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7269. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7270. #define HTT_RC_UPDATE_VDEVID_S 8
  7271. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7272. #define HTT_RC_UPDATE_PEERID_S 16
  7273. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7274. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7275. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7276. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7277. do { \
  7278. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7279. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7280. } while (0)
  7281. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7282. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7283. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7284. do { \
  7285. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7286. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7287. } while (0)
  7288. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7289. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7290. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7291. do { \
  7292. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7293. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7294. } while (0)
  7295. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7296. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7297. /**
  7298. * @brief target -> host rx fragment indication message definition
  7299. *
  7300. * @details
  7301. * The following field definitions describe the format of the rx fragment
  7302. * indication message sent from the target to the host.
  7303. * The rx fragment indication message shares the format of the
  7304. * rx indication message, but not all fields from the rx indication message
  7305. * are relevant to the rx fragment indication message.
  7306. *
  7307. *
  7308. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7309. * |-----------+-------------------+---------------------+-------------|
  7310. * | peer ID | |FV| ext TID | msg type |
  7311. * |-------------------------------------------------------------------|
  7312. * | | flush | flush |
  7313. * | | end | start |
  7314. * | | seq num | seq num |
  7315. * |-------------------------------------------------------------------|
  7316. * | reserved | FW rx desc bytes |
  7317. * |-------------------------------------------------------------------|
  7318. * | | FW MSDU Rx |
  7319. * | | desc B0 |
  7320. * |-------------------------------------------------------------------|
  7321. * Header fields:
  7322. * - MSG_TYPE
  7323. * Bits 7:0
  7324. * Purpose: identifies this as an rx fragment indication message
  7325. * Value: 0xa
  7326. * - EXT_TID
  7327. * Bits 12:8
  7328. * Purpose: identify the traffic ID of the rx data, including
  7329. * special "extended" TID values for multicast, broadcast, and
  7330. * non-QoS data frames
  7331. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7332. * - FLUSH_VALID (FV)
  7333. * Bit 13
  7334. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7335. * is valid
  7336. * Value:
  7337. * 1 -> flush IE is valid and needs to be processed
  7338. * 0 -> flush IE is not valid and should be ignored
  7339. * - PEER_ID
  7340. * Bits 31:16
  7341. * Purpose: Identify, by ID, which peer sent the rx data
  7342. * Value: ID of the peer who sent the rx data
  7343. * - FLUSH_SEQ_NUM_START
  7344. * Bits 5:0
  7345. * Purpose: Indicate the start of a series of MPDUs to flush
  7346. * Not all MPDUs within this series are necessarily valid - the host
  7347. * must check each sequence number within this range to see if the
  7348. * corresponding MPDU is actually present.
  7349. * This field is only valid if the FV bit is set.
  7350. * Value:
  7351. * The sequence number for the first MPDUs to check to flush.
  7352. * The sequence number is masked by 0x3f.
  7353. * - FLUSH_SEQ_NUM_END
  7354. * Bits 11:6
  7355. * Purpose: Indicate the end of a series of MPDUs to flush
  7356. * Value:
  7357. * The sequence number one larger than the sequence number of the
  7358. * last MPDU to check to flush.
  7359. * The sequence number is masked by 0x3f.
  7360. * Not all MPDUs within this series are necessarily valid - the host
  7361. * must check each sequence number within this range to see if the
  7362. * corresponding MPDU is actually present.
  7363. * This field is only valid if the FV bit is set.
  7364. * Rx descriptor fields:
  7365. * - FW_RX_DESC_BYTES
  7366. * Bits 15:0
  7367. * Purpose: Indicate how many bytes in the Rx indication are used for
  7368. * FW Rx descriptors
  7369. * Value: 1
  7370. */
  7371. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7372. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7373. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7374. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7375. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7376. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7377. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7378. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7379. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7380. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7381. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7382. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7383. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7384. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7385. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7386. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7387. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7388. #define HTT_RX_FRAG_IND_BYTES \
  7389. (4 /* msg hdr */ + \
  7390. 4 /* flush spec */ + \
  7391. 4 /* (unused) FW rx desc bytes spec */ + \
  7392. 4 /* FW rx desc */)
  7393. /**
  7394. * @brief target -> host test message definition
  7395. *
  7396. * @details
  7397. * The following field definitions describe the format of the test
  7398. * message sent from the target to the host.
  7399. * The message consists of a 4-octet header, followed by a variable
  7400. * number of 32-bit integer values, followed by a variable number
  7401. * of 8-bit character values.
  7402. *
  7403. * |31 16|15 8|7 0|
  7404. * |-----------------------------------------------------------|
  7405. * | num chars | num ints | msg type |
  7406. * |-----------------------------------------------------------|
  7407. * | int 0 |
  7408. * |-----------------------------------------------------------|
  7409. * | int 1 |
  7410. * |-----------------------------------------------------------|
  7411. * | ... |
  7412. * |-----------------------------------------------------------|
  7413. * | char 3 | char 2 | char 1 | char 0 |
  7414. * |-----------------------------------------------------------|
  7415. * | | | ... | char 4 |
  7416. * |-----------------------------------------------------------|
  7417. * - MSG_TYPE
  7418. * Bits 7:0
  7419. * Purpose: identifies this as a test message
  7420. * Value: HTT_MSG_TYPE_TEST
  7421. * - NUM_INTS
  7422. * Bits 15:8
  7423. * Purpose: indicate how many 32-bit integers follow the message header
  7424. * - NUM_CHARS
  7425. * Bits 31:16
  7426. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7427. */
  7428. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7429. #define HTT_RX_TEST_NUM_INTS_S 8
  7430. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7431. #define HTT_RX_TEST_NUM_CHARS_S 16
  7432. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7433. do { \
  7434. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7435. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7436. } while (0)
  7437. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7438. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7439. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7440. do { \
  7441. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7442. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7443. } while (0)
  7444. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7445. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7446. /**
  7447. * @brief target -> host packet log message
  7448. *
  7449. * @details
  7450. * The following field definitions describe the format of the packet log
  7451. * message sent from the target to the host.
  7452. * The message consists of a 4-octet header,followed by a variable number
  7453. * of 32-bit character values.
  7454. *
  7455. * |31 24|23 16|15 8|7 0|
  7456. * |-----------------------------------------------------------|
  7457. * | | | | msg type |
  7458. * |-----------------------------------------------------------|
  7459. * | payload |
  7460. * |-----------------------------------------------------------|
  7461. * - MSG_TYPE
  7462. * Bits 7:0
  7463. * Purpose: identifies this as a test message
  7464. * Value: HTT_MSG_TYPE_PACKETLOG
  7465. */
  7466. PREPACK struct htt_pktlog_msg {
  7467. A_UINT32 header;
  7468. A_UINT32 payload[1 /* or more */];
  7469. } POSTPACK;
  7470. /*
  7471. * Rx reorder statistics
  7472. * NB: all the fields must be defined in 4 octets size.
  7473. */
  7474. struct rx_reorder_stats {
  7475. /* Non QoS MPDUs received */
  7476. A_UINT32 deliver_non_qos;
  7477. /* MPDUs received in-order */
  7478. A_UINT32 deliver_in_order;
  7479. /* Flush due to reorder timer expired */
  7480. A_UINT32 deliver_flush_timeout;
  7481. /* Flush due to move out of window */
  7482. A_UINT32 deliver_flush_oow;
  7483. /* Flush due to DELBA */
  7484. A_UINT32 deliver_flush_delba;
  7485. /* MPDUs dropped due to FCS error */
  7486. A_UINT32 fcs_error;
  7487. /* MPDUs dropped due to monitor mode non-data packet */
  7488. A_UINT32 mgmt_ctrl;
  7489. /* Unicast-data MPDUs dropped due to invalid peer */
  7490. A_UINT32 invalid_peer;
  7491. /* MPDUs dropped due to duplication (non aggregation) */
  7492. A_UINT32 dup_non_aggr;
  7493. /* MPDUs dropped due to processed before */
  7494. A_UINT32 dup_past;
  7495. /* MPDUs dropped due to duplicate in reorder queue */
  7496. A_UINT32 dup_in_reorder;
  7497. /* Reorder timeout happened */
  7498. A_UINT32 reorder_timeout;
  7499. /* invalid bar ssn */
  7500. A_UINT32 invalid_bar_ssn;
  7501. /* reorder reset due to bar ssn */
  7502. A_UINT32 ssn_reset;
  7503. /* Flush due to delete peer */
  7504. A_UINT32 deliver_flush_delpeer;
  7505. /* Flush due to offload */
  7506. A_UINT32 deliver_flush_offload;
  7507. /* Flush due to out of buffer */
  7508. A_UINT32 deliver_flush_oob;
  7509. /* MPDUs dropped due to PN check fail */
  7510. A_UINT32 pn_fail;
  7511. /* MPDUs dropped due to unable to allocate memory */
  7512. A_UINT32 store_fail;
  7513. /* Number of times the tid pool alloc succeeded */
  7514. A_UINT32 tid_pool_alloc_succ;
  7515. /* Number of times the MPDU pool alloc succeeded */
  7516. A_UINT32 mpdu_pool_alloc_succ;
  7517. /* Number of times the MSDU pool alloc succeeded */
  7518. A_UINT32 msdu_pool_alloc_succ;
  7519. /* Number of times the tid pool alloc failed */
  7520. A_UINT32 tid_pool_alloc_fail;
  7521. /* Number of times the MPDU pool alloc failed */
  7522. A_UINT32 mpdu_pool_alloc_fail;
  7523. /* Number of times the MSDU pool alloc failed */
  7524. A_UINT32 msdu_pool_alloc_fail;
  7525. /* Number of times the tid pool freed */
  7526. A_UINT32 tid_pool_free;
  7527. /* Number of times the MPDU pool freed */
  7528. A_UINT32 mpdu_pool_free;
  7529. /* Number of times the MSDU pool freed */
  7530. A_UINT32 msdu_pool_free;
  7531. /* number of MSDUs undelivered to HTT and queued
  7532. * to Data Rx MSDU free list */
  7533. A_UINT32 msdu_queued;
  7534. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  7535. A_UINT32 msdu_recycled;
  7536. /* Number of MPDUs with invalid peer but A2 found in AST */
  7537. A_UINT32 invalid_peer_a2_in_ast;
  7538. /* Number of MPDUs with invalid peer but A3 found in AST */
  7539. A_UINT32 invalid_peer_a3_in_ast;
  7540. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  7541. A_UINT32 invalid_peer_bmc_mpdus;
  7542. /* Number of MSDUs with err attention word */
  7543. A_UINT32 rxdesc_err_att;
  7544. /* Number of MSDUs with flag of peer_idx_invalid */
  7545. A_UINT32 rxdesc_err_peer_idx_inv;
  7546. /* Number of MSDUs with flag of peer_idx_timeout */
  7547. A_UINT32 rxdesc_err_peer_idx_to;
  7548. /* Number of MSDUs with flag of overflow */
  7549. A_UINT32 rxdesc_err_ov;
  7550. /* Number of MSDUs with flag of msdu_length_err */
  7551. A_UINT32 rxdesc_err_msdu_len;
  7552. /* Number of MSDUs with flag of mpdu_length_err */
  7553. A_UINT32 rxdesc_err_mpdu_len;
  7554. /* Number of MSDUs with flag of tkip_mic_err */
  7555. A_UINT32 rxdesc_err_tkip_mic;
  7556. /* Number of MSDUs with flag of decrypt_err */
  7557. A_UINT32 rxdesc_err_decrypt;
  7558. /* Number of MSDUs with flag of fcs_err */
  7559. A_UINT32 rxdesc_err_fcs;
  7560. /* Number of Unicast (bc_mc bit is not set in attention word)
  7561. * frames with invalid peer handler
  7562. */
  7563. A_UINT32 rxdesc_uc_msdus_inv_peer;
  7564. /* Number of unicast frame directly (direct bit is set in attention word)
  7565. * to DUT with invalid peer handler
  7566. */
  7567. A_UINT32 rxdesc_direct_msdus_inv_peer;
  7568. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  7569. * frames with invalid peer handler
  7570. */
  7571. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  7572. /* Number of MSDUs dropped due to no first MSDU flag */
  7573. A_UINT32 rxdesc_no_1st_msdu;
  7574. /* Number of MSDUs droped due to ring overflow */
  7575. A_UINT32 msdu_drop_ring_ov;
  7576. /* Number of MSDUs dropped due to FC mismatch */
  7577. A_UINT32 msdu_drop_fc_mismatch;
  7578. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  7579. A_UINT32 msdu_drop_mgmt_remote_ring;
  7580. /* Number of MSDUs dropped due to errors not reported in attention word */
  7581. A_UINT32 msdu_drop_misc;
  7582. /* Number of MSDUs go to offload before reorder */
  7583. A_UINT32 offload_msdu_wal;
  7584. /* Number of data frame dropped by offload after reorder */
  7585. A_UINT32 offload_msdu_reorder;
  7586. /* Number of MPDUs with sequence number in the past and within
  7587. the BA window */
  7588. A_UINT32 dup_past_within_window;
  7589. /* Number of MPDUs with sequence number in the past and
  7590. * outside the BA window */
  7591. A_UINT32 dup_past_outside_window;
  7592. /* Number of MSDUs with decrypt/MIC error */
  7593. A_UINT32 rxdesc_err_decrypt_mic;
  7594. /* Number of data MSDUs received on both local and remote rings */
  7595. A_UINT32 data_msdus_on_both_rings;
  7596. /* MPDUs never filled */
  7597. A_UINT32 holes_not_filled;
  7598. };
  7599. /*
  7600. * Rx Remote buffer statistics
  7601. * NB: all the fields must be defined in 4 octets size.
  7602. */
  7603. struct rx_remote_buffer_mgmt_stats {
  7604. /* Total number of MSDUs reaped for Rx processing */
  7605. A_UINT32 remote_reaped;
  7606. /* MSDUs recycled within firmware */
  7607. A_UINT32 remote_recycled;
  7608. /* MSDUs stored by Data Rx */
  7609. A_UINT32 data_rx_msdus_stored;
  7610. /* Number of HTT indications from WAL Rx MSDU */
  7611. A_UINT32 wal_rx_ind;
  7612. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  7613. A_UINT32 wal_rx_ind_unconsumed;
  7614. /* Number of HTT indications from Data Rx MSDU */
  7615. A_UINT32 data_rx_ind;
  7616. /* Number of unconsumed HTT indications from Data Rx MSDU */
  7617. A_UINT32 data_rx_ind_unconsumed;
  7618. /* Number of HTT indications from ATHBUF */
  7619. A_UINT32 athbuf_rx_ind;
  7620. /* Number of remote buffers requested for refill */
  7621. A_UINT32 refill_buf_req;
  7622. /* Number of remote buffers filled by the host */
  7623. A_UINT32 refill_buf_rsp;
  7624. /* Number of times MAC hw_index = f/w write_index */
  7625. A_INT32 mac_no_bufs;
  7626. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  7627. A_INT32 fw_indices_equal;
  7628. /* Number of times f/w finds no buffers to post */
  7629. A_INT32 host_no_bufs;
  7630. };
  7631. /*
  7632. * TXBF MU/SU packets and NDPA statistics
  7633. * NB: all the fields must be defined in 4 octets size.
  7634. */
  7635. struct rx_txbf_musu_ndpa_pkts_stats {
  7636. /* number of TXBF MU packets received */
  7637. A_UINT32 number_mu_pkts;
  7638. /* number of TXBF SU packets received */
  7639. A_UINT32 number_su_pkts;
  7640. /* number of TXBF directed NDPA */
  7641. A_UINT32 txbf_directed_ndpa_count;
  7642. /* number of TXBF retried NDPA */
  7643. A_UINT32 txbf_ndpa_retry_count;
  7644. /* total number of TXBF NDPA */
  7645. A_UINT32 txbf_total_ndpa_count;
  7646. /* must be set to 0x0 */
  7647. A_UINT32 reserved[3];
  7648. };
  7649. /*
  7650. * htt_dbg_stats_status -
  7651. * present - The requested stats have been delivered in full.
  7652. * This indicates that either the stats information was contained
  7653. * in its entirety within this message, or else this message
  7654. * completes the delivery of the requested stats info that was
  7655. * partially delivered through earlier STATS_CONF messages.
  7656. * partial - The requested stats have been delivered in part.
  7657. * One or more subsequent STATS_CONF messages with the same
  7658. * cookie value will be sent to deliver the remainder of the
  7659. * information.
  7660. * error - The requested stats could not be delivered, for example due
  7661. * to a shortage of memory to construct a message holding the
  7662. * requested stats.
  7663. * invalid - The requested stat type is either not recognized, or the
  7664. * target is configured to not gather the stats type in question.
  7665. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7666. * series_done - This special value indicates that no further stats info
  7667. * elements are present within a series of stats info elems
  7668. * (within a stats upload confirmation message).
  7669. */
  7670. enum htt_dbg_stats_status {
  7671. HTT_DBG_STATS_STATUS_PRESENT = 0,
  7672. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  7673. HTT_DBG_STATS_STATUS_ERROR = 2,
  7674. HTT_DBG_STATS_STATUS_INVALID = 3,
  7675. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  7676. };
  7677. /**
  7678. * @brief target -> host statistics upload
  7679. *
  7680. * @details
  7681. * The following field definitions describe the format of the HTT target
  7682. * to host stats upload confirmation message.
  7683. * The message contains a cookie echoed from the HTT host->target stats
  7684. * upload request, which identifies which request the confirmation is
  7685. * for, and a series of tag-length-value stats information elements.
  7686. * The tag-length header for each stats info element also includes a
  7687. * status field, to indicate whether the request for the stat type in
  7688. * question was fully met, partially met, unable to be met, or invalid
  7689. * (if the stat type in question is disabled in the target).
  7690. * A special value of all 1's in this status field is used to indicate
  7691. * the end of the series of stats info elements.
  7692. *
  7693. *
  7694. * |31 16|15 8|7 5|4 0|
  7695. * |------------------------------------------------------------|
  7696. * | reserved | msg type |
  7697. * |------------------------------------------------------------|
  7698. * | cookie LSBs |
  7699. * |------------------------------------------------------------|
  7700. * | cookie MSBs |
  7701. * |------------------------------------------------------------|
  7702. * | stats entry length | reserved | S |stat type|
  7703. * |------------------------------------------------------------|
  7704. * | |
  7705. * | type-specific stats info |
  7706. * | |
  7707. * |------------------------------------------------------------|
  7708. * | stats entry length | reserved | S |stat type|
  7709. * |------------------------------------------------------------|
  7710. * | |
  7711. * | type-specific stats info |
  7712. * | |
  7713. * |------------------------------------------------------------|
  7714. * | n/a | reserved | 111 | n/a |
  7715. * |------------------------------------------------------------|
  7716. * Header fields:
  7717. * - MSG_TYPE
  7718. * Bits 7:0
  7719. * Purpose: identifies this is a statistics upload confirmation message
  7720. * Value: 0x9
  7721. * - COOKIE_LSBS
  7722. * Bits 31:0
  7723. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7724. * message with its preceding host->target stats request message.
  7725. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7726. * - COOKIE_MSBS
  7727. * Bits 31:0
  7728. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7729. * message with its preceding host->target stats request message.
  7730. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7731. *
  7732. * Stats Information Element tag-length header fields:
  7733. * - STAT_TYPE
  7734. * Bits 4:0
  7735. * Purpose: identifies the type of statistics info held in the
  7736. * following information element
  7737. * Value: htt_dbg_stats_type
  7738. * - STATUS
  7739. * Bits 7:5
  7740. * Purpose: indicate whether the requested stats are present
  7741. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  7742. * the completion of the stats entry series
  7743. * - LENGTH
  7744. * Bits 31:16
  7745. * Purpose: indicate the stats information size
  7746. * Value: This field specifies the number of bytes of stats information
  7747. * that follows the element tag-length header.
  7748. * It is expected but not required that this length is a multiple of
  7749. * 4 bytes. Even if the length is not an integer multiple of 4, the
  7750. * subsequent stats entry header will begin on a 4-byte aligned
  7751. * boundary.
  7752. */
  7753. #define HTT_T2H_STATS_COOKIE_SIZE 8
  7754. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  7755. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  7756. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  7757. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  7758. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  7759. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  7760. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  7761. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  7762. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  7763. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  7764. do { \
  7765. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  7766. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  7767. } while (0)
  7768. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  7769. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  7770. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  7771. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  7772. do { \
  7773. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  7774. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  7775. } while (0)
  7776. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  7777. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  7778. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  7779. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  7780. do { \
  7781. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  7782. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  7783. } while (0)
  7784. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  7785. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  7786. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  7787. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  7788. #define HTT_MAX_AGGR 64
  7789. #define HTT_HL_MAX_AGGR 18
  7790. /**
  7791. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  7792. *
  7793. * @details
  7794. * The following field definitions describe the format of the HTT host
  7795. * to target frag_desc/msdu_ext bank configuration message.
  7796. * The message contains the based address and the min and max id of the
  7797. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  7798. * MSDU_EXT/FRAG_DESC.
  7799. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  7800. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  7801. * the hardware does the mapping/translation.
  7802. *
  7803. * Total banks that can be configured is configured to 16.
  7804. *
  7805. * This should be called before any TX has be initiated by the HTT
  7806. *
  7807. * |31 16|15 8|7 5|4 0|
  7808. * |------------------------------------------------------------|
  7809. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  7810. * |------------------------------------------------------------|
  7811. * | BANK0_BASE_ADDRESS (bits 31:0) |
  7812. #if HTT_PADDR64
  7813. * | BANK0_BASE_ADDRESS (bits 63:32) |
  7814. #endif
  7815. * |------------------------------------------------------------|
  7816. * | ... |
  7817. * |------------------------------------------------------------|
  7818. * | BANK15_BASE_ADDRESS (bits 31:0) |
  7819. #if HTT_PADDR64
  7820. * | BANK15_BASE_ADDRESS (bits 63:32) |
  7821. #endif
  7822. * |------------------------------------------------------------|
  7823. * | BANK0_MAX_ID | BANK0_MIN_ID |
  7824. * |------------------------------------------------------------|
  7825. * | ... |
  7826. * |------------------------------------------------------------|
  7827. * | BANK15_MAX_ID | BANK15_MIN_ID |
  7828. * |------------------------------------------------------------|
  7829. * Header fields:
  7830. * - MSG_TYPE
  7831. * Bits 7:0
  7832. * Value: 0x6
  7833. * for systems with 64-bit format for bus addresses:
  7834. * - BANKx_BASE_ADDRESS_LO
  7835. * Bits 31:0
  7836. * Purpose: Provide a mechanism to specify the base address of the
  7837. * MSDU_EXT bank physical/bus address.
  7838. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  7839. * - BANKx_BASE_ADDRESS_HI
  7840. * Bits 31:0
  7841. * Purpose: Provide a mechanism to specify the base address of the
  7842. * MSDU_EXT bank physical/bus address.
  7843. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  7844. * for systems with 32-bit format for bus addresses:
  7845. * - BANKx_BASE_ADDRESS
  7846. * Bits 31:0
  7847. * Purpose: Provide a mechanism to specify the base address of the
  7848. * MSDU_EXT bank physical/bus address.
  7849. * Value: MSDU_EXT bank physical / bus address
  7850. * - BANKx_MIN_ID
  7851. * Bits 15:0
  7852. * Purpose: Provide a mechanism to specify the min index that needs to
  7853. * mapped.
  7854. * - BANKx_MAX_ID
  7855. * Bits 31:16
  7856. * Purpose: Provide a mechanism to specify the max index that needs to
  7857. * mapped.
  7858. *
  7859. */
  7860. /** @todo Compress the fields to fit MAX HTT Message size, until then
  7861. * configure to a safe value.
  7862. * @note MAX supported banks is 16.
  7863. */
  7864. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  7865. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  7866. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  7867. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  7868. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  7869. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  7870. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  7871. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  7872. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  7873. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  7874. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  7875. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  7876. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  7877. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  7878. do { \
  7879. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  7880. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  7881. } while (0)
  7882. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  7883. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> \
  7884. HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  7885. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  7886. do { \
  7887. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value);\
  7888. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S);\
  7889. } while (0)
  7890. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  7891. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> \
  7892. HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  7893. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  7894. do { \
  7895. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  7896. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  7897. } while (0)
  7898. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  7899. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> \
  7900. HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  7901. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  7902. do { \
  7903. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  7904. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  7905. } while (0)
  7906. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  7907. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> \
  7908. HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  7909. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  7910. do { \
  7911. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  7912. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  7913. } while (0)
  7914. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  7915. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> \
  7916. HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  7917. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  7918. do { \
  7919. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  7920. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  7921. } while (0)
  7922. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  7923. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> \
  7924. HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  7925. /*
  7926. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  7927. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  7928. * addresses are stored in a XXX-bit field.
  7929. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  7930. * htt_tx_frag_desc64_bank_cfg_t structs.
  7931. */
  7932. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  7933. _paddr_bits_, \
  7934. _paddr__bank_base_address_) \
  7935. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  7936. /** word 0 \
  7937. * msg_type: 8, \
  7938. * pdev_id: 2, \
  7939. * swap: 1, \
  7940. * reserved0: 5, \
  7941. * num_banks: 8, \
  7942. * desc_size: 8; \
  7943. */ \
  7944. A_UINT32 word0; \
  7945. /* \
  7946. * If bank_base_address is 64 bits, the upper / lower
  7947. * halves are stored \
  7948. * in little-endian order (bytes 0-3 in the first A_UINT32,
  7949. * bytes 4-7 in the second A_UINT32). \
  7950. */ \
  7951. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  7952. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  7953. } POSTPACK
  7954. /* define htt_tx_frag_desc32_bank_cfg_t */
  7955. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  7956. /* define htt_tx_frag_desc64_bank_cfg_t */
  7957. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  7958. /*
  7959. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  7960. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  7961. */
  7962. #if HTT_PADDR64
  7963. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  7964. #else
  7965. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  7966. #endif
  7967. /**
  7968. * @brief target -> host HTT TX Credit total count update message definition
  7969. *
  7970. *|31 16|15|14 9| 8 |7 0 |
  7971. *|---------------------+--+----------+-------+----------|
  7972. *|cur htt credit delta | Q| reserved | sign | msg type |
  7973. *|------------------------------------------------------|
  7974. *
  7975. * Header fields:
  7976. * - MSG_TYPE
  7977. * Bits 7:0
  7978. * Purpose: identifies this as a htt tx credit delta update message
  7979. * Value: 0xe
  7980. * - SIGN
  7981. * Bits 8
  7982. * identifies whether credit delta is positive or negative
  7983. * Value:
  7984. * - 0x0: credit delta is positive, rebalance in some buffers
  7985. * - 0x1: credit delta is negative, rebalance out some buffers
  7986. * - reserved
  7987. * Bits 14:9
  7988. * Value: 0x0
  7989. * - TXQ_GRP
  7990. * Bit 15
  7991. * Purpose: indicates whether any tx queue group information elements
  7992. * are appended to the tx credit update message
  7993. * Value: 0 -> no tx queue group information element is present
  7994. * 1 -> a tx queue group information element immediately follows
  7995. * - DELTA_COUNT
  7996. * Bits 31:16
  7997. * Purpose: Specify current htt credit delta absolute count
  7998. */
  7999. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8000. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8001. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8002. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8003. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8004. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8005. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8006. do { \
  8007. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8008. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8009. } while (0)
  8010. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8011. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8012. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8013. do { \
  8014. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8015. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8016. } while (0)
  8017. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8018. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8019. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8020. do { \
  8021. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8022. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8023. } while (0)
  8024. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8025. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8026. #define HTT_TX_CREDIT_MSG_BYTES 4
  8027. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8028. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8029. /**
  8030. * @brief HTT WDI_IPA Operation Response Message
  8031. *
  8032. * @details
  8033. * HTT WDI_IPA Operation Response message is sent by target
  8034. * to host confirming suspend or resume operation.
  8035. * |31 24|23 16|15 8|7 0|
  8036. * |----------------+----------------+----------------+----------------|
  8037. * | op_code | Rsvd | msg_type |
  8038. * |-------------------------------------------------------------------|
  8039. * | Rsvd | Response len |
  8040. * |-------------------------------------------------------------------|
  8041. * | |
  8042. * | Response-type specific info |
  8043. * | |
  8044. * | |
  8045. * |-------------------------------------------------------------------|
  8046. * Header fields:
  8047. * - MSG_TYPE
  8048. * Bits 7:0
  8049. * Purpose: Identifies this as WDI_IPA Operation Response message
  8050. * value: = 0x13
  8051. * - OP_CODE
  8052. * Bits 31:16
  8053. * Purpose: Identifies the operation target is responding to
  8054. * (e.g. TX suspend)
  8055. * value: = enum htt_wdi_ipa_op_code
  8056. * - RSP_LEN
  8057. * Bits 16:0
  8058. * Purpose: length for the response-type specific info
  8059. * value: = length in bytes for response-type specific info
  8060. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8061. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8062. */
  8063. PREPACK struct htt_wdi_ipa_op_response_t {
  8064. /* DWORD 0: flags and meta-data */
  8065. A_UINT32
  8066. msg_type:8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8067. reserved1:8,
  8068. op_code:16;
  8069. A_UINT32
  8070. rsp_len:16,
  8071. reserved2:16;
  8072. } POSTPACK;
  8073. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8074. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8075. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8076. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8077. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8078. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8079. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> \
  8080. HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8081. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8082. do { \
  8083. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8084. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8085. } while (0)
  8086. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8087. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> \
  8088. HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8089. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8090. do { \
  8091. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8092. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8093. } while (0)
  8094. enum htt_phy_mode {
  8095. htt_phy_mode_11a = 0,
  8096. htt_phy_mode_11g = 1,
  8097. htt_phy_mode_11b = 2,
  8098. htt_phy_mode_11g_only = 3,
  8099. htt_phy_mode_11na_ht20 = 4,
  8100. htt_phy_mode_11ng_ht20 = 5,
  8101. htt_phy_mode_11na_ht40 = 6,
  8102. htt_phy_mode_11ng_ht40 = 7,
  8103. htt_phy_mode_11ac_vht20 = 8,
  8104. htt_phy_mode_11ac_vht40 = 9,
  8105. htt_phy_mode_11ac_vht80 = 10,
  8106. htt_phy_mode_11ac_vht20_2g = 11,
  8107. htt_phy_mode_11ac_vht40_2g = 12,
  8108. htt_phy_mode_11ac_vht80_2g = 13,
  8109. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8110. htt_phy_mode_11ac_vht160 = 15,
  8111. htt_phy_mode_max,
  8112. };
  8113. /**
  8114. * @brief target -> host HTT channel change indication
  8115. * @details
  8116. * Specify when a channel change occurs.
  8117. * This allows the host to precisely determine which rx frames arrived
  8118. * on the old channel and which rx frames arrived on the new channel.
  8119. *
  8120. *|31 |7 0 |
  8121. *|-------------------------------------------+----------|
  8122. *| reserved | msg type |
  8123. *|------------------------------------------------------|
  8124. *| primary_chan_center_freq_mhz |
  8125. *|------------------------------------------------------|
  8126. *| contiguous_chan1_center_freq_mhz |
  8127. *|------------------------------------------------------|
  8128. *| contiguous_chan2_center_freq_mhz |
  8129. *|------------------------------------------------------|
  8130. *| phy_mode |
  8131. *|------------------------------------------------------|
  8132. *
  8133. * Header fields:
  8134. * - MSG_TYPE
  8135. * Bits 7:0
  8136. * Purpose: identifies this as a htt channel change indication message
  8137. * Value: 0x15
  8138. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8139. * Bits 31:0
  8140. * Purpose: identify the (center of the) new 20 MHz primary channel
  8141. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8142. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8143. * Bits 31:0
  8144. * Purpose: identify the (center of the) contiguous frequency range
  8145. * comprising the new channel.
  8146. * For example, if the new channel is a 80 MHz channel extending
  8147. * 60 MHz beyond the primary channel, this field would be 30 larger
  8148. * than the primary channel center frequency field.
  8149. * Value: center frequency of the contiguous frequency range comprising
  8150. * the full channel in MHz units
  8151. * (80+80 channels also use the CONTIG_CHAN2 field)
  8152. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8153. * Bits 31:0
  8154. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8155. * within a VHT 80+80 channel.
  8156. * This field is only relevant for VHT 80+80 channels.
  8157. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8158. * channel (arbitrary value for cases besides VHT 80+80)
  8159. * - PHY_MODE
  8160. * Bits 31:0
  8161. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8162. * and band
  8163. * Value: htt_phy_mode enum value
  8164. */
  8165. PREPACK struct htt_chan_change_t {
  8166. /* DWORD 0: flags and meta-data */
  8167. A_UINT32 msg_type:8, /* HTT_T2H_MSG_TYPE_CHAN_CHANGE */
  8168. reserved1:24;
  8169. A_UINT32 primary_chan_center_freq_mhz;
  8170. A_UINT32 contig_chan1_center_freq_mhz;
  8171. A_UINT32 contig_chan2_center_freq_mhz;
  8172. A_UINT32 phy_mode;
  8173. } POSTPACK;
  8174. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8175. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8176. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8177. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8178. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8179. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8180. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8181. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8182. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8183. do { \
  8184. HTT_CHECK_SET_VAL( \
  8185. HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value); \
  8186. (word) |= (value) << \
  8187. HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8188. } while (0)
  8189. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8190. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8191. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8192. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8193. do { \
  8194. HTT_CHECK_SET_VAL( \
  8195. HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value); \
  8196. (word) |= (value) << \
  8197. HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8198. } while (0)
  8199. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8200. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8201. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8202. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8203. do { \
  8204. HTT_CHECK_SET_VAL( \
  8205. HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value); \
  8206. (word) |= (value) << \
  8207. HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8208. } while (0)
  8209. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8210. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8211. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8212. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8213. do { \
  8214. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value); \
  8215. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8216. } while (0)
  8217. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8218. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8219. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8220. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8221. /**
  8222. * @brief rx offload packet error message
  8223. *
  8224. * @details
  8225. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8226. * of target payload like mic err.
  8227. *
  8228. * |31 24|23 16|15 8|7 0|
  8229. * |----------------+----------------+----------------+----------------|
  8230. * | tid | vdev_id | msg_sub_type | msg_type |
  8231. * |-------------------------------------------------------------------|
  8232. * : (sub-type dependent content) :
  8233. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8234. * Header fields:
  8235. * - msg_type
  8236. * Bits 7:0
  8237. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8238. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8239. * - msg_sub_type
  8240. * Bits 15:8
  8241. * Purpose: Identifies which type of rx error is reported by this message
  8242. * value: htt_rx_ofld_pkt_err_type
  8243. * - vdev_id
  8244. * Bits 23:16
  8245. * Purpose: Identifies which vdev received the erroneous rx frame
  8246. * value:
  8247. * - tid
  8248. * Bits 31:24
  8249. * Purpose: Identifies the traffic type of the rx frame
  8250. * value:
  8251. *
  8252. * - The payload fields used if the sub-type == MIC error are shown below.
  8253. * Note - MIC err is per MSDU, while PN is per MPDU.
  8254. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8255. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8256. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8257. * instead of sending separate HTT messages for each wrong MSDU within
  8258. * the MPDU.
  8259. *
  8260. * |31 24|23 16|15 8|7 0|
  8261. * |----------------+----------------+----------------+----------------|
  8262. * | Rsvd | key_id | peer_id |
  8263. * |-------------------------------------------------------------------|
  8264. * | receiver MAC addr 31:0 |
  8265. * |-------------------------------------------------------------------|
  8266. * | Rsvd | receiver MAC addr 47:32 |
  8267. * |-------------------------------------------------------------------|
  8268. * | transmitter MAC addr 31:0 |
  8269. * |-------------------------------------------------------------------|
  8270. * | Rsvd | transmitter MAC addr 47:32 |
  8271. * |-------------------------------------------------------------------|
  8272. * | PN 31:0 |
  8273. * |-------------------------------------------------------------------|
  8274. * | Rsvd | PN 47:32 |
  8275. * |-------------------------------------------------------------------|
  8276. * - peer_id
  8277. * Bits 15:0
  8278. * Purpose: identifies which peer is frame is from
  8279. * value:
  8280. * - key_id
  8281. * Bits 23:16
  8282. * Purpose: identifies key_id of rx frame
  8283. * value:
  8284. * - RA_31_0 (receiver MAC addr 31:0)
  8285. * Bits 31:0
  8286. * Purpose: identifies by MAC address which vdev received the frame
  8287. * value: MAC address lower 4 bytes
  8288. * - RA_47_32 (receiver MAC addr 47:32)
  8289. * Bits 15:0
  8290. * Purpose: identifies by MAC address which vdev received the frame
  8291. * value: MAC address upper 2 bytes
  8292. * - TA_31_0 (transmitter MAC addr 31:0)
  8293. * Bits 31:0
  8294. * Purpose: identifies by MAC address which peer transmitted the frame
  8295. * value: MAC address lower 4 bytes
  8296. * - TA_47_32 (transmitter MAC addr 47:32)
  8297. * Bits 15:0
  8298. * Purpose: identifies by MAC address which peer transmitted the frame
  8299. * value: MAC address upper 2 bytes
  8300. * - PN_31_0
  8301. * Bits 31:0
  8302. * Purpose: Identifies pn of rx frame
  8303. * value: PN lower 4 bytes
  8304. * - PN_47_32
  8305. * Bits 15:0
  8306. * Purpose: Identifies pn of rx frame
  8307. * value:
  8308. * TKIP or CCMP: PN upper 2 bytes
  8309. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8310. */
  8311. enum htt_rx_ofld_pkt_err_type {
  8312. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8313. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8314. };
  8315. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8316. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8317. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8318. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8319. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8320. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8321. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8322. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8323. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8324. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8325. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8326. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8327. do { \
  8328. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8329. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8330. } while (0)
  8331. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8332. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> \
  8333. HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8334. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8335. do { \
  8336. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8337. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8338. } while (0)
  8339. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8340. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8341. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8342. do { \
  8343. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8344. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8345. } while (0)
  8346. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8347. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8348. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8349. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8350. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8351. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8352. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8353. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8354. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8355. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8356. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8357. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8358. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8359. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8360. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8361. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8362. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8363. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8364. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8365. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8366. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8367. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8368. do { \
  8369. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8370. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8371. } while (0)
  8372. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8373. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8374. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8375. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8376. do { \
  8377. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8378. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8379. } while (0)
  8380. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8381. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8382. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8383. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8384. do { \
  8385. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8386. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8387. } while (0)
  8388. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8389. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8390. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8391. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8392. do { \
  8393. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8394. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8395. } while (0)
  8396. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8397. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8398. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8399. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8400. do { \
  8401. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8402. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8403. } while (0)
  8404. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8405. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8406. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8407. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8408. do { \
  8409. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8410. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8411. } while (0)
  8412. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8413. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8414. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8415. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8416. do { \
  8417. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8418. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8419. } while (0)
  8420. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8421. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8422. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8423. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8424. do { \
  8425. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8426. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8427. } while (0)
  8428. /**
  8429. * @brief peer rate report message
  8430. *
  8431. * @details
  8432. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8433. * justified rate of all the peers.
  8434. *
  8435. * |31 24|23 16|15 8|7 0|
  8436. * |----------------+----------------+----------------+----------------|
  8437. * | peer_count | | msg_type |
  8438. * |-------------------------------------------------------------------|
  8439. * : Payload (variant number of peer rate report) :
  8440. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8441. * Header fields:
  8442. * - msg_type
  8443. * Bits 7:0
  8444. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8445. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8446. * - reserved
  8447. * Bits 15:8
  8448. * Purpose:
  8449. * value:
  8450. * - peer_count
  8451. * Bits 31:16
  8452. * Purpose: Specify how many peer rate report elements are present in the payload.
  8453. * value:
  8454. *
  8455. * Payload:
  8456. * There are variant number of peer rate report follow the first 32 bits.
  8457. * The peer rate report is defined as follows.
  8458. *
  8459. * |31 20|19 16|15 0|
  8460. * |-----------------------+---------+---------------------------------|-
  8461. * | reserved | phy | peer_id | \
  8462. * |-------------------------------------------------------------------| -> report #0
  8463. * | rate | /
  8464. * |-----------------------+---------+---------------------------------|-
  8465. * | reserved | phy | peer_id | \
  8466. * |-------------------------------------------------------------------| -> report #1
  8467. * | rate | /
  8468. * |-----------------------+---------+---------------------------------|-
  8469. * | reserved | phy | peer_id | \
  8470. * |-------------------------------------------------------------------| -> report #2
  8471. * | rate | /
  8472. * |-------------------------------------------------------------------|-
  8473. * : :
  8474. * : :
  8475. * : :
  8476. * :-------------------------------------------------------------------:
  8477. *
  8478. * - peer_id
  8479. * Bits 15:0
  8480. * Purpose: identify the peer
  8481. * value:
  8482. * - phy
  8483. * Bits 19:16
  8484. * Purpose: identify which phy is in use
  8485. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8486. * Please see enum htt_peer_report_phy_type for detail.
  8487. * - reserved
  8488. * Bits 31:20
  8489. * Purpose:
  8490. * value:
  8491. * - rate
  8492. * Bits 31:0
  8493. * Purpose: represent the justified rate of the peer specified by peer_id
  8494. * value:
  8495. */
  8496. enum htt_peer_rate_report_phy_type {
  8497. HTT_PEER_RATE_REPORT_11B = 0,
  8498. HTT_PEER_RATE_REPORT_11A_G,
  8499. HTT_PEER_RATE_REPORT_11N,
  8500. HTT_PEER_RATE_REPORT_11AC,
  8501. };
  8502. #define HTT_PEER_RATE_REPORT_SIZE 8
  8503. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8504. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8505. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8506. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8507. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8508. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8509. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8510. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8511. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8512. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8513. do { \
  8514. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8515. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8516. } while (0)
  8517. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8518. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8519. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8520. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8521. do { \
  8522. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8523. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8524. } while (0)
  8525. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8526. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8527. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8528. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8529. do { \
  8530. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8531. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8532. } while (0)
  8533. /**
  8534. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8535. *
  8536. * @details
  8537. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  8538. * a flow of descriptors.
  8539. *
  8540. * This message is in TLV format and indicates the parameters to be setup a
  8541. * flow in the host. Each entry indicates that a particular flow ID is ready to
  8542. * receive descriptors from a specified pool.
  8543. *
  8544. * The message would appear as follows:
  8545. *
  8546. * |31 24|23 16|15 8|7 0|
  8547. * |----------------+----------------+----------------+----------------|
  8548. * header | reserved | num_flows | msg_type |
  8549. * |-------------------------------------------------------------------|
  8550. * | |
  8551. * : payload :
  8552. * | |
  8553. * |-------------------------------------------------------------------|
  8554. *
  8555. * The header field is one DWORD long and is interpreted as follows:
  8556. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  8557. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  8558. * this message
  8559. * b'16-31 - reserved: These bits are reserved for future use
  8560. *
  8561. * Payload:
  8562. * The payload would contain multiple objects of the following structure. Each
  8563. * object represents a flow.
  8564. *
  8565. * |31 24|23 16|15 8|7 0|
  8566. * |----------------+----------------+----------------+----------------|
  8567. * header | reserved | num_flows | msg_type |
  8568. * |-------------------------------------------------------------------|
  8569. * payload0| flow_type |
  8570. * |-------------------------------------------------------------------|
  8571. * | flow_id |
  8572. * |-------------------------------------------------------------------|
  8573. * | reserved0 | flow_pool_id |
  8574. * |-------------------------------------------------------------------|
  8575. * | reserved1 | flow_pool_size |
  8576. * |-------------------------------------------------------------------|
  8577. * | reserved2 |
  8578. * |-------------------------------------------------------------------|
  8579. * payload1| flow_type |
  8580. * |-------------------------------------------------------------------|
  8581. * | flow_id |
  8582. * |-------------------------------------------------------------------|
  8583. * | reserved0 | flow_pool_id |
  8584. * |-------------------------------------------------------------------|
  8585. * | reserved1 | flow_pool_size |
  8586. * |-------------------------------------------------------------------|
  8587. * | reserved2 |
  8588. * |-------------------------------------------------------------------|
  8589. * | . |
  8590. * | . |
  8591. * | . |
  8592. * |-------------------------------------------------------------------|
  8593. *
  8594. * Each payload is 5 DWORDS long and is interpreted as follows:
  8595. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  8596. * this flow is associated. It can be VDEV, peer,
  8597. * or tid (AC). Based on enum htt_flow_type.
  8598. *
  8599. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8600. * object. For flow_type vdev it is set to the
  8601. * vdevid, for peer it is peerid and for tid, it is
  8602. * tid_num.
  8603. *
  8604. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  8605. * in the host for this flow
  8606. * b'16:31 - reserved0: This field in reserved for the future. In case
  8607. * we have a hierarchical implementation (HCM) of
  8608. * pools, it can be used to indicate the ID of the
  8609. * parent-pool.
  8610. *
  8611. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  8612. * Descriptors for this flow will be
  8613. * allocated from this pool in the host.
  8614. * b'16:31 - reserved1: This field in reserved for the future. In case
  8615. * we have a hierarchical implementation of pools,
  8616. * it can be used to indicate the max number of
  8617. * descriptors in the pool. The b'0:15 can be used
  8618. * to indicate min number of descriptors in the
  8619. * HCM scheme.
  8620. *
  8621. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  8622. * we have a hierarchical implementation of pools,
  8623. * b'0:15 can be used to indicate the
  8624. * priority-based borrowing (PBB) threshold of
  8625. * the flow's pool. The b'16:31 are still left
  8626. * reserved.
  8627. */
  8628. enum htt_flow_type {
  8629. FLOW_TYPE_VDEV = 0,
  8630. /* Insert new flow types above this line */
  8631. };
  8632. PREPACK struct htt_flow_pool_map_payload_t {
  8633. A_UINT32 flow_type;
  8634. A_UINT32 flow_id;
  8635. A_UINT32 flow_pool_id:16,
  8636. reserved0:16;
  8637. A_UINT32 flow_pool_size:16,
  8638. reserved1:16;
  8639. A_UINT32 reserved2;
  8640. } POSTPACK;
  8641. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  8642. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  8643. (sizeof(struct htt_flow_pool_map_payload_t))
  8644. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  8645. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  8646. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  8647. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  8648. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  8649. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  8650. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  8651. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  8652. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  8653. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  8654. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  8655. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  8656. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  8657. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  8658. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  8659. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  8660. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  8661. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  8662. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  8663. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  8664. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  8665. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  8666. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  8667. do { \
  8668. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  8669. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  8670. } while (0)
  8671. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  8672. do { \
  8673. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  8674. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  8675. } while (0)
  8676. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  8677. do { \
  8678. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  8679. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  8680. } while (0)
  8681. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  8682. do { \
  8683. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  8684. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  8685. } while (0)
  8686. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  8687. do { \
  8688. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  8689. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  8690. } while (0)
  8691. /**
  8692. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  8693. *
  8694. * @details
  8695. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  8696. * down a flow of descriptors.
  8697. * This message indicates that for the flow (whose ID is provided) is wanting
  8698. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  8699. * pool of descriptors from where descriptors are being allocated for this
  8700. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  8701. * be unmapped by the host.
  8702. *
  8703. * The message would appear as follows:
  8704. *
  8705. * |31 24|23 16|15 8|7 0|
  8706. * |----------------+----------------+----------------+----------------|
  8707. * | reserved0 | msg_type |
  8708. * |-------------------------------------------------------------------|
  8709. * | flow_type |
  8710. * |-------------------------------------------------------------------|
  8711. * | flow_id |
  8712. * |-------------------------------------------------------------------|
  8713. * | reserved1 | flow_pool_id |
  8714. * |-------------------------------------------------------------------|
  8715. *
  8716. * The message is interpreted as follows:
  8717. * dword0 - b'0:7 - msg_type: This will be set to
  8718. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  8719. * b'8:31 - reserved0: Reserved for future use
  8720. *
  8721. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  8722. * this flow is associated. It can be VDEV, peer,
  8723. * or tid (AC). Based on enum htt_flow_type.
  8724. *
  8725. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8726. * object. For flow_type vdev it is set to the
  8727. * vdevid, for peer it is peerid and for tid, it is
  8728. * tid_num.
  8729. *
  8730. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  8731. * used in the host for this flow
  8732. * b'16:31 - reserved0: This field in reserved for the future.
  8733. *
  8734. */
  8735. PREPACK struct htt_flow_pool_unmap_t {
  8736. A_UINT32 msg_type:8,
  8737. reserved0:24;
  8738. A_UINT32 flow_type;
  8739. A_UINT32 flow_id;
  8740. A_UINT32 flow_pool_id:16,
  8741. reserved1:16;
  8742. } POSTPACK;
  8743. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  8744. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  8745. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  8746. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  8747. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  8748. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  8749. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  8750. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  8751. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  8752. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  8753. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  8754. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  8755. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  8756. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  8757. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  8758. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  8759. do { \
  8760. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  8761. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  8762. } while (0)
  8763. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  8764. do { \
  8765. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  8766. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  8767. } while (0)
  8768. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  8769. do { \
  8770. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  8771. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  8772. } while (0)
  8773. /**
  8774. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  8775. *
  8776. * @details
  8777. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  8778. * SRNG ring setup is done
  8779. *
  8780. * This message indicates whether the last setup operation is successful.
  8781. * It will be sent to host when host set respose_required bit in
  8782. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  8783. * The message would appear as follows:
  8784. *
  8785. * |31 24|23 16|15 8|7 0|
  8786. * |--------------- +----------------+----------------+----------------|
  8787. * | setup_status | ring_id | pdev_id | msg_type |
  8788. * |-------------------------------------------------------------------|
  8789. *
  8790. * The message is interpreted as follows:
  8791. * dword0 - b'0:7 - msg_type: This will be set to
  8792. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  8793. * b'8:15 - pdev_id:
  8794. * 0 (for rings at SOC/UMAC level),
  8795. * 1/2/3 mac id (for rings at LMAC level)
  8796. * b'16:23 - ring_id: Identify the ring which is set up
  8797. * More details can be got from enum htt_srng_ring_id
  8798. * b'24:31 - setup_status: Indicate status of setup operation
  8799. * Refer to htt_ring_setup_status
  8800. */
  8801. PREPACK struct htt_sring_setup_done_t {
  8802. A_UINT32 msg_type: 8,
  8803. pdev_id: 8,
  8804. ring_id: 8,
  8805. setup_status: 8;
  8806. } POSTPACK;
  8807. enum htt_ring_setup_status {
  8808. htt_ring_setup_status_ok = 0,
  8809. htt_ring_setup_status_error,
  8810. };
  8811. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  8812. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  8813. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  8814. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  8815. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  8816. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  8817. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  8818. do { \
  8819. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  8820. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  8821. } while (0)
  8822. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  8823. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  8824. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  8825. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  8826. HTT_SRING_SETUP_DONE_RING_ID_S)
  8827. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  8828. do { \
  8829. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  8830. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  8831. } while (0)
  8832. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  8833. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  8834. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  8835. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  8836. HTT_SRING_SETUP_DONE_STATUS_S)
  8837. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  8838. do { \
  8839. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  8840. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  8841. } while (0)
  8842. /**
  8843. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  8844. *
  8845. * @details
  8846. * HTT TX map flow entry with tqm flow pointer
  8847. * Sent from firmware to host to add tqm flow pointer in corresponding
  8848. * flow search entry. Flow metadata is replayed back to host as part of this
  8849. * struct to enable host to find the specific flow search entry
  8850. *
  8851. * The message would appear as follows:
  8852. *
  8853. * |31 28|27 18|17 14|13 8|7 0|
  8854. * |-------+------------------------------------------+----------------|
  8855. * | rsvd0 | fse_hsh_idx | msg_type |
  8856. * |-------------------------------------------------------------------|
  8857. * | rsvd1 | tid | peer_id |
  8858. * |-------------------------------------------------------------------|
  8859. * | tqm_flow_pntr_lo |
  8860. * |-------------------------------------------------------------------|
  8861. * | tqm_flow_pntr_hi |
  8862. * |-------------------------------------------------------------------|
  8863. * | fse_meta_data |
  8864. * |-------------------------------------------------------------------|
  8865. *
  8866. * The message is interpreted as follows:
  8867. *
  8868. * dword0 - b'0:7 - msg_type: This will be set to
  8869. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  8870. *
  8871. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  8872. * for this flow entry
  8873. *
  8874. * dword0 - b'28:31 - rsvd0: Reserved for future use
  8875. *
  8876. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  8877. *
  8878. * dword1 - b'14:17 - tid
  8879. *
  8880. * dword1 - b'18:31 - rsvd1: Reserved for future use
  8881. *
  8882. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  8883. *
  8884. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  8885. *
  8886. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  8887. * given by host
  8888. */
  8889. PREPACK struct htt_tx_map_flow_info {
  8890. A_UINT32
  8891. msg_type: 8,
  8892. fse_hsh_idx: 20,
  8893. rsvd0: 4;
  8894. A_UINT32
  8895. peer_id: 14,
  8896. tid: 4,
  8897. rsvd1: 14;
  8898. A_UINT32 tqm_flow_pntr_lo;
  8899. A_UINT32 tqm_flow_pntr_hi;
  8900. struct htt_tx_flow_metadata fse_meta_data;
  8901. } POSTPACK;
  8902. /* DWORD 0 */
  8903. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  8904. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  8905. /* DWORD 1 */
  8906. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  8907. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  8908. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  8909. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  8910. /* DWORD 0 */
  8911. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  8912. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  8913. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  8914. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  8915. do { \
  8916. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  8917. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  8918. } while (0)
  8919. /* DWORD 1 */
  8920. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  8921. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  8922. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  8923. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  8924. do { \
  8925. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  8926. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  8927. } while (0)
  8928. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  8929. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  8930. HTT_TX_MAP_FLOW_INFO_TID_S)
  8931. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  8932. do { \
  8933. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  8934. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  8935. } while (0)
  8936. /*
  8937. * htt_dbg_ext_stats_status -
  8938. * present - The requested stats have been delivered in full.
  8939. * This indicates that either the stats information was contained
  8940. * in its entirety within this message, or else this message
  8941. * completes the delivery of the requested stats info that was
  8942. * partially delivered through earlier STATS_CONF messages.
  8943. * partial - The requested stats have been delivered in part.
  8944. * One or more subsequent STATS_CONF messages with the same
  8945. * cookie value will be sent to deliver the remainder of the
  8946. * information.
  8947. * error - The requested stats could not be delivered, for example due
  8948. * to a shortage of memory to construct a message holding the
  8949. * requested stats.
  8950. * invalid - The requested stat type is either not recognized, or the
  8951. * target is configured to not gather the stats type in question.
  8952. */
  8953. enum htt_dbg_ext_stats_status {
  8954. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  8955. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  8956. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  8957. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  8958. };
  8959. /**
  8960. * @brief target -> host extended statistics upload
  8961. *
  8962. * @details
  8963. * The following field definitions describe the format of the HTT target
  8964. * to host stats upload confirmation message.
  8965. * The message contains a cookie echoed from the HTT host->target stats
  8966. * upload request, which identifies which request the confirmation is
  8967. * for, and a single stats can span over multiple HTT stats indication
  8968. * due to the HTT message size limitation so every HTT ext stats indication
  8969. * will have tag-length-value stats information elements.
  8970. * The tag-length header for each HTT stats IND message also includes a
  8971. * status field, to indicate whether the request for the stat type in
  8972. * question was fully met, partially met, unable to be met, or invalid
  8973. * (if the stat type in question is disabled in the target).
  8974. * A Done bit 1's indicate the end of the of stats info elements.
  8975. *
  8976. *
  8977. * |31 16|15 12|11|10 8|7 5|4 0|
  8978. * |--------------------------------------------------------------|
  8979. * | reserved | msg type |
  8980. * |--------------------------------------------------------------|
  8981. * | cookie LSBs |
  8982. * |--------------------------------------------------------------|
  8983. * | cookie MSBs |
  8984. * |--------------------------------------------------------------|
  8985. * | stats entry length | rsvd | D| S | stat type |
  8986. * |--------------------------------------------------------------|
  8987. * | type-specific stats info |
  8988. * | (see htt_stats.h) |
  8989. * |--------------------------------------------------------------|
  8990. * Header fields:
  8991. * - MSG_TYPE
  8992. * Bits 7:0
  8993. * Purpose: Identifies this is a extended statistics upload confirmation
  8994. * message.
  8995. * Value: 0x1c
  8996. * - COOKIE_LSBS
  8997. * Bits 31:0
  8998. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8999. * message with its preceding host->target stats request message.
  9000. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9001. * - COOKIE_MSBS
  9002. * Bits 31:0
  9003. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9004. * message with its preceding host->target stats request message.
  9005. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9006. *
  9007. * Stats Information Element tag-length header fields:
  9008. * - STAT_TYPE
  9009. * Bits 7:0
  9010. * Purpose: identifies the type of statistics info held in the
  9011. * following information element
  9012. * Value: htt_dbg_ext_stats_type
  9013. * - STATUS
  9014. * Bits 10:8
  9015. * Purpose: indicate whether the requested stats are present
  9016. * Value: htt_dbg_ext_stats_status
  9017. * - DONE
  9018. * Bits 11
  9019. * Purpose:
  9020. * Indicates the completion of the stats entry, this will be the last
  9021. * stats conf HTT segment for the requested stats type.
  9022. * Value:
  9023. * 0 -> the stats retrieval is ongoing
  9024. * 1 -> the stats retrieval is complete
  9025. * - LENGTH
  9026. * Bits 31:16
  9027. * Purpose: indicate the stats information size
  9028. * Value: This field specifies the number of bytes of stats information
  9029. * that follows the element tag-length header.
  9030. * It is expected but not required that this length is a multiple of
  9031. * 4 bytes.
  9032. */
  9033. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9034. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9035. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9036. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9037. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9038. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9039. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9040. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9041. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9042. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9043. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9044. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9045. do { \
  9046. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value);\
  9047. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9048. } while (0)
  9049. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9050. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9051. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9052. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9053. do { \
  9054. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, \
  9055. value); \
  9056. (word) |= (value) << \
  9057. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9058. } while (0)
  9059. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9060. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9061. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9062. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9063. do { \
  9064. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value);\
  9065. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S;\
  9066. } while (0)
  9067. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9068. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9069. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9070. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9071. do { \
  9072. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, \
  9073. value); \
  9074. (word) |= (value) << \
  9075. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9076. } while (0)
  9077. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9078. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9079. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9080. typedef enum {
  9081. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9082. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9083. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9084. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9085. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9086. /* Host <-> Target Peer type is assigned up to 127 */
  9087. HTT_PEER_TYPE_HOST_MAX = 127,
  9088. /* Reserved from 128 - 255 for target internal use.*/
  9089. /* Temporarily created during offload roam */
  9090. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128,
  9091. } HTT_PEER_TYPE;
  9092. /** 2 word representation of MAC addr */
  9093. typedef struct {
  9094. /** upper 4 bytes of MAC address */
  9095. A_UINT32 mac_addr31to0;
  9096. /** lower 2 bytes of MAC address */
  9097. A_UINT32 mac_addr47to32;
  9098. } htt_mac_addr;
  9099. /** macro to convert MAC address from char array to HTT word format */
  9100. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) \
  9101. do { \
  9102. (phtt_mac_addr)->mac_addr31to0 = \
  9103. (((c_macaddr)[0] << 0) | \
  9104. ((c_macaddr)[1] << 8) | \
  9105. ((c_macaddr)[2] << 16) | \
  9106. ((c_macaddr)[3] << 24)); \
  9107. (phtt_mac_addr)->mac_addr47to32 = \
  9108. ((c_macaddr)[4] | ((c_macaddr)[5] << 8)); \
  9109. } while (0)
  9110. #endif