htt.h 453 KB

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