wmi.h 176 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147
  1. /*
  2. * Copyright (c) 2005-2011 Atheros Communications Inc.
  3. * Copyright (c) 2011-2013 Qualcomm Atheros, Inc.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. #ifndef _WMI_H_
  18. #define _WMI_H_
  19. #include <linux/types.h>
  20. #include <net/mac80211.h>
  21. /*
  22. * This file specifies the WMI interface for the Unified Software
  23. * Architecture.
  24. *
  25. * It includes definitions of all the commands and events. Commands are
  26. * messages from the host to the target. Events and Replies are messages
  27. * from the target to the host.
  28. *
  29. * Ownership of correctness in regards to WMI commands belongs to the host
  30. * driver and the target is not required to validate parameters for value,
  31. * proper range, or any other checking.
  32. *
  33. * Guidelines for extending this interface are below.
  34. *
  35. * 1. Add new WMI commands ONLY within the specified range - 0x9000 - 0x9fff
  36. *
  37. * 2. Use ONLY u32 type for defining member variables within WMI
  38. * command/event structures. Do not use u8, u16, bool or
  39. * enum types within these structures.
  40. *
  41. * 3. DO NOT define bit fields within structures. Implement bit fields
  42. * using masks if necessary. Do not use the programming language's bit
  43. * field definition.
  44. *
  45. * 4. Define macros for encode/decode of u8, u16 fields within
  46. * the u32 variables. Use these macros for set/get of these fields.
  47. * Try to use this to optimize the structure without bloating it with
  48. * u32 variables for every lower sized field.
  49. *
  50. * 5. Do not use PACK/UNPACK attributes for the structures as each member
  51. * variable is already 4-byte aligned by virtue of being a u32
  52. * type.
  53. *
  54. * 6. Comment each parameter part of the WMI command/event structure by
  55. * using the 2 stars at the begining of C comment instead of one star to
  56. * enable HTML document generation using Doxygen.
  57. *
  58. */
  59. /* Control Path */
  60. struct wmi_cmd_hdr {
  61. __le32 cmd_id;
  62. } __packed;
  63. #define WMI_CMD_HDR_CMD_ID_MASK 0x00FFFFFF
  64. #define WMI_CMD_HDR_CMD_ID_LSB 0
  65. #define WMI_CMD_HDR_PLT_PRIV_MASK 0xFF000000
  66. #define WMI_CMD_HDR_PLT_PRIV_LSB 24
  67. #define HTC_PROTOCOL_VERSION 0x0002
  68. #define WMI_PROTOCOL_VERSION 0x0002
  69. enum wmi_service {
  70. WMI_SERVICE_BEACON_OFFLOAD = 0,
  71. WMI_SERVICE_SCAN_OFFLOAD,
  72. WMI_SERVICE_ROAM_OFFLOAD,
  73. WMI_SERVICE_BCN_MISS_OFFLOAD,
  74. WMI_SERVICE_STA_PWRSAVE,
  75. WMI_SERVICE_STA_ADVANCED_PWRSAVE,
  76. WMI_SERVICE_AP_UAPSD,
  77. WMI_SERVICE_AP_DFS,
  78. WMI_SERVICE_11AC,
  79. WMI_SERVICE_BLOCKACK,
  80. WMI_SERVICE_PHYERR,
  81. WMI_SERVICE_BCN_FILTER,
  82. WMI_SERVICE_RTT,
  83. WMI_SERVICE_RATECTRL,
  84. WMI_SERVICE_WOW,
  85. WMI_SERVICE_RATECTRL_CACHE,
  86. WMI_SERVICE_IRAM_TIDS,
  87. WMI_SERVICE_ARPNS_OFFLOAD,
  88. WMI_SERVICE_NLO,
  89. WMI_SERVICE_GTK_OFFLOAD,
  90. WMI_SERVICE_SCAN_SCH,
  91. WMI_SERVICE_CSA_OFFLOAD,
  92. WMI_SERVICE_CHATTER,
  93. WMI_SERVICE_COEX_FREQAVOID,
  94. WMI_SERVICE_PACKET_POWER_SAVE,
  95. WMI_SERVICE_FORCE_FW_HANG,
  96. WMI_SERVICE_GPIO,
  97. WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
  98. WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
  99. WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
  100. WMI_SERVICE_STA_KEEP_ALIVE,
  101. WMI_SERVICE_TX_ENCAP,
  102. WMI_SERVICE_BURST,
  103. WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT,
  104. WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT,
  105. WMI_SERVICE_ROAM_SCAN_OFFLOAD,
  106. WMI_SERVICE_AP_PS_DETECT_OUT_OF_SYNC,
  107. WMI_SERVICE_EARLY_RX,
  108. WMI_SERVICE_STA_SMPS,
  109. WMI_SERVICE_FWTEST,
  110. WMI_SERVICE_STA_WMMAC,
  111. WMI_SERVICE_TDLS,
  112. WMI_SERVICE_MCC_BCN_INTERVAL_CHANGE,
  113. WMI_SERVICE_ADAPTIVE_OCS,
  114. WMI_SERVICE_BA_SSN_SUPPORT,
  115. WMI_SERVICE_FILTER_IPSEC_NATKEEPALIVE,
  116. WMI_SERVICE_WLAN_HB,
  117. WMI_SERVICE_LTE_ANT_SHARE_SUPPORT,
  118. WMI_SERVICE_BATCH_SCAN,
  119. WMI_SERVICE_QPOWER,
  120. WMI_SERVICE_PLMREQ,
  121. WMI_SERVICE_THERMAL_MGMT,
  122. WMI_SERVICE_RMC,
  123. WMI_SERVICE_MHF_OFFLOAD,
  124. WMI_SERVICE_COEX_SAR,
  125. WMI_SERVICE_BCN_TXRATE_OVERRIDE,
  126. WMI_SERVICE_NAN,
  127. WMI_SERVICE_L1SS_STAT,
  128. WMI_SERVICE_ESTIMATE_LINKSPEED,
  129. WMI_SERVICE_OBSS_SCAN,
  130. WMI_SERVICE_TDLS_OFFCHAN,
  131. WMI_SERVICE_TDLS_UAPSD_BUFFER_STA,
  132. WMI_SERVICE_TDLS_UAPSD_SLEEP_STA,
  133. WMI_SERVICE_IBSS_PWRSAVE,
  134. WMI_SERVICE_LPASS,
  135. WMI_SERVICE_EXTSCAN,
  136. WMI_SERVICE_D0WOW,
  137. WMI_SERVICE_HSOFFLOAD,
  138. WMI_SERVICE_ROAM_HO_OFFLOAD,
  139. WMI_SERVICE_RX_FULL_REORDER,
  140. WMI_SERVICE_DHCP_OFFLOAD,
  141. WMI_SERVICE_STA_RX_IPA_OFFLOAD_SUPPORT,
  142. WMI_SERVICE_MDNS_OFFLOAD,
  143. WMI_SERVICE_SAP_AUTH_OFFLOAD,
  144. WMI_SERVICE_ATF,
  145. WMI_SERVICE_COEX_GPIO,
  146. WMI_SERVICE_ENHANCED_PROXY_STA,
  147. WMI_SERVICE_TT,
  148. WMI_SERVICE_PEER_CACHING,
  149. WMI_SERVICE_AUX_SPECTRAL_INTF,
  150. WMI_SERVICE_AUX_CHAN_LOAD_INTF,
  151. WMI_SERVICE_BSS_CHANNEL_INFO_64,
  152. /* keep last */
  153. WMI_SERVICE_MAX,
  154. };
  155. enum wmi_10x_service {
  156. WMI_10X_SERVICE_BEACON_OFFLOAD = 0,
  157. WMI_10X_SERVICE_SCAN_OFFLOAD,
  158. WMI_10X_SERVICE_ROAM_OFFLOAD,
  159. WMI_10X_SERVICE_BCN_MISS_OFFLOAD,
  160. WMI_10X_SERVICE_STA_PWRSAVE,
  161. WMI_10X_SERVICE_STA_ADVANCED_PWRSAVE,
  162. WMI_10X_SERVICE_AP_UAPSD,
  163. WMI_10X_SERVICE_AP_DFS,
  164. WMI_10X_SERVICE_11AC,
  165. WMI_10X_SERVICE_BLOCKACK,
  166. WMI_10X_SERVICE_PHYERR,
  167. WMI_10X_SERVICE_BCN_FILTER,
  168. WMI_10X_SERVICE_RTT,
  169. WMI_10X_SERVICE_RATECTRL,
  170. WMI_10X_SERVICE_WOW,
  171. WMI_10X_SERVICE_RATECTRL_CACHE,
  172. WMI_10X_SERVICE_IRAM_TIDS,
  173. WMI_10X_SERVICE_BURST,
  174. /* introduced in 10.2 */
  175. WMI_10X_SERVICE_SMART_ANTENNA_SW_SUPPORT,
  176. WMI_10X_SERVICE_FORCE_FW_HANG,
  177. WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT,
  178. WMI_10X_SERVICE_ATF,
  179. WMI_10X_SERVICE_COEX_GPIO,
  180. };
  181. enum wmi_main_service {
  182. WMI_MAIN_SERVICE_BEACON_OFFLOAD = 0,
  183. WMI_MAIN_SERVICE_SCAN_OFFLOAD,
  184. WMI_MAIN_SERVICE_ROAM_OFFLOAD,
  185. WMI_MAIN_SERVICE_BCN_MISS_OFFLOAD,
  186. WMI_MAIN_SERVICE_STA_PWRSAVE,
  187. WMI_MAIN_SERVICE_STA_ADVANCED_PWRSAVE,
  188. WMI_MAIN_SERVICE_AP_UAPSD,
  189. WMI_MAIN_SERVICE_AP_DFS,
  190. WMI_MAIN_SERVICE_11AC,
  191. WMI_MAIN_SERVICE_BLOCKACK,
  192. WMI_MAIN_SERVICE_PHYERR,
  193. WMI_MAIN_SERVICE_BCN_FILTER,
  194. WMI_MAIN_SERVICE_RTT,
  195. WMI_MAIN_SERVICE_RATECTRL,
  196. WMI_MAIN_SERVICE_WOW,
  197. WMI_MAIN_SERVICE_RATECTRL_CACHE,
  198. WMI_MAIN_SERVICE_IRAM_TIDS,
  199. WMI_MAIN_SERVICE_ARPNS_OFFLOAD,
  200. WMI_MAIN_SERVICE_NLO,
  201. WMI_MAIN_SERVICE_GTK_OFFLOAD,
  202. WMI_MAIN_SERVICE_SCAN_SCH,
  203. WMI_MAIN_SERVICE_CSA_OFFLOAD,
  204. WMI_MAIN_SERVICE_CHATTER,
  205. WMI_MAIN_SERVICE_COEX_FREQAVOID,
  206. WMI_MAIN_SERVICE_PACKET_POWER_SAVE,
  207. WMI_MAIN_SERVICE_FORCE_FW_HANG,
  208. WMI_MAIN_SERVICE_GPIO,
  209. WMI_MAIN_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
  210. WMI_MAIN_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
  211. WMI_MAIN_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
  212. WMI_MAIN_SERVICE_STA_KEEP_ALIVE,
  213. WMI_MAIN_SERVICE_TX_ENCAP,
  214. };
  215. enum wmi_10_4_service {
  216. WMI_10_4_SERVICE_BEACON_OFFLOAD = 0,
  217. WMI_10_4_SERVICE_SCAN_OFFLOAD,
  218. WMI_10_4_SERVICE_ROAM_OFFLOAD,
  219. WMI_10_4_SERVICE_BCN_MISS_OFFLOAD,
  220. WMI_10_4_SERVICE_STA_PWRSAVE,
  221. WMI_10_4_SERVICE_STA_ADVANCED_PWRSAVE,
  222. WMI_10_4_SERVICE_AP_UAPSD,
  223. WMI_10_4_SERVICE_AP_DFS,
  224. WMI_10_4_SERVICE_11AC,
  225. WMI_10_4_SERVICE_BLOCKACK,
  226. WMI_10_4_SERVICE_PHYERR,
  227. WMI_10_4_SERVICE_BCN_FILTER,
  228. WMI_10_4_SERVICE_RTT,
  229. WMI_10_4_SERVICE_RATECTRL,
  230. WMI_10_4_SERVICE_WOW,
  231. WMI_10_4_SERVICE_RATECTRL_CACHE,
  232. WMI_10_4_SERVICE_IRAM_TIDS,
  233. WMI_10_4_SERVICE_BURST,
  234. WMI_10_4_SERVICE_SMART_ANTENNA_SW_SUPPORT,
  235. WMI_10_4_SERVICE_GTK_OFFLOAD,
  236. WMI_10_4_SERVICE_SCAN_SCH,
  237. WMI_10_4_SERVICE_CSA_OFFLOAD,
  238. WMI_10_4_SERVICE_CHATTER,
  239. WMI_10_4_SERVICE_COEX_FREQAVOID,
  240. WMI_10_4_SERVICE_PACKET_POWER_SAVE,
  241. WMI_10_4_SERVICE_FORCE_FW_HANG,
  242. WMI_10_4_SERVICE_SMART_ANTENNA_HW_SUPPORT,
  243. WMI_10_4_SERVICE_GPIO,
  244. WMI_10_4_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
  245. WMI_10_4_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
  246. WMI_10_4_SERVICE_STA_KEEP_ALIVE,
  247. WMI_10_4_SERVICE_TX_ENCAP,
  248. WMI_10_4_SERVICE_AP_PS_DETECT_OUT_OF_SYNC,
  249. WMI_10_4_SERVICE_EARLY_RX,
  250. WMI_10_4_SERVICE_ENHANCED_PROXY_STA,
  251. WMI_10_4_SERVICE_TT,
  252. WMI_10_4_SERVICE_ATF,
  253. WMI_10_4_SERVICE_PEER_CACHING,
  254. WMI_10_4_SERVICE_COEX_GPIO,
  255. WMI_10_4_SERVICE_AUX_SPECTRAL_INTF,
  256. WMI_10_4_SERVICE_AUX_CHAN_LOAD_INTF,
  257. WMI_10_4_SERVICE_BSS_CHANNEL_INFO_64,
  258. };
  259. static inline char *wmi_service_name(int service_id)
  260. {
  261. #define SVCSTR(x) case x: return #x
  262. switch (service_id) {
  263. SVCSTR(WMI_SERVICE_BEACON_OFFLOAD);
  264. SVCSTR(WMI_SERVICE_SCAN_OFFLOAD);
  265. SVCSTR(WMI_SERVICE_ROAM_OFFLOAD);
  266. SVCSTR(WMI_SERVICE_BCN_MISS_OFFLOAD);
  267. SVCSTR(WMI_SERVICE_STA_PWRSAVE);
  268. SVCSTR(WMI_SERVICE_STA_ADVANCED_PWRSAVE);
  269. SVCSTR(WMI_SERVICE_AP_UAPSD);
  270. SVCSTR(WMI_SERVICE_AP_DFS);
  271. SVCSTR(WMI_SERVICE_11AC);
  272. SVCSTR(WMI_SERVICE_BLOCKACK);
  273. SVCSTR(WMI_SERVICE_PHYERR);
  274. SVCSTR(WMI_SERVICE_BCN_FILTER);
  275. SVCSTR(WMI_SERVICE_RTT);
  276. SVCSTR(WMI_SERVICE_RATECTRL);
  277. SVCSTR(WMI_SERVICE_WOW);
  278. SVCSTR(WMI_SERVICE_RATECTRL_CACHE);
  279. SVCSTR(WMI_SERVICE_IRAM_TIDS);
  280. SVCSTR(WMI_SERVICE_ARPNS_OFFLOAD);
  281. SVCSTR(WMI_SERVICE_NLO);
  282. SVCSTR(WMI_SERVICE_GTK_OFFLOAD);
  283. SVCSTR(WMI_SERVICE_SCAN_SCH);
  284. SVCSTR(WMI_SERVICE_CSA_OFFLOAD);
  285. SVCSTR(WMI_SERVICE_CHATTER);
  286. SVCSTR(WMI_SERVICE_COEX_FREQAVOID);
  287. SVCSTR(WMI_SERVICE_PACKET_POWER_SAVE);
  288. SVCSTR(WMI_SERVICE_FORCE_FW_HANG);
  289. SVCSTR(WMI_SERVICE_GPIO);
  290. SVCSTR(WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM);
  291. SVCSTR(WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG);
  292. SVCSTR(WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG);
  293. SVCSTR(WMI_SERVICE_STA_KEEP_ALIVE);
  294. SVCSTR(WMI_SERVICE_TX_ENCAP);
  295. SVCSTR(WMI_SERVICE_BURST);
  296. SVCSTR(WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT);
  297. SVCSTR(WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT);
  298. SVCSTR(WMI_SERVICE_ROAM_SCAN_OFFLOAD);
  299. SVCSTR(WMI_SERVICE_AP_PS_DETECT_OUT_OF_SYNC);
  300. SVCSTR(WMI_SERVICE_EARLY_RX);
  301. SVCSTR(WMI_SERVICE_STA_SMPS);
  302. SVCSTR(WMI_SERVICE_FWTEST);
  303. SVCSTR(WMI_SERVICE_STA_WMMAC);
  304. SVCSTR(WMI_SERVICE_TDLS);
  305. SVCSTR(WMI_SERVICE_MCC_BCN_INTERVAL_CHANGE);
  306. SVCSTR(WMI_SERVICE_ADAPTIVE_OCS);
  307. SVCSTR(WMI_SERVICE_BA_SSN_SUPPORT);
  308. SVCSTR(WMI_SERVICE_FILTER_IPSEC_NATKEEPALIVE);
  309. SVCSTR(WMI_SERVICE_WLAN_HB);
  310. SVCSTR(WMI_SERVICE_LTE_ANT_SHARE_SUPPORT);
  311. SVCSTR(WMI_SERVICE_BATCH_SCAN);
  312. SVCSTR(WMI_SERVICE_QPOWER);
  313. SVCSTR(WMI_SERVICE_PLMREQ);
  314. SVCSTR(WMI_SERVICE_THERMAL_MGMT);
  315. SVCSTR(WMI_SERVICE_RMC);
  316. SVCSTR(WMI_SERVICE_MHF_OFFLOAD);
  317. SVCSTR(WMI_SERVICE_COEX_SAR);
  318. SVCSTR(WMI_SERVICE_BCN_TXRATE_OVERRIDE);
  319. SVCSTR(WMI_SERVICE_NAN);
  320. SVCSTR(WMI_SERVICE_L1SS_STAT);
  321. SVCSTR(WMI_SERVICE_ESTIMATE_LINKSPEED);
  322. SVCSTR(WMI_SERVICE_OBSS_SCAN);
  323. SVCSTR(WMI_SERVICE_TDLS_OFFCHAN);
  324. SVCSTR(WMI_SERVICE_TDLS_UAPSD_BUFFER_STA);
  325. SVCSTR(WMI_SERVICE_TDLS_UAPSD_SLEEP_STA);
  326. SVCSTR(WMI_SERVICE_IBSS_PWRSAVE);
  327. SVCSTR(WMI_SERVICE_LPASS);
  328. SVCSTR(WMI_SERVICE_EXTSCAN);
  329. SVCSTR(WMI_SERVICE_D0WOW);
  330. SVCSTR(WMI_SERVICE_HSOFFLOAD);
  331. SVCSTR(WMI_SERVICE_ROAM_HO_OFFLOAD);
  332. SVCSTR(WMI_SERVICE_RX_FULL_REORDER);
  333. SVCSTR(WMI_SERVICE_DHCP_OFFLOAD);
  334. SVCSTR(WMI_SERVICE_STA_RX_IPA_OFFLOAD_SUPPORT);
  335. SVCSTR(WMI_SERVICE_MDNS_OFFLOAD);
  336. SVCSTR(WMI_SERVICE_SAP_AUTH_OFFLOAD);
  337. SVCSTR(WMI_SERVICE_ATF);
  338. SVCSTR(WMI_SERVICE_COEX_GPIO);
  339. SVCSTR(WMI_SERVICE_ENHANCED_PROXY_STA);
  340. SVCSTR(WMI_SERVICE_TT);
  341. SVCSTR(WMI_SERVICE_PEER_CACHING);
  342. SVCSTR(WMI_SERVICE_AUX_SPECTRAL_INTF);
  343. SVCSTR(WMI_SERVICE_AUX_CHAN_LOAD_INTF);
  344. SVCSTR(WMI_SERVICE_BSS_CHANNEL_INFO_64);
  345. default:
  346. return NULL;
  347. }
  348. #undef SVCSTR
  349. }
  350. #define WMI_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id, len) \
  351. ((svc_id) < (len) && \
  352. __le32_to_cpu((wmi_svc_bmap)[(svc_id)/(sizeof(u32))]) & \
  353. BIT((svc_id)%(sizeof(u32))))
  354. #define SVCMAP(x, y, len) \
  355. do { \
  356. if (WMI_SERVICE_IS_ENABLED((in), (x), (len))) \
  357. __set_bit(y, out); \
  358. } while (0)
  359. static inline void wmi_10x_svc_map(const __le32 *in, unsigned long *out,
  360. size_t len)
  361. {
  362. SVCMAP(WMI_10X_SERVICE_BEACON_OFFLOAD,
  363. WMI_SERVICE_BEACON_OFFLOAD, len);
  364. SVCMAP(WMI_10X_SERVICE_SCAN_OFFLOAD,
  365. WMI_SERVICE_SCAN_OFFLOAD, len);
  366. SVCMAP(WMI_10X_SERVICE_ROAM_OFFLOAD,
  367. WMI_SERVICE_ROAM_OFFLOAD, len);
  368. SVCMAP(WMI_10X_SERVICE_BCN_MISS_OFFLOAD,
  369. WMI_SERVICE_BCN_MISS_OFFLOAD, len);
  370. SVCMAP(WMI_10X_SERVICE_STA_PWRSAVE,
  371. WMI_SERVICE_STA_PWRSAVE, len);
  372. SVCMAP(WMI_10X_SERVICE_STA_ADVANCED_PWRSAVE,
  373. WMI_SERVICE_STA_ADVANCED_PWRSAVE, len);
  374. SVCMAP(WMI_10X_SERVICE_AP_UAPSD,
  375. WMI_SERVICE_AP_UAPSD, len);
  376. SVCMAP(WMI_10X_SERVICE_AP_DFS,
  377. WMI_SERVICE_AP_DFS, len);
  378. SVCMAP(WMI_10X_SERVICE_11AC,
  379. WMI_SERVICE_11AC, len);
  380. SVCMAP(WMI_10X_SERVICE_BLOCKACK,
  381. WMI_SERVICE_BLOCKACK, len);
  382. SVCMAP(WMI_10X_SERVICE_PHYERR,
  383. WMI_SERVICE_PHYERR, len);
  384. SVCMAP(WMI_10X_SERVICE_BCN_FILTER,
  385. WMI_SERVICE_BCN_FILTER, len);
  386. SVCMAP(WMI_10X_SERVICE_RTT,
  387. WMI_SERVICE_RTT, len);
  388. SVCMAP(WMI_10X_SERVICE_RATECTRL,
  389. WMI_SERVICE_RATECTRL, len);
  390. SVCMAP(WMI_10X_SERVICE_WOW,
  391. WMI_SERVICE_WOW, len);
  392. SVCMAP(WMI_10X_SERVICE_RATECTRL_CACHE,
  393. WMI_SERVICE_RATECTRL_CACHE, len);
  394. SVCMAP(WMI_10X_SERVICE_IRAM_TIDS,
  395. WMI_SERVICE_IRAM_TIDS, len);
  396. SVCMAP(WMI_10X_SERVICE_BURST,
  397. WMI_SERVICE_BURST, len);
  398. SVCMAP(WMI_10X_SERVICE_SMART_ANTENNA_SW_SUPPORT,
  399. WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT, len);
  400. SVCMAP(WMI_10X_SERVICE_FORCE_FW_HANG,
  401. WMI_SERVICE_FORCE_FW_HANG, len);
  402. SVCMAP(WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT,
  403. WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT, len);
  404. SVCMAP(WMI_10X_SERVICE_ATF,
  405. WMI_SERVICE_ATF, len);
  406. SVCMAP(WMI_10X_SERVICE_COEX_GPIO,
  407. WMI_SERVICE_COEX_GPIO, len);
  408. }
  409. static inline void wmi_main_svc_map(const __le32 *in, unsigned long *out,
  410. size_t len)
  411. {
  412. SVCMAP(WMI_MAIN_SERVICE_BEACON_OFFLOAD,
  413. WMI_SERVICE_BEACON_OFFLOAD, len);
  414. SVCMAP(WMI_MAIN_SERVICE_SCAN_OFFLOAD,
  415. WMI_SERVICE_SCAN_OFFLOAD, len);
  416. SVCMAP(WMI_MAIN_SERVICE_ROAM_OFFLOAD,
  417. WMI_SERVICE_ROAM_OFFLOAD, len);
  418. SVCMAP(WMI_MAIN_SERVICE_BCN_MISS_OFFLOAD,
  419. WMI_SERVICE_BCN_MISS_OFFLOAD, len);
  420. SVCMAP(WMI_MAIN_SERVICE_STA_PWRSAVE,
  421. WMI_SERVICE_STA_PWRSAVE, len);
  422. SVCMAP(WMI_MAIN_SERVICE_STA_ADVANCED_PWRSAVE,
  423. WMI_SERVICE_STA_ADVANCED_PWRSAVE, len);
  424. SVCMAP(WMI_MAIN_SERVICE_AP_UAPSD,
  425. WMI_SERVICE_AP_UAPSD, len);
  426. SVCMAP(WMI_MAIN_SERVICE_AP_DFS,
  427. WMI_SERVICE_AP_DFS, len);
  428. SVCMAP(WMI_MAIN_SERVICE_11AC,
  429. WMI_SERVICE_11AC, len);
  430. SVCMAP(WMI_MAIN_SERVICE_BLOCKACK,
  431. WMI_SERVICE_BLOCKACK, len);
  432. SVCMAP(WMI_MAIN_SERVICE_PHYERR,
  433. WMI_SERVICE_PHYERR, len);
  434. SVCMAP(WMI_MAIN_SERVICE_BCN_FILTER,
  435. WMI_SERVICE_BCN_FILTER, len);
  436. SVCMAP(WMI_MAIN_SERVICE_RTT,
  437. WMI_SERVICE_RTT, len);
  438. SVCMAP(WMI_MAIN_SERVICE_RATECTRL,
  439. WMI_SERVICE_RATECTRL, len);
  440. SVCMAP(WMI_MAIN_SERVICE_WOW,
  441. WMI_SERVICE_WOW, len);
  442. SVCMAP(WMI_MAIN_SERVICE_RATECTRL_CACHE,
  443. WMI_SERVICE_RATECTRL_CACHE, len);
  444. SVCMAP(WMI_MAIN_SERVICE_IRAM_TIDS,
  445. WMI_SERVICE_IRAM_TIDS, len);
  446. SVCMAP(WMI_MAIN_SERVICE_ARPNS_OFFLOAD,
  447. WMI_SERVICE_ARPNS_OFFLOAD, len);
  448. SVCMAP(WMI_MAIN_SERVICE_NLO,
  449. WMI_SERVICE_NLO, len);
  450. SVCMAP(WMI_MAIN_SERVICE_GTK_OFFLOAD,
  451. WMI_SERVICE_GTK_OFFLOAD, len);
  452. SVCMAP(WMI_MAIN_SERVICE_SCAN_SCH,
  453. WMI_SERVICE_SCAN_SCH, len);
  454. SVCMAP(WMI_MAIN_SERVICE_CSA_OFFLOAD,
  455. WMI_SERVICE_CSA_OFFLOAD, len);
  456. SVCMAP(WMI_MAIN_SERVICE_CHATTER,
  457. WMI_SERVICE_CHATTER, len);
  458. SVCMAP(WMI_MAIN_SERVICE_COEX_FREQAVOID,
  459. WMI_SERVICE_COEX_FREQAVOID, len);
  460. SVCMAP(WMI_MAIN_SERVICE_PACKET_POWER_SAVE,
  461. WMI_SERVICE_PACKET_POWER_SAVE, len);
  462. SVCMAP(WMI_MAIN_SERVICE_FORCE_FW_HANG,
  463. WMI_SERVICE_FORCE_FW_HANG, len);
  464. SVCMAP(WMI_MAIN_SERVICE_GPIO,
  465. WMI_SERVICE_GPIO, len);
  466. SVCMAP(WMI_MAIN_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
  467. WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM, len);
  468. SVCMAP(WMI_MAIN_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
  469. WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG, len);
  470. SVCMAP(WMI_MAIN_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
  471. WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG, len);
  472. SVCMAP(WMI_MAIN_SERVICE_STA_KEEP_ALIVE,
  473. WMI_SERVICE_STA_KEEP_ALIVE, len);
  474. SVCMAP(WMI_MAIN_SERVICE_TX_ENCAP,
  475. WMI_SERVICE_TX_ENCAP, len);
  476. }
  477. static inline void wmi_10_4_svc_map(const __le32 *in, unsigned long *out,
  478. size_t len)
  479. {
  480. SVCMAP(WMI_10_4_SERVICE_BEACON_OFFLOAD,
  481. WMI_SERVICE_BEACON_OFFLOAD, len);
  482. SVCMAP(WMI_10_4_SERVICE_SCAN_OFFLOAD,
  483. WMI_SERVICE_SCAN_OFFLOAD, len);
  484. SVCMAP(WMI_10_4_SERVICE_ROAM_OFFLOAD,
  485. WMI_SERVICE_ROAM_OFFLOAD, len);
  486. SVCMAP(WMI_10_4_SERVICE_BCN_MISS_OFFLOAD,
  487. WMI_SERVICE_BCN_MISS_OFFLOAD, len);
  488. SVCMAP(WMI_10_4_SERVICE_STA_PWRSAVE,
  489. WMI_SERVICE_STA_PWRSAVE, len);
  490. SVCMAP(WMI_10_4_SERVICE_STA_ADVANCED_PWRSAVE,
  491. WMI_SERVICE_STA_ADVANCED_PWRSAVE, len);
  492. SVCMAP(WMI_10_4_SERVICE_AP_UAPSD,
  493. WMI_SERVICE_AP_UAPSD, len);
  494. SVCMAP(WMI_10_4_SERVICE_AP_DFS,
  495. WMI_SERVICE_AP_DFS, len);
  496. SVCMAP(WMI_10_4_SERVICE_11AC,
  497. WMI_SERVICE_11AC, len);
  498. SVCMAP(WMI_10_4_SERVICE_BLOCKACK,
  499. WMI_SERVICE_BLOCKACK, len);
  500. SVCMAP(WMI_10_4_SERVICE_PHYERR,
  501. WMI_SERVICE_PHYERR, len);
  502. SVCMAP(WMI_10_4_SERVICE_BCN_FILTER,
  503. WMI_SERVICE_BCN_FILTER, len);
  504. SVCMAP(WMI_10_4_SERVICE_RTT,
  505. WMI_SERVICE_RTT, len);
  506. SVCMAP(WMI_10_4_SERVICE_RATECTRL,
  507. WMI_SERVICE_RATECTRL, len);
  508. SVCMAP(WMI_10_4_SERVICE_WOW,
  509. WMI_SERVICE_WOW, len);
  510. SVCMAP(WMI_10_4_SERVICE_RATECTRL_CACHE,
  511. WMI_SERVICE_RATECTRL_CACHE, len);
  512. SVCMAP(WMI_10_4_SERVICE_IRAM_TIDS,
  513. WMI_SERVICE_IRAM_TIDS, len);
  514. SVCMAP(WMI_10_4_SERVICE_BURST,
  515. WMI_SERVICE_BURST, len);
  516. SVCMAP(WMI_10_4_SERVICE_SMART_ANTENNA_SW_SUPPORT,
  517. WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT, len);
  518. SVCMAP(WMI_10_4_SERVICE_GTK_OFFLOAD,
  519. WMI_SERVICE_GTK_OFFLOAD, len);
  520. SVCMAP(WMI_10_4_SERVICE_SCAN_SCH,
  521. WMI_SERVICE_SCAN_SCH, len);
  522. SVCMAP(WMI_10_4_SERVICE_CSA_OFFLOAD,
  523. WMI_SERVICE_CSA_OFFLOAD, len);
  524. SVCMAP(WMI_10_4_SERVICE_CHATTER,
  525. WMI_SERVICE_CHATTER, len);
  526. SVCMAP(WMI_10_4_SERVICE_COEX_FREQAVOID,
  527. WMI_SERVICE_COEX_FREQAVOID, len);
  528. SVCMAP(WMI_10_4_SERVICE_PACKET_POWER_SAVE,
  529. WMI_SERVICE_PACKET_POWER_SAVE, len);
  530. SVCMAP(WMI_10_4_SERVICE_FORCE_FW_HANG,
  531. WMI_SERVICE_FORCE_FW_HANG, len);
  532. SVCMAP(WMI_10_4_SERVICE_SMART_ANTENNA_HW_SUPPORT,
  533. WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT, len);
  534. SVCMAP(WMI_10_4_SERVICE_GPIO,
  535. WMI_SERVICE_GPIO, len);
  536. SVCMAP(WMI_10_4_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
  537. WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG, len);
  538. SVCMAP(WMI_10_4_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
  539. WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG, len);
  540. SVCMAP(WMI_10_4_SERVICE_STA_KEEP_ALIVE,
  541. WMI_SERVICE_STA_KEEP_ALIVE, len);
  542. SVCMAP(WMI_10_4_SERVICE_TX_ENCAP,
  543. WMI_SERVICE_TX_ENCAP, len);
  544. SVCMAP(WMI_10_4_SERVICE_AP_PS_DETECT_OUT_OF_SYNC,
  545. WMI_SERVICE_AP_PS_DETECT_OUT_OF_SYNC, len);
  546. SVCMAP(WMI_10_4_SERVICE_EARLY_RX,
  547. WMI_SERVICE_EARLY_RX, len);
  548. SVCMAP(WMI_10_4_SERVICE_ENHANCED_PROXY_STA,
  549. WMI_SERVICE_ENHANCED_PROXY_STA, len);
  550. SVCMAP(WMI_10_4_SERVICE_TT,
  551. WMI_SERVICE_TT, len);
  552. SVCMAP(WMI_10_4_SERVICE_ATF,
  553. WMI_SERVICE_ATF, len);
  554. SVCMAP(WMI_10_4_SERVICE_PEER_CACHING,
  555. WMI_SERVICE_PEER_CACHING, len);
  556. SVCMAP(WMI_10_4_SERVICE_COEX_GPIO,
  557. WMI_SERVICE_COEX_GPIO, len);
  558. SVCMAP(WMI_10_4_SERVICE_AUX_SPECTRAL_INTF,
  559. WMI_SERVICE_AUX_SPECTRAL_INTF, len);
  560. SVCMAP(WMI_10_4_SERVICE_AUX_CHAN_LOAD_INTF,
  561. WMI_SERVICE_AUX_CHAN_LOAD_INTF, len);
  562. SVCMAP(WMI_10_4_SERVICE_BSS_CHANNEL_INFO_64,
  563. WMI_SERVICE_BSS_CHANNEL_INFO_64, len);
  564. }
  565. #undef SVCMAP
  566. /* 2 word representation of MAC addr */
  567. struct wmi_mac_addr {
  568. union {
  569. u8 addr[6];
  570. struct {
  571. u32 word0;
  572. u32 word1;
  573. } __packed;
  574. } __packed;
  575. } __packed;
  576. struct wmi_cmd_map {
  577. u32 init_cmdid;
  578. u32 start_scan_cmdid;
  579. u32 stop_scan_cmdid;
  580. u32 scan_chan_list_cmdid;
  581. u32 scan_sch_prio_tbl_cmdid;
  582. u32 pdev_set_regdomain_cmdid;
  583. u32 pdev_set_channel_cmdid;
  584. u32 pdev_set_param_cmdid;
  585. u32 pdev_pktlog_enable_cmdid;
  586. u32 pdev_pktlog_disable_cmdid;
  587. u32 pdev_set_wmm_params_cmdid;
  588. u32 pdev_set_ht_cap_ie_cmdid;
  589. u32 pdev_set_vht_cap_ie_cmdid;
  590. u32 pdev_set_dscp_tid_map_cmdid;
  591. u32 pdev_set_quiet_mode_cmdid;
  592. u32 pdev_green_ap_ps_enable_cmdid;
  593. u32 pdev_get_tpc_config_cmdid;
  594. u32 pdev_set_base_macaddr_cmdid;
  595. u32 vdev_create_cmdid;
  596. u32 vdev_delete_cmdid;
  597. u32 vdev_start_request_cmdid;
  598. u32 vdev_restart_request_cmdid;
  599. u32 vdev_up_cmdid;
  600. u32 vdev_stop_cmdid;
  601. u32 vdev_down_cmdid;
  602. u32 vdev_set_param_cmdid;
  603. u32 vdev_install_key_cmdid;
  604. u32 peer_create_cmdid;
  605. u32 peer_delete_cmdid;
  606. u32 peer_flush_tids_cmdid;
  607. u32 peer_set_param_cmdid;
  608. u32 peer_assoc_cmdid;
  609. u32 peer_add_wds_entry_cmdid;
  610. u32 peer_remove_wds_entry_cmdid;
  611. u32 peer_mcast_group_cmdid;
  612. u32 bcn_tx_cmdid;
  613. u32 pdev_send_bcn_cmdid;
  614. u32 bcn_tmpl_cmdid;
  615. u32 bcn_filter_rx_cmdid;
  616. u32 prb_req_filter_rx_cmdid;
  617. u32 mgmt_tx_cmdid;
  618. u32 prb_tmpl_cmdid;
  619. u32 addba_clear_resp_cmdid;
  620. u32 addba_send_cmdid;
  621. u32 addba_status_cmdid;
  622. u32 delba_send_cmdid;
  623. u32 addba_set_resp_cmdid;
  624. u32 send_singleamsdu_cmdid;
  625. u32 sta_powersave_mode_cmdid;
  626. u32 sta_powersave_param_cmdid;
  627. u32 sta_mimo_ps_mode_cmdid;
  628. u32 pdev_dfs_enable_cmdid;
  629. u32 pdev_dfs_disable_cmdid;
  630. u32 roam_scan_mode;
  631. u32 roam_scan_rssi_threshold;
  632. u32 roam_scan_period;
  633. u32 roam_scan_rssi_change_threshold;
  634. u32 roam_ap_profile;
  635. u32 ofl_scan_add_ap_profile;
  636. u32 ofl_scan_remove_ap_profile;
  637. u32 ofl_scan_period;
  638. u32 p2p_dev_set_device_info;
  639. u32 p2p_dev_set_discoverability;
  640. u32 p2p_go_set_beacon_ie;
  641. u32 p2p_go_set_probe_resp_ie;
  642. u32 p2p_set_vendor_ie_data_cmdid;
  643. u32 ap_ps_peer_param_cmdid;
  644. u32 ap_ps_peer_uapsd_coex_cmdid;
  645. u32 peer_rate_retry_sched_cmdid;
  646. u32 wlan_profile_trigger_cmdid;
  647. u32 wlan_profile_set_hist_intvl_cmdid;
  648. u32 wlan_profile_get_profile_data_cmdid;
  649. u32 wlan_profile_enable_profile_id_cmdid;
  650. u32 wlan_profile_list_profile_id_cmdid;
  651. u32 pdev_suspend_cmdid;
  652. u32 pdev_resume_cmdid;
  653. u32 add_bcn_filter_cmdid;
  654. u32 rmv_bcn_filter_cmdid;
  655. u32 wow_add_wake_pattern_cmdid;
  656. u32 wow_del_wake_pattern_cmdid;
  657. u32 wow_enable_disable_wake_event_cmdid;
  658. u32 wow_enable_cmdid;
  659. u32 wow_hostwakeup_from_sleep_cmdid;
  660. u32 rtt_measreq_cmdid;
  661. u32 rtt_tsf_cmdid;
  662. u32 vdev_spectral_scan_configure_cmdid;
  663. u32 vdev_spectral_scan_enable_cmdid;
  664. u32 request_stats_cmdid;
  665. u32 set_arp_ns_offload_cmdid;
  666. u32 network_list_offload_config_cmdid;
  667. u32 gtk_offload_cmdid;
  668. u32 csa_offload_enable_cmdid;
  669. u32 csa_offload_chanswitch_cmdid;
  670. u32 chatter_set_mode_cmdid;
  671. u32 peer_tid_addba_cmdid;
  672. u32 peer_tid_delba_cmdid;
  673. u32 sta_dtim_ps_method_cmdid;
  674. u32 sta_uapsd_auto_trig_cmdid;
  675. u32 sta_keepalive_cmd;
  676. u32 echo_cmdid;
  677. u32 pdev_utf_cmdid;
  678. u32 dbglog_cfg_cmdid;
  679. u32 pdev_qvit_cmdid;
  680. u32 pdev_ftm_intg_cmdid;
  681. u32 vdev_set_keepalive_cmdid;
  682. u32 vdev_get_keepalive_cmdid;
  683. u32 force_fw_hang_cmdid;
  684. u32 gpio_config_cmdid;
  685. u32 gpio_output_cmdid;
  686. u32 pdev_get_temperature_cmdid;
  687. u32 vdev_set_wmm_params_cmdid;
  688. u32 tdls_set_state_cmdid;
  689. u32 tdls_peer_update_cmdid;
  690. u32 adaptive_qcs_cmdid;
  691. u32 scan_update_request_cmdid;
  692. u32 vdev_standby_response_cmdid;
  693. u32 vdev_resume_response_cmdid;
  694. u32 wlan_peer_caching_add_peer_cmdid;
  695. u32 wlan_peer_caching_evict_peer_cmdid;
  696. u32 wlan_peer_caching_restore_peer_cmdid;
  697. u32 wlan_peer_caching_print_all_peers_info_cmdid;
  698. u32 peer_update_wds_entry_cmdid;
  699. u32 peer_add_proxy_sta_entry_cmdid;
  700. u32 rtt_keepalive_cmdid;
  701. u32 oem_req_cmdid;
  702. u32 nan_cmdid;
  703. u32 vdev_ratemask_cmdid;
  704. u32 qboost_cfg_cmdid;
  705. u32 pdev_smart_ant_enable_cmdid;
  706. u32 pdev_smart_ant_set_rx_antenna_cmdid;
  707. u32 peer_smart_ant_set_tx_antenna_cmdid;
  708. u32 peer_smart_ant_set_train_info_cmdid;
  709. u32 peer_smart_ant_set_node_config_ops_cmdid;
  710. u32 pdev_set_antenna_switch_table_cmdid;
  711. u32 pdev_set_ctl_table_cmdid;
  712. u32 pdev_set_mimogain_table_cmdid;
  713. u32 pdev_ratepwr_table_cmdid;
  714. u32 pdev_ratepwr_chainmsk_table_cmdid;
  715. u32 pdev_fips_cmdid;
  716. u32 tt_set_conf_cmdid;
  717. u32 fwtest_cmdid;
  718. u32 vdev_atf_request_cmdid;
  719. u32 peer_atf_request_cmdid;
  720. u32 pdev_get_ani_cck_config_cmdid;
  721. u32 pdev_get_ani_ofdm_config_cmdid;
  722. u32 pdev_reserve_ast_entry_cmdid;
  723. u32 pdev_get_nfcal_power_cmdid;
  724. u32 pdev_get_tpc_cmdid;
  725. u32 pdev_get_ast_info_cmdid;
  726. u32 vdev_set_dscp_tid_map_cmdid;
  727. u32 pdev_get_info_cmdid;
  728. u32 vdev_get_info_cmdid;
  729. u32 vdev_filter_neighbor_rx_packets_cmdid;
  730. u32 mu_cal_start_cmdid;
  731. u32 set_cca_params_cmdid;
  732. u32 pdev_bss_chan_info_request_cmdid;
  733. };
  734. /*
  735. * wmi command groups.
  736. */
  737. enum wmi_cmd_group {
  738. /* 0 to 2 are reserved */
  739. WMI_GRP_START = 0x3,
  740. WMI_GRP_SCAN = WMI_GRP_START,
  741. WMI_GRP_PDEV,
  742. WMI_GRP_VDEV,
  743. WMI_GRP_PEER,
  744. WMI_GRP_MGMT,
  745. WMI_GRP_BA_NEG,
  746. WMI_GRP_STA_PS,
  747. WMI_GRP_DFS,
  748. WMI_GRP_ROAM,
  749. WMI_GRP_OFL_SCAN,
  750. WMI_GRP_P2P,
  751. WMI_GRP_AP_PS,
  752. WMI_GRP_RATE_CTRL,
  753. WMI_GRP_PROFILE,
  754. WMI_GRP_SUSPEND,
  755. WMI_GRP_BCN_FILTER,
  756. WMI_GRP_WOW,
  757. WMI_GRP_RTT,
  758. WMI_GRP_SPECTRAL,
  759. WMI_GRP_STATS,
  760. WMI_GRP_ARP_NS_OFL,
  761. WMI_GRP_NLO_OFL,
  762. WMI_GRP_GTK_OFL,
  763. WMI_GRP_CSA_OFL,
  764. WMI_GRP_CHATTER,
  765. WMI_GRP_TID_ADDBA,
  766. WMI_GRP_MISC,
  767. WMI_GRP_GPIO,
  768. };
  769. #define WMI_CMD_GRP(grp_id) (((grp_id) << 12) | 0x1)
  770. #define WMI_EVT_GRP_START_ID(grp_id) (((grp_id) << 12) | 0x1)
  771. #define WMI_CMD_UNSUPPORTED 0
  772. /* Command IDs and command events for MAIN FW. */
  773. enum wmi_cmd_id {
  774. WMI_INIT_CMDID = 0x1,
  775. /* Scan specific commands */
  776. WMI_START_SCAN_CMDID = WMI_CMD_GRP(WMI_GRP_SCAN),
  777. WMI_STOP_SCAN_CMDID,
  778. WMI_SCAN_CHAN_LIST_CMDID,
  779. WMI_SCAN_SCH_PRIO_TBL_CMDID,
  780. /* PDEV (physical device) specific commands */
  781. WMI_PDEV_SET_REGDOMAIN_CMDID = WMI_CMD_GRP(WMI_GRP_PDEV),
  782. WMI_PDEV_SET_CHANNEL_CMDID,
  783. WMI_PDEV_SET_PARAM_CMDID,
  784. WMI_PDEV_PKTLOG_ENABLE_CMDID,
  785. WMI_PDEV_PKTLOG_DISABLE_CMDID,
  786. WMI_PDEV_SET_WMM_PARAMS_CMDID,
  787. WMI_PDEV_SET_HT_CAP_IE_CMDID,
  788. WMI_PDEV_SET_VHT_CAP_IE_CMDID,
  789. WMI_PDEV_SET_DSCP_TID_MAP_CMDID,
  790. WMI_PDEV_SET_QUIET_MODE_CMDID,
  791. WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID,
  792. WMI_PDEV_GET_TPC_CONFIG_CMDID,
  793. WMI_PDEV_SET_BASE_MACADDR_CMDID,
  794. /* VDEV (virtual device) specific commands */
  795. WMI_VDEV_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_VDEV),
  796. WMI_VDEV_DELETE_CMDID,
  797. WMI_VDEV_START_REQUEST_CMDID,
  798. WMI_VDEV_RESTART_REQUEST_CMDID,
  799. WMI_VDEV_UP_CMDID,
  800. WMI_VDEV_STOP_CMDID,
  801. WMI_VDEV_DOWN_CMDID,
  802. WMI_VDEV_SET_PARAM_CMDID,
  803. WMI_VDEV_INSTALL_KEY_CMDID,
  804. /* peer specific commands */
  805. WMI_PEER_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_PEER),
  806. WMI_PEER_DELETE_CMDID,
  807. WMI_PEER_FLUSH_TIDS_CMDID,
  808. WMI_PEER_SET_PARAM_CMDID,
  809. WMI_PEER_ASSOC_CMDID,
  810. WMI_PEER_ADD_WDS_ENTRY_CMDID,
  811. WMI_PEER_REMOVE_WDS_ENTRY_CMDID,
  812. WMI_PEER_MCAST_GROUP_CMDID,
  813. /* beacon/management specific commands */
  814. WMI_BCN_TX_CMDID = WMI_CMD_GRP(WMI_GRP_MGMT),
  815. WMI_PDEV_SEND_BCN_CMDID,
  816. WMI_BCN_TMPL_CMDID,
  817. WMI_BCN_FILTER_RX_CMDID,
  818. WMI_PRB_REQ_FILTER_RX_CMDID,
  819. WMI_MGMT_TX_CMDID,
  820. WMI_PRB_TMPL_CMDID,
  821. /* commands to directly control BA negotiation directly from host. */
  822. WMI_ADDBA_CLEAR_RESP_CMDID = WMI_CMD_GRP(WMI_GRP_BA_NEG),
  823. WMI_ADDBA_SEND_CMDID,
  824. WMI_ADDBA_STATUS_CMDID,
  825. WMI_DELBA_SEND_CMDID,
  826. WMI_ADDBA_SET_RESP_CMDID,
  827. WMI_SEND_SINGLEAMSDU_CMDID,
  828. /* Station power save specific config */
  829. WMI_STA_POWERSAVE_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_STA_PS),
  830. WMI_STA_POWERSAVE_PARAM_CMDID,
  831. WMI_STA_MIMO_PS_MODE_CMDID,
  832. /** DFS-specific commands */
  833. WMI_PDEV_DFS_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_DFS),
  834. WMI_PDEV_DFS_DISABLE_CMDID,
  835. /* Roaming specific commands */
  836. WMI_ROAM_SCAN_MODE = WMI_CMD_GRP(WMI_GRP_ROAM),
  837. WMI_ROAM_SCAN_RSSI_THRESHOLD,
  838. WMI_ROAM_SCAN_PERIOD,
  839. WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
  840. WMI_ROAM_AP_PROFILE,
  841. /* offload scan specific commands */
  842. WMI_OFL_SCAN_ADD_AP_PROFILE = WMI_CMD_GRP(WMI_GRP_OFL_SCAN),
  843. WMI_OFL_SCAN_REMOVE_AP_PROFILE,
  844. WMI_OFL_SCAN_PERIOD,
  845. /* P2P specific commands */
  846. WMI_P2P_DEV_SET_DEVICE_INFO = WMI_CMD_GRP(WMI_GRP_P2P),
  847. WMI_P2P_DEV_SET_DISCOVERABILITY,
  848. WMI_P2P_GO_SET_BEACON_IE,
  849. WMI_P2P_GO_SET_PROBE_RESP_IE,
  850. WMI_P2P_SET_VENDOR_IE_DATA_CMDID,
  851. /* AP power save specific config */
  852. WMI_AP_PS_PEER_PARAM_CMDID = WMI_CMD_GRP(WMI_GRP_AP_PS),
  853. WMI_AP_PS_PEER_UAPSD_COEX_CMDID,
  854. /* Rate-control specific commands */
  855. WMI_PEER_RATE_RETRY_SCHED_CMDID =
  856. WMI_CMD_GRP(WMI_GRP_RATE_CTRL),
  857. /* WLAN Profiling commands. */
  858. WMI_WLAN_PROFILE_TRIGGER_CMDID = WMI_CMD_GRP(WMI_GRP_PROFILE),
  859. WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
  860. WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
  861. WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
  862. WMI_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
  863. /* Suspend resume command Ids */
  864. WMI_PDEV_SUSPEND_CMDID = WMI_CMD_GRP(WMI_GRP_SUSPEND),
  865. WMI_PDEV_RESUME_CMDID,
  866. /* Beacon filter commands */
  867. WMI_ADD_BCN_FILTER_CMDID = WMI_CMD_GRP(WMI_GRP_BCN_FILTER),
  868. WMI_RMV_BCN_FILTER_CMDID,
  869. /* WOW Specific WMI commands*/
  870. WMI_WOW_ADD_WAKE_PATTERN_CMDID = WMI_CMD_GRP(WMI_GRP_WOW),
  871. WMI_WOW_DEL_WAKE_PATTERN_CMDID,
  872. WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
  873. WMI_WOW_ENABLE_CMDID,
  874. WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
  875. /* RTT measurement related cmd */
  876. WMI_RTT_MEASREQ_CMDID = WMI_CMD_GRP(WMI_GRP_RTT),
  877. WMI_RTT_TSF_CMDID,
  878. /* spectral scan commands */
  879. WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID = WMI_CMD_GRP(WMI_GRP_SPECTRAL),
  880. WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
  881. /* F/W stats */
  882. WMI_REQUEST_STATS_CMDID = WMI_CMD_GRP(WMI_GRP_STATS),
  883. /* ARP OFFLOAD REQUEST*/
  884. WMI_SET_ARP_NS_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_ARP_NS_OFL),
  885. /* NS offload confid*/
  886. WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_NLO_OFL),
  887. /* GTK offload Specific WMI commands*/
  888. WMI_GTK_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_GTK_OFL),
  889. /* CSA offload Specific WMI commands*/
  890. WMI_CSA_OFFLOAD_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_CSA_OFL),
  891. WMI_CSA_OFFLOAD_CHANSWITCH_CMDID,
  892. /* Chatter commands*/
  893. WMI_CHATTER_SET_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_CHATTER),
  894. /* addba specific commands */
  895. WMI_PEER_TID_ADDBA_CMDID = WMI_CMD_GRP(WMI_GRP_TID_ADDBA),
  896. WMI_PEER_TID_DELBA_CMDID,
  897. /* set station mimo powersave method */
  898. WMI_STA_DTIM_PS_METHOD_CMDID,
  899. /* Configure the Station UAPSD AC Auto Trigger Parameters */
  900. WMI_STA_UAPSD_AUTO_TRIG_CMDID,
  901. /* STA Keep alive parameter configuration,
  902. Requires WMI_SERVICE_STA_KEEP_ALIVE */
  903. WMI_STA_KEEPALIVE_CMD,
  904. /* misc command group */
  905. WMI_ECHO_CMDID = WMI_CMD_GRP(WMI_GRP_MISC),
  906. WMI_PDEV_UTF_CMDID,
  907. WMI_DBGLOG_CFG_CMDID,
  908. WMI_PDEV_QVIT_CMDID,
  909. WMI_PDEV_FTM_INTG_CMDID,
  910. WMI_VDEV_SET_KEEPALIVE_CMDID,
  911. WMI_VDEV_GET_KEEPALIVE_CMDID,
  912. WMI_FORCE_FW_HANG_CMDID,
  913. /* GPIO Configuration */
  914. WMI_GPIO_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_GPIO),
  915. WMI_GPIO_OUTPUT_CMDID,
  916. };
  917. enum wmi_event_id {
  918. WMI_SERVICE_READY_EVENTID = 0x1,
  919. WMI_READY_EVENTID,
  920. /* Scan specific events */
  921. WMI_SCAN_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_SCAN),
  922. /* PDEV specific events */
  923. WMI_PDEV_TPC_CONFIG_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PDEV),
  924. WMI_CHAN_INFO_EVENTID,
  925. WMI_PHYERR_EVENTID,
  926. /* VDEV specific events */
  927. WMI_VDEV_START_RESP_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_VDEV),
  928. WMI_VDEV_STOPPED_EVENTID,
  929. WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID,
  930. /* peer specific events */
  931. WMI_PEER_STA_KICKOUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PEER),
  932. /* beacon/mgmt specific events */
  933. WMI_MGMT_RX_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MGMT),
  934. WMI_HOST_SWBA_EVENTID,
  935. WMI_TBTTOFFSET_UPDATE_EVENTID,
  936. /* ADDBA Related WMI Events*/
  937. WMI_TX_DELBA_COMPLETE_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_BA_NEG),
  938. WMI_TX_ADDBA_COMPLETE_EVENTID,
  939. /* Roam event to trigger roaming on host */
  940. WMI_ROAM_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_ROAM),
  941. WMI_PROFILE_MATCH,
  942. /* WoW */
  943. WMI_WOW_WAKEUP_HOST_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_WOW),
  944. /* RTT */
  945. WMI_RTT_MEASUREMENT_REPORT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_RTT),
  946. WMI_TSF_MEASUREMENT_REPORT_EVENTID,
  947. WMI_RTT_ERROR_REPORT_EVENTID,
  948. /* GTK offload */
  949. WMI_GTK_OFFLOAD_STATUS_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GTK_OFL),
  950. WMI_GTK_REKEY_FAIL_EVENTID,
  951. /* CSA IE received event */
  952. WMI_CSA_HANDLING_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_CSA_OFL),
  953. /* Misc events */
  954. WMI_ECHO_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MISC),
  955. WMI_PDEV_UTF_EVENTID,
  956. WMI_DEBUG_MESG_EVENTID,
  957. WMI_UPDATE_STATS_EVENTID,
  958. WMI_DEBUG_PRINT_EVENTID,
  959. WMI_DCS_INTERFERENCE_EVENTID,
  960. WMI_PDEV_QVIT_EVENTID,
  961. WMI_WLAN_PROFILE_DATA_EVENTID,
  962. WMI_PDEV_FTM_INTG_EVENTID,
  963. WMI_WLAN_FREQ_AVOID_EVENTID,
  964. WMI_VDEV_GET_KEEPALIVE_EVENTID,
  965. /* GPIO Event */
  966. WMI_GPIO_INPUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GPIO),
  967. };
  968. /* Command IDs and command events for 10.X firmware */
  969. enum wmi_10x_cmd_id {
  970. WMI_10X_START_CMDID = 0x9000,
  971. WMI_10X_END_CMDID = 0x9FFF,
  972. /* initialize the wlan sub system */
  973. WMI_10X_INIT_CMDID,
  974. /* Scan specific commands */
  975. WMI_10X_START_SCAN_CMDID = WMI_10X_START_CMDID,
  976. WMI_10X_STOP_SCAN_CMDID,
  977. WMI_10X_SCAN_CHAN_LIST_CMDID,
  978. WMI_10X_ECHO_CMDID,
  979. /* PDEV(physical device) specific commands */
  980. WMI_10X_PDEV_SET_REGDOMAIN_CMDID,
  981. WMI_10X_PDEV_SET_CHANNEL_CMDID,
  982. WMI_10X_PDEV_SET_PARAM_CMDID,
  983. WMI_10X_PDEV_PKTLOG_ENABLE_CMDID,
  984. WMI_10X_PDEV_PKTLOG_DISABLE_CMDID,
  985. WMI_10X_PDEV_SET_WMM_PARAMS_CMDID,
  986. WMI_10X_PDEV_SET_HT_CAP_IE_CMDID,
  987. WMI_10X_PDEV_SET_VHT_CAP_IE_CMDID,
  988. WMI_10X_PDEV_SET_BASE_MACADDR_CMDID,
  989. WMI_10X_PDEV_SET_DSCP_TID_MAP_CMDID,
  990. WMI_10X_PDEV_SET_QUIET_MODE_CMDID,
  991. WMI_10X_PDEV_GREEN_AP_PS_ENABLE_CMDID,
  992. WMI_10X_PDEV_GET_TPC_CONFIG_CMDID,
  993. /* VDEV(virtual device) specific commands */
  994. WMI_10X_VDEV_CREATE_CMDID,
  995. WMI_10X_VDEV_DELETE_CMDID,
  996. WMI_10X_VDEV_START_REQUEST_CMDID,
  997. WMI_10X_VDEV_RESTART_REQUEST_CMDID,
  998. WMI_10X_VDEV_UP_CMDID,
  999. WMI_10X_VDEV_STOP_CMDID,
  1000. WMI_10X_VDEV_DOWN_CMDID,
  1001. WMI_10X_VDEV_STANDBY_RESPONSE_CMDID,
  1002. WMI_10X_VDEV_RESUME_RESPONSE_CMDID,
  1003. WMI_10X_VDEV_SET_PARAM_CMDID,
  1004. WMI_10X_VDEV_INSTALL_KEY_CMDID,
  1005. /* peer specific commands */
  1006. WMI_10X_PEER_CREATE_CMDID,
  1007. WMI_10X_PEER_DELETE_CMDID,
  1008. WMI_10X_PEER_FLUSH_TIDS_CMDID,
  1009. WMI_10X_PEER_SET_PARAM_CMDID,
  1010. WMI_10X_PEER_ASSOC_CMDID,
  1011. WMI_10X_PEER_ADD_WDS_ENTRY_CMDID,
  1012. WMI_10X_PEER_REMOVE_WDS_ENTRY_CMDID,
  1013. WMI_10X_PEER_MCAST_GROUP_CMDID,
  1014. /* beacon/management specific commands */
  1015. WMI_10X_BCN_TX_CMDID,
  1016. WMI_10X_BCN_PRB_TMPL_CMDID,
  1017. WMI_10X_BCN_FILTER_RX_CMDID,
  1018. WMI_10X_PRB_REQ_FILTER_RX_CMDID,
  1019. WMI_10X_MGMT_TX_CMDID,
  1020. /* commands to directly control ba negotiation directly from host. */
  1021. WMI_10X_ADDBA_CLEAR_RESP_CMDID,
  1022. WMI_10X_ADDBA_SEND_CMDID,
  1023. WMI_10X_ADDBA_STATUS_CMDID,
  1024. WMI_10X_DELBA_SEND_CMDID,
  1025. WMI_10X_ADDBA_SET_RESP_CMDID,
  1026. WMI_10X_SEND_SINGLEAMSDU_CMDID,
  1027. /* Station power save specific config */
  1028. WMI_10X_STA_POWERSAVE_MODE_CMDID,
  1029. WMI_10X_STA_POWERSAVE_PARAM_CMDID,
  1030. WMI_10X_STA_MIMO_PS_MODE_CMDID,
  1031. /* set debug log config */
  1032. WMI_10X_DBGLOG_CFG_CMDID,
  1033. /* DFS-specific commands */
  1034. WMI_10X_PDEV_DFS_ENABLE_CMDID,
  1035. WMI_10X_PDEV_DFS_DISABLE_CMDID,
  1036. /* QVIT specific command id */
  1037. WMI_10X_PDEV_QVIT_CMDID,
  1038. /* Offload Scan and Roaming related commands */
  1039. WMI_10X_ROAM_SCAN_MODE,
  1040. WMI_10X_ROAM_SCAN_RSSI_THRESHOLD,
  1041. WMI_10X_ROAM_SCAN_PERIOD,
  1042. WMI_10X_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
  1043. WMI_10X_ROAM_AP_PROFILE,
  1044. WMI_10X_OFL_SCAN_ADD_AP_PROFILE,
  1045. WMI_10X_OFL_SCAN_REMOVE_AP_PROFILE,
  1046. WMI_10X_OFL_SCAN_PERIOD,
  1047. /* P2P specific commands */
  1048. WMI_10X_P2P_DEV_SET_DEVICE_INFO,
  1049. WMI_10X_P2P_DEV_SET_DISCOVERABILITY,
  1050. WMI_10X_P2P_GO_SET_BEACON_IE,
  1051. WMI_10X_P2P_GO_SET_PROBE_RESP_IE,
  1052. /* AP power save specific config */
  1053. WMI_10X_AP_PS_PEER_PARAM_CMDID,
  1054. WMI_10X_AP_PS_PEER_UAPSD_COEX_CMDID,
  1055. /* Rate-control specific commands */
  1056. WMI_10X_PEER_RATE_RETRY_SCHED_CMDID,
  1057. /* WLAN Profiling commands. */
  1058. WMI_10X_WLAN_PROFILE_TRIGGER_CMDID,
  1059. WMI_10X_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
  1060. WMI_10X_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
  1061. WMI_10X_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
  1062. WMI_10X_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
  1063. /* Suspend resume command Ids */
  1064. WMI_10X_PDEV_SUSPEND_CMDID,
  1065. WMI_10X_PDEV_RESUME_CMDID,
  1066. /* Beacon filter commands */
  1067. WMI_10X_ADD_BCN_FILTER_CMDID,
  1068. WMI_10X_RMV_BCN_FILTER_CMDID,
  1069. /* WOW Specific WMI commands*/
  1070. WMI_10X_WOW_ADD_WAKE_PATTERN_CMDID,
  1071. WMI_10X_WOW_DEL_WAKE_PATTERN_CMDID,
  1072. WMI_10X_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
  1073. WMI_10X_WOW_ENABLE_CMDID,
  1074. WMI_10X_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
  1075. /* RTT measurement related cmd */
  1076. WMI_10X_RTT_MEASREQ_CMDID,
  1077. WMI_10X_RTT_TSF_CMDID,
  1078. /* transmit beacon by value */
  1079. WMI_10X_PDEV_SEND_BCN_CMDID,
  1080. /* F/W stats */
  1081. WMI_10X_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
  1082. WMI_10X_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
  1083. WMI_10X_REQUEST_STATS_CMDID,
  1084. /* GPIO Configuration */
  1085. WMI_10X_GPIO_CONFIG_CMDID,
  1086. WMI_10X_GPIO_OUTPUT_CMDID,
  1087. WMI_10X_PDEV_UTF_CMDID = WMI_10X_END_CMDID - 1,
  1088. };
  1089. enum wmi_10x_event_id {
  1090. WMI_10X_SERVICE_READY_EVENTID = 0x8000,
  1091. WMI_10X_READY_EVENTID,
  1092. WMI_10X_START_EVENTID = 0x9000,
  1093. WMI_10X_END_EVENTID = 0x9FFF,
  1094. /* Scan specific events */
  1095. WMI_10X_SCAN_EVENTID = WMI_10X_START_EVENTID,
  1096. WMI_10X_ECHO_EVENTID,
  1097. WMI_10X_DEBUG_MESG_EVENTID,
  1098. WMI_10X_UPDATE_STATS_EVENTID,
  1099. /* Instantaneous RSSI event */
  1100. WMI_10X_INST_RSSI_STATS_EVENTID,
  1101. /* VDEV specific events */
  1102. WMI_10X_VDEV_START_RESP_EVENTID,
  1103. WMI_10X_VDEV_STANDBY_REQ_EVENTID,
  1104. WMI_10X_VDEV_RESUME_REQ_EVENTID,
  1105. WMI_10X_VDEV_STOPPED_EVENTID,
  1106. /* peer specific events */
  1107. WMI_10X_PEER_STA_KICKOUT_EVENTID,
  1108. /* beacon/mgmt specific events */
  1109. WMI_10X_HOST_SWBA_EVENTID,
  1110. WMI_10X_TBTTOFFSET_UPDATE_EVENTID,
  1111. WMI_10X_MGMT_RX_EVENTID,
  1112. /* Channel stats event */
  1113. WMI_10X_CHAN_INFO_EVENTID,
  1114. /* PHY Error specific WMI event */
  1115. WMI_10X_PHYERR_EVENTID,
  1116. /* Roam event to trigger roaming on host */
  1117. WMI_10X_ROAM_EVENTID,
  1118. /* matching AP found from list of profiles */
  1119. WMI_10X_PROFILE_MATCH,
  1120. /* debug print message used for tracing FW code while debugging */
  1121. WMI_10X_DEBUG_PRINT_EVENTID,
  1122. /* VI spoecific event */
  1123. WMI_10X_PDEV_QVIT_EVENTID,
  1124. /* FW code profile data in response to profile request */
  1125. WMI_10X_WLAN_PROFILE_DATA_EVENTID,
  1126. /*RTT related event ID*/
  1127. WMI_10X_RTT_MEASUREMENT_REPORT_EVENTID,
  1128. WMI_10X_TSF_MEASUREMENT_REPORT_EVENTID,
  1129. WMI_10X_RTT_ERROR_REPORT_EVENTID,
  1130. WMI_10X_WOW_WAKEUP_HOST_EVENTID,
  1131. WMI_10X_DCS_INTERFERENCE_EVENTID,
  1132. /* TPC config for the current operating channel */
  1133. WMI_10X_PDEV_TPC_CONFIG_EVENTID,
  1134. WMI_10X_GPIO_INPUT_EVENTID,
  1135. WMI_10X_PDEV_UTF_EVENTID = WMI_10X_END_EVENTID-1,
  1136. };
  1137. enum wmi_10_2_cmd_id {
  1138. WMI_10_2_START_CMDID = 0x9000,
  1139. WMI_10_2_END_CMDID = 0x9FFF,
  1140. WMI_10_2_INIT_CMDID,
  1141. WMI_10_2_START_SCAN_CMDID = WMI_10_2_START_CMDID,
  1142. WMI_10_2_STOP_SCAN_CMDID,
  1143. WMI_10_2_SCAN_CHAN_LIST_CMDID,
  1144. WMI_10_2_ECHO_CMDID,
  1145. WMI_10_2_PDEV_SET_REGDOMAIN_CMDID,
  1146. WMI_10_2_PDEV_SET_CHANNEL_CMDID,
  1147. WMI_10_2_PDEV_SET_PARAM_CMDID,
  1148. WMI_10_2_PDEV_PKTLOG_ENABLE_CMDID,
  1149. WMI_10_2_PDEV_PKTLOG_DISABLE_CMDID,
  1150. WMI_10_2_PDEV_SET_WMM_PARAMS_CMDID,
  1151. WMI_10_2_PDEV_SET_HT_CAP_IE_CMDID,
  1152. WMI_10_2_PDEV_SET_VHT_CAP_IE_CMDID,
  1153. WMI_10_2_PDEV_SET_BASE_MACADDR_CMDID,
  1154. WMI_10_2_PDEV_SET_QUIET_MODE_CMDID,
  1155. WMI_10_2_PDEV_GREEN_AP_PS_ENABLE_CMDID,
  1156. WMI_10_2_PDEV_GET_TPC_CONFIG_CMDID,
  1157. WMI_10_2_VDEV_CREATE_CMDID,
  1158. WMI_10_2_VDEV_DELETE_CMDID,
  1159. WMI_10_2_VDEV_START_REQUEST_CMDID,
  1160. WMI_10_2_VDEV_RESTART_REQUEST_CMDID,
  1161. WMI_10_2_VDEV_UP_CMDID,
  1162. WMI_10_2_VDEV_STOP_CMDID,
  1163. WMI_10_2_VDEV_DOWN_CMDID,
  1164. WMI_10_2_VDEV_STANDBY_RESPONSE_CMDID,
  1165. WMI_10_2_VDEV_RESUME_RESPONSE_CMDID,
  1166. WMI_10_2_VDEV_SET_PARAM_CMDID,
  1167. WMI_10_2_VDEV_INSTALL_KEY_CMDID,
  1168. WMI_10_2_VDEV_SET_DSCP_TID_MAP_CMDID,
  1169. WMI_10_2_PEER_CREATE_CMDID,
  1170. WMI_10_2_PEER_DELETE_CMDID,
  1171. WMI_10_2_PEER_FLUSH_TIDS_CMDID,
  1172. WMI_10_2_PEER_SET_PARAM_CMDID,
  1173. WMI_10_2_PEER_ASSOC_CMDID,
  1174. WMI_10_2_PEER_ADD_WDS_ENTRY_CMDID,
  1175. WMI_10_2_PEER_UPDATE_WDS_ENTRY_CMDID,
  1176. WMI_10_2_PEER_REMOVE_WDS_ENTRY_CMDID,
  1177. WMI_10_2_PEER_MCAST_GROUP_CMDID,
  1178. WMI_10_2_BCN_TX_CMDID,
  1179. WMI_10_2_BCN_PRB_TMPL_CMDID,
  1180. WMI_10_2_BCN_FILTER_RX_CMDID,
  1181. WMI_10_2_PRB_REQ_FILTER_RX_CMDID,
  1182. WMI_10_2_MGMT_TX_CMDID,
  1183. WMI_10_2_ADDBA_CLEAR_RESP_CMDID,
  1184. WMI_10_2_ADDBA_SEND_CMDID,
  1185. WMI_10_2_ADDBA_STATUS_CMDID,
  1186. WMI_10_2_DELBA_SEND_CMDID,
  1187. WMI_10_2_ADDBA_SET_RESP_CMDID,
  1188. WMI_10_2_SEND_SINGLEAMSDU_CMDID,
  1189. WMI_10_2_STA_POWERSAVE_MODE_CMDID,
  1190. WMI_10_2_STA_POWERSAVE_PARAM_CMDID,
  1191. WMI_10_2_STA_MIMO_PS_MODE_CMDID,
  1192. WMI_10_2_DBGLOG_CFG_CMDID,
  1193. WMI_10_2_PDEV_DFS_ENABLE_CMDID,
  1194. WMI_10_2_PDEV_DFS_DISABLE_CMDID,
  1195. WMI_10_2_PDEV_QVIT_CMDID,
  1196. WMI_10_2_ROAM_SCAN_MODE,
  1197. WMI_10_2_ROAM_SCAN_RSSI_THRESHOLD,
  1198. WMI_10_2_ROAM_SCAN_PERIOD,
  1199. WMI_10_2_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
  1200. WMI_10_2_ROAM_AP_PROFILE,
  1201. WMI_10_2_OFL_SCAN_ADD_AP_PROFILE,
  1202. WMI_10_2_OFL_SCAN_REMOVE_AP_PROFILE,
  1203. WMI_10_2_OFL_SCAN_PERIOD,
  1204. WMI_10_2_P2P_DEV_SET_DEVICE_INFO,
  1205. WMI_10_2_P2P_DEV_SET_DISCOVERABILITY,
  1206. WMI_10_2_P2P_GO_SET_BEACON_IE,
  1207. WMI_10_2_P2P_GO_SET_PROBE_RESP_IE,
  1208. WMI_10_2_AP_PS_PEER_PARAM_CMDID,
  1209. WMI_10_2_AP_PS_PEER_UAPSD_COEX_CMDID,
  1210. WMI_10_2_PEER_RATE_RETRY_SCHED_CMDID,
  1211. WMI_10_2_WLAN_PROFILE_TRIGGER_CMDID,
  1212. WMI_10_2_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
  1213. WMI_10_2_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
  1214. WMI_10_2_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
  1215. WMI_10_2_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
  1216. WMI_10_2_PDEV_SUSPEND_CMDID,
  1217. WMI_10_2_PDEV_RESUME_CMDID,
  1218. WMI_10_2_ADD_BCN_FILTER_CMDID,
  1219. WMI_10_2_RMV_BCN_FILTER_CMDID,
  1220. WMI_10_2_WOW_ADD_WAKE_PATTERN_CMDID,
  1221. WMI_10_2_WOW_DEL_WAKE_PATTERN_CMDID,
  1222. WMI_10_2_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
  1223. WMI_10_2_WOW_ENABLE_CMDID,
  1224. WMI_10_2_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
  1225. WMI_10_2_RTT_MEASREQ_CMDID,
  1226. WMI_10_2_RTT_TSF_CMDID,
  1227. WMI_10_2_RTT_KEEPALIVE_CMDID,
  1228. WMI_10_2_PDEV_SEND_BCN_CMDID,
  1229. WMI_10_2_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
  1230. WMI_10_2_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
  1231. WMI_10_2_REQUEST_STATS_CMDID,
  1232. WMI_10_2_GPIO_CONFIG_CMDID,
  1233. WMI_10_2_GPIO_OUTPUT_CMDID,
  1234. WMI_10_2_VDEV_RATEMASK_CMDID,
  1235. WMI_10_2_PDEV_SMART_ANT_ENABLE_CMDID,
  1236. WMI_10_2_PDEV_SMART_ANT_SET_RX_ANTENNA_CMDID,
  1237. WMI_10_2_PEER_SMART_ANT_SET_TX_ANTENNA_CMDID,
  1238. WMI_10_2_PEER_SMART_ANT_SET_TRAIN_INFO_CMDID,
  1239. WMI_10_2_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID,
  1240. WMI_10_2_FORCE_FW_HANG_CMDID,
  1241. WMI_10_2_PDEV_SET_ANTENNA_SWITCH_TABLE_CMDID,
  1242. WMI_10_2_PDEV_SET_CTL_TABLE_CMDID,
  1243. WMI_10_2_PDEV_SET_MIMOGAIN_TABLE_CMDID,
  1244. WMI_10_2_PDEV_RATEPWR_TABLE_CMDID,
  1245. WMI_10_2_PDEV_RATEPWR_CHAINMSK_TABLE_CMDID,
  1246. WMI_10_2_PDEV_GET_INFO,
  1247. WMI_10_2_VDEV_GET_INFO,
  1248. WMI_10_2_VDEV_ATF_REQUEST_CMDID,
  1249. WMI_10_2_PEER_ATF_REQUEST_CMDID,
  1250. WMI_10_2_PDEV_GET_TEMPERATURE_CMDID,
  1251. WMI_10_2_PDEV_UTF_CMDID = WMI_10_2_END_CMDID - 1,
  1252. };
  1253. enum wmi_10_2_event_id {
  1254. WMI_10_2_SERVICE_READY_EVENTID = 0x8000,
  1255. WMI_10_2_READY_EVENTID,
  1256. WMI_10_2_DEBUG_MESG_EVENTID,
  1257. WMI_10_2_START_EVENTID = 0x9000,
  1258. WMI_10_2_END_EVENTID = 0x9FFF,
  1259. WMI_10_2_SCAN_EVENTID = WMI_10_2_START_EVENTID,
  1260. WMI_10_2_ECHO_EVENTID,
  1261. WMI_10_2_UPDATE_STATS_EVENTID,
  1262. WMI_10_2_INST_RSSI_STATS_EVENTID,
  1263. WMI_10_2_VDEV_START_RESP_EVENTID,
  1264. WMI_10_2_VDEV_STANDBY_REQ_EVENTID,
  1265. WMI_10_2_VDEV_RESUME_REQ_EVENTID,
  1266. WMI_10_2_VDEV_STOPPED_EVENTID,
  1267. WMI_10_2_PEER_STA_KICKOUT_EVENTID,
  1268. WMI_10_2_HOST_SWBA_EVENTID,
  1269. WMI_10_2_TBTTOFFSET_UPDATE_EVENTID,
  1270. WMI_10_2_MGMT_RX_EVENTID,
  1271. WMI_10_2_CHAN_INFO_EVENTID,
  1272. WMI_10_2_PHYERR_EVENTID,
  1273. WMI_10_2_ROAM_EVENTID,
  1274. WMI_10_2_PROFILE_MATCH,
  1275. WMI_10_2_DEBUG_PRINT_EVENTID,
  1276. WMI_10_2_PDEV_QVIT_EVENTID,
  1277. WMI_10_2_WLAN_PROFILE_DATA_EVENTID,
  1278. WMI_10_2_RTT_MEASUREMENT_REPORT_EVENTID,
  1279. WMI_10_2_TSF_MEASUREMENT_REPORT_EVENTID,
  1280. WMI_10_2_RTT_ERROR_REPORT_EVENTID,
  1281. WMI_10_2_RTT_KEEPALIVE_EVENTID,
  1282. WMI_10_2_WOW_WAKEUP_HOST_EVENTID,
  1283. WMI_10_2_DCS_INTERFERENCE_EVENTID,
  1284. WMI_10_2_PDEV_TPC_CONFIG_EVENTID,
  1285. WMI_10_2_GPIO_INPUT_EVENTID,
  1286. WMI_10_2_PEER_RATECODE_LIST_EVENTID,
  1287. WMI_10_2_GENERIC_BUFFER_EVENTID,
  1288. WMI_10_2_MCAST_BUF_RELEASE_EVENTID,
  1289. WMI_10_2_MCAST_LIST_AGEOUT_EVENTID,
  1290. WMI_10_2_WDS_PEER_EVENTID,
  1291. WMI_10_2_PEER_STA_PS_STATECHG_EVENTID,
  1292. WMI_10_2_PDEV_TEMPERATURE_EVENTID,
  1293. WMI_10_2_PDEV_UTF_EVENTID = WMI_10_2_END_EVENTID - 1,
  1294. };
  1295. enum wmi_10_4_cmd_id {
  1296. WMI_10_4_START_CMDID = 0x9000,
  1297. WMI_10_4_END_CMDID = 0x9FFF,
  1298. WMI_10_4_INIT_CMDID,
  1299. WMI_10_4_START_SCAN_CMDID = WMI_10_4_START_CMDID,
  1300. WMI_10_4_STOP_SCAN_CMDID,
  1301. WMI_10_4_SCAN_CHAN_LIST_CMDID,
  1302. WMI_10_4_SCAN_SCH_PRIO_TBL_CMDID,
  1303. WMI_10_4_SCAN_UPDATE_REQUEST_CMDID,
  1304. WMI_10_4_ECHO_CMDID,
  1305. WMI_10_4_PDEV_SET_REGDOMAIN_CMDID,
  1306. WMI_10_4_PDEV_SET_CHANNEL_CMDID,
  1307. WMI_10_4_PDEV_SET_PARAM_CMDID,
  1308. WMI_10_4_PDEV_PKTLOG_ENABLE_CMDID,
  1309. WMI_10_4_PDEV_PKTLOG_DISABLE_CMDID,
  1310. WMI_10_4_PDEV_SET_WMM_PARAMS_CMDID,
  1311. WMI_10_4_PDEV_SET_HT_CAP_IE_CMDID,
  1312. WMI_10_4_PDEV_SET_VHT_CAP_IE_CMDID,
  1313. WMI_10_4_PDEV_SET_BASE_MACADDR_CMDID,
  1314. WMI_10_4_PDEV_SET_DSCP_TID_MAP_CMDID,
  1315. WMI_10_4_PDEV_SET_QUIET_MODE_CMDID,
  1316. WMI_10_4_PDEV_GREEN_AP_PS_ENABLE_CMDID,
  1317. WMI_10_4_PDEV_GET_TPC_CONFIG_CMDID,
  1318. WMI_10_4_VDEV_CREATE_CMDID,
  1319. WMI_10_4_VDEV_DELETE_CMDID,
  1320. WMI_10_4_VDEV_START_REQUEST_CMDID,
  1321. WMI_10_4_VDEV_RESTART_REQUEST_CMDID,
  1322. WMI_10_4_VDEV_UP_CMDID,
  1323. WMI_10_4_VDEV_STOP_CMDID,
  1324. WMI_10_4_VDEV_DOWN_CMDID,
  1325. WMI_10_4_VDEV_STANDBY_RESPONSE_CMDID,
  1326. WMI_10_4_VDEV_RESUME_RESPONSE_CMDID,
  1327. WMI_10_4_VDEV_SET_PARAM_CMDID,
  1328. WMI_10_4_VDEV_INSTALL_KEY_CMDID,
  1329. WMI_10_4_WLAN_PEER_CACHING_ADD_PEER_CMDID,
  1330. WMI_10_4_WLAN_PEER_CACHING_EVICT_PEER_CMDID,
  1331. WMI_10_4_WLAN_PEER_CACHING_RESTORE_PEER_CMDID,
  1332. WMI_10_4_WLAN_PEER_CACHING_PRINT_ALL_PEERS_INFO_CMDID,
  1333. WMI_10_4_PEER_CREATE_CMDID,
  1334. WMI_10_4_PEER_DELETE_CMDID,
  1335. WMI_10_4_PEER_FLUSH_TIDS_CMDID,
  1336. WMI_10_4_PEER_SET_PARAM_CMDID,
  1337. WMI_10_4_PEER_ASSOC_CMDID,
  1338. WMI_10_4_PEER_ADD_WDS_ENTRY_CMDID,
  1339. WMI_10_4_PEER_UPDATE_WDS_ENTRY_CMDID,
  1340. WMI_10_4_PEER_REMOVE_WDS_ENTRY_CMDID,
  1341. WMI_10_4_PEER_ADD_PROXY_STA_ENTRY_CMDID,
  1342. WMI_10_4_PEER_MCAST_GROUP_CMDID,
  1343. WMI_10_4_BCN_TX_CMDID,
  1344. WMI_10_4_PDEV_SEND_BCN_CMDID,
  1345. WMI_10_4_BCN_PRB_TMPL_CMDID,
  1346. WMI_10_4_BCN_FILTER_RX_CMDID,
  1347. WMI_10_4_PRB_REQ_FILTER_RX_CMDID,
  1348. WMI_10_4_MGMT_TX_CMDID,
  1349. WMI_10_4_PRB_TMPL_CMDID,
  1350. WMI_10_4_ADDBA_CLEAR_RESP_CMDID,
  1351. WMI_10_4_ADDBA_SEND_CMDID,
  1352. WMI_10_4_ADDBA_STATUS_CMDID,
  1353. WMI_10_4_DELBA_SEND_CMDID,
  1354. WMI_10_4_ADDBA_SET_RESP_CMDID,
  1355. WMI_10_4_SEND_SINGLEAMSDU_CMDID,
  1356. WMI_10_4_STA_POWERSAVE_MODE_CMDID,
  1357. WMI_10_4_STA_POWERSAVE_PARAM_CMDID,
  1358. WMI_10_4_STA_MIMO_PS_MODE_CMDID,
  1359. WMI_10_4_DBGLOG_CFG_CMDID,
  1360. WMI_10_4_PDEV_DFS_ENABLE_CMDID,
  1361. WMI_10_4_PDEV_DFS_DISABLE_CMDID,
  1362. WMI_10_4_PDEV_QVIT_CMDID,
  1363. WMI_10_4_ROAM_SCAN_MODE,
  1364. WMI_10_4_ROAM_SCAN_RSSI_THRESHOLD,
  1365. WMI_10_4_ROAM_SCAN_PERIOD,
  1366. WMI_10_4_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
  1367. WMI_10_4_ROAM_AP_PROFILE,
  1368. WMI_10_4_OFL_SCAN_ADD_AP_PROFILE,
  1369. WMI_10_4_OFL_SCAN_REMOVE_AP_PROFILE,
  1370. WMI_10_4_OFL_SCAN_PERIOD,
  1371. WMI_10_4_P2P_DEV_SET_DEVICE_INFO,
  1372. WMI_10_4_P2P_DEV_SET_DISCOVERABILITY,
  1373. WMI_10_4_P2P_GO_SET_BEACON_IE,
  1374. WMI_10_4_P2P_GO_SET_PROBE_RESP_IE,
  1375. WMI_10_4_P2P_SET_VENDOR_IE_DATA_CMDID,
  1376. WMI_10_4_AP_PS_PEER_PARAM_CMDID,
  1377. WMI_10_4_AP_PS_PEER_UAPSD_COEX_CMDID,
  1378. WMI_10_4_PEER_RATE_RETRY_SCHED_CMDID,
  1379. WMI_10_4_WLAN_PROFILE_TRIGGER_CMDID,
  1380. WMI_10_4_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
  1381. WMI_10_4_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
  1382. WMI_10_4_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
  1383. WMI_10_4_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
  1384. WMI_10_4_PDEV_SUSPEND_CMDID,
  1385. WMI_10_4_PDEV_RESUME_CMDID,
  1386. WMI_10_4_ADD_BCN_FILTER_CMDID,
  1387. WMI_10_4_RMV_BCN_FILTER_CMDID,
  1388. WMI_10_4_WOW_ADD_WAKE_PATTERN_CMDID,
  1389. WMI_10_4_WOW_DEL_WAKE_PATTERN_CMDID,
  1390. WMI_10_4_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
  1391. WMI_10_4_WOW_ENABLE_CMDID,
  1392. WMI_10_4_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
  1393. WMI_10_4_RTT_MEASREQ_CMDID,
  1394. WMI_10_4_RTT_TSF_CMDID,
  1395. WMI_10_4_RTT_KEEPALIVE_CMDID,
  1396. WMI_10_4_OEM_REQ_CMDID,
  1397. WMI_10_4_NAN_CMDID,
  1398. WMI_10_4_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
  1399. WMI_10_4_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
  1400. WMI_10_4_REQUEST_STATS_CMDID,
  1401. WMI_10_4_GPIO_CONFIG_CMDID,
  1402. WMI_10_4_GPIO_OUTPUT_CMDID,
  1403. WMI_10_4_VDEV_RATEMASK_CMDID,
  1404. WMI_10_4_CSA_OFFLOAD_ENABLE_CMDID,
  1405. WMI_10_4_GTK_OFFLOAD_CMDID,
  1406. WMI_10_4_QBOOST_CFG_CMDID,
  1407. WMI_10_4_CSA_OFFLOAD_CHANSWITCH_CMDID,
  1408. WMI_10_4_PDEV_SMART_ANT_ENABLE_CMDID,
  1409. WMI_10_4_PDEV_SMART_ANT_SET_RX_ANTENNA_CMDID,
  1410. WMI_10_4_PEER_SMART_ANT_SET_TX_ANTENNA_CMDID,
  1411. WMI_10_4_PEER_SMART_ANT_SET_TRAIN_INFO_CMDID,
  1412. WMI_10_4_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID,
  1413. WMI_10_4_VDEV_SET_KEEPALIVE_CMDID,
  1414. WMI_10_4_VDEV_GET_KEEPALIVE_CMDID,
  1415. WMI_10_4_FORCE_FW_HANG_CMDID,
  1416. WMI_10_4_PDEV_SET_ANTENNA_SWITCH_TABLE_CMDID,
  1417. WMI_10_4_PDEV_SET_CTL_TABLE_CMDID,
  1418. WMI_10_4_PDEV_SET_MIMOGAIN_TABLE_CMDID,
  1419. WMI_10_4_PDEV_RATEPWR_TABLE_CMDID,
  1420. WMI_10_4_PDEV_RATEPWR_CHAINMSK_TABLE_CMDID,
  1421. WMI_10_4_PDEV_FIPS_CMDID,
  1422. WMI_10_4_TT_SET_CONF_CMDID,
  1423. WMI_10_4_FWTEST_CMDID,
  1424. WMI_10_4_VDEV_ATF_REQUEST_CMDID,
  1425. WMI_10_4_PEER_ATF_REQUEST_CMDID,
  1426. WMI_10_4_PDEV_GET_ANI_CCK_CONFIG_CMDID,
  1427. WMI_10_4_PDEV_GET_ANI_OFDM_CONFIG_CMDID,
  1428. WMI_10_4_PDEV_RESERVE_AST_ENTRY_CMDID,
  1429. WMI_10_4_PDEV_GET_NFCAL_POWER_CMDID,
  1430. WMI_10_4_PDEV_GET_TPC_CMDID,
  1431. WMI_10_4_PDEV_GET_AST_INFO_CMDID,
  1432. WMI_10_4_VDEV_SET_DSCP_TID_MAP_CMDID,
  1433. WMI_10_4_PDEV_GET_TEMPERATURE_CMDID,
  1434. WMI_10_4_PDEV_GET_INFO_CMDID,
  1435. WMI_10_4_VDEV_GET_INFO_CMDID,
  1436. WMI_10_4_VDEV_FILTER_NEIGHBOR_RX_PACKETS_CMDID,
  1437. WMI_10_4_MU_CAL_START_CMDID,
  1438. WMI_10_4_SET_CCA_PARAMS_CMDID,
  1439. WMI_10_4_PDEV_BSS_CHAN_INFO_REQUEST_CMDID,
  1440. WMI_10_4_PDEV_UTF_CMDID = WMI_10_4_END_CMDID - 1,
  1441. };
  1442. enum wmi_10_4_event_id {
  1443. WMI_10_4_SERVICE_READY_EVENTID = 0x8000,
  1444. WMI_10_4_READY_EVENTID,
  1445. WMI_10_4_DEBUG_MESG_EVENTID,
  1446. WMI_10_4_START_EVENTID = 0x9000,
  1447. WMI_10_4_END_EVENTID = 0x9FFF,
  1448. WMI_10_4_SCAN_EVENTID = WMI_10_4_START_EVENTID,
  1449. WMI_10_4_ECHO_EVENTID,
  1450. WMI_10_4_UPDATE_STATS_EVENTID,
  1451. WMI_10_4_INST_RSSI_STATS_EVENTID,
  1452. WMI_10_4_VDEV_START_RESP_EVENTID,
  1453. WMI_10_4_VDEV_STANDBY_REQ_EVENTID,
  1454. WMI_10_4_VDEV_RESUME_REQ_EVENTID,
  1455. WMI_10_4_VDEV_STOPPED_EVENTID,
  1456. WMI_10_4_PEER_STA_KICKOUT_EVENTID,
  1457. WMI_10_4_HOST_SWBA_EVENTID,
  1458. WMI_10_4_TBTTOFFSET_UPDATE_EVENTID,
  1459. WMI_10_4_MGMT_RX_EVENTID,
  1460. WMI_10_4_CHAN_INFO_EVENTID,
  1461. WMI_10_4_PHYERR_EVENTID,
  1462. WMI_10_4_ROAM_EVENTID,
  1463. WMI_10_4_PROFILE_MATCH,
  1464. WMI_10_4_DEBUG_PRINT_EVENTID,
  1465. WMI_10_4_PDEV_QVIT_EVENTID,
  1466. WMI_10_4_WLAN_PROFILE_DATA_EVENTID,
  1467. WMI_10_4_RTT_MEASUREMENT_REPORT_EVENTID,
  1468. WMI_10_4_TSF_MEASUREMENT_REPORT_EVENTID,
  1469. WMI_10_4_RTT_ERROR_REPORT_EVENTID,
  1470. WMI_10_4_RTT_KEEPALIVE_EVENTID,
  1471. WMI_10_4_OEM_CAPABILITY_EVENTID,
  1472. WMI_10_4_OEM_MEASUREMENT_REPORT_EVENTID,
  1473. WMI_10_4_OEM_ERROR_REPORT_EVENTID,
  1474. WMI_10_4_NAN_EVENTID,
  1475. WMI_10_4_WOW_WAKEUP_HOST_EVENTID,
  1476. WMI_10_4_GTK_OFFLOAD_STATUS_EVENTID,
  1477. WMI_10_4_GTK_REKEY_FAIL_EVENTID,
  1478. WMI_10_4_DCS_INTERFERENCE_EVENTID,
  1479. WMI_10_4_PDEV_TPC_CONFIG_EVENTID,
  1480. WMI_10_4_CSA_HANDLING_EVENTID,
  1481. WMI_10_4_GPIO_INPUT_EVENTID,
  1482. WMI_10_4_PEER_RATECODE_LIST_EVENTID,
  1483. WMI_10_4_GENERIC_BUFFER_EVENTID,
  1484. WMI_10_4_MCAST_BUF_RELEASE_EVENTID,
  1485. WMI_10_4_MCAST_LIST_AGEOUT_EVENTID,
  1486. WMI_10_4_VDEV_GET_KEEPALIVE_EVENTID,
  1487. WMI_10_4_WDS_PEER_EVENTID,
  1488. WMI_10_4_PEER_STA_PS_STATECHG_EVENTID,
  1489. WMI_10_4_PDEV_FIPS_EVENTID,
  1490. WMI_10_4_TT_STATS_EVENTID,
  1491. WMI_10_4_PDEV_CHANNEL_HOPPING_EVENTID,
  1492. WMI_10_4_PDEV_ANI_CCK_LEVEL_EVENTID,
  1493. WMI_10_4_PDEV_ANI_OFDM_LEVEL_EVENTID,
  1494. WMI_10_4_PDEV_RESERVE_AST_ENTRY_EVENTID,
  1495. WMI_10_4_PDEV_NFCAL_POWER_EVENTID,
  1496. WMI_10_4_PDEV_TPC_EVENTID,
  1497. WMI_10_4_PDEV_GET_AST_INFO_EVENTID,
  1498. WMI_10_4_PDEV_TEMPERATURE_EVENTID,
  1499. WMI_10_4_PDEV_NFCAL_POWER_ALL_CHANNELS_EVENTID,
  1500. WMI_10_4_PDEV_BSS_CHAN_INFO_EVENTID,
  1501. WMI_10_4_PDEV_UTF_EVENTID = WMI_10_4_END_EVENTID - 1,
  1502. };
  1503. enum wmi_phy_mode {
  1504. MODE_11A = 0, /* 11a Mode */
  1505. MODE_11G = 1, /* 11b/g Mode */
  1506. MODE_11B = 2, /* 11b Mode */
  1507. MODE_11GONLY = 3, /* 11g only Mode */
  1508. MODE_11NA_HT20 = 4, /* 11a HT20 mode */
  1509. MODE_11NG_HT20 = 5, /* 11g HT20 mode */
  1510. MODE_11NA_HT40 = 6, /* 11a HT40 mode */
  1511. MODE_11NG_HT40 = 7, /* 11g HT40 mode */
  1512. MODE_11AC_VHT20 = 8,
  1513. MODE_11AC_VHT40 = 9,
  1514. MODE_11AC_VHT80 = 10,
  1515. /* MODE_11AC_VHT160 = 11, */
  1516. MODE_11AC_VHT20_2G = 11,
  1517. MODE_11AC_VHT40_2G = 12,
  1518. MODE_11AC_VHT80_2G = 13,
  1519. MODE_UNKNOWN = 14,
  1520. MODE_MAX = 14
  1521. };
  1522. static inline const char *ath10k_wmi_phymode_str(enum wmi_phy_mode mode)
  1523. {
  1524. switch (mode) {
  1525. case MODE_11A:
  1526. return "11a";
  1527. case MODE_11G:
  1528. return "11g";
  1529. case MODE_11B:
  1530. return "11b";
  1531. case MODE_11GONLY:
  1532. return "11gonly";
  1533. case MODE_11NA_HT20:
  1534. return "11na-ht20";
  1535. case MODE_11NG_HT20:
  1536. return "11ng-ht20";
  1537. case MODE_11NA_HT40:
  1538. return "11na-ht40";
  1539. case MODE_11NG_HT40:
  1540. return "11ng-ht40";
  1541. case MODE_11AC_VHT20:
  1542. return "11ac-vht20";
  1543. case MODE_11AC_VHT40:
  1544. return "11ac-vht40";
  1545. case MODE_11AC_VHT80:
  1546. return "11ac-vht80";
  1547. case MODE_11AC_VHT20_2G:
  1548. return "11ac-vht20-2g";
  1549. case MODE_11AC_VHT40_2G:
  1550. return "11ac-vht40-2g";
  1551. case MODE_11AC_VHT80_2G:
  1552. return "11ac-vht80-2g";
  1553. case MODE_UNKNOWN:
  1554. /* skip */
  1555. break;
  1556. /* no default handler to allow compiler to check that the
  1557. * enum is fully handled */
  1558. };
  1559. return "<unknown>";
  1560. }
  1561. #define WMI_CHAN_LIST_TAG 0x1
  1562. #define WMI_SSID_LIST_TAG 0x2
  1563. #define WMI_BSSID_LIST_TAG 0x3
  1564. #define WMI_IE_TAG 0x4
  1565. struct wmi_channel {
  1566. __le32 mhz;
  1567. __le32 band_center_freq1;
  1568. __le32 band_center_freq2; /* valid for 11ac, 80plus80 */
  1569. union {
  1570. __le32 flags; /* WMI_CHAN_FLAG_ */
  1571. struct {
  1572. u8 mode; /* only 6 LSBs */
  1573. } __packed;
  1574. } __packed;
  1575. union {
  1576. __le32 reginfo0;
  1577. struct {
  1578. /* note: power unit is 0.5 dBm */
  1579. u8 min_power;
  1580. u8 max_power;
  1581. u8 reg_power;
  1582. u8 reg_classid;
  1583. } __packed;
  1584. } __packed;
  1585. union {
  1586. __le32 reginfo1;
  1587. struct {
  1588. u8 antenna_max;
  1589. } __packed;
  1590. } __packed;
  1591. } __packed;
  1592. struct wmi_channel_arg {
  1593. u32 freq;
  1594. u32 band_center_freq1;
  1595. bool passive;
  1596. bool allow_ibss;
  1597. bool allow_ht;
  1598. bool allow_vht;
  1599. bool ht40plus;
  1600. bool chan_radar;
  1601. /* note: power unit is 0.5 dBm */
  1602. u32 min_power;
  1603. u32 max_power;
  1604. u32 max_reg_power;
  1605. u32 max_antenna_gain;
  1606. u32 reg_class_id;
  1607. enum wmi_phy_mode mode;
  1608. };
  1609. enum wmi_channel_change_cause {
  1610. WMI_CHANNEL_CHANGE_CAUSE_NONE = 0,
  1611. WMI_CHANNEL_CHANGE_CAUSE_CSA,
  1612. };
  1613. #define WMI_CHAN_FLAG_HT40_PLUS (1 << 6)
  1614. #define WMI_CHAN_FLAG_PASSIVE (1 << 7)
  1615. #define WMI_CHAN_FLAG_ADHOC_ALLOWED (1 << 8)
  1616. #define WMI_CHAN_FLAG_AP_DISABLED (1 << 9)
  1617. #define WMI_CHAN_FLAG_DFS (1 << 10)
  1618. #define WMI_CHAN_FLAG_ALLOW_HT (1 << 11)
  1619. #define WMI_CHAN_FLAG_ALLOW_VHT (1 << 12)
  1620. /* Indicate reason for channel switch */
  1621. #define WMI_CHANNEL_CHANGE_CAUSE_CSA (1 << 13)
  1622. #define WMI_MAX_SPATIAL_STREAM 3 /* default max ss */
  1623. #define WMI_10_4_MAX_SPATIAL_STREAM 4
  1624. /* HT Capabilities*/
  1625. #define WMI_HT_CAP_ENABLED 0x0001 /* HT Enabled/ disabled */
  1626. #define WMI_HT_CAP_HT20_SGI 0x0002 /* Short Guard Interval with HT20 */
  1627. #define WMI_HT_CAP_DYNAMIC_SMPS 0x0004 /* Dynamic MIMO powersave */
  1628. #define WMI_HT_CAP_TX_STBC 0x0008 /* B3 TX STBC */
  1629. #define WMI_HT_CAP_TX_STBC_MASK_SHIFT 3
  1630. #define WMI_HT_CAP_RX_STBC 0x0030 /* B4-B5 RX STBC */
  1631. #define WMI_HT_CAP_RX_STBC_MASK_SHIFT 4
  1632. #define WMI_HT_CAP_LDPC 0x0040 /* LDPC supported */
  1633. #define WMI_HT_CAP_L_SIG_TXOP_PROT 0x0080 /* L-SIG TXOP Protection */
  1634. #define WMI_HT_CAP_MPDU_DENSITY 0x0700 /* MPDU Density */
  1635. #define WMI_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8
  1636. #define WMI_HT_CAP_HT40_SGI 0x0800
  1637. #define WMI_HT_CAP_DEFAULT_ALL (WMI_HT_CAP_ENABLED | \
  1638. WMI_HT_CAP_HT20_SGI | \
  1639. WMI_HT_CAP_HT40_SGI | \
  1640. WMI_HT_CAP_TX_STBC | \
  1641. WMI_HT_CAP_RX_STBC | \
  1642. WMI_HT_CAP_LDPC)
  1643. /*
  1644. * WMI_VHT_CAP_* these maps to ieee 802.11ac vht capability information
  1645. * field. The fields not defined here are not supported, or reserved.
  1646. * Do not change these masks and if you have to add new one follow the
  1647. * bitmask as specified by 802.11ac draft.
  1648. */
  1649. #define WMI_VHT_CAP_MAX_MPDU_LEN_MASK 0x00000003
  1650. #define WMI_VHT_CAP_RX_LDPC 0x00000010
  1651. #define WMI_VHT_CAP_SGI_80MHZ 0x00000020
  1652. #define WMI_VHT_CAP_TX_STBC 0x00000080
  1653. #define WMI_VHT_CAP_RX_STBC_MASK 0x00000300
  1654. #define WMI_VHT_CAP_RX_STBC_MASK_SHIFT 8
  1655. #define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP 0x03800000
  1656. #define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP_SHIFT 23
  1657. #define WMI_VHT_CAP_RX_FIXED_ANT 0x10000000
  1658. #define WMI_VHT_CAP_TX_FIXED_ANT 0x20000000
  1659. /* The following also refer for max HT AMSDU */
  1660. #define WMI_VHT_CAP_MAX_MPDU_LEN_3839 0x00000000
  1661. #define WMI_VHT_CAP_MAX_MPDU_LEN_7935 0x00000001
  1662. #define WMI_VHT_CAP_MAX_MPDU_LEN_11454 0x00000002
  1663. #define WMI_VHT_CAP_DEFAULT_ALL (WMI_VHT_CAP_MAX_MPDU_LEN_11454 | \
  1664. WMI_VHT_CAP_RX_LDPC | \
  1665. WMI_VHT_CAP_SGI_80MHZ | \
  1666. WMI_VHT_CAP_TX_STBC | \
  1667. WMI_VHT_CAP_RX_STBC_MASK | \
  1668. WMI_VHT_CAP_MAX_AMPDU_LEN_EXP | \
  1669. WMI_VHT_CAP_RX_FIXED_ANT | \
  1670. WMI_VHT_CAP_TX_FIXED_ANT)
  1671. /*
  1672. * Interested readers refer to Rx/Tx MCS Map definition as defined in
  1673. * 802.11ac
  1674. */
  1675. #define WMI_VHT_MAX_MCS_4_SS_MASK(r, ss) ((3 & (r)) << (((ss) - 1) << 1))
  1676. #define WMI_VHT_MAX_SUPP_RATE_MASK 0x1fff0000
  1677. #define WMI_VHT_MAX_SUPP_RATE_MASK_SHIFT 16
  1678. enum {
  1679. REGDMN_MODE_11A = 0x00001, /* 11a channels */
  1680. REGDMN_MODE_TURBO = 0x00002, /* 11a turbo-only channels */
  1681. REGDMN_MODE_11B = 0x00004, /* 11b channels */
  1682. REGDMN_MODE_PUREG = 0x00008, /* 11g channels (OFDM only) */
  1683. REGDMN_MODE_11G = 0x00008, /* XXX historical */
  1684. REGDMN_MODE_108G = 0x00020, /* 11a+Turbo channels */
  1685. REGDMN_MODE_108A = 0x00040, /* 11g+Turbo channels */
  1686. REGDMN_MODE_XR = 0x00100, /* XR channels */
  1687. REGDMN_MODE_11A_HALF_RATE = 0x00200, /* 11A half rate channels */
  1688. REGDMN_MODE_11A_QUARTER_RATE = 0x00400, /* 11A quarter rate channels */
  1689. REGDMN_MODE_11NG_HT20 = 0x00800, /* 11N-G HT20 channels */
  1690. REGDMN_MODE_11NA_HT20 = 0x01000, /* 11N-A HT20 channels */
  1691. REGDMN_MODE_11NG_HT40PLUS = 0x02000, /* 11N-G HT40 + channels */
  1692. REGDMN_MODE_11NG_HT40MINUS = 0x04000, /* 11N-G HT40 - channels */
  1693. REGDMN_MODE_11NA_HT40PLUS = 0x08000, /* 11N-A HT40 + channels */
  1694. REGDMN_MODE_11NA_HT40MINUS = 0x10000, /* 11N-A HT40 - channels */
  1695. REGDMN_MODE_11AC_VHT20 = 0x20000, /* 5Ghz, VHT20 */
  1696. REGDMN_MODE_11AC_VHT40PLUS = 0x40000, /* 5Ghz, VHT40 + channels */
  1697. REGDMN_MODE_11AC_VHT40MINUS = 0x80000, /* 5Ghz VHT40 - channels */
  1698. REGDMN_MODE_11AC_VHT80 = 0x100000, /* 5Ghz, VHT80 channels */
  1699. REGDMN_MODE_ALL = 0xffffffff
  1700. };
  1701. #define REGDMN_CAP1_CHAN_HALF_RATE 0x00000001
  1702. #define REGDMN_CAP1_CHAN_QUARTER_RATE 0x00000002
  1703. #define REGDMN_CAP1_CHAN_HAL49GHZ 0x00000004
  1704. /* regulatory capabilities */
  1705. #define REGDMN_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040
  1706. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080
  1707. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U2 0x0100
  1708. #define REGDMN_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200
  1709. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400
  1710. #define REGDMN_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800
  1711. struct hal_reg_capabilities {
  1712. /* regdomain value specified in EEPROM */
  1713. __le32 eeprom_rd;
  1714. /*regdomain */
  1715. __le32 eeprom_rd_ext;
  1716. /* CAP1 capabilities bit map. */
  1717. __le32 regcap1;
  1718. /* REGDMN EEPROM CAP. */
  1719. __le32 regcap2;
  1720. /* REGDMN MODE */
  1721. __le32 wireless_modes;
  1722. __le32 low_2ghz_chan;
  1723. __le32 high_2ghz_chan;
  1724. __le32 low_5ghz_chan;
  1725. __le32 high_5ghz_chan;
  1726. } __packed;
  1727. enum wlan_mode_capability {
  1728. WHAL_WLAN_11A_CAPABILITY = 0x1,
  1729. WHAL_WLAN_11G_CAPABILITY = 0x2,
  1730. WHAL_WLAN_11AG_CAPABILITY = 0x3,
  1731. };
  1732. /* structure used by FW for requesting host memory */
  1733. struct wlan_host_mem_req {
  1734. /* ID of the request */
  1735. __le32 req_id;
  1736. /* size of the of each unit */
  1737. __le32 unit_size;
  1738. /* flags to indicate that
  1739. * the number units is dependent
  1740. * on number of resources(num vdevs num peers .. etc)
  1741. */
  1742. __le32 num_unit_info;
  1743. /*
  1744. * actual number of units to allocate . if flags in the num_unit_info
  1745. * indicate that number of units is tied to number of a particular
  1746. * resource to allocate then num_units filed is set to 0 and host
  1747. * will derive the number units from number of the resources it is
  1748. * requesting.
  1749. */
  1750. __le32 num_units;
  1751. } __packed;
  1752. /*
  1753. * The following struct holds optional payload for
  1754. * wmi_service_ready_event,e.g., 11ac pass some of the
  1755. * device capability to the host.
  1756. */
  1757. struct wmi_service_ready_event {
  1758. __le32 sw_version;
  1759. __le32 sw_version_1;
  1760. __le32 abi_version;
  1761. /* WMI_PHY_CAPABILITY */
  1762. __le32 phy_capability;
  1763. /* Maximum number of frag table entries that SW will populate less 1 */
  1764. __le32 max_frag_entry;
  1765. __le32 wmi_service_bitmap[16];
  1766. __le32 num_rf_chains;
  1767. /*
  1768. * The following field is only valid for service type
  1769. * WMI_SERVICE_11AC
  1770. */
  1771. __le32 ht_cap_info; /* WMI HT Capability */
  1772. __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
  1773. __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
  1774. __le32 hw_min_tx_power;
  1775. __le32 hw_max_tx_power;
  1776. struct hal_reg_capabilities hal_reg_capabilities;
  1777. __le32 sys_cap_info;
  1778. __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
  1779. /*
  1780. * Max beacon and Probe Response IE offload size
  1781. * (includes optional P2P IEs)
  1782. */
  1783. __le32 max_bcn_ie_size;
  1784. /*
  1785. * request to host to allocate a chuck of memory and pss it down to FW
  1786. * via WM_INIT. FW uses this as FW extesnsion memory for saving its
  1787. * data structures. Only valid for low latency interfaces like PCIE
  1788. * where FW can access this memory directly (or) by DMA.
  1789. */
  1790. __le32 num_mem_reqs;
  1791. struct wlan_host_mem_req mem_reqs[0];
  1792. } __packed;
  1793. /* This is the definition from 10.X firmware branch */
  1794. struct wmi_10x_service_ready_event {
  1795. __le32 sw_version;
  1796. __le32 abi_version;
  1797. /* WMI_PHY_CAPABILITY */
  1798. __le32 phy_capability;
  1799. /* Maximum number of frag table entries that SW will populate less 1 */
  1800. __le32 max_frag_entry;
  1801. __le32 wmi_service_bitmap[16];
  1802. __le32 num_rf_chains;
  1803. /*
  1804. * The following field is only valid for service type
  1805. * WMI_SERVICE_11AC
  1806. */
  1807. __le32 ht_cap_info; /* WMI HT Capability */
  1808. __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
  1809. __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
  1810. __le32 hw_min_tx_power;
  1811. __le32 hw_max_tx_power;
  1812. struct hal_reg_capabilities hal_reg_capabilities;
  1813. __le32 sys_cap_info;
  1814. __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
  1815. /*
  1816. * request to host to allocate a chuck of memory and pss it down to FW
  1817. * via WM_INIT. FW uses this as FW extesnsion memory for saving its
  1818. * data structures. Only valid for low latency interfaces like PCIE
  1819. * where FW can access this memory directly (or) by DMA.
  1820. */
  1821. __le32 num_mem_reqs;
  1822. struct wlan_host_mem_req mem_reqs[0];
  1823. } __packed;
  1824. #define WMI_SERVICE_READY_TIMEOUT_HZ (5*HZ)
  1825. #define WMI_UNIFIED_READY_TIMEOUT_HZ (5*HZ)
  1826. struct wmi_ready_event {
  1827. __le32 sw_version;
  1828. __le32 abi_version;
  1829. struct wmi_mac_addr mac_addr;
  1830. __le32 status;
  1831. } __packed;
  1832. struct wmi_resource_config {
  1833. /* number of virtual devices (VAPs) to support */
  1834. __le32 num_vdevs;
  1835. /* number of peer nodes to support */
  1836. __le32 num_peers;
  1837. /*
  1838. * In offload mode target supports features like WOW, chatter and
  1839. * other protocol offloads. In order to support them some
  1840. * functionalities like reorder buffering, PN checking need to be
  1841. * done in target. This determines maximum number of peers suported
  1842. * by target in offload mode
  1843. */
  1844. __le32 num_offload_peers;
  1845. /* For target-based RX reordering */
  1846. __le32 num_offload_reorder_bufs;
  1847. /* number of keys per peer */
  1848. __le32 num_peer_keys;
  1849. /* total number of TX/RX data TIDs */
  1850. __le32 num_tids;
  1851. /*
  1852. * max skid for resolving hash collisions
  1853. *
  1854. * The address search table is sparse, so that if two MAC addresses
  1855. * result in the same hash value, the second of these conflicting
  1856. * entries can slide to the next index in the address search table,
  1857. * and use it, if it is unoccupied. This ast_skid_limit parameter
  1858. * specifies the upper bound on how many subsequent indices to search
  1859. * over to find an unoccupied space.
  1860. */
  1861. __le32 ast_skid_limit;
  1862. /*
  1863. * the nominal chain mask for transmit
  1864. *
  1865. * The chain mask may be modified dynamically, e.g. to operate AP
  1866. * tx with a reduced number of chains if no clients are associated.
  1867. * This configuration parameter specifies the nominal chain-mask that
  1868. * should be used when not operating with a reduced set of tx chains.
  1869. */
  1870. __le32 tx_chain_mask;
  1871. /*
  1872. * the nominal chain mask for receive
  1873. *
  1874. * The chain mask may be modified dynamically, e.g. for a client
  1875. * to use a reduced number of chains for receive if the traffic to
  1876. * the client is low enough that it doesn't require downlink MIMO
  1877. * or antenna diversity.
  1878. * This configuration parameter specifies the nominal chain-mask that
  1879. * should be used when not operating with a reduced set of rx chains.
  1880. */
  1881. __le32 rx_chain_mask;
  1882. /*
  1883. * what rx reorder timeout (ms) to use for the AC
  1884. *
  1885. * Each WMM access class (voice, video, best-effort, background) will
  1886. * have its own timeout value to dictate how long to wait for missing
  1887. * rx MPDUs to arrive before flushing subsequent MPDUs that have
  1888. * already been received.
  1889. * This parameter specifies the timeout in milliseconds for each
  1890. * class.
  1891. */
  1892. __le32 rx_timeout_pri_vi;
  1893. __le32 rx_timeout_pri_vo;
  1894. __le32 rx_timeout_pri_be;
  1895. __le32 rx_timeout_pri_bk;
  1896. /*
  1897. * what mode the rx should decap packets to
  1898. *
  1899. * MAC can decap to RAW (no decap), native wifi or Ethernet types
  1900. * THis setting also determines the default TX behavior, however TX
  1901. * behavior can be modified on a per VAP basis during VAP init
  1902. */
  1903. __le32 rx_decap_mode;
  1904. /* what is the maximum number of scan requests that can be queued */
  1905. __le32 scan_max_pending_reqs;
  1906. /* maximum VDEV that could use BMISS offload */
  1907. __le32 bmiss_offload_max_vdev;
  1908. /* maximum VDEV that could use offload roaming */
  1909. __le32 roam_offload_max_vdev;
  1910. /* maximum AP profiles that would push to offload roaming */
  1911. __le32 roam_offload_max_ap_profiles;
  1912. /*
  1913. * how many groups to use for mcast->ucast conversion
  1914. *
  1915. * The target's WAL maintains a table to hold information regarding
  1916. * which peers belong to a given multicast group, so that if
  1917. * multicast->unicast conversion is enabled, the target can convert
  1918. * multicast tx frames to a series of unicast tx frames, to each
  1919. * peer within the multicast group.
  1920. This num_mcast_groups configuration parameter tells the target how
  1921. * many multicast groups to provide storage for within its multicast
  1922. * group membership table.
  1923. */
  1924. __le32 num_mcast_groups;
  1925. /*
  1926. * size to alloc for the mcast membership table
  1927. *
  1928. * This num_mcast_table_elems configuration parameter tells the
  1929. * target how many peer elements it needs to provide storage for in
  1930. * its multicast group membership table.
  1931. * These multicast group membership table elements are shared by the
  1932. * multicast groups stored within the table.
  1933. */
  1934. __le32 num_mcast_table_elems;
  1935. /*
  1936. * whether/how to do multicast->unicast conversion
  1937. *
  1938. * This configuration parameter specifies whether the target should
  1939. * perform multicast --> unicast conversion on transmit, and if so,
  1940. * what to do if it finds no entries in its multicast group
  1941. * membership table for the multicast IP address in the tx frame.
  1942. * Configuration value:
  1943. * 0 -> Do not perform multicast to unicast conversion.
  1944. * 1 -> Convert multicast frames to unicast, if the IP multicast
  1945. * address from the tx frame is found in the multicast group
  1946. * membership table. If the IP multicast address is not found,
  1947. * drop the frame.
  1948. * 2 -> Convert multicast frames to unicast, if the IP multicast
  1949. * address from the tx frame is found in the multicast group
  1950. * membership table. If the IP multicast address is not found,
  1951. * transmit the frame as multicast.
  1952. */
  1953. __le32 mcast2ucast_mode;
  1954. /*
  1955. * how much memory to allocate for a tx PPDU dbg log
  1956. *
  1957. * This parameter controls how much memory the target will allocate
  1958. * to store a log of tx PPDU meta-information (how large the PPDU
  1959. * was, when it was sent, whether it was successful, etc.)
  1960. */
  1961. __le32 tx_dbg_log_size;
  1962. /* how many AST entries to be allocated for WDS */
  1963. __le32 num_wds_entries;
  1964. /*
  1965. * MAC DMA burst size, e.g., For target PCI limit can be
  1966. * 0 -default, 1 256B
  1967. */
  1968. __le32 dma_burst_size;
  1969. /*
  1970. * Fixed delimiters to be inserted after every MPDU to
  1971. * account for interface latency to avoid underrun.
  1972. */
  1973. __le32 mac_aggr_delim;
  1974. /*
  1975. * determine whether target is responsible for detecting duplicate
  1976. * non-aggregate MPDU and timing out stale fragments.
  1977. *
  1978. * A-MPDU reordering is always performed on the target.
  1979. *
  1980. * 0: target responsible for frag timeout and dup checking
  1981. * 1: host responsible for frag timeout and dup checking
  1982. */
  1983. __le32 rx_skip_defrag_timeout_dup_detection_check;
  1984. /*
  1985. * Configuration for VoW :
  1986. * No of Video Nodes to be supported
  1987. * and Max no of descriptors for each Video link (node).
  1988. */
  1989. __le32 vow_config;
  1990. /* maximum VDEV that could use GTK offload */
  1991. __le32 gtk_offload_max_vdev;
  1992. /* Number of msdu descriptors target should use */
  1993. __le32 num_msdu_desc;
  1994. /*
  1995. * Max. number of Tx fragments per MSDU
  1996. * This parameter controls the max number of Tx fragments per MSDU.
  1997. * This is sent by the target as part of the WMI_SERVICE_READY event
  1998. * and is overriden by the OS shim as required.
  1999. */
  2000. __le32 max_frag_entries;
  2001. } __packed;
  2002. struct wmi_resource_config_10x {
  2003. /* number of virtual devices (VAPs) to support */
  2004. __le32 num_vdevs;
  2005. /* number of peer nodes to support */
  2006. __le32 num_peers;
  2007. /* number of keys per peer */
  2008. __le32 num_peer_keys;
  2009. /* total number of TX/RX data TIDs */
  2010. __le32 num_tids;
  2011. /*
  2012. * max skid for resolving hash collisions
  2013. *
  2014. * The address search table is sparse, so that if two MAC addresses
  2015. * result in the same hash value, the second of these conflicting
  2016. * entries can slide to the next index in the address search table,
  2017. * and use it, if it is unoccupied. This ast_skid_limit parameter
  2018. * specifies the upper bound on how many subsequent indices to search
  2019. * over to find an unoccupied space.
  2020. */
  2021. __le32 ast_skid_limit;
  2022. /*
  2023. * the nominal chain mask for transmit
  2024. *
  2025. * The chain mask may be modified dynamically, e.g. to operate AP
  2026. * tx with a reduced number of chains if no clients are associated.
  2027. * This configuration parameter specifies the nominal chain-mask that
  2028. * should be used when not operating with a reduced set of tx chains.
  2029. */
  2030. __le32 tx_chain_mask;
  2031. /*
  2032. * the nominal chain mask for receive
  2033. *
  2034. * The chain mask may be modified dynamically, e.g. for a client
  2035. * to use a reduced number of chains for receive if the traffic to
  2036. * the client is low enough that it doesn't require downlink MIMO
  2037. * or antenna diversity.
  2038. * This configuration parameter specifies the nominal chain-mask that
  2039. * should be used when not operating with a reduced set of rx chains.
  2040. */
  2041. __le32 rx_chain_mask;
  2042. /*
  2043. * what rx reorder timeout (ms) to use for the AC
  2044. *
  2045. * Each WMM access class (voice, video, best-effort, background) will
  2046. * have its own timeout value to dictate how long to wait for missing
  2047. * rx MPDUs to arrive before flushing subsequent MPDUs that have
  2048. * already been received.
  2049. * This parameter specifies the timeout in milliseconds for each
  2050. * class.
  2051. */
  2052. __le32 rx_timeout_pri_vi;
  2053. __le32 rx_timeout_pri_vo;
  2054. __le32 rx_timeout_pri_be;
  2055. __le32 rx_timeout_pri_bk;
  2056. /*
  2057. * what mode the rx should decap packets to
  2058. *
  2059. * MAC can decap to RAW (no decap), native wifi or Ethernet types
  2060. * THis setting also determines the default TX behavior, however TX
  2061. * behavior can be modified on a per VAP basis during VAP init
  2062. */
  2063. __le32 rx_decap_mode;
  2064. /* what is the maximum number of scan requests that can be queued */
  2065. __le32 scan_max_pending_reqs;
  2066. /* maximum VDEV that could use BMISS offload */
  2067. __le32 bmiss_offload_max_vdev;
  2068. /* maximum VDEV that could use offload roaming */
  2069. __le32 roam_offload_max_vdev;
  2070. /* maximum AP profiles that would push to offload roaming */
  2071. __le32 roam_offload_max_ap_profiles;
  2072. /*
  2073. * how many groups to use for mcast->ucast conversion
  2074. *
  2075. * The target's WAL maintains a table to hold information regarding
  2076. * which peers belong to a given multicast group, so that if
  2077. * multicast->unicast conversion is enabled, the target can convert
  2078. * multicast tx frames to a series of unicast tx frames, to each
  2079. * peer within the multicast group.
  2080. This num_mcast_groups configuration parameter tells the target how
  2081. * many multicast groups to provide storage for within its multicast
  2082. * group membership table.
  2083. */
  2084. __le32 num_mcast_groups;
  2085. /*
  2086. * size to alloc for the mcast membership table
  2087. *
  2088. * This num_mcast_table_elems configuration parameter tells the
  2089. * target how many peer elements it needs to provide storage for in
  2090. * its multicast group membership table.
  2091. * These multicast group membership table elements are shared by the
  2092. * multicast groups stored within the table.
  2093. */
  2094. __le32 num_mcast_table_elems;
  2095. /*
  2096. * whether/how to do multicast->unicast conversion
  2097. *
  2098. * This configuration parameter specifies whether the target should
  2099. * perform multicast --> unicast conversion on transmit, and if so,
  2100. * what to do if it finds no entries in its multicast group
  2101. * membership table for the multicast IP address in the tx frame.
  2102. * Configuration value:
  2103. * 0 -> Do not perform multicast to unicast conversion.
  2104. * 1 -> Convert multicast frames to unicast, if the IP multicast
  2105. * address from the tx frame is found in the multicast group
  2106. * membership table. If the IP multicast address is not found,
  2107. * drop the frame.
  2108. * 2 -> Convert multicast frames to unicast, if the IP multicast
  2109. * address from the tx frame is found in the multicast group
  2110. * membership table. If the IP multicast address is not found,
  2111. * transmit the frame as multicast.
  2112. */
  2113. __le32 mcast2ucast_mode;
  2114. /*
  2115. * how much memory to allocate for a tx PPDU dbg log
  2116. *
  2117. * This parameter controls how much memory the target will allocate
  2118. * to store a log of tx PPDU meta-information (how large the PPDU
  2119. * was, when it was sent, whether it was successful, etc.)
  2120. */
  2121. __le32 tx_dbg_log_size;
  2122. /* how many AST entries to be allocated for WDS */
  2123. __le32 num_wds_entries;
  2124. /*
  2125. * MAC DMA burst size, e.g., For target PCI limit can be
  2126. * 0 -default, 1 256B
  2127. */
  2128. __le32 dma_burst_size;
  2129. /*
  2130. * Fixed delimiters to be inserted after every MPDU to
  2131. * account for interface latency to avoid underrun.
  2132. */
  2133. __le32 mac_aggr_delim;
  2134. /*
  2135. * determine whether target is responsible for detecting duplicate
  2136. * non-aggregate MPDU and timing out stale fragments.
  2137. *
  2138. * A-MPDU reordering is always performed on the target.
  2139. *
  2140. * 0: target responsible for frag timeout and dup checking
  2141. * 1: host responsible for frag timeout and dup checking
  2142. */
  2143. __le32 rx_skip_defrag_timeout_dup_detection_check;
  2144. /*
  2145. * Configuration for VoW :
  2146. * No of Video Nodes to be supported
  2147. * and Max no of descriptors for each Video link (node).
  2148. */
  2149. __le32 vow_config;
  2150. /* Number of msdu descriptors target should use */
  2151. __le32 num_msdu_desc;
  2152. /*
  2153. * Max. number of Tx fragments per MSDU
  2154. * This parameter controls the max number of Tx fragments per MSDU.
  2155. * This is sent by the target as part of the WMI_SERVICE_READY event
  2156. * and is overriden by the OS shim as required.
  2157. */
  2158. __le32 max_frag_entries;
  2159. } __packed;
  2160. enum wmi_10_2_feature_mask {
  2161. WMI_10_2_RX_BATCH_MODE = BIT(0),
  2162. WMI_10_2_ATF_CONFIG = BIT(1),
  2163. WMI_10_2_COEX_GPIO = BIT(3),
  2164. };
  2165. struct wmi_resource_config_10_2 {
  2166. struct wmi_resource_config_10x common;
  2167. __le32 max_peer_ext_stats;
  2168. __le32 smart_ant_cap; /* 0-disable, 1-enable */
  2169. __le32 bk_min_free;
  2170. __le32 be_min_free;
  2171. __le32 vi_min_free;
  2172. __le32 vo_min_free;
  2173. __le32 feature_mask;
  2174. } __packed;
  2175. #define NUM_UNITS_IS_NUM_VDEVS BIT(0)
  2176. #define NUM_UNITS_IS_NUM_PEERS BIT(1)
  2177. #define NUM_UNITS_IS_NUM_ACTIVE_PEERS BIT(2)
  2178. struct wmi_resource_config_10_4 {
  2179. /* Number of virtual devices (VAPs) to support */
  2180. __le32 num_vdevs;
  2181. /* Number of peer nodes to support */
  2182. __le32 num_peers;
  2183. /* Number of active peer nodes to support */
  2184. __le32 num_active_peers;
  2185. /* In offload mode, target supports features like WOW, chatter and other
  2186. * protocol offloads. In order to support them some functionalities like
  2187. * reorder buffering, PN checking need to be done in target.
  2188. * This determines maximum number of peers supported by target in
  2189. * offload mode.
  2190. */
  2191. __le32 num_offload_peers;
  2192. /* Number of reorder buffers available for doing target based reorder
  2193. * Rx reorder buffering
  2194. */
  2195. __le32 num_offload_reorder_buffs;
  2196. /* Number of keys per peer */
  2197. __le32 num_peer_keys;
  2198. /* Total number of TX/RX data TIDs */
  2199. __le32 num_tids;
  2200. /* Max skid for resolving hash collisions.
  2201. * The address search table is sparse, so that if two MAC addresses
  2202. * result in the same hash value, the second of these conflicting
  2203. * entries can slide to the next index in the address search table,
  2204. * and use it, if it is unoccupied. This ast_skid_limit parameter
  2205. * specifies the upper bound on how many subsequent indices to search
  2206. * over to find an unoccupied space.
  2207. */
  2208. __le32 ast_skid_limit;
  2209. /* The nominal chain mask for transmit.
  2210. * The chain mask may be modified dynamically, e.g. to operate AP tx
  2211. * with a reduced number of chains if no clients are associated.
  2212. * This configuration parameter specifies the nominal chain-mask that
  2213. * should be used when not operating with a reduced set of tx chains.
  2214. */
  2215. __le32 tx_chain_mask;
  2216. /* The nominal chain mask for receive.
  2217. * The chain mask may be modified dynamically, e.g. for a client to use
  2218. * a reduced number of chains for receive if the traffic to the client
  2219. * is low enough that it doesn't require downlink MIMO or antenna
  2220. * diversity. This configuration parameter specifies the nominal
  2221. * chain-mask that should be used when not operating with a reduced
  2222. * set of rx chains.
  2223. */
  2224. __le32 rx_chain_mask;
  2225. /* What rx reorder timeout (ms) to use for the AC.
  2226. * Each WMM access class (voice, video, best-effort, background) will
  2227. * have its own timeout value to dictate how long to wait for missing
  2228. * rx MPDUs to arrive before flushing subsequent MPDUs that have already
  2229. * been received. This parameter specifies the timeout in milliseconds
  2230. * for each class.
  2231. */
  2232. __le32 rx_timeout_pri[4];
  2233. /* What mode the rx should decap packets to.
  2234. * MAC can decap to RAW (no decap), native wifi or Ethernet types.
  2235. * This setting also determines the default TX behavior, however TX
  2236. * behavior can be modified on a per VAP basis during VAP init
  2237. */
  2238. __le32 rx_decap_mode;
  2239. __le32 scan_max_pending_req;
  2240. __le32 bmiss_offload_max_vdev;
  2241. __le32 roam_offload_max_vdev;
  2242. __le32 roam_offload_max_ap_profiles;
  2243. /* How many groups to use for mcast->ucast conversion.
  2244. * The target's WAL maintains a table to hold information regarding
  2245. * which peers belong to a given multicast group, so that if
  2246. * multicast->unicast conversion is enabled, the target can convert
  2247. * multicast tx frames to a series of unicast tx frames, to each peer
  2248. * within the multicast group. This num_mcast_groups configuration
  2249. * parameter tells the target how many multicast groups to provide
  2250. * storage for within its multicast group membership table.
  2251. */
  2252. __le32 num_mcast_groups;
  2253. /* Size to alloc for the mcast membership table.
  2254. * This num_mcast_table_elems configuration parameter tells the target
  2255. * how many peer elements it needs to provide storage for in its
  2256. * multicast group membership table. These multicast group membership
  2257. * table elements are shared by the multicast groups stored within
  2258. * the table.
  2259. */
  2260. __le32 num_mcast_table_elems;
  2261. /* Whether/how to do multicast->unicast conversion.
  2262. * This configuration parameter specifies whether the target should
  2263. * perform multicast --> unicast conversion on transmit, and if so,
  2264. * what to do if it finds no entries in its multicast group membership
  2265. * table for the multicast IP address in the tx frame.
  2266. * Configuration value:
  2267. * 0 -> Do not perform multicast to unicast conversion.
  2268. * 1 -> Convert multicast frames to unicast, if the IP multicast address
  2269. * from the tx frame is found in the multicast group membership
  2270. * table. If the IP multicast address is not found, drop the frame
  2271. * 2 -> Convert multicast frames to unicast, if the IP multicast address
  2272. * from the tx frame is found in the multicast group membership
  2273. * table. If the IP multicast address is not found, transmit the
  2274. * frame as multicast.
  2275. */
  2276. __le32 mcast2ucast_mode;
  2277. /* How much memory to allocate for a tx PPDU dbg log.
  2278. * This parameter controls how much memory the target will allocate to
  2279. * store a log of tx PPDU meta-information (how large the PPDU was,
  2280. * when it was sent, whether it was successful, etc.)
  2281. */
  2282. __le32 tx_dbg_log_size;
  2283. /* How many AST entries to be allocated for WDS */
  2284. __le32 num_wds_entries;
  2285. /* MAC DMA burst size. 0 -default, 1 -256B */
  2286. __le32 dma_burst_size;
  2287. /* Fixed delimiters to be inserted after every MPDU to account for
  2288. * interface latency to avoid underrun.
  2289. */
  2290. __le32 mac_aggr_delim;
  2291. /* Determine whether target is responsible for detecting duplicate
  2292. * non-aggregate MPDU and timing out stale fragments. A-MPDU reordering
  2293. * is always performed on the target.
  2294. *
  2295. * 0: target responsible for frag timeout and dup checking
  2296. * 1: host responsible for frag timeout and dup checking
  2297. */
  2298. __le32 rx_skip_defrag_timeout_dup_detection_check;
  2299. /* Configuration for VoW : No of Video nodes to be supported and max
  2300. * no of descriptors for each video link (node).
  2301. */
  2302. __le32 vow_config;
  2303. /* Maximum vdev that could use gtk offload */
  2304. __le32 gtk_offload_max_vdev;
  2305. /* Number of msdu descriptors target should use */
  2306. __le32 num_msdu_desc;
  2307. /* Max number of tx fragments per MSDU.
  2308. * This parameter controls the max number of tx fragments per MSDU.
  2309. * This will passed by target as part of the WMI_SERVICE_READY event
  2310. * and is overridden by the OS shim as required.
  2311. */
  2312. __le32 max_frag_entries;
  2313. /* Max number of extended peer stats.
  2314. * This parameter controls the max number of peers for which extended
  2315. * statistics are supported by target
  2316. */
  2317. __le32 max_peer_ext_stats;
  2318. /* Smart antenna capabilities information.
  2319. * 1 - Smart antenna is enabled
  2320. * 0 - Smart antenna is disabled
  2321. * In future this can contain smart antenna specific capabilities.
  2322. */
  2323. __le32 smart_ant_cap;
  2324. /* User can configure the buffers allocated for each AC (BE, BK, VI, VO)
  2325. * during init.
  2326. */
  2327. __le32 bk_minfree;
  2328. __le32 be_minfree;
  2329. __le32 vi_minfree;
  2330. __le32 vo_minfree;
  2331. /* Rx batch mode capability.
  2332. * 1 - Rx batch mode enabled
  2333. * 0 - Rx batch mode disabled
  2334. */
  2335. __le32 rx_batchmode;
  2336. /* Thermal throttling capability.
  2337. * 1 - Capable of thermal throttling
  2338. * 0 - Not capable of thermal throttling
  2339. */
  2340. __le32 tt_support;
  2341. /* ATF configuration.
  2342. * 1 - Enable ATF
  2343. * 0 - Disable ATF
  2344. */
  2345. __le32 atf_config;
  2346. /* Configure padding to manage IP header un-alignment
  2347. * 1 - Enable padding
  2348. * 0 - Disable padding
  2349. */
  2350. __le32 iphdr_pad_config;
  2351. /* qwrap configuration
  2352. * 1 - This is qwrap configuration
  2353. * 0 - This is not qwrap
  2354. */
  2355. __le32 qwrap_config;
  2356. } __packed;
  2357. /* strucutre describing host memory chunk. */
  2358. struct host_memory_chunk {
  2359. /* id of the request that is passed up in service ready */
  2360. __le32 req_id;
  2361. /* the physical address the memory chunk */
  2362. __le32 ptr;
  2363. /* size of the chunk */
  2364. __le32 size;
  2365. } __packed;
  2366. struct wmi_host_mem_chunks {
  2367. __le32 count;
  2368. /* some fw revisions require at least 1 chunk regardless of count */
  2369. struct host_memory_chunk items[1];
  2370. } __packed;
  2371. struct wmi_init_cmd {
  2372. struct wmi_resource_config resource_config;
  2373. struct wmi_host_mem_chunks mem_chunks;
  2374. } __packed;
  2375. /* _10x stucture is from 10.X FW API */
  2376. struct wmi_init_cmd_10x {
  2377. struct wmi_resource_config_10x resource_config;
  2378. struct wmi_host_mem_chunks mem_chunks;
  2379. } __packed;
  2380. struct wmi_init_cmd_10_2 {
  2381. struct wmi_resource_config_10_2 resource_config;
  2382. struct wmi_host_mem_chunks mem_chunks;
  2383. } __packed;
  2384. struct wmi_init_cmd_10_4 {
  2385. struct wmi_resource_config_10_4 resource_config;
  2386. struct wmi_host_mem_chunks mem_chunks;
  2387. } __packed;
  2388. struct wmi_chan_list_entry {
  2389. __le16 freq;
  2390. u8 phy_mode; /* valid for 10.2 only */
  2391. u8 reserved;
  2392. } __packed;
  2393. /* TLV for channel list */
  2394. struct wmi_chan_list {
  2395. __le32 tag; /* WMI_CHAN_LIST_TAG */
  2396. __le32 num_chan;
  2397. struct wmi_chan_list_entry channel_list[0];
  2398. } __packed;
  2399. struct wmi_bssid_list {
  2400. __le32 tag; /* WMI_BSSID_LIST_TAG */
  2401. __le32 num_bssid;
  2402. struct wmi_mac_addr bssid_list[0];
  2403. } __packed;
  2404. struct wmi_ie_data {
  2405. __le32 tag; /* WMI_IE_TAG */
  2406. __le32 ie_len;
  2407. u8 ie_data[0];
  2408. } __packed;
  2409. struct wmi_ssid {
  2410. __le32 ssid_len;
  2411. u8 ssid[32];
  2412. } __packed;
  2413. struct wmi_ssid_list {
  2414. __le32 tag; /* WMI_SSID_LIST_TAG */
  2415. __le32 num_ssids;
  2416. struct wmi_ssid ssids[0];
  2417. } __packed;
  2418. /* prefix used by scan requestor ids on the host */
  2419. #define WMI_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
  2420. /* prefix used by scan request ids generated on the host */
  2421. /* host cycles through the lower 12 bits to generate ids */
  2422. #define WMI_HOST_SCAN_REQ_ID_PREFIX 0xA000
  2423. #define WLAN_SCAN_PARAMS_MAX_SSID 16
  2424. #define WLAN_SCAN_PARAMS_MAX_BSSID 4
  2425. #define WLAN_SCAN_PARAMS_MAX_IE_LEN 256
  2426. /* Values lower than this may be refused by some firmware revisions with a scan
  2427. * completion with a timedout reason.
  2428. */
  2429. #define WMI_SCAN_CHAN_MIN_TIME_MSEC 40
  2430. /* Scan priority numbers must be sequential, starting with 0 */
  2431. enum wmi_scan_priority {
  2432. WMI_SCAN_PRIORITY_VERY_LOW = 0,
  2433. WMI_SCAN_PRIORITY_LOW,
  2434. WMI_SCAN_PRIORITY_MEDIUM,
  2435. WMI_SCAN_PRIORITY_HIGH,
  2436. WMI_SCAN_PRIORITY_VERY_HIGH,
  2437. WMI_SCAN_PRIORITY_COUNT /* number of priorities supported */
  2438. };
  2439. struct wmi_start_scan_common {
  2440. /* Scan ID */
  2441. __le32 scan_id;
  2442. /* Scan requestor ID */
  2443. __le32 scan_req_id;
  2444. /* VDEV id(interface) that is requesting scan */
  2445. __le32 vdev_id;
  2446. /* Scan Priority, input to scan scheduler */
  2447. __le32 scan_priority;
  2448. /* Scan events subscription */
  2449. __le32 notify_scan_events;
  2450. /* dwell time in msec on active channels */
  2451. __le32 dwell_time_active;
  2452. /* dwell time in msec on passive channels */
  2453. __le32 dwell_time_passive;
  2454. /*
  2455. * min time in msec on the BSS channel,only valid if atleast one
  2456. * VDEV is active
  2457. */
  2458. __le32 min_rest_time;
  2459. /*
  2460. * max rest time in msec on the BSS channel,only valid if at least
  2461. * one VDEV is active
  2462. */
  2463. /*
  2464. * the scanner will rest on the bss channel at least min_rest_time
  2465. * after min_rest_time the scanner will start checking for tx/rx
  2466. * activity on all VDEVs. if there is no activity the scanner will
  2467. * switch to off channel. if there is activity the scanner will let
  2468. * the radio on the bss channel until max_rest_time expires.at
  2469. * max_rest_time scanner will switch to off channel irrespective of
  2470. * activity. activity is determined by the idle_time parameter.
  2471. */
  2472. __le32 max_rest_time;
  2473. /*
  2474. * time before sending next set of probe requests.
  2475. * The scanner keeps repeating probe requests transmission with
  2476. * period specified by repeat_probe_time.
  2477. * The number of probe requests specified depends on the ssid_list
  2478. * and bssid_list
  2479. */
  2480. __le32 repeat_probe_time;
  2481. /* time in msec between 2 consequetive probe requests with in a set. */
  2482. __le32 probe_spacing_time;
  2483. /*
  2484. * data inactivity time in msec on bss channel that will be used by
  2485. * scanner for measuring the inactivity.
  2486. */
  2487. __le32 idle_time;
  2488. /* maximum time in msec allowed for scan */
  2489. __le32 max_scan_time;
  2490. /*
  2491. * delay in msec before sending first probe request after switching
  2492. * to a channel
  2493. */
  2494. __le32 probe_delay;
  2495. /* Scan control flags */
  2496. __le32 scan_ctrl_flags;
  2497. } __packed;
  2498. struct wmi_start_scan_tlvs {
  2499. /* TLV parameters. These includes channel list, ssid list, bssid list,
  2500. * extra ies.
  2501. */
  2502. u8 tlvs[0];
  2503. } __packed;
  2504. struct wmi_start_scan_cmd {
  2505. struct wmi_start_scan_common common;
  2506. __le32 burst_duration_ms;
  2507. struct wmi_start_scan_tlvs tlvs;
  2508. } __packed;
  2509. /* This is the definition from 10.X firmware branch */
  2510. struct wmi_10x_start_scan_cmd {
  2511. struct wmi_start_scan_common common;
  2512. struct wmi_start_scan_tlvs tlvs;
  2513. } __packed;
  2514. struct wmi_ssid_arg {
  2515. int len;
  2516. const u8 *ssid;
  2517. };
  2518. struct wmi_bssid_arg {
  2519. const u8 *bssid;
  2520. };
  2521. struct wmi_start_scan_arg {
  2522. u32 scan_id;
  2523. u32 scan_req_id;
  2524. u32 vdev_id;
  2525. u32 scan_priority;
  2526. u32 notify_scan_events;
  2527. u32 dwell_time_active;
  2528. u32 dwell_time_passive;
  2529. u32 min_rest_time;
  2530. u32 max_rest_time;
  2531. u32 repeat_probe_time;
  2532. u32 probe_spacing_time;
  2533. u32 idle_time;
  2534. u32 max_scan_time;
  2535. u32 probe_delay;
  2536. u32 scan_ctrl_flags;
  2537. u32 burst_duration_ms;
  2538. u32 ie_len;
  2539. u32 n_channels;
  2540. u32 n_ssids;
  2541. u32 n_bssids;
  2542. u8 ie[WLAN_SCAN_PARAMS_MAX_IE_LEN];
  2543. u16 channels[64];
  2544. struct wmi_ssid_arg ssids[WLAN_SCAN_PARAMS_MAX_SSID];
  2545. struct wmi_bssid_arg bssids[WLAN_SCAN_PARAMS_MAX_BSSID];
  2546. };
  2547. /* scan control flags */
  2548. /* passively scan all channels including active channels */
  2549. #define WMI_SCAN_FLAG_PASSIVE 0x1
  2550. /* add wild card ssid probe request even though ssid_list is specified. */
  2551. #define WMI_SCAN_ADD_BCAST_PROBE_REQ 0x2
  2552. /* add cck rates to rates/xrate ie for the generated probe request */
  2553. #define WMI_SCAN_ADD_CCK_RATES 0x4
  2554. /* add ofdm rates to rates/xrate ie for the generated probe request */
  2555. #define WMI_SCAN_ADD_OFDM_RATES 0x8
  2556. /* To enable indication of Chan load and Noise floor to host */
  2557. #define WMI_SCAN_CHAN_STAT_EVENT 0x10
  2558. /* Filter Probe request frames */
  2559. #define WMI_SCAN_FILTER_PROBE_REQ 0x20
  2560. /* When set, DFS channels will not be scanned */
  2561. #define WMI_SCAN_BYPASS_DFS_CHN 0x40
  2562. /* Different FW scan engine may choose to bail out on errors.
  2563. * Allow the driver to have influence over that. */
  2564. #define WMI_SCAN_CONTINUE_ON_ERROR 0x80
  2565. /* WMI_SCAN_CLASS_MASK must be the same value as IEEE80211_SCAN_CLASS_MASK */
  2566. #define WMI_SCAN_CLASS_MASK 0xFF000000
  2567. enum wmi_stop_scan_type {
  2568. WMI_SCAN_STOP_ONE = 0x00000000, /* stop by scan_id */
  2569. WMI_SCAN_STOP_VDEV_ALL = 0x01000000, /* stop by vdev_id */
  2570. WMI_SCAN_STOP_ALL = 0x04000000, /* stop all scans */
  2571. };
  2572. struct wmi_stop_scan_cmd {
  2573. __le32 scan_req_id;
  2574. __le32 scan_id;
  2575. __le32 req_type;
  2576. __le32 vdev_id;
  2577. } __packed;
  2578. struct wmi_stop_scan_arg {
  2579. u32 req_id;
  2580. enum wmi_stop_scan_type req_type;
  2581. union {
  2582. u32 scan_id;
  2583. u32 vdev_id;
  2584. } u;
  2585. };
  2586. struct wmi_scan_chan_list_cmd {
  2587. __le32 num_scan_chans;
  2588. struct wmi_channel chan_info[0];
  2589. } __packed;
  2590. struct wmi_scan_chan_list_arg {
  2591. u32 n_channels;
  2592. struct wmi_channel_arg *channels;
  2593. };
  2594. enum wmi_bss_filter {
  2595. WMI_BSS_FILTER_NONE = 0, /* no beacons forwarded */
  2596. WMI_BSS_FILTER_ALL, /* all beacons forwarded */
  2597. WMI_BSS_FILTER_PROFILE, /* only beacons matching profile */
  2598. WMI_BSS_FILTER_ALL_BUT_PROFILE, /* all but beacons matching profile */
  2599. WMI_BSS_FILTER_CURRENT_BSS, /* only beacons matching current BSS */
  2600. WMI_BSS_FILTER_ALL_BUT_BSS, /* all but beacons matching BSS */
  2601. WMI_BSS_FILTER_PROBED_SSID, /* beacons matching probed ssid */
  2602. WMI_BSS_FILTER_LAST_BSS, /* marker only */
  2603. };
  2604. enum wmi_scan_event_type {
  2605. WMI_SCAN_EVENT_STARTED = BIT(0),
  2606. WMI_SCAN_EVENT_COMPLETED = BIT(1),
  2607. WMI_SCAN_EVENT_BSS_CHANNEL = BIT(2),
  2608. WMI_SCAN_EVENT_FOREIGN_CHANNEL = BIT(3),
  2609. WMI_SCAN_EVENT_DEQUEUED = BIT(4),
  2610. /* possibly by high-prio scan */
  2611. WMI_SCAN_EVENT_PREEMPTED = BIT(5),
  2612. WMI_SCAN_EVENT_START_FAILED = BIT(6),
  2613. WMI_SCAN_EVENT_RESTARTED = BIT(7),
  2614. WMI_SCAN_EVENT_FOREIGN_CHANNEL_EXIT = BIT(8),
  2615. WMI_SCAN_EVENT_MAX = BIT(15),
  2616. };
  2617. enum wmi_scan_completion_reason {
  2618. WMI_SCAN_REASON_COMPLETED,
  2619. WMI_SCAN_REASON_CANCELLED,
  2620. WMI_SCAN_REASON_PREEMPTED,
  2621. WMI_SCAN_REASON_TIMEDOUT,
  2622. WMI_SCAN_REASON_INTERNAL_FAILURE,
  2623. WMI_SCAN_REASON_MAX,
  2624. };
  2625. struct wmi_scan_event {
  2626. __le32 event_type; /* %WMI_SCAN_EVENT_ */
  2627. __le32 reason; /* %WMI_SCAN_REASON_ */
  2628. __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
  2629. __le32 scan_req_id;
  2630. __le32 scan_id;
  2631. __le32 vdev_id;
  2632. } __packed;
  2633. /*
  2634. * This defines how much headroom is kept in the
  2635. * receive frame between the descriptor and the
  2636. * payload, in order for the WMI PHY error and
  2637. * management handler to insert header contents.
  2638. *
  2639. * This is in bytes.
  2640. */
  2641. #define WMI_MGMT_RX_HDR_HEADROOM 52
  2642. /*
  2643. * This event will be used for sending scan results
  2644. * as well as rx mgmt frames to the host. The rx buffer
  2645. * will be sent as part of this WMI event. It would be a
  2646. * good idea to pass all the fields in the RX status
  2647. * descriptor up to the host.
  2648. */
  2649. struct wmi_mgmt_rx_hdr_v1 {
  2650. __le32 channel;
  2651. __le32 snr;
  2652. __le32 rate;
  2653. __le32 phy_mode;
  2654. __le32 buf_len;
  2655. __le32 status; /* %WMI_RX_STATUS_ */
  2656. } __packed;
  2657. struct wmi_mgmt_rx_hdr_v2 {
  2658. struct wmi_mgmt_rx_hdr_v1 v1;
  2659. __le32 rssi_ctl[4];
  2660. } __packed;
  2661. struct wmi_mgmt_rx_event_v1 {
  2662. struct wmi_mgmt_rx_hdr_v1 hdr;
  2663. u8 buf[0];
  2664. } __packed;
  2665. struct wmi_mgmt_rx_event_v2 {
  2666. struct wmi_mgmt_rx_hdr_v2 hdr;
  2667. u8 buf[0];
  2668. } __packed;
  2669. struct wmi_10_4_mgmt_rx_hdr {
  2670. __le32 channel;
  2671. __le32 snr;
  2672. u8 rssi_ctl[4];
  2673. __le32 rate;
  2674. __le32 phy_mode;
  2675. __le32 buf_len;
  2676. __le32 status;
  2677. } __packed;
  2678. struct wmi_10_4_mgmt_rx_event {
  2679. struct wmi_10_4_mgmt_rx_hdr hdr;
  2680. u8 buf[0];
  2681. } __packed;
  2682. #define WMI_RX_STATUS_OK 0x00
  2683. #define WMI_RX_STATUS_ERR_CRC 0x01
  2684. #define WMI_RX_STATUS_ERR_DECRYPT 0x08
  2685. #define WMI_RX_STATUS_ERR_MIC 0x10
  2686. #define WMI_RX_STATUS_ERR_KEY_CACHE_MISS 0x20
  2687. #define PHY_ERROR_GEN_SPECTRAL_SCAN 0x26
  2688. #define PHY_ERROR_GEN_FALSE_RADAR_EXT 0x24
  2689. #define PHY_ERROR_GEN_RADAR 0x05
  2690. #define PHY_ERROR_10_4_RADAR_MASK 0x4
  2691. #define PHY_ERROR_10_4_SPECTRAL_SCAN_MASK 0x4000000
  2692. enum phy_err_type {
  2693. PHY_ERROR_UNKNOWN,
  2694. PHY_ERROR_SPECTRAL_SCAN,
  2695. PHY_ERROR_FALSE_RADAR_EXT,
  2696. PHY_ERROR_RADAR
  2697. };
  2698. struct wmi_phyerr {
  2699. __le32 tsf_timestamp;
  2700. __le16 freq1;
  2701. __le16 freq2;
  2702. u8 rssi_combined;
  2703. u8 chan_width_mhz;
  2704. u8 phy_err_code;
  2705. u8 rsvd0;
  2706. __le32 rssi_chains[4];
  2707. __le16 nf_chains[4];
  2708. __le32 buf_len;
  2709. u8 buf[0];
  2710. } __packed;
  2711. struct wmi_phyerr_event {
  2712. __le32 num_phyerrs;
  2713. __le32 tsf_l32;
  2714. __le32 tsf_u32;
  2715. struct wmi_phyerr phyerrs[0];
  2716. } __packed;
  2717. struct wmi_10_4_phyerr_event {
  2718. __le32 tsf_l32;
  2719. __le32 tsf_u32;
  2720. __le16 freq1;
  2721. __le16 freq2;
  2722. u8 rssi_combined;
  2723. u8 chan_width_mhz;
  2724. u8 phy_err_code;
  2725. u8 rsvd0;
  2726. __le32 rssi_chains[4];
  2727. __le16 nf_chains[4];
  2728. __le32 phy_err_mask[2];
  2729. __le32 tsf_timestamp;
  2730. __le32 buf_len;
  2731. u8 buf[0];
  2732. } __packed;
  2733. #define PHYERR_TLV_SIG 0xBB
  2734. #define PHYERR_TLV_TAG_SEARCH_FFT_REPORT 0xFB
  2735. #define PHYERR_TLV_TAG_RADAR_PULSE_SUMMARY 0xF8
  2736. #define PHYERR_TLV_TAG_SPECTRAL_SUMMARY_REPORT 0xF9
  2737. struct phyerr_radar_report {
  2738. __le32 reg0; /* RADAR_REPORT_REG0_* */
  2739. __le32 reg1; /* REDAR_REPORT_REG1_* */
  2740. } __packed;
  2741. #define RADAR_REPORT_REG0_PULSE_IS_CHIRP_MASK 0x80000000
  2742. #define RADAR_REPORT_REG0_PULSE_IS_CHIRP_LSB 31
  2743. #define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_MASK 0x40000000
  2744. #define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_LSB 30
  2745. #define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_MASK 0x3FF00000
  2746. #define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_LSB 20
  2747. #define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_MASK 0x000F0000
  2748. #define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_LSB 16
  2749. #define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_MASK 0x0000FC00
  2750. #define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_LSB 10
  2751. #define RADAR_REPORT_REG0_PULSE_SIDX_MASK 0x000003FF
  2752. #define RADAR_REPORT_REG0_PULSE_SIDX_LSB 0
  2753. #define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_MASK 0x80000000
  2754. #define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_LSB 31
  2755. #define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_MASK 0x7F000000
  2756. #define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_LSB 24
  2757. #define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_MASK 0x00FF0000
  2758. #define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_LSB 16
  2759. #define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_MASK 0x0000FF00
  2760. #define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_LSB 8
  2761. #define RADAR_REPORT_REG1_PULSE_DUR_MASK 0x000000FF
  2762. #define RADAR_REPORT_REG1_PULSE_DUR_LSB 0
  2763. struct phyerr_fft_report {
  2764. __le32 reg0; /* SEARCH_FFT_REPORT_REG0_ * */
  2765. __le32 reg1; /* SEARCH_FFT_REPORT_REG1_ * */
  2766. } __packed;
  2767. #define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_MASK 0xFF800000
  2768. #define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_LSB 23
  2769. #define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_MASK 0x007FC000
  2770. #define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_LSB 14
  2771. #define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_MASK 0x00003000
  2772. #define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_LSB 12
  2773. #define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_MASK 0x00000FFF
  2774. #define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_LSB 0
  2775. #define SEARCH_FFT_REPORT_REG1_RELPWR_DB_MASK 0xFC000000
  2776. #define SEARCH_FFT_REPORT_REG1_RELPWR_DB_LSB 26
  2777. #define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_MASK 0x03FC0000
  2778. #define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_LSB 18
  2779. #define SEARCH_FFT_REPORT_REG1_PEAK_MAG_MASK 0x0003FF00
  2780. #define SEARCH_FFT_REPORT_REG1_PEAK_MAG_LSB 8
  2781. #define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_MASK 0x000000FF
  2782. #define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_LSB 0
  2783. struct phyerr_tlv {
  2784. __le16 len;
  2785. u8 tag;
  2786. u8 sig;
  2787. } __packed;
  2788. #define DFS_RSSI_POSSIBLY_FALSE 50
  2789. #define DFS_PEAK_MAG_THOLD_POSSIBLY_FALSE 40
  2790. struct wmi_mgmt_tx_hdr {
  2791. __le32 vdev_id;
  2792. struct wmi_mac_addr peer_macaddr;
  2793. __le32 tx_rate;
  2794. __le32 tx_power;
  2795. __le32 buf_len;
  2796. } __packed;
  2797. struct wmi_mgmt_tx_cmd {
  2798. struct wmi_mgmt_tx_hdr hdr;
  2799. u8 buf[0];
  2800. } __packed;
  2801. struct wmi_echo_event {
  2802. __le32 value;
  2803. } __packed;
  2804. struct wmi_echo_cmd {
  2805. __le32 value;
  2806. } __packed;
  2807. struct wmi_pdev_set_regdomain_cmd {
  2808. __le32 reg_domain;
  2809. __le32 reg_domain_2G;
  2810. __le32 reg_domain_5G;
  2811. __le32 conformance_test_limit_2G;
  2812. __le32 conformance_test_limit_5G;
  2813. } __packed;
  2814. enum wmi_dfs_region {
  2815. /* Uninitialized dfs domain */
  2816. WMI_UNINIT_DFS_DOMAIN = 0,
  2817. /* FCC3 dfs domain */
  2818. WMI_FCC_DFS_DOMAIN = 1,
  2819. /* ETSI dfs domain */
  2820. WMI_ETSI_DFS_DOMAIN = 2,
  2821. /*Japan dfs domain */
  2822. WMI_MKK4_DFS_DOMAIN = 3,
  2823. };
  2824. struct wmi_pdev_set_regdomain_cmd_10x {
  2825. __le32 reg_domain;
  2826. __le32 reg_domain_2G;
  2827. __le32 reg_domain_5G;
  2828. __le32 conformance_test_limit_2G;
  2829. __le32 conformance_test_limit_5G;
  2830. /* dfs domain from wmi_dfs_region */
  2831. __le32 dfs_domain;
  2832. } __packed;
  2833. /* Command to set/unset chip in quiet mode */
  2834. struct wmi_pdev_set_quiet_cmd {
  2835. /* period in TUs */
  2836. __le32 period;
  2837. /* duration in TUs */
  2838. __le32 duration;
  2839. /* offset in TUs */
  2840. __le32 next_start;
  2841. /* enable/disable */
  2842. __le32 enabled;
  2843. } __packed;
  2844. /*
  2845. * 802.11g protection mode.
  2846. */
  2847. enum ath10k_protmode {
  2848. ATH10K_PROT_NONE = 0, /* no protection */
  2849. ATH10K_PROT_CTSONLY = 1, /* CTS to self */
  2850. ATH10K_PROT_RTSCTS = 2, /* RTS-CTS */
  2851. };
  2852. enum wmi_rtscts_profile {
  2853. WMI_RTSCTS_FOR_NO_RATESERIES = 0,
  2854. WMI_RTSCTS_FOR_SECOND_RATESERIES,
  2855. WMI_RTSCTS_ACROSS_SW_RETRIES
  2856. };
  2857. #define WMI_RTSCTS_ENABLED 1
  2858. #define WMI_RTSCTS_SET_MASK 0x0f
  2859. #define WMI_RTSCTS_SET_LSB 0
  2860. #define WMI_RTSCTS_PROFILE_MASK 0xf0
  2861. #define WMI_RTSCTS_PROFILE_LSB 4
  2862. enum wmi_beacon_gen_mode {
  2863. WMI_BEACON_STAGGERED_MODE = 0,
  2864. WMI_BEACON_BURST_MODE = 1
  2865. };
  2866. enum wmi_csa_event_ies_present_flag {
  2867. WMI_CSA_IE_PRESENT = 0x00000001,
  2868. WMI_XCSA_IE_PRESENT = 0x00000002,
  2869. WMI_WBW_IE_PRESENT = 0x00000004,
  2870. WMI_CSWARP_IE_PRESENT = 0x00000008,
  2871. };
  2872. /* wmi CSA receive event from beacon frame */
  2873. struct wmi_csa_event {
  2874. __le32 i_fc_dur;
  2875. /* Bit 0-15: FC */
  2876. /* Bit 16-31: DUR */
  2877. struct wmi_mac_addr i_addr1;
  2878. struct wmi_mac_addr i_addr2;
  2879. __le32 csa_ie[2];
  2880. __le32 xcsa_ie[2];
  2881. __le32 wb_ie[2];
  2882. __le32 cswarp_ie;
  2883. __le32 ies_present_flag; /* wmi_csa_event_ies_present_flag */
  2884. } __packed;
  2885. /* the definition of different PDEV parameters */
  2886. #define PDEV_DEFAULT_STATS_UPDATE_PERIOD 500
  2887. #define VDEV_DEFAULT_STATS_UPDATE_PERIOD 500
  2888. #define PEER_DEFAULT_STATS_UPDATE_PERIOD 500
  2889. struct wmi_pdev_param_map {
  2890. u32 tx_chain_mask;
  2891. u32 rx_chain_mask;
  2892. u32 txpower_limit2g;
  2893. u32 txpower_limit5g;
  2894. u32 txpower_scale;
  2895. u32 beacon_gen_mode;
  2896. u32 beacon_tx_mode;
  2897. u32 resmgr_offchan_mode;
  2898. u32 protection_mode;
  2899. u32 dynamic_bw;
  2900. u32 non_agg_sw_retry_th;
  2901. u32 agg_sw_retry_th;
  2902. u32 sta_kickout_th;
  2903. u32 ac_aggrsize_scaling;
  2904. u32 ltr_enable;
  2905. u32 ltr_ac_latency_be;
  2906. u32 ltr_ac_latency_bk;
  2907. u32 ltr_ac_latency_vi;
  2908. u32 ltr_ac_latency_vo;
  2909. u32 ltr_ac_latency_timeout;
  2910. u32 ltr_sleep_override;
  2911. u32 ltr_rx_override;
  2912. u32 ltr_tx_activity_timeout;
  2913. u32 l1ss_enable;
  2914. u32 dsleep_enable;
  2915. u32 pcielp_txbuf_flush;
  2916. u32 pcielp_txbuf_watermark;
  2917. u32 pcielp_txbuf_tmo_en;
  2918. u32 pcielp_txbuf_tmo_value;
  2919. u32 pdev_stats_update_period;
  2920. u32 vdev_stats_update_period;
  2921. u32 peer_stats_update_period;
  2922. u32 bcnflt_stats_update_period;
  2923. u32 pmf_qos;
  2924. u32 arp_ac_override;
  2925. u32 dcs;
  2926. u32 ani_enable;
  2927. u32 ani_poll_period;
  2928. u32 ani_listen_period;
  2929. u32 ani_ofdm_level;
  2930. u32 ani_cck_level;
  2931. u32 dyntxchain;
  2932. u32 proxy_sta;
  2933. u32 idle_ps_config;
  2934. u32 power_gating_sleep;
  2935. u32 fast_channel_reset;
  2936. u32 burst_dur;
  2937. u32 burst_enable;
  2938. u32 cal_period;
  2939. u32 aggr_burst;
  2940. u32 rx_decap_mode;
  2941. u32 smart_antenna_default_antenna;
  2942. u32 igmpmld_override;
  2943. u32 igmpmld_tid;
  2944. u32 antenna_gain;
  2945. u32 rx_filter;
  2946. u32 set_mcast_to_ucast_tid;
  2947. u32 proxy_sta_mode;
  2948. u32 set_mcast2ucast_mode;
  2949. u32 set_mcast2ucast_buffer;
  2950. u32 remove_mcast2ucast_buffer;
  2951. u32 peer_sta_ps_statechg_enable;
  2952. u32 igmpmld_ac_override;
  2953. u32 block_interbss;
  2954. u32 set_disable_reset_cmdid;
  2955. u32 set_msdu_ttl_cmdid;
  2956. u32 set_ppdu_duration_cmdid;
  2957. u32 txbf_sound_period_cmdid;
  2958. u32 set_promisc_mode_cmdid;
  2959. u32 set_burst_mode_cmdid;
  2960. u32 en_stats;
  2961. u32 mu_group_policy;
  2962. u32 noise_detection;
  2963. u32 noise_threshold;
  2964. u32 dpd_enable;
  2965. u32 set_mcast_bcast_echo;
  2966. u32 atf_strict_sch;
  2967. u32 atf_sched_duration;
  2968. u32 ant_plzn;
  2969. u32 mgmt_retry_limit;
  2970. u32 sensitivity_level;
  2971. u32 signed_txpower_2g;
  2972. u32 signed_txpower_5g;
  2973. u32 enable_per_tid_amsdu;
  2974. u32 enable_per_tid_ampdu;
  2975. u32 cca_threshold;
  2976. u32 rts_fixed_rate;
  2977. u32 pdev_reset;
  2978. u32 wapi_mbssid_offset;
  2979. u32 arp_srcaddr;
  2980. u32 arp_dstaddr;
  2981. };
  2982. #define WMI_PDEV_PARAM_UNSUPPORTED 0
  2983. enum wmi_pdev_param {
  2984. /* TX chain mask */
  2985. WMI_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
  2986. /* RX chain mask */
  2987. WMI_PDEV_PARAM_RX_CHAIN_MASK,
  2988. /* TX power limit for 2G Radio */
  2989. WMI_PDEV_PARAM_TXPOWER_LIMIT2G,
  2990. /* TX power limit for 5G Radio */
  2991. WMI_PDEV_PARAM_TXPOWER_LIMIT5G,
  2992. /* TX power scale */
  2993. WMI_PDEV_PARAM_TXPOWER_SCALE,
  2994. /* Beacon generation mode . 0: host, 1: target */
  2995. WMI_PDEV_PARAM_BEACON_GEN_MODE,
  2996. /* Beacon generation mode . 0: staggered 1: bursted */
  2997. WMI_PDEV_PARAM_BEACON_TX_MODE,
  2998. /*
  2999. * Resource manager off chan mode .
  3000. * 0: turn off off chan mode. 1: turn on offchan mode
  3001. */
  3002. WMI_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
  3003. /*
  3004. * Protection mode:
  3005. * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
  3006. */
  3007. WMI_PDEV_PARAM_PROTECTION_MODE,
  3008. /*
  3009. * Dynamic bandwidth - 0: disable, 1: enable
  3010. *
  3011. * When enabled HW rate control tries different bandwidths when
  3012. * retransmitting frames.
  3013. */
  3014. WMI_PDEV_PARAM_DYNAMIC_BW,
  3015. /* Non aggregrate/ 11g sw retry threshold.0-disable */
  3016. WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
  3017. /* aggregrate sw retry threshold. 0-disable*/
  3018. WMI_PDEV_PARAM_AGG_SW_RETRY_TH,
  3019. /* Station kickout threshold (non of consecutive failures).0-disable */
  3020. WMI_PDEV_PARAM_STA_KICKOUT_TH,
  3021. /* Aggerate size scaling configuration per AC */
  3022. WMI_PDEV_PARAM_AC_AGGRSIZE_SCALING,
  3023. /* LTR enable */
  3024. WMI_PDEV_PARAM_LTR_ENABLE,
  3025. /* LTR latency for BE, in us */
  3026. WMI_PDEV_PARAM_LTR_AC_LATENCY_BE,
  3027. /* LTR latency for BK, in us */
  3028. WMI_PDEV_PARAM_LTR_AC_LATENCY_BK,
  3029. /* LTR latency for VI, in us */
  3030. WMI_PDEV_PARAM_LTR_AC_LATENCY_VI,
  3031. /* LTR latency for VO, in us */
  3032. WMI_PDEV_PARAM_LTR_AC_LATENCY_VO,
  3033. /* LTR AC latency timeout, in ms */
  3034. WMI_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
  3035. /* LTR platform latency override, in us */
  3036. WMI_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
  3037. /* LTR-RX override, in us */
  3038. WMI_PDEV_PARAM_LTR_RX_OVERRIDE,
  3039. /* Tx activity timeout for LTR, in us */
  3040. WMI_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
  3041. /* L1SS state machine enable */
  3042. WMI_PDEV_PARAM_L1SS_ENABLE,
  3043. /* Deep sleep state machine enable */
  3044. WMI_PDEV_PARAM_DSLEEP_ENABLE,
  3045. /* RX buffering flush enable */
  3046. WMI_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
  3047. /* RX buffering matermark */
  3048. WMI_PDEV_PARAM_PCIELP_TXBUF_WATERMARK,
  3049. /* RX buffering timeout enable */
  3050. WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
  3051. /* RX buffering timeout value */
  3052. WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
  3053. /* pdev level stats update period in ms */
  3054. WMI_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
  3055. /* vdev level stats update period in ms */
  3056. WMI_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
  3057. /* peer level stats update period in ms */
  3058. WMI_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
  3059. /* beacon filter status update period */
  3060. WMI_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
  3061. /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
  3062. WMI_PDEV_PARAM_PMF_QOS,
  3063. /* Access category on which ARP frames are sent */
  3064. WMI_PDEV_PARAM_ARP_AC_OVERRIDE,
  3065. /* DCS configuration */
  3066. WMI_PDEV_PARAM_DCS,
  3067. /* Enable/Disable ANI on target */
  3068. WMI_PDEV_PARAM_ANI_ENABLE,
  3069. /* configure the ANI polling period */
  3070. WMI_PDEV_PARAM_ANI_POLL_PERIOD,
  3071. /* configure the ANI listening period */
  3072. WMI_PDEV_PARAM_ANI_LISTEN_PERIOD,
  3073. /* configure OFDM immunity level */
  3074. WMI_PDEV_PARAM_ANI_OFDM_LEVEL,
  3075. /* configure CCK immunity level */
  3076. WMI_PDEV_PARAM_ANI_CCK_LEVEL,
  3077. /* Enable/Disable CDD for 1x1 STAs in rate control module */
  3078. WMI_PDEV_PARAM_DYNTXCHAIN,
  3079. /* Enable/Disable proxy STA */
  3080. WMI_PDEV_PARAM_PROXY_STA,
  3081. /* Enable/Disable low power state when all VDEVs are inactive/idle. */
  3082. WMI_PDEV_PARAM_IDLE_PS_CONFIG,
  3083. /* Enable/Disable power gating sleep */
  3084. WMI_PDEV_PARAM_POWER_GATING_SLEEP,
  3085. };
  3086. enum wmi_10x_pdev_param {
  3087. /* TX chian mask */
  3088. WMI_10X_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
  3089. /* RX chian mask */
  3090. WMI_10X_PDEV_PARAM_RX_CHAIN_MASK,
  3091. /* TX power limit for 2G Radio */
  3092. WMI_10X_PDEV_PARAM_TXPOWER_LIMIT2G,
  3093. /* TX power limit for 5G Radio */
  3094. WMI_10X_PDEV_PARAM_TXPOWER_LIMIT5G,
  3095. /* TX power scale */
  3096. WMI_10X_PDEV_PARAM_TXPOWER_SCALE,
  3097. /* Beacon generation mode . 0: host, 1: target */
  3098. WMI_10X_PDEV_PARAM_BEACON_GEN_MODE,
  3099. /* Beacon generation mode . 0: staggered 1: bursted */
  3100. WMI_10X_PDEV_PARAM_BEACON_TX_MODE,
  3101. /*
  3102. * Resource manager off chan mode .
  3103. * 0: turn off off chan mode. 1: turn on offchan mode
  3104. */
  3105. WMI_10X_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
  3106. /*
  3107. * Protection mode:
  3108. * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
  3109. */
  3110. WMI_10X_PDEV_PARAM_PROTECTION_MODE,
  3111. /* Dynamic bandwidth 0: disable 1: enable */
  3112. WMI_10X_PDEV_PARAM_DYNAMIC_BW,
  3113. /* Non aggregrate/ 11g sw retry threshold.0-disable */
  3114. WMI_10X_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
  3115. /* aggregrate sw retry threshold. 0-disable*/
  3116. WMI_10X_PDEV_PARAM_AGG_SW_RETRY_TH,
  3117. /* Station kickout threshold (non of consecutive failures).0-disable */
  3118. WMI_10X_PDEV_PARAM_STA_KICKOUT_TH,
  3119. /* Aggerate size scaling configuration per AC */
  3120. WMI_10X_PDEV_PARAM_AC_AGGRSIZE_SCALING,
  3121. /* LTR enable */
  3122. WMI_10X_PDEV_PARAM_LTR_ENABLE,
  3123. /* LTR latency for BE, in us */
  3124. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BE,
  3125. /* LTR latency for BK, in us */
  3126. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BK,
  3127. /* LTR latency for VI, in us */
  3128. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VI,
  3129. /* LTR latency for VO, in us */
  3130. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VO,
  3131. /* LTR AC latency timeout, in ms */
  3132. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
  3133. /* LTR platform latency override, in us */
  3134. WMI_10X_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
  3135. /* LTR-RX override, in us */
  3136. WMI_10X_PDEV_PARAM_LTR_RX_OVERRIDE,
  3137. /* Tx activity timeout for LTR, in us */
  3138. WMI_10X_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
  3139. /* L1SS state machine enable */
  3140. WMI_10X_PDEV_PARAM_L1SS_ENABLE,
  3141. /* Deep sleep state machine enable */
  3142. WMI_10X_PDEV_PARAM_DSLEEP_ENABLE,
  3143. /* pdev level stats update period in ms */
  3144. WMI_10X_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
  3145. /* vdev level stats update period in ms */
  3146. WMI_10X_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
  3147. /* peer level stats update period in ms */
  3148. WMI_10X_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
  3149. /* beacon filter status update period */
  3150. WMI_10X_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
  3151. /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
  3152. WMI_10X_PDEV_PARAM_PMF_QOS,
  3153. /* Access category on which ARP and DHCP frames are sent */
  3154. WMI_10X_PDEV_PARAM_ARPDHCP_AC_OVERRIDE,
  3155. /* DCS configuration */
  3156. WMI_10X_PDEV_PARAM_DCS,
  3157. /* Enable/Disable ANI on target */
  3158. WMI_10X_PDEV_PARAM_ANI_ENABLE,
  3159. /* configure the ANI polling period */
  3160. WMI_10X_PDEV_PARAM_ANI_POLL_PERIOD,
  3161. /* configure the ANI listening period */
  3162. WMI_10X_PDEV_PARAM_ANI_LISTEN_PERIOD,
  3163. /* configure OFDM immunity level */
  3164. WMI_10X_PDEV_PARAM_ANI_OFDM_LEVEL,
  3165. /* configure CCK immunity level */
  3166. WMI_10X_PDEV_PARAM_ANI_CCK_LEVEL,
  3167. /* Enable/Disable CDD for 1x1 STAs in rate control module */
  3168. WMI_10X_PDEV_PARAM_DYNTXCHAIN,
  3169. /* Enable/Disable Fast channel reset*/
  3170. WMI_10X_PDEV_PARAM_FAST_CHANNEL_RESET,
  3171. /* Set Bursting DUR */
  3172. WMI_10X_PDEV_PARAM_BURST_DUR,
  3173. /* Set Bursting Enable*/
  3174. WMI_10X_PDEV_PARAM_BURST_ENABLE,
  3175. /* following are available as of firmware 10.2 */
  3176. WMI_10X_PDEV_PARAM_SMART_ANTENNA_DEFAULT_ANTENNA,
  3177. WMI_10X_PDEV_PARAM_IGMPMLD_OVERRIDE,
  3178. WMI_10X_PDEV_PARAM_IGMPMLD_TID,
  3179. WMI_10X_PDEV_PARAM_ANTENNA_GAIN,
  3180. WMI_10X_PDEV_PARAM_RX_DECAP_MODE,
  3181. WMI_10X_PDEV_PARAM_RX_FILTER,
  3182. WMI_10X_PDEV_PARAM_SET_MCAST_TO_UCAST_TID,
  3183. WMI_10X_PDEV_PARAM_PROXY_STA_MODE,
  3184. WMI_10X_PDEV_PARAM_SET_MCAST2UCAST_MODE,
  3185. WMI_10X_PDEV_PARAM_SET_MCAST2UCAST_BUFFER,
  3186. WMI_10X_PDEV_PARAM_REMOVE_MCAST2UCAST_BUFFER,
  3187. WMI_10X_PDEV_PARAM_PEER_STA_PS_STATECHG_ENABLE,
  3188. WMI_10X_PDEV_PARAM_RTS_FIXED_RATE,
  3189. WMI_10X_PDEV_PARAM_CAL_PERIOD
  3190. };
  3191. enum wmi_10_4_pdev_param {
  3192. WMI_10_4_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
  3193. WMI_10_4_PDEV_PARAM_RX_CHAIN_MASK,
  3194. WMI_10_4_PDEV_PARAM_TXPOWER_LIMIT2G,
  3195. WMI_10_4_PDEV_PARAM_TXPOWER_LIMIT5G,
  3196. WMI_10_4_PDEV_PARAM_TXPOWER_SCALE,
  3197. WMI_10_4_PDEV_PARAM_BEACON_GEN_MODE,
  3198. WMI_10_4_PDEV_PARAM_BEACON_TX_MODE,
  3199. WMI_10_4_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
  3200. WMI_10_4_PDEV_PARAM_PROTECTION_MODE,
  3201. WMI_10_4_PDEV_PARAM_DYNAMIC_BW,
  3202. WMI_10_4_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
  3203. WMI_10_4_PDEV_PARAM_AGG_SW_RETRY_TH,
  3204. WMI_10_4_PDEV_PARAM_STA_KICKOUT_TH,
  3205. WMI_10_4_PDEV_PARAM_AC_AGGRSIZE_SCALING,
  3206. WMI_10_4_PDEV_PARAM_LTR_ENABLE,
  3207. WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_BE,
  3208. WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_BK,
  3209. WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_VI,
  3210. WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_VO,
  3211. WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
  3212. WMI_10_4_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
  3213. WMI_10_4_PDEV_PARAM_LTR_RX_OVERRIDE,
  3214. WMI_10_4_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
  3215. WMI_10_4_PDEV_PARAM_L1SS_ENABLE,
  3216. WMI_10_4_PDEV_PARAM_DSLEEP_ENABLE,
  3217. WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
  3218. WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_WATERMARK,
  3219. WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
  3220. WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
  3221. WMI_10_4_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
  3222. WMI_10_4_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
  3223. WMI_10_4_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
  3224. WMI_10_4_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
  3225. WMI_10_4_PDEV_PARAM_PMF_QOS,
  3226. WMI_10_4_PDEV_PARAM_ARP_AC_OVERRIDE,
  3227. WMI_10_4_PDEV_PARAM_DCS,
  3228. WMI_10_4_PDEV_PARAM_ANI_ENABLE,
  3229. WMI_10_4_PDEV_PARAM_ANI_POLL_PERIOD,
  3230. WMI_10_4_PDEV_PARAM_ANI_LISTEN_PERIOD,
  3231. WMI_10_4_PDEV_PARAM_ANI_OFDM_LEVEL,
  3232. WMI_10_4_PDEV_PARAM_ANI_CCK_LEVEL,
  3233. WMI_10_4_PDEV_PARAM_DYNTXCHAIN,
  3234. WMI_10_4_PDEV_PARAM_PROXY_STA,
  3235. WMI_10_4_PDEV_PARAM_IDLE_PS_CONFIG,
  3236. WMI_10_4_PDEV_PARAM_POWER_GATING_SLEEP,
  3237. WMI_10_4_PDEV_PARAM_AGGR_BURST,
  3238. WMI_10_4_PDEV_PARAM_RX_DECAP_MODE,
  3239. WMI_10_4_PDEV_PARAM_FAST_CHANNEL_RESET,
  3240. WMI_10_4_PDEV_PARAM_BURST_DUR,
  3241. WMI_10_4_PDEV_PARAM_BURST_ENABLE,
  3242. WMI_10_4_PDEV_PARAM_SMART_ANTENNA_DEFAULT_ANTENNA,
  3243. WMI_10_4_PDEV_PARAM_IGMPMLD_OVERRIDE,
  3244. WMI_10_4_PDEV_PARAM_IGMPMLD_TID,
  3245. WMI_10_4_PDEV_PARAM_ANTENNA_GAIN,
  3246. WMI_10_4_PDEV_PARAM_RX_FILTER,
  3247. WMI_10_4_PDEV_SET_MCAST_TO_UCAST_TID,
  3248. WMI_10_4_PDEV_PARAM_PROXY_STA_MODE,
  3249. WMI_10_4_PDEV_PARAM_SET_MCAST2UCAST_MODE,
  3250. WMI_10_4_PDEV_PARAM_SET_MCAST2UCAST_BUFFER,
  3251. WMI_10_4_PDEV_PARAM_REMOVE_MCAST2UCAST_BUFFER,
  3252. WMI_10_4_PDEV_PEER_STA_PS_STATECHG_ENABLE,
  3253. WMI_10_4_PDEV_PARAM_IGMPMLD_AC_OVERRIDE,
  3254. WMI_10_4_PDEV_PARAM_BLOCK_INTERBSS,
  3255. WMI_10_4_PDEV_PARAM_SET_DISABLE_RESET_CMDID,
  3256. WMI_10_4_PDEV_PARAM_SET_MSDU_TTL_CMDID,
  3257. WMI_10_4_PDEV_PARAM_SET_PPDU_DURATION_CMDID,
  3258. WMI_10_4_PDEV_PARAM_TXBF_SOUND_PERIOD_CMDID,
  3259. WMI_10_4_PDEV_PARAM_SET_PROMISC_MODE_CMDID,
  3260. WMI_10_4_PDEV_PARAM_SET_BURST_MODE_CMDID,
  3261. WMI_10_4_PDEV_PARAM_EN_STATS,
  3262. WMI_10_4_PDEV_PARAM_MU_GROUP_POLICY,
  3263. WMI_10_4_PDEV_PARAM_NOISE_DETECTION,
  3264. WMI_10_4_PDEV_PARAM_NOISE_THRESHOLD,
  3265. WMI_10_4_PDEV_PARAM_DPD_ENABLE,
  3266. WMI_10_4_PDEV_PARAM_SET_MCAST_BCAST_ECHO,
  3267. WMI_10_4_PDEV_PARAM_ATF_STRICT_SCH,
  3268. WMI_10_4_PDEV_PARAM_ATF_SCHED_DURATION,
  3269. WMI_10_4_PDEV_PARAM_ANT_PLZN,
  3270. WMI_10_4_PDEV_PARAM_MGMT_RETRY_LIMIT,
  3271. WMI_10_4_PDEV_PARAM_SENSITIVITY_LEVEL,
  3272. WMI_10_4_PDEV_PARAM_SIGNED_TXPOWER_2G,
  3273. WMI_10_4_PDEV_PARAM_SIGNED_TXPOWER_5G,
  3274. WMI_10_4_PDEV_PARAM_ENABLE_PER_TID_AMSDU,
  3275. WMI_10_4_PDEV_PARAM_ENABLE_PER_TID_AMPDU,
  3276. WMI_10_4_PDEV_PARAM_CCA_THRESHOLD,
  3277. WMI_10_4_PDEV_PARAM_RTS_FIXED_RATE,
  3278. WMI_10_4_PDEV_PARAM_CAL_PERIOD,
  3279. WMI_10_4_PDEV_PARAM_PDEV_RESET,
  3280. WMI_10_4_PDEV_PARAM_WAPI_MBSSID_OFFSET,
  3281. WMI_10_4_PDEV_PARAM_ARP_SRCADDR,
  3282. WMI_10_4_PDEV_PARAM_ARP_DSTADDR,
  3283. };
  3284. struct wmi_pdev_set_param_cmd {
  3285. __le32 param_id;
  3286. __le32 param_value;
  3287. } __packed;
  3288. /* valid period is 1 ~ 60000ms, unit in millisecond */
  3289. #define WMI_PDEV_PARAM_CAL_PERIOD_MAX 60000
  3290. struct wmi_pdev_get_tpc_config_cmd {
  3291. /* parameter */
  3292. __le32 param;
  3293. } __packed;
  3294. #define WMI_TPC_RATE_MAX 160
  3295. #define WMI_TPC_TX_N_CHAIN 4
  3296. enum wmi_tpc_config_event_flag {
  3297. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_CDD = 0x1,
  3298. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_STBC = 0x2,
  3299. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF = 0x4,
  3300. };
  3301. struct wmi_pdev_tpc_config_event {
  3302. __le32 reg_domain;
  3303. __le32 chan_freq;
  3304. __le32 phy_mode;
  3305. __le32 twice_antenna_reduction;
  3306. __le32 twice_max_rd_power;
  3307. s32 twice_antenna_gain;
  3308. __le32 power_limit;
  3309. __le32 rate_max;
  3310. __le32 num_tx_chain;
  3311. __le32 ctl;
  3312. __le32 flags;
  3313. s8 max_reg_allow_pow[WMI_TPC_TX_N_CHAIN];
  3314. s8 max_reg_allow_pow_agcdd[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  3315. s8 max_reg_allow_pow_agstbc[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  3316. s8 max_reg_allow_pow_agtxbf[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  3317. u8 rates_array[WMI_TPC_RATE_MAX];
  3318. } __packed;
  3319. /* Transmit power scale factor. */
  3320. enum wmi_tp_scale {
  3321. WMI_TP_SCALE_MAX = 0, /* no scaling (default) */
  3322. WMI_TP_SCALE_50 = 1, /* 50% of max (-3 dBm) */
  3323. WMI_TP_SCALE_25 = 2, /* 25% of max (-6 dBm) */
  3324. WMI_TP_SCALE_12 = 3, /* 12% of max (-9 dBm) */
  3325. WMI_TP_SCALE_MIN = 4, /* min, but still on */
  3326. WMI_TP_SCALE_SIZE = 5, /* max num of enum */
  3327. };
  3328. struct wmi_pdev_chanlist_update_event {
  3329. /* number of channels */
  3330. __le32 num_chan;
  3331. /* array of channels */
  3332. struct wmi_channel channel_list[1];
  3333. } __packed;
  3334. #define WMI_MAX_DEBUG_MESG (sizeof(u32) * 32)
  3335. struct wmi_debug_mesg_event {
  3336. /* message buffer, NULL terminated */
  3337. char bufp[WMI_MAX_DEBUG_MESG];
  3338. } __packed;
  3339. enum {
  3340. /* P2P device */
  3341. VDEV_SUBTYPE_P2PDEV = 0,
  3342. /* P2P client */
  3343. VDEV_SUBTYPE_P2PCLI,
  3344. /* P2P GO */
  3345. VDEV_SUBTYPE_P2PGO,
  3346. /* BT3.0 HS */
  3347. VDEV_SUBTYPE_BT,
  3348. };
  3349. struct wmi_pdev_set_channel_cmd {
  3350. /* idnore power , only use flags , mode and freq */
  3351. struct wmi_channel chan;
  3352. } __packed;
  3353. struct wmi_pdev_pktlog_enable_cmd {
  3354. __le32 ev_bitmap;
  3355. } __packed;
  3356. /* Customize the DSCP (bit) to TID (0-7) mapping for QOS */
  3357. #define WMI_DSCP_MAP_MAX (64)
  3358. struct wmi_pdev_set_dscp_tid_map_cmd {
  3359. /* map indicating DSCP to TID conversion */
  3360. __le32 dscp_to_tid_map[WMI_DSCP_MAP_MAX];
  3361. } __packed;
  3362. enum mcast_bcast_rate_id {
  3363. WMI_SET_MCAST_RATE,
  3364. WMI_SET_BCAST_RATE
  3365. };
  3366. struct mcast_bcast_rate {
  3367. enum mcast_bcast_rate_id rate_id;
  3368. __le32 rate;
  3369. } __packed;
  3370. struct wmi_wmm_params {
  3371. __le32 cwmin;
  3372. __le32 cwmax;
  3373. __le32 aifs;
  3374. __le32 txop;
  3375. __le32 acm;
  3376. __le32 no_ack;
  3377. } __packed;
  3378. struct wmi_pdev_set_wmm_params {
  3379. struct wmi_wmm_params ac_be;
  3380. struct wmi_wmm_params ac_bk;
  3381. struct wmi_wmm_params ac_vi;
  3382. struct wmi_wmm_params ac_vo;
  3383. } __packed;
  3384. struct wmi_wmm_params_arg {
  3385. u32 cwmin;
  3386. u32 cwmax;
  3387. u32 aifs;
  3388. u32 txop;
  3389. u32 acm;
  3390. u32 no_ack;
  3391. };
  3392. struct wmi_wmm_params_all_arg {
  3393. struct wmi_wmm_params_arg ac_be;
  3394. struct wmi_wmm_params_arg ac_bk;
  3395. struct wmi_wmm_params_arg ac_vi;
  3396. struct wmi_wmm_params_arg ac_vo;
  3397. };
  3398. struct wmi_pdev_stats_tx {
  3399. /* Num HTT cookies queued to dispatch list */
  3400. __le32 comp_queued;
  3401. /* Num HTT cookies dispatched */
  3402. __le32 comp_delivered;
  3403. /* Num MSDU queued to WAL */
  3404. __le32 msdu_enqued;
  3405. /* Num MPDU queue to WAL */
  3406. __le32 mpdu_enqued;
  3407. /* Num MSDUs dropped by WMM limit */
  3408. __le32 wmm_drop;
  3409. /* Num Local frames queued */
  3410. __le32 local_enqued;
  3411. /* Num Local frames done */
  3412. __le32 local_freed;
  3413. /* Num queued to HW */
  3414. __le32 hw_queued;
  3415. /* Num PPDU reaped from HW */
  3416. __le32 hw_reaped;
  3417. /* Num underruns */
  3418. __le32 underrun;
  3419. /* Num PPDUs cleaned up in TX abort */
  3420. __le32 tx_abort;
  3421. /* Num MPDUs requed by SW */
  3422. __le32 mpdus_requed;
  3423. /* excessive retries */
  3424. __le32 tx_ko;
  3425. /* data hw rate code */
  3426. __le32 data_rc;
  3427. /* Scheduler self triggers */
  3428. __le32 self_triggers;
  3429. /* frames dropped due to excessive sw retries */
  3430. __le32 sw_retry_failure;
  3431. /* illegal rate phy errors */
  3432. __le32 illgl_rate_phy_err;
  3433. /* wal pdev continous xretry */
  3434. __le32 pdev_cont_xretry;
  3435. /* wal pdev continous xretry */
  3436. __le32 pdev_tx_timeout;
  3437. /* wal pdev resets */
  3438. __le32 pdev_resets;
  3439. /* frames dropped due to non-availability of stateless TIDs */
  3440. __le32 stateless_tid_alloc_failure;
  3441. __le32 phy_underrun;
  3442. /* MPDU is more than txop limit */
  3443. __le32 txop_ovf;
  3444. } __packed;
  3445. struct wmi_pdev_stats_rx {
  3446. /* Cnts any change in ring routing mid-ppdu */
  3447. __le32 mid_ppdu_route_change;
  3448. /* Total number of statuses processed */
  3449. __le32 status_rcvd;
  3450. /* Extra frags on rings 0-3 */
  3451. __le32 r0_frags;
  3452. __le32 r1_frags;
  3453. __le32 r2_frags;
  3454. __le32 r3_frags;
  3455. /* MSDUs / MPDUs delivered to HTT */
  3456. __le32 htt_msdus;
  3457. __le32 htt_mpdus;
  3458. /* MSDUs / MPDUs delivered to local stack */
  3459. __le32 loc_msdus;
  3460. __le32 loc_mpdus;
  3461. /* AMSDUs that have more MSDUs than the status ring size */
  3462. __le32 oversize_amsdu;
  3463. /* Number of PHY errors */
  3464. __le32 phy_errs;
  3465. /* Number of PHY errors drops */
  3466. __le32 phy_err_drop;
  3467. /* Number of mpdu errors - FCS, MIC, ENC etc. */
  3468. __le32 mpdu_errs;
  3469. } __packed;
  3470. struct wmi_pdev_stats_peer {
  3471. /* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
  3472. __le32 dummy;
  3473. } __packed;
  3474. enum wmi_stats_id {
  3475. WMI_STAT_PEER = BIT(0),
  3476. WMI_STAT_AP = BIT(1),
  3477. WMI_STAT_PDEV = BIT(2),
  3478. WMI_STAT_VDEV = BIT(3),
  3479. WMI_STAT_BCNFLT = BIT(4),
  3480. WMI_STAT_VDEV_RATE = BIT(5),
  3481. };
  3482. struct wlan_inst_rssi_args {
  3483. __le16 cfg_retry_count;
  3484. __le16 retry_count;
  3485. };
  3486. struct wmi_request_stats_cmd {
  3487. __le32 stats_id;
  3488. __le32 vdev_id;
  3489. /* peer MAC address */
  3490. struct wmi_mac_addr peer_macaddr;
  3491. /* Instantaneous RSSI arguments */
  3492. struct wlan_inst_rssi_args inst_rssi_args;
  3493. } __packed;
  3494. /* Suspend option */
  3495. enum {
  3496. /* suspend */
  3497. WMI_PDEV_SUSPEND,
  3498. /* suspend and disable all interrupts */
  3499. WMI_PDEV_SUSPEND_AND_DISABLE_INTR,
  3500. };
  3501. struct wmi_pdev_suspend_cmd {
  3502. /* suspend option sent to target */
  3503. __le32 suspend_opt;
  3504. } __packed;
  3505. struct wmi_stats_event {
  3506. __le32 stats_id; /* WMI_STAT_ */
  3507. /*
  3508. * number of pdev stats event structures
  3509. * (wmi_pdev_stats) 0 or 1
  3510. */
  3511. __le32 num_pdev_stats;
  3512. /*
  3513. * number of vdev stats event structures
  3514. * (wmi_vdev_stats) 0 or max vdevs
  3515. */
  3516. __le32 num_vdev_stats;
  3517. /*
  3518. * number of peer stats event structures
  3519. * (wmi_peer_stats) 0 or max peers
  3520. */
  3521. __le32 num_peer_stats;
  3522. __le32 num_bcnflt_stats;
  3523. /*
  3524. * followed by
  3525. * num_pdev_stats * size of(struct wmi_pdev_stats)
  3526. * num_vdev_stats * size of(struct wmi_vdev_stats)
  3527. * num_peer_stats * size of(struct wmi_peer_stats)
  3528. *
  3529. * By having a zero sized array, the pointer to data area
  3530. * becomes available without increasing the struct size
  3531. */
  3532. u8 data[0];
  3533. } __packed;
  3534. struct wmi_10_2_stats_event {
  3535. __le32 stats_id; /* %WMI_REQUEST_ */
  3536. __le32 num_pdev_stats;
  3537. __le32 num_pdev_ext_stats;
  3538. __le32 num_vdev_stats;
  3539. __le32 num_peer_stats;
  3540. __le32 num_bcnflt_stats;
  3541. u8 data[0];
  3542. } __packed;
  3543. /*
  3544. * PDEV statistics
  3545. * TODO: add all PDEV stats here
  3546. */
  3547. struct wmi_pdev_stats_base {
  3548. __le32 chan_nf;
  3549. __le32 tx_frame_count;
  3550. __le32 rx_frame_count;
  3551. __le32 rx_clear_count;
  3552. __le32 cycle_count;
  3553. __le32 phy_err_count;
  3554. __le32 chan_tx_pwr;
  3555. } __packed;
  3556. struct wmi_pdev_stats {
  3557. struct wmi_pdev_stats_base base;
  3558. struct wmi_pdev_stats_tx tx;
  3559. struct wmi_pdev_stats_rx rx;
  3560. struct wmi_pdev_stats_peer peer;
  3561. } __packed;
  3562. struct wmi_pdev_stats_extra {
  3563. __le32 ack_rx_bad;
  3564. __le32 rts_bad;
  3565. __le32 rts_good;
  3566. __le32 fcs_bad;
  3567. __le32 no_beacons;
  3568. __le32 mib_int_count;
  3569. } __packed;
  3570. struct wmi_10x_pdev_stats {
  3571. struct wmi_pdev_stats_base base;
  3572. struct wmi_pdev_stats_tx tx;
  3573. struct wmi_pdev_stats_rx rx;
  3574. struct wmi_pdev_stats_peer peer;
  3575. struct wmi_pdev_stats_extra extra;
  3576. } __packed;
  3577. struct wmi_pdev_stats_mem {
  3578. __le32 dram_free;
  3579. __le32 iram_free;
  3580. } __packed;
  3581. struct wmi_10_2_pdev_stats {
  3582. struct wmi_pdev_stats_base base;
  3583. struct wmi_pdev_stats_tx tx;
  3584. __le32 mc_drop;
  3585. struct wmi_pdev_stats_rx rx;
  3586. __le32 pdev_rx_timeout;
  3587. struct wmi_pdev_stats_mem mem;
  3588. struct wmi_pdev_stats_peer peer;
  3589. struct wmi_pdev_stats_extra extra;
  3590. } __packed;
  3591. /*
  3592. * VDEV statistics
  3593. * TODO: add all VDEV stats here
  3594. */
  3595. struct wmi_vdev_stats {
  3596. __le32 vdev_id;
  3597. } __packed;
  3598. /*
  3599. * peer statistics.
  3600. * TODO: add more stats
  3601. */
  3602. struct wmi_peer_stats {
  3603. struct wmi_mac_addr peer_macaddr;
  3604. __le32 peer_rssi;
  3605. __le32 peer_tx_rate;
  3606. } __packed;
  3607. struct wmi_10x_peer_stats {
  3608. struct wmi_peer_stats old;
  3609. __le32 peer_rx_rate;
  3610. } __packed;
  3611. struct wmi_10_2_peer_stats {
  3612. struct wmi_peer_stats old;
  3613. __le32 peer_rx_rate;
  3614. __le32 current_per;
  3615. __le32 retries;
  3616. __le32 tx_rate_count;
  3617. __le32 max_4ms_frame_len;
  3618. __le32 total_sub_frames;
  3619. __le32 tx_bytes;
  3620. __le32 num_pkt_loss_overflow[4];
  3621. __le32 num_pkt_loss_excess_retry[4];
  3622. } __packed;
  3623. struct wmi_10_2_4_peer_stats {
  3624. struct wmi_10_2_peer_stats common;
  3625. __le32 unknown_value; /* FIXME: what is this word? */
  3626. } __packed;
  3627. struct wmi_10_2_pdev_ext_stats {
  3628. __le32 rx_rssi_comb;
  3629. __le32 rx_rssi[4];
  3630. __le32 rx_mcs[10];
  3631. __le32 tx_mcs[10];
  3632. __le32 ack_rssi;
  3633. } __packed;
  3634. struct wmi_vdev_create_cmd {
  3635. __le32 vdev_id;
  3636. __le32 vdev_type;
  3637. __le32 vdev_subtype;
  3638. struct wmi_mac_addr vdev_macaddr;
  3639. } __packed;
  3640. enum wmi_vdev_type {
  3641. WMI_VDEV_TYPE_AP = 1,
  3642. WMI_VDEV_TYPE_STA = 2,
  3643. WMI_VDEV_TYPE_IBSS = 3,
  3644. WMI_VDEV_TYPE_MONITOR = 4,
  3645. };
  3646. enum wmi_vdev_subtype {
  3647. WMI_VDEV_SUBTYPE_NONE = 0,
  3648. WMI_VDEV_SUBTYPE_P2P_DEVICE = 1,
  3649. WMI_VDEV_SUBTYPE_P2P_CLIENT = 2,
  3650. WMI_VDEV_SUBTYPE_P2P_GO = 3,
  3651. };
  3652. /* values for vdev_subtype */
  3653. /* values for vdev_start_request flags */
  3654. /*
  3655. * Indicates that AP VDEV uses hidden ssid. only valid for
  3656. * AP/GO */
  3657. #define WMI_VDEV_START_HIDDEN_SSID (1<<0)
  3658. /*
  3659. * Indicates if robust management frame/management frame
  3660. * protection is enabled. For GO/AP vdevs, it indicates that
  3661. * it may support station/client associations with RMF enabled.
  3662. * For STA/client vdevs, it indicates that sta will
  3663. * associate with AP with RMF enabled. */
  3664. #define WMI_VDEV_START_PMF_ENABLED (1<<1)
  3665. struct wmi_p2p_noa_descriptor {
  3666. __le32 type_count; /* 255: continuous schedule, 0: reserved */
  3667. __le32 duration; /* Absent period duration in micro seconds */
  3668. __le32 interval; /* Absent period interval in micro seconds */
  3669. __le32 start_time; /* 32 bit tsf time when in starts */
  3670. } __packed;
  3671. struct wmi_vdev_start_request_cmd {
  3672. /* WMI channel */
  3673. struct wmi_channel chan;
  3674. /* unique id identifying the VDEV, generated by the caller */
  3675. __le32 vdev_id;
  3676. /* requestor id identifying the caller module */
  3677. __le32 requestor_id;
  3678. /* beacon interval from received beacon */
  3679. __le32 beacon_interval;
  3680. /* DTIM Period from the received beacon */
  3681. __le32 dtim_period;
  3682. /* Flags */
  3683. __le32 flags;
  3684. /* ssid field. Only valid for AP/GO/IBSS/BTAmp VDEV type. */
  3685. struct wmi_ssid ssid;
  3686. /* beacon/probe reponse xmit rate. Applicable for SoftAP. */
  3687. __le32 bcn_tx_rate;
  3688. /* beacon/probe reponse xmit power. Applicable for SoftAP. */
  3689. __le32 bcn_tx_power;
  3690. /* number of p2p NOA descriptor(s) from scan entry */
  3691. __le32 num_noa_descriptors;
  3692. /*
  3693. * Disable H/W ack. This used by WMI_VDEV_RESTART_REQUEST_CMDID.
  3694. * During CAC, Our HW shouldn't ack ditected frames
  3695. */
  3696. __le32 disable_hw_ack;
  3697. /* actual p2p NOA descriptor from scan entry */
  3698. struct wmi_p2p_noa_descriptor noa_descriptors[2];
  3699. } __packed;
  3700. struct wmi_vdev_restart_request_cmd {
  3701. struct wmi_vdev_start_request_cmd vdev_start_request_cmd;
  3702. } __packed;
  3703. struct wmi_vdev_start_request_arg {
  3704. u32 vdev_id;
  3705. struct wmi_channel_arg channel;
  3706. u32 bcn_intval;
  3707. u32 dtim_period;
  3708. u8 *ssid;
  3709. u32 ssid_len;
  3710. u32 bcn_tx_rate;
  3711. u32 bcn_tx_power;
  3712. bool disable_hw_ack;
  3713. bool hidden_ssid;
  3714. bool pmf_enabled;
  3715. };
  3716. struct wmi_vdev_delete_cmd {
  3717. /* unique id identifying the VDEV, generated by the caller */
  3718. __le32 vdev_id;
  3719. } __packed;
  3720. struct wmi_vdev_up_cmd {
  3721. __le32 vdev_id;
  3722. __le32 vdev_assoc_id;
  3723. struct wmi_mac_addr vdev_bssid;
  3724. } __packed;
  3725. struct wmi_vdev_stop_cmd {
  3726. __le32 vdev_id;
  3727. } __packed;
  3728. struct wmi_vdev_down_cmd {
  3729. __le32 vdev_id;
  3730. } __packed;
  3731. struct wmi_vdev_standby_response_cmd {
  3732. /* unique id identifying the VDEV, generated by the caller */
  3733. __le32 vdev_id;
  3734. } __packed;
  3735. struct wmi_vdev_resume_response_cmd {
  3736. /* unique id identifying the VDEV, generated by the caller */
  3737. __le32 vdev_id;
  3738. } __packed;
  3739. struct wmi_vdev_set_param_cmd {
  3740. __le32 vdev_id;
  3741. __le32 param_id;
  3742. __le32 param_value;
  3743. } __packed;
  3744. #define WMI_MAX_KEY_INDEX 3
  3745. #define WMI_MAX_KEY_LEN 32
  3746. #define WMI_KEY_PAIRWISE 0x00
  3747. #define WMI_KEY_GROUP 0x01
  3748. #define WMI_KEY_TX_USAGE 0x02 /* default tx key - static wep */
  3749. struct wmi_key_seq_counter {
  3750. __le32 key_seq_counter_l;
  3751. __le32 key_seq_counter_h;
  3752. } __packed;
  3753. #define WMI_CIPHER_NONE 0x0 /* clear key */
  3754. #define WMI_CIPHER_WEP 0x1
  3755. #define WMI_CIPHER_TKIP 0x2
  3756. #define WMI_CIPHER_AES_OCB 0x3
  3757. #define WMI_CIPHER_AES_CCM 0x4
  3758. #define WMI_CIPHER_WAPI 0x5
  3759. #define WMI_CIPHER_CKIP 0x6
  3760. #define WMI_CIPHER_AES_CMAC 0x7
  3761. struct wmi_vdev_install_key_cmd {
  3762. __le32 vdev_id;
  3763. struct wmi_mac_addr peer_macaddr;
  3764. __le32 key_idx;
  3765. __le32 key_flags;
  3766. __le32 key_cipher; /* %WMI_CIPHER_ */
  3767. struct wmi_key_seq_counter key_rsc_counter;
  3768. struct wmi_key_seq_counter key_global_rsc_counter;
  3769. struct wmi_key_seq_counter key_tsc_counter;
  3770. u8 wpi_key_rsc_counter[16];
  3771. u8 wpi_key_tsc_counter[16];
  3772. __le32 key_len;
  3773. __le32 key_txmic_len;
  3774. __le32 key_rxmic_len;
  3775. /* contains key followed by tx mic followed by rx mic */
  3776. u8 key_data[0];
  3777. } __packed;
  3778. struct wmi_vdev_install_key_arg {
  3779. u32 vdev_id;
  3780. const u8 *macaddr;
  3781. u32 key_idx;
  3782. u32 key_flags;
  3783. u32 key_cipher;
  3784. u32 key_len;
  3785. u32 key_txmic_len;
  3786. u32 key_rxmic_len;
  3787. const void *key_data;
  3788. };
  3789. /*
  3790. * vdev fixed rate format:
  3791. * - preamble - b7:b6 - see WMI_RATE_PREMABLE_
  3792. * - nss - b5:b4 - ss number (0 mean 1ss)
  3793. * - rate_mcs - b3:b0 - as below
  3794. * CCK: 0 - 11Mbps, 1 - 5,5Mbps, 2 - 2Mbps, 3 - 1Mbps,
  3795. * 4 - 11Mbps (s), 5 - 5,5Mbps (s), 6 - 2Mbps (s)
  3796. * OFDM: 0 - 48Mbps, 1 - 24Mbps, 2 - 12Mbps, 3 - 6Mbps,
  3797. * 4 - 54Mbps, 5 - 36Mbps, 6 - 18Mbps, 7 - 9Mbps
  3798. * HT/VHT: MCS index
  3799. */
  3800. /* Preamble types to be used with VDEV fixed rate configuration */
  3801. enum wmi_rate_preamble {
  3802. WMI_RATE_PREAMBLE_OFDM,
  3803. WMI_RATE_PREAMBLE_CCK,
  3804. WMI_RATE_PREAMBLE_HT,
  3805. WMI_RATE_PREAMBLE_VHT,
  3806. };
  3807. /* Value to disable fixed rate setting */
  3808. #define WMI_FIXED_RATE_NONE (0xff)
  3809. struct wmi_vdev_param_map {
  3810. u32 rts_threshold;
  3811. u32 fragmentation_threshold;
  3812. u32 beacon_interval;
  3813. u32 listen_interval;
  3814. u32 multicast_rate;
  3815. u32 mgmt_tx_rate;
  3816. u32 slot_time;
  3817. u32 preamble;
  3818. u32 swba_time;
  3819. u32 wmi_vdev_stats_update_period;
  3820. u32 wmi_vdev_pwrsave_ageout_time;
  3821. u32 wmi_vdev_host_swba_interval;
  3822. u32 dtim_period;
  3823. u32 wmi_vdev_oc_scheduler_air_time_limit;
  3824. u32 wds;
  3825. u32 atim_window;
  3826. u32 bmiss_count_max;
  3827. u32 bmiss_first_bcnt;
  3828. u32 bmiss_final_bcnt;
  3829. u32 feature_wmm;
  3830. u32 chwidth;
  3831. u32 chextoffset;
  3832. u32 disable_htprotection;
  3833. u32 sta_quickkickout;
  3834. u32 mgmt_rate;
  3835. u32 protection_mode;
  3836. u32 fixed_rate;
  3837. u32 sgi;
  3838. u32 ldpc;
  3839. u32 tx_stbc;
  3840. u32 rx_stbc;
  3841. u32 intra_bss_fwd;
  3842. u32 def_keyid;
  3843. u32 nss;
  3844. u32 bcast_data_rate;
  3845. u32 mcast_data_rate;
  3846. u32 mcast_indicate;
  3847. u32 dhcp_indicate;
  3848. u32 unknown_dest_indicate;
  3849. u32 ap_keepalive_min_idle_inactive_time_secs;
  3850. u32 ap_keepalive_max_idle_inactive_time_secs;
  3851. u32 ap_keepalive_max_unresponsive_time_secs;
  3852. u32 ap_enable_nawds;
  3853. u32 mcast2ucast_set;
  3854. u32 enable_rtscts;
  3855. u32 txbf;
  3856. u32 packet_powersave;
  3857. u32 drop_unencry;
  3858. u32 tx_encap_type;
  3859. u32 ap_detect_out_of_sync_sleeping_sta_time_secs;
  3860. u32 rc_num_retries;
  3861. u32 cabq_maxdur;
  3862. u32 mfptest_set;
  3863. u32 rts_fixed_rate;
  3864. u32 vht_sgimask;
  3865. u32 vht80_ratemask;
  3866. u32 early_rx_adjust_enable;
  3867. u32 early_rx_tgt_bmiss_num;
  3868. u32 early_rx_bmiss_sample_cycle;
  3869. u32 early_rx_slop_step;
  3870. u32 early_rx_init_slop;
  3871. u32 early_rx_adjust_pause;
  3872. u32 proxy_sta;
  3873. u32 meru_vc;
  3874. u32 rx_decap_type;
  3875. u32 bw_nss_ratemask;
  3876. };
  3877. #define WMI_VDEV_PARAM_UNSUPPORTED 0
  3878. /* the definition of different VDEV parameters */
  3879. enum wmi_vdev_param {
  3880. /* RTS Threshold */
  3881. WMI_VDEV_PARAM_RTS_THRESHOLD = 0x1,
  3882. /* Fragmentation threshold */
  3883. WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
  3884. /* beacon interval in TUs */
  3885. WMI_VDEV_PARAM_BEACON_INTERVAL,
  3886. /* Listen interval in TUs */
  3887. WMI_VDEV_PARAM_LISTEN_INTERVAL,
  3888. /* muticast rate in Mbps */
  3889. WMI_VDEV_PARAM_MULTICAST_RATE,
  3890. /* management frame rate in Mbps */
  3891. WMI_VDEV_PARAM_MGMT_TX_RATE,
  3892. /* slot time (long vs short) */
  3893. WMI_VDEV_PARAM_SLOT_TIME,
  3894. /* preamble (long vs short) */
  3895. WMI_VDEV_PARAM_PREAMBLE,
  3896. /* SWBA time (time before tbtt in msec) */
  3897. WMI_VDEV_PARAM_SWBA_TIME,
  3898. /* time period for updating VDEV stats */
  3899. WMI_VDEV_STATS_UPDATE_PERIOD,
  3900. /* age out time in msec for frames queued for station in power save */
  3901. WMI_VDEV_PWRSAVE_AGEOUT_TIME,
  3902. /*
  3903. * Host SWBA interval (time in msec before tbtt for SWBA event
  3904. * generation).
  3905. */
  3906. WMI_VDEV_HOST_SWBA_INTERVAL,
  3907. /* DTIM period (specified in units of num beacon intervals) */
  3908. WMI_VDEV_PARAM_DTIM_PERIOD,
  3909. /*
  3910. * scheduler air time limit for this VDEV. used by off chan
  3911. * scheduler.
  3912. */
  3913. WMI_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
  3914. /* enable/dsiable WDS for this VDEV */
  3915. WMI_VDEV_PARAM_WDS,
  3916. /* ATIM Window */
  3917. WMI_VDEV_PARAM_ATIM_WINDOW,
  3918. /* BMISS max */
  3919. WMI_VDEV_PARAM_BMISS_COUNT_MAX,
  3920. /* BMISS first time */
  3921. WMI_VDEV_PARAM_BMISS_FIRST_BCNT,
  3922. /* BMISS final time */
  3923. WMI_VDEV_PARAM_BMISS_FINAL_BCNT,
  3924. /* WMM enables/disabled */
  3925. WMI_VDEV_PARAM_FEATURE_WMM,
  3926. /* Channel width */
  3927. WMI_VDEV_PARAM_CHWIDTH,
  3928. /* Channel Offset */
  3929. WMI_VDEV_PARAM_CHEXTOFFSET,
  3930. /* Disable HT Protection */
  3931. WMI_VDEV_PARAM_DISABLE_HTPROTECTION,
  3932. /* Quick STA Kickout */
  3933. WMI_VDEV_PARAM_STA_QUICKKICKOUT,
  3934. /* Rate to be used with Management frames */
  3935. WMI_VDEV_PARAM_MGMT_RATE,
  3936. /* Protection Mode */
  3937. WMI_VDEV_PARAM_PROTECTION_MODE,
  3938. /* Fixed rate setting */
  3939. WMI_VDEV_PARAM_FIXED_RATE,
  3940. /* Short GI Enable/Disable */
  3941. WMI_VDEV_PARAM_SGI,
  3942. /* Enable LDPC */
  3943. WMI_VDEV_PARAM_LDPC,
  3944. /* Enable Tx STBC */
  3945. WMI_VDEV_PARAM_TX_STBC,
  3946. /* Enable Rx STBC */
  3947. WMI_VDEV_PARAM_RX_STBC,
  3948. /* Intra BSS forwarding */
  3949. WMI_VDEV_PARAM_INTRA_BSS_FWD,
  3950. /* Setting Default xmit key for Vdev */
  3951. WMI_VDEV_PARAM_DEF_KEYID,
  3952. /* NSS width */
  3953. WMI_VDEV_PARAM_NSS,
  3954. /* Set the custom rate for the broadcast data frames */
  3955. WMI_VDEV_PARAM_BCAST_DATA_RATE,
  3956. /* Set the custom rate (rate-code) for multicast data frames */
  3957. WMI_VDEV_PARAM_MCAST_DATA_RATE,
  3958. /* Tx multicast packet indicate Enable/Disable */
  3959. WMI_VDEV_PARAM_MCAST_INDICATE,
  3960. /* Tx DHCP packet indicate Enable/Disable */
  3961. WMI_VDEV_PARAM_DHCP_INDICATE,
  3962. /* Enable host inspection of Tx unicast packet to unknown destination */
  3963. WMI_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
  3964. /* The minimum amount of time AP begins to consider STA inactive */
  3965. WMI_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
  3966. /*
  3967. * An associated STA is considered inactive when there is no recent
  3968. * TX/RX activity and no downlink frames are buffered for it. Once a
  3969. * STA exceeds the maximum idle inactive time, the AP will send an
  3970. * 802.11 data-null as a keep alive to verify the STA is still
  3971. * associated. If the STA does ACK the data-null, or if the data-null
  3972. * is buffered and the STA does not retrieve it, the STA will be
  3973. * considered unresponsive
  3974. * (see WMI_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
  3975. */
  3976. WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
  3977. /*
  3978. * An associated STA is considered unresponsive if there is no recent
  3979. * TX/RX activity and downlink frames are buffered for it. Once a STA
  3980. * exceeds the maximum unresponsive time, the AP will send a
  3981. * WMI_STA_KICKOUT event to the host so the STA can be deleted. */
  3982. WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
  3983. /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
  3984. WMI_VDEV_PARAM_AP_ENABLE_NAWDS,
  3985. /* Enable/Disable RTS-CTS */
  3986. WMI_VDEV_PARAM_ENABLE_RTSCTS,
  3987. /* Enable TXBFee/er */
  3988. WMI_VDEV_PARAM_TXBF,
  3989. /* Set packet power save */
  3990. WMI_VDEV_PARAM_PACKET_POWERSAVE,
  3991. /*
  3992. * Drops un-encrypted packets if eceived in an encrypted connection
  3993. * otherwise forwards to host.
  3994. */
  3995. WMI_VDEV_PARAM_DROP_UNENCRY,
  3996. /*
  3997. * Set the encapsulation type for frames.
  3998. */
  3999. WMI_VDEV_PARAM_TX_ENCAP_TYPE,
  4000. };
  4001. /* the definition of different VDEV parameters */
  4002. enum wmi_10x_vdev_param {
  4003. /* RTS Threshold */
  4004. WMI_10X_VDEV_PARAM_RTS_THRESHOLD = 0x1,
  4005. /* Fragmentation threshold */
  4006. WMI_10X_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
  4007. /* beacon interval in TUs */
  4008. WMI_10X_VDEV_PARAM_BEACON_INTERVAL,
  4009. /* Listen interval in TUs */
  4010. WMI_10X_VDEV_PARAM_LISTEN_INTERVAL,
  4011. /* muticast rate in Mbps */
  4012. WMI_10X_VDEV_PARAM_MULTICAST_RATE,
  4013. /* management frame rate in Mbps */
  4014. WMI_10X_VDEV_PARAM_MGMT_TX_RATE,
  4015. /* slot time (long vs short) */
  4016. WMI_10X_VDEV_PARAM_SLOT_TIME,
  4017. /* preamble (long vs short) */
  4018. WMI_10X_VDEV_PARAM_PREAMBLE,
  4019. /* SWBA time (time before tbtt in msec) */
  4020. WMI_10X_VDEV_PARAM_SWBA_TIME,
  4021. /* time period for updating VDEV stats */
  4022. WMI_10X_VDEV_STATS_UPDATE_PERIOD,
  4023. /* age out time in msec for frames queued for station in power save */
  4024. WMI_10X_VDEV_PWRSAVE_AGEOUT_TIME,
  4025. /*
  4026. * Host SWBA interval (time in msec before tbtt for SWBA event
  4027. * generation).
  4028. */
  4029. WMI_10X_VDEV_HOST_SWBA_INTERVAL,
  4030. /* DTIM period (specified in units of num beacon intervals) */
  4031. WMI_10X_VDEV_PARAM_DTIM_PERIOD,
  4032. /*
  4033. * scheduler air time limit for this VDEV. used by off chan
  4034. * scheduler.
  4035. */
  4036. WMI_10X_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
  4037. /* enable/dsiable WDS for this VDEV */
  4038. WMI_10X_VDEV_PARAM_WDS,
  4039. /* ATIM Window */
  4040. WMI_10X_VDEV_PARAM_ATIM_WINDOW,
  4041. /* BMISS max */
  4042. WMI_10X_VDEV_PARAM_BMISS_COUNT_MAX,
  4043. /* WMM enables/disabled */
  4044. WMI_10X_VDEV_PARAM_FEATURE_WMM,
  4045. /* Channel width */
  4046. WMI_10X_VDEV_PARAM_CHWIDTH,
  4047. /* Channel Offset */
  4048. WMI_10X_VDEV_PARAM_CHEXTOFFSET,
  4049. /* Disable HT Protection */
  4050. WMI_10X_VDEV_PARAM_DISABLE_HTPROTECTION,
  4051. /* Quick STA Kickout */
  4052. WMI_10X_VDEV_PARAM_STA_QUICKKICKOUT,
  4053. /* Rate to be used with Management frames */
  4054. WMI_10X_VDEV_PARAM_MGMT_RATE,
  4055. /* Protection Mode */
  4056. WMI_10X_VDEV_PARAM_PROTECTION_MODE,
  4057. /* Fixed rate setting */
  4058. WMI_10X_VDEV_PARAM_FIXED_RATE,
  4059. /* Short GI Enable/Disable */
  4060. WMI_10X_VDEV_PARAM_SGI,
  4061. /* Enable LDPC */
  4062. WMI_10X_VDEV_PARAM_LDPC,
  4063. /* Enable Tx STBC */
  4064. WMI_10X_VDEV_PARAM_TX_STBC,
  4065. /* Enable Rx STBC */
  4066. WMI_10X_VDEV_PARAM_RX_STBC,
  4067. /* Intra BSS forwarding */
  4068. WMI_10X_VDEV_PARAM_INTRA_BSS_FWD,
  4069. /* Setting Default xmit key for Vdev */
  4070. WMI_10X_VDEV_PARAM_DEF_KEYID,
  4071. /* NSS width */
  4072. WMI_10X_VDEV_PARAM_NSS,
  4073. /* Set the custom rate for the broadcast data frames */
  4074. WMI_10X_VDEV_PARAM_BCAST_DATA_RATE,
  4075. /* Set the custom rate (rate-code) for multicast data frames */
  4076. WMI_10X_VDEV_PARAM_MCAST_DATA_RATE,
  4077. /* Tx multicast packet indicate Enable/Disable */
  4078. WMI_10X_VDEV_PARAM_MCAST_INDICATE,
  4079. /* Tx DHCP packet indicate Enable/Disable */
  4080. WMI_10X_VDEV_PARAM_DHCP_INDICATE,
  4081. /* Enable host inspection of Tx unicast packet to unknown destination */
  4082. WMI_10X_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
  4083. /* The minimum amount of time AP begins to consider STA inactive */
  4084. WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
  4085. /*
  4086. * An associated STA is considered inactive when there is no recent
  4087. * TX/RX activity and no downlink frames are buffered for it. Once a
  4088. * STA exceeds the maximum idle inactive time, the AP will send an
  4089. * 802.11 data-null as a keep alive to verify the STA is still
  4090. * associated. If the STA does ACK the data-null, or if the data-null
  4091. * is buffered and the STA does not retrieve it, the STA will be
  4092. * considered unresponsive
  4093. * (see WMI_10X_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
  4094. */
  4095. WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
  4096. /*
  4097. * An associated STA is considered unresponsive if there is no recent
  4098. * TX/RX activity and downlink frames are buffered for it. Once a STA
  4099. * exceeds the maximum unresponsive time, the AP will send a
  4100. * WMI_10X_STA_KICKOUT event to the host so the STA can be deleted. */
  4101. WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
  4102. /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
  4103. WMI_10X_VDEV_PARAM_AP_ENABLE_NAWDS,
  4104. WMI_10X_VDEV_PARAM_MCAST2UCAST_SET,
  4105. /* Enable/Disable RTS-CTS */
  4106. WMI_10X_VDEV_PARAM_ENABLE_RTSCTS,
  4107. WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,
  4108. /* following are available as of firmware 10.2 */
  4109. WMI_10X_VDEV_PARAM_TX_ENCAP_TYPE,
  4110. WMI_10X_VDEV_PARAM_CABQ_MAXDUR,
  4111. WMI_10X_VDEV_PARAM_MFPTEST_SET,
  4112. WMI_10X_VDEV_PARAM_RTS_FIXED_RATE,
  4113. WMI_10X_VDEV_PARAM_VHT_SGIMASK,
  4114. WMI_10X_VDEV_PARAM_VHT80_RATEMASK,
  4115. };
  4116. enum wmi_10_4_vdev_param {
  4117. WMI_10_4_VDEV_PARAM_RTS_THRESHOLD = 0x1,
  4118. WMI_10_4_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
  4119. WMI_10_4_VDEV_PARAM_BEACON_INTERVAL,
  4120. WMI_10_4_VDEV_PARAM_LISTEN_INTERVAL,
  4121. WMI_10_4_VDEV_PARAM_MULTICAST_RATE,
  4122. WMI_10_4_VDEV_PARAM_MGMT_TX_RATE,
  4123. WMI_10_4_VDEV_PARAM_SLOT_TIME,
  4124. WMI_10_4_VDEV_PARAM_PREAMBLE,
  4125. WMI_10_4_VDEV_PARAM_SWBA_TIME,
  4126. WMI_10_4_VDEV_STATS_UPDATE_PERIOD,
  4127. WMI_10_4_VDEV_PWRSAVE_AGEOUT_TIME,
  4128. WMI_10_4_VDEV_HOST_SWBA_INTERVAL,
  4129. WMI_10_4_VDEV_PARAM_DTIM_PERIOD,
  4130. WMI_10_4_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
  4131. WMI_10_4_VDEV_PARAM_WDS,
  4132. WMI_10_4_VDEV_PARAM_ATIM_WINDOW,
  4133. WMI_10_4_VDEV_PARAM_BMISS_COUNT_MAX,
  4134. WMI_10_4_VDEV_PARAM_BMISS_FIRST_BCNT,
  4135. WMI_10_4_VDEV_PARAM_BMISS_FINAL_BCNT,
  4136. WMI_10_4_VDEV_PARAM_FEATURE_WMM,
  4137. WMI_10_4_VDEV_PARAM_CHWIDTH,
  4138. WMI_10_4_VDEV_PARAM_CHEXTOFFSET,
  4139. WMI_10_4_VDEV_PARAM_DISABLE_HTPROTECTION,
  4140. WMI_10_4_VDEV_PARAM_STA_QUICKKICKOUT,
  4141. WMI_10_4_VDEV_PARAM_MGMT_RATE,
  4142. WMI_10_4_VDEV_PARAM_PROTECTION_MODE,
  4143. WMI_10_4_VDEV_PARAM_FIXED_RATE,
  4144. WMI_10_4_VDEV_PARAM_SGI,
  4145. WMI_10_4_VDEV_PARAM_LDPC,
  4146. WMI_10_4_VDEV_PARAM_TX_STBC,
  4147. WMI_10_4_VDEV_PARAM_RX_STBC,
  4148. WMI_10_4_VDEV_PARAM_INTRA_BSS_FWD,
  4149. WMI_10_4_VDEV_PARAM_DEF_KEYID,
  4150. WMI_10_4_VDEV_PARAM_NSS,
  4151. WMI_10_4_VDEV_PARAM_BCAST_DATA_RATE,
  4152. WMI_10_4_VDEV_PARAM_MCAST_DATA_RATE,
  4153. WMI_10_4_VDEV_PARAM_MCAST_INDICATE,
  4154. WMI_10_4_VDEV_PARAM_DHCP_INDICATE,
  4155. WMI_10_4_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
  4156. WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
  4157. WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
  4158. WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
  4159. WMI_10_4_VDEV_PARAM_AP_ENABLE_NAWDS,
  4160. WMI_10_4_VDEV_PARAM_MCAST2UCAST_SET,
  4161. WMI_10_4_VDEV_PARAM_ENABLE_RTSCTS,
  4162. WMI_10_4_VDEV_PARAM_RC_NUM_RETRIES,
  4163. WMI_10_4_VDEV_PARAM_TXBF,
  4164. WMI_10_4_VDEV_PARAM_PACKET_POWERSAVE,
  4165. WMI_10_4_VDEV_PARAM_DROP_UNENCRY,
  4166. WMI_10_4_VDEV_PARAM_TX_ENCAP_TYPE,
  4167. WMI_10_4_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,
  4168. WMI_10_4_VDEV_PARAM_CABQ_MAXDUR,
  4169. WMI_10_4_VDEV_PARAM_MFPTEST_SET,
  4170. WMI_10_4_VDEV_PARAM_RTS_FIXED_RATE,
  4171. WMI_10_4_VDEV_PARAM_VHT_SGIMASK,
  4172. WMI_10_4_VDEV_PARAM_VHT80_RATEMASK,
  4173. WMI_10_4_VDEV_PARAM_EARLY_RX_ADJUST_ENABLE,
  4174. WMI_10_4_VDEV_PARAM_EARLY_RX_TGT_BMISS_NUM,
  4175. WMI_10_4_VDEV_PARAM_EARLY_RX_BMISS_SAMPLE_CYCLE,
  4176. WMI_10_4_VDEV_PARAM_EARLY_RX_SLOP_STEP,
  4177. WMI_10_4_VDEV_PARAM_EARLY_RX_INIT_SLOP,
  4178. WMI_10_4_VDEV_PARAM_EARLY_RX_ADJUST_PAUSE,
  4179. WMI_10_4_VDEV_PARAM_PROXY_STA,
  4180. WMI_10_4_VDEV_PARAM_MERU_VC,
  4181. WMI_10_4_VDEV_PARAM_RX_DECAP_TYPE,
  4182. WMI_10_4_VDEV_PARAM_BW_NSS_RATEMASK,
  4183. };
  4184. #define WMI_VDEV_PARAM_TXBF_SU_TX_BFEE BIT(0)
  4185. #define WMI_VDEV_PARAM_TXBF_MU_TX_BFEE BIT(1)
  4186. #define WMI_VDEV_PARAM_TXBF_SU_TX_BFER BIT(2)
  4187. #define WMI_VDEV_PARAM_TXBF_MU_TX_BFER BIT(3)
  4188. #define WMI_TXBF_STS_CAP_OFFSET_LSB 4
  4189. #define WMI_TXBF_STS_CAP_OFFSET_MASK 0xf0
  4190. #define WMI_BF_SOUND_DIM_OFFSET_LSB 8
  4191. #define WMI_BF_SOUND_DIM_OFFSET_MASK 0xf00
  4192. /* slot time long */
  4193. #define WMI_VDEV_SLOT_TIME_LONG 0x1
  4194. /* slot time short */
  4195. #define WMI_VDEV_SLOT_TIME_SHORT 0x2
  4196. /* preablbe long */
  4197. #define WMI_VDEV_PREAMBLE_LONG 0x1
  4198. /* preablbe short */
  4199. #define WMI_VDEV_PREAMBLE_SHORT 0x2
  4200. enum wmi_start_event_param {
  4201. WMI_VDEV_RESP_START_EVENT = 0,
  4202. WMI_VDEV_RESP_RESTART_EVENT,
  4203. };
  4204. struct wmi_vdev_start_response_event {
  4205. __le32 vdev_id;
  4206. __le32 req_id;
  4207. __le32 resp_type; /* %WMI_VDEV_RESP_ */
  4208. __le32 status;
  4209. } __packed;
  4210. struct wmi_vdev_standby_req_event {
  4211. /* unique id identifying the VDEV, generated by the caller */
  4212. __le32 vdev_id;
  4213. } __packed;
  4214. struct wmi_vdev_resume_req_event {
  4215. /* unique id identifying the VDEV, generated by the caller */
  4216. __le32 vdev_id;
  4217. } __packed;
  4218. struct wmi_vdev_stopped_event {
  4219. /* unique id identifying the VDEV, generated by the caller */
  4220. __le32 vdev_id;
  4221. } __packed;
  4222. /*
  4223. * common structure used for simple events
  4224. * (stopped, resume_req, standby response)
  4225. */
  4226. struct wmi_vdev_simple_event {
  4227. /* unique id identifying the VDEV, generated by the caller */
  4228. __le32 vdev_id;
  4229. } __packed;
  4230. /* VDEV start response status codes */
  4231. /* VDEV succesfully started */
  4232. #define WMI_INIFIED_VDEV_START_RESPONSE_STATUS_SUCCESS 0x0
  4233. /* requested VDEV not found */
  4234. #define WMI_INIFIED_VDEV_START_RESPONSE_INVALID_VDEVID 0x1
  4235. /* unsupported VDEV combination */
  4236. #define WMI_INIFIED_VDEV_START_RESPONSE_NOT_SUPPORTED 0x2
  4237. /* TODO: please add more comments if you have in-depth information */
  4238. struct wmi_vdev_spectral_conf_cmd {
  4239. __le32 vdev_id;
  4240. /* number of fft samples to send (0 for infinite) */
  4241. __le32 scan_count;
  4242. __le32 scan_period;
  4243. __le32 scan_priority;
  4244. /* number of bins in the FFT: 2^(fft_size - bin_scale) */
  4245. __le32 scan_fft_size;
  4246. __le32 scan_gc_ena;
  4247. __le32 scan_restart_ena;
  4248. __le32 scan_noise_floor_ref;
  4249. __le32 scan_init_delay;
  4250. __le32 scan_nb_tone_thr;
  4251. __le32 scan_str_bin_thr;
  4252. __le32 scan_wb_rpt_mode;
  4253. __le32 scan_rssi_rpt_mode;
  4254. __le32 scan_rssi_thr;
  4255. __le32 scan_pwr_format;
  4256. /* rpt_mode: Format of FFT report to software for spectral scan
  4257. * triggered FFTs:
  4258. * 0: No FFT report (only spectral scan summary report)
  4259. * 1: 2-dword summary of metrics for each completed FFT + spectral
  4260. * scan summary report
  4261. * 2: 2-dword summary of metrics for each completed FFT +
  4262. * 1x- oversampled bins(in-band) per FFT + spectral scan summary
  4263. * report
  4264. * 3: 2-dword summary of metrics for each completed FFT +
  4265. * 2x- oversampled bins (all) per FFT + spectral scan summary
  4266. */
  4267. __le32 scan_rpt_mode;
  4268. __le32 scan_bin_scale;
  4269. __le32 scan_dbm_adj;
  4270. __le32 scan_chn_mask;
  4271. } __packed;
  4272. struct wmi_vdev_spectral_conf_arg {
  4273. u32 vdev_id;
  4274. u32 scan_count;
  4275. u32 scan_period;
  4276. u32 scan_priority;
  4277. u32 scan_fft_size;
  4278. u32 scan_gc_ena;
  4279. u32 scan_restart_ena;
  4280. u32 scan_noise_floor_ref;
  4281. u32 scan_init_delay;
  4282. u32 scan_nb_tone_thr;
  4283. u32 scan_str_bin_thr;
  4284. u32 scan_wb_rpt_mode;
  4285. u32 scan_rssi_rpt_mode;
  4286. u32 scan_rssi_thr;
  4287. u32 scan_pwr_format;
  4288. u32 scan_rpt_mode;
  4289. u32 scan_bin_scale;
  4290. u32 scan_dbm_adj;
  4291. u32 scan_chn_mask;
  4292. };
  4293. #define WMI_SPECTRAL_ENABLE_DEFAULT 0
  4294. #define WMI_SPECTRAL_COUNT_DEFAULT 0
  4295. #define WMI_SPECTRAL_PERIOD_DEFAULT 35
  4296. #define WMI_SPECTRAL_PRIORITY_DEFAULT 1
  4297. #define WMI_SPECTRAL_FFT_SIZE_DEFAULT 7
  4298. #define WMI_SPECTRAL_GC_ENA_DEFAULT 1
  4299. #define WMI_SPECTRAL_RESTART_ENA_DEFAULT 0
  4300. #define WMI_SPECTRAL_NOISE_FLOOR_REF_DEFAULT -96
  4301. #define WMI_SPECTRAL_INIT_DELAY_DEFAULT 80
  4302. #define WMI_SPECTRAL_NB_TONE_THR_DEFAULT 12
  4303. #define WMI_SPECTRAL_STR_BIN_THR_DEFAULT 8
  4304. #define WMI_SPECTRAL_WB_RPT_MODE_DEFAULT 0
  4305. #define WMI_SPECTRAL_RSSI_RPT_MODE_DEFAULT 0
  4306. #define WMI_SPECTRAL_RSSI_THR_DEFAULT 0xf0
  4307. #define WMI_SPECTRAL_PWR_FORMAT_DEFAULT 0
  4308. #define WMI_SPECTRAL_RPT_MODE_DEFAULT 2
  4309. #define WMI_SPECTRAL_BIN_SCALE_DEFAULT 1
  4310. #define WMI_SPECTRAL_DBM_ADJ_DEFAULT 1
  4311. #define WMI_SPECTRAL_CHN_MASK_DEFAULT 1
  4312. struct wmi_vdev_spectral_enable_cmd {
  4313. __le32 vdev_id;
  4314. __le32 trigger_cmd;
  4315. __le32 enable_cmd;
  4316. } __packed;
  4317. #define WMI_SPECTRAL_TRIGGER_CMD_TRIGGER 1
  4318. #define WMI_SPECTRAL_TRIGGER_CMD_CLEAR 2
  4319. #define WMI_SPECTRAL_ENABLE_CMD_ENABLE 1
  4320. #define WMI_SPECTRAL_ENABLE_CMD_DISABLE 2
  4321. /* Beacon processing related command and event structures */
  4322. struct wmi_bcn_tx_hdr {
  4323. __le32 vdev_id;
  4324. __le32 tx_rate;
  4325. __le32 tx_power;
  4326. __le32 bcn_len;
  4327. } __packed;
  4328. struct wmi_bcn_tx_cmd {
  4329. struct wmi_bcn_tx_hdr hdr;
  4330. u8 *bcn[0];
  4331. } __packed;
  4332. struct wmi_bcn_tx_arg {
  4333. u32 vdev_id;
  4334. u32 tx_rate;
  4335. u32 tx_power;
  4336. u32 bcn_len;
  4337. const void *bcn;
  4338. };
  4339. enum wmi_bcn_tx_ref_flags {
  4340. WMI_BCN_TX_REF_FLAG_DTIM_ZERO = 0x1,
  4341. WMI_BCN_TX_REF_FLAG_DELIVER_CAB = 0x2,
  4342. };
  4343. /* TODO: It is unclear why "no antenna" works while any other seemingly valid
  4344. * chainmask yields no beacons on the air at all.
  4345. */
  4346. #define WMI_BCN_TX_REF_DEF_ANTENNA 0
  4347. struct wmi_bcn_tx_ref_cmd {
  4348. __le32 vdev_id;
  4349. __le32 data_len;
  4350. /* physical address of the frame - dma pointer */
  4351. __le32 data_ptr;
  4352. /* id for host to track */
  4353. __le32 msdu_id;
  4354. /* frame ctrl to setup PPDU desc */
  4355. __le32 frame_control;
  4356. /* to control CABQ traffic: WMI_BCN_TX_REF_FLAG_ */
  4357. __le32 flags;
  4358. /* introduced in 10.2 */
  4359. __le32 antenna_mask;
  4360. } __packed;
  4361. /* Beacon filter */
  4362. #define WMI_BCN_FILTER_ALL 0 /* Filter all beacons */
  4363. #define WMI_BCN_FILTER_NONE 1 /* Pass all beacons */
  4364. #define WMI_BCN_FILTER_RSSI 2 /* Pass Beacons RSSI >= RSSI threshold */
  4365. #define WMI_BCN_FILTER_BSSID 3 /* Pass Beacons with matching BSSID */
  4366. #define WMI_BCN_FILTER_SSID 4 /* Pass Beacons with matching SSID */
  4367. struct wmi_bcn_filter_rx_cmd {
  4368. /* Filter ID */
  4369. __le32 bcn_filter_id;
  4370. /* Filter type - wmi_bcn_filter */
  4371. __le32 bcn_filter;
  4372. /* Buffer len */
  4373. __le32 bcn_filter_len;
  4374. /* Filter info (threshold, BSSID, RSSI) */
  4375. u8 *bcn_filter_buf;
  4376. } __packed;
  4377. /* Capabilities and IEs to be passed to firmware */
  4378. struct wmi_bcn_prb_info {
  4379. /* Capabilities */
  4380. __le32 caps;
  4381. /* ERP info */
  4382. __le32 erp;
  4383. /* Advanced capabilities */
  4384. /* HT capabilities */
  4385. /* HT Info */
  4386. /* ibss_dfs */
  4387. /* wpa Info */
  4388. /* rsn Info */
  4389. /* rrm info */
  4390. /* ath_ext */
  4391. /* app IE */
  4392. } __packed;
  4393. struct wmi_bcn_tmpl_cmd {
  4394. /* unique id identifying the VDEV, generated by the caller */
  4395. __le32 vdev_id;
  4396. /* TIM IE offset from the beginning of the template. */
  4397. __le32 tim_ie_offset;
  4398. /* beacon probe capabilities and IEs */
  4399. struct wmi_bcn_prb_info bcn_prb_info;
  4400. /* beacon buffer length */
  4401. __le32 buf_len;
  4402. /* variable length data */
  4403. u8 data[1];
  4404. } __packed;
  4405. struct wmi_prb_tmpl_cmd {
  4406. /* unique id identifying the VDEV, generated by the caller */
  4407. __le32 vdev_id;
  4408. /* beacon probe capabilities and IEs */
  4409. struct wmi_bcn_prb_info bcn_prb_info;
  4410. /* beacon buffer length */
  4411. __le32 buf_len;
  4412. /* Variable length data */
  4413. u8 data[1];
  4414. } __packed;
  4415. enum wmi_sta_ps_mode {
  4416. /* enable power save for the given STA VDEV */
  4417. WMI_STA_PS_MODE_DISABLED = 0,
  4418. /* disable power save for a given STA VDEV */
  4419. WMI_STA_PS_MODE_ENABLED = 1,
  4420. };
  4421. struct wmi_sta_powersave_mode_cmd {
  4422. /* unique id identifying the VDEV, generated by the caller */
  4423. __le32 vdev_id;
  4424. /*
  4425. * Power save mode
  4426. * (see enum wmi_sta_ps_mode)
  4427. */
  4428. __le32 sta_ps_mode;
  4429. } __packed;
  4430. enum wmi_csa_offload_en {
  4431. WMI_CSA_OFFLOAD_DISABLE = 0,
  4432. WMI_CSA_OFFLOAD_ENABLE = 1,
  4433. };
  4434. struct wmi_csa_offload_enable_cmd {
  4435. __le32 vdev_id;
  4436. __le32 csa_offload_enable;
  4437. } __packed;
  4438. struct wmi_csa_offload_chanswitch_cmd {
  4439. __le32 vdev_id;
  4440. struct wmi_channel chan;
  4441. } __packed;
  4442. /*
  4443. * This parameter controls the policy for retrieving frames from AP while the
  4444. * STA is in sleep state.
  4445. *
  4446. * Only takes affect if the sta_ps_mode is enabled
  4447. */
  4448. enum wmi_sta_ps_param_rx_wake_policy {
  4449. /*
  4450. * Wake up when ever there is an RX activity on the VDEV. In this mode
  4451. * the Power save SM(state machine) will come out of sleep by either
  4452. * sending null frame (or) a data frame (with PS==0) in response to TIM
  4453. * bit set in the received beacon frame from AP.
  4454. */
  4455. WMI_STA_PS_RX_WAKE_POLICY_WAKE = 0,
  4456. /*
  4457. * Here the power save state machine will not wakeup in response to TIM
  4458. * bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD
  4459. * configuration setup by WMISET_PS_SET_UAPSD WMI command. When all
  4460. * access categories are delivery-enabled, the station will send a
  4461. * UAPSD trigger frame, otherwise it will send a PS-Poll.
  4462. */
  4463. WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1,
  4464. };
  4465. /*
  4466. * Number of tx frames/beacon that cause the power save SM to wake up.
  4467. *
  4468. * Value 1 causes the SM to wake up for every TX. Value 0 has a special
  4469. * meaning, It will cause the SM to never wake up. This is useful if you want
  4470. * to keep the system to sleep all the time for some kind of test mode . host
  4471. * can change this parameter any time. It will affect at the next tx frame.
  4472. */
  4473. enum wmi_sta_ps_param_tx_wake_threshold {
  4474. WMI_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0,
  4475. WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1,
  4476. /*
  4477. * Values greater than one indicate that many TX attempts per beacon
  4478. * interval before the STA will wake up
  4479. */
  4480. };
  4481. /*
  4482. * The maximum number of PS-Poll frames the FW will send in response to
  4483. * traffic advertised in TIM before waking up (by sending a null frame with PS
  4484. * = 0). Value 0 has a special meaning: there is no maximum count and the FW
  4485. * will send as many PS-Poll as are necessary to retrieve buffered BU. This
  4486. * parameter is used when the RX wake policy is
  4487. * WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD and ignored when the RX wake
  4488. * policy is WMI_STA_PS_RX_WAKE_POLICY_WAKE.
  4489. */
  4490. enum wmi_sta_ps_param_pspoll_count {
  4491. WMI_STA_PS_PSPOLL_COUNT_NO_MAX = 0,
  4492. /*
  4493. * Values greater than 0 indicate the maximum numer of PS-Poll frames
  4494. * FW will send before waking up.
  4495. */
  4496. /* When u-APSD is enabled the firmware will be very reluctant to exit
  4497. * STA PS. This could result in very poor Rx performance with STA doing
  4498. * PS-Poll for each and every buffered frame. This value is a bit
  4499. * arbitrary.
  4500. */
  4501. WMI_STA_PS_PSPOLL_COUNT_UAPSD = 3,
  4502. };
  4503. /*
  4504. * This will include the delivery and trigger enabled state for every AC.
  4505. * This is the negotiated state with AP. The host MLME needs to set this based
  4506. * on AP capability and the state Set in the association request by the
  4507. * station MLME.Lower 8 bits of the value specify the UAPSD configuration.
  4508. */
  4509. #define WMI_UAPSD_AC_TYPE_DELI 0
  4510. #define WMI_UAPSD_AC_TYPE_TRIG 1
  4511. #define WMI_UAPSD_AC_BIT_MASK(ac, type) \
  4512. ((type == WMI_UAPSD_AC_TYPE_DELI) ? (1<<(ac<<1)) : (1<<((ac<<1)+1)))
  4513. enum wmi_sta_ps_param_uapsd {
  4514. WMI_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
  4515. WMI_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
  4516. WMI_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
  4517. WMI_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
  4518. WMI_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
  4519. WMI_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
  4520. WMI_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
  4521. WMI_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
  4522. };
  4523. #define WMI_STA_UAPSD_MAX_INTERVAL_MSEC UINT_MAX
  4524. struct wmi_sta_uapsd_auto_trig_param {
  4525. __le32 wmm_ac;
  4526. __le32 user_priority;
  4527. __le32 service_interval;
  4528. __le32 suspend_interval;
  4529. __le32 delay_interval;
  4530. };
  4531. struct wmi_sta_uapsd_auto_trig_cmd_fixed_param {
  4532. __le32 vdev_id;
  4533. struct wmi_mac_addr peer_macaddr;
  4534. __le32 num_ac;
  4535. };
  4536. struct wmi_sta_uapsd_auto_trig_arg {
  4537. u32 wmm_ac;
  4538. u32 user_priority;
  4539. u32 service_interval;
  4540. u32 suspend_interval;
  4541. u32 delay_interval;
  4542. };
  4543. enum wmi_sta_powersave_param {
  4544. /*
  4545. * Controls how frames are retrievd from AP while STA is sleeping
  4546. *
  4547. * (see enum wmi_sta_ps_param_rx_wake_policy)
  4548. */
  4549. WMI_STA_PS_PARAM_RX_WAKE_POLICY = 0,
  4550. /*
  4551. * The STA will go active after this many TX
  4552. *
  4553. * (see enum wmi_sta_ps_param_tx_wake_threshold)
  4554. */
  4555. WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
  4556. /*
  4557. * Number of PS-Poll to send before STA wakes up
  4558. *
  4559. * (see enum wmi_sta_ps_param_pspoll_count)
  4560. *
  4561. */
  4562. WMI_STA_PS_PARAM_PSPOLL_COUNT = 2,
  4563. /*
  4564. * TX/RX inactivity time in msec before going to sleep.
  4565. *
  4566. * The power save SM will monitor tx/rx activity on the VDEV, if no
  4567. * activity for the specified msec of the parameter the Power save
  4568. * SM will go to sleep.
  4569. */
  4570. WMI_STA_PS_PARAM_INACTIVITY_TIME = 3,
  4571. /*
  4572. * Set uapsd configuration.
  4573. *
  4574. * (see enum wmi_sta_ps_param_uapsd)
  4575. */
  4576. WMI_STA_PS_PARAM_UAPSD = 4,
  4577. };
  4578. struct wmi_sta_powersave_param_cmd {
  4579. __le32 vdev_id;
  4580. __le32 param_id; /* %WMI_STA_PS_PARAM_ */
  4581. __le32 param_value;
  4582. } __packed;
  4583. /* No MIMO power save */
  4584. #define WMI_STA_MIMO_PS_MODE_DISABLE
  4585. /* mimo powersave mode static*/
  4586. #define WMI_STA_MIMO_PS_MODE_STATIC
  4587. /* mimo powersave mode dynamic */
  4588. #define WMI_STA_MIMO_PS_MODE_DYNAMIC
  4589. struct wmi_sta_mimo_ps_mode_cmd {
  4590. /* unique id identifying the VDEV, generated by the caller */
  4591. __le32 vdev_id;
  4592. /* mimo powersave mode as defined above */
  4593. __le32 mimo_pwrsave_mode;
  4594. } __packed;
  4595. /* U-APSD configuration of peer station from (re)assoc request and TSPECs */
  4596. enum wmi_ap_ps_param_uapsd {
  4597. WMI_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
  4598. WMI_AP_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
  4599. WMI_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
  4600. WMI_AP_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
  4601. WMI_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
  4602. WMI_AP_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
  4603. WMI_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
  4604. WMI_AP_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
  4605. };
  4606. /* U-APSD maximum service period of peer station */
  4607. enum wmi_ap_ps_peer_param_max_sp {
  4608. WMI_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0,
  4609. WMI_AP_PS_PEER_PARAM_MAX_SP_2 = 1,
  4610. WMI_AP_PS_PEER_PARAM_MAX_SP_4 = 2,
  4611. WMI_AP_PS_PEER_PARAM_MAX_SP_6 = 3,
  4612. MAX_WMI_AP_PS_PEER_PARAM_MAX_SP,
  4613. };
  4614. /*
  4615. * AP power save parameter
  4616. * Set a power save specific parameter for a peer station
  4617. */
  4618. enum wmi_ap_ps_peer_param {
  4619. /* Set uapsd configuration for a given peer.
  4620. *
  4621. * Include the delivery and trigger enabled state for every AC.
  4622. * The host MLME needs to set this based on AP capability and stations
  4623. * request Set in the association request received from the station.
  4624. *
  4625. * Lower 8 bits of the value specify the UAPSD configuration.
  4626. *
  4627. * (see enum wmi_ap_ps_param_uapsd)
  4628. * The default value is 0.
  4629. */
  4630. WMI_AP_PS_PEER_PARAM_UAPSD = 0,
  4631. /*
  4632. * Set the service period for a UAPSD capable station
  4633. *
  4634. * The service period from wme ie in the (re)assoc request frame.
  4635. *
  4636. * (see enum wmi_ap_ps_peer_param_max_sp)
  4637. */
  4638. WMI_AP_PS_PEER_PARAM_MAX_SP = 1,
  4639. /* Time in seconds for aging out buffered frames for STA in PS */
  4640. WMI_AP_PS_PEER_PARAM_AGEOUT_TIME = 2,
  4641. };
  4642. struct wmi_ap_ps_peer_cmd {
  4643. /* unique id identifying the VDEV, generated by the caller */
  4644. __le32 vdev_id;
  4645. /* peer MAC address */
  4646. struct wmi_mac_addr peer_macaddr;
  4647. /* AP powersave param (see enum wmi_ap_ps_peer_param) */
  4648. __le32 param_id;
  4649. /* AP powersave param value */
  4650. __le32 param_value;
  4651. } __packed;
  4652. /* 128 clients = 4 words */
  4653. #define WMI_TIM_BITMAP_ARRAY_SIZE 4
  4654. struct wmi_tim_info {
  4655. __le32 tim_len;
  4656. __le32 tim_mcast;
  4657. __le32 tim_bitmap[WMI_TIM_BITMAP_ARRAY_SIZE];
  4658. __le32 tim_changed;
  4659. __le32 tim_num_ps_pending;
  4660. } __packed;
  4661. struct wmi_tim_info_arg {
  4662. __le32 tim_len;
  4663. __le32 tim_mcast;
  4664. const __le32 *tim_bitmap;
  4665. __le32 tim_changed;
  4666. __le32 tim_num_ps_pending;
  4667. } __packed;
  4668. /* Maximum number of NOA Descriptors supported */
  4669. #define WMI_P2P_MAX_NOA_DESCRIPTORS 4
  4670. #define WMI_P2P_OPPPS_ENABLE_BIT BIT(0)
  4671. #define WMI_P2P_OPPPS_CTWINDOW_OFFSET 1
  4672. #define WMI_P2P_NOA_CHANGED_BIT BIT(0)
  4673. struct wmi_p2p_noa_info {
  4674. /* Bit 0 - Flag to indicate an update in NOA schedule
  4675. Bits 7-1 - Reserved */
  4676. u8 changed;
  4677. /* NOA index */
  4678. u8 index;
  4679. /* Bit 0 - Opp PS state of the AP
  4680. Bits 1-7 - Ctwindow in TUs */
  4681. u8 ctwindow_oppps;
  4682. /* Number of NOA descriptors */
  4683. u8 num_descriptors;
  4684. struct wmi_p2p_noa_descriptor descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS];
  4685. } __packed;
  4686. struct wmi_bcn_info {
  4687. struct wmi_tim_info tim_info;
  4688. struct wmi_p2p_noa_info p2p_noa_info;
  4689. } __packed;
  4690. struct wmi_host_swba_event {
  4691. __le32 vdev_map;
  4692. struct wmi_bcn_info bcn_info[0];
  4693. } __packed;
  4694. /* 16 words = 512 client + 1 word = for guard */
  4695. #define WMI_10_4_TIM_BITMAP_ARRAY_SIZE 17
  4696. struct wmi_10_4_tim_info {
  4697. __le32 tim_len;
  4698. __le32 tim_mcast;
  4699. __le32 tim_bitmap[WMI_10_4_TIM_BITMAP_ARRAY_SIZE];
  4700. __le32 tim_changed;
  4701. __le32 tim_num_ps_pending;
  4702. } __packed;
  4703. #define WMI_10_4_P2P_MAX_NOA_DESCRIPTORS 1
  4704. struct wmi_10_4_p2p_noa_info {
  4705. /* Bit 0 - Flag to indicate an update in NOA schedule
  4706. * Bits 7-1 - Reserved
  4707. */
  4708. u8 changed;
  4709. /* NOA index */
  4710. u8 index;
  4711. /* Bit 0 - Opp PS state of the AP
  4712. * Bits 1-7 - Ctwindow in TUs
  4713. */
  4714. u8 ctwindow_oppps;
  4715. /* Number of NOA descriptors */
  4716. u8 num_descriptors;
  4717. struct wmi_p2p_noa_descriptor
  4718. noa_descriptors[WMI_10_4_P2P_MAX_NOA_DESCRIPTORS];
  4719. } __packed;
  4720. struct wmi_10_4_bcn_info {
  4721. struct wmi_10_4_tim_info tim_info;
  4722. struct wmi_10_4_p2p_noa_info p2p_noa_info;
  4723. } __packed;
  4724. struct wmi_10_4_host_swba_event {
  4725. __le32 vdev_map;
  4726. struct wmi_10_4_bcn_info bcn_info[0];
  4727. } __packed;
  4728. #define WMI_MAX_AP_VDEV 16
  4729. struct wmi_tbtt_offset_event {
  4730. __le32 vdev_map;
  4731. __le32 tbttoffset_list[WMI_MAX_AP_VDEV];
  4732. } __packed;
  4733. struct wmi_peer_create_cmd {
  4734. __le32 vdev_id;
  4735. struct wmi_mac_addr peer_macaddr;
  4736. } __packed;
  4737. enum wmi_peer_type {
  4738. WMI_PEER_TYPE_DEFAULT = 0,
  4739. WMI_PEER_TYPE_BSS = 1,
  4740. WMI_PEER_TYPE_TDLS = 2,
  4741. };
  4742. struct wmi_peer_delete_cmd {
  4743. __le32 vdev_id;
  4744. struct wmi_mac_addr peer_macaddr;
  4745. } __packed;
  4746. struct wmi_peer_flush_tids_cmd {
  4747. __le32 vdev_id;
  4748. struct wmi_mac_addr peer_macaddr;
  4749. __le32 peer_tid_bitmap;
  4750. } __packed;
  4751. struct wmi_fixed_rate {
  4752. /*
  4753. * rate mode . 0: disable fixed rate (auto rate)
  4754. * 1: legacy (non 11n) rate specified as ieee rate 2*Mbps
  4755. * 2: ht20 11n rate specified as mcs index
  4756. * 3: ht40 11n rate specified as mcs index
  4757. */
  4758. __le32 rate_mode;
  4759. /*
  4760. * 4 rate values for 4 rate series. series 0 is stored in byte 0 (LSB)
  4761. * and series 3 is stored at byte 3 (MSB)
  4762. */
  4763. __le32 rate_series;
  4764. /*
  4765. * 4 retry counts for 4 rate series. retry count for rate 0 is stored
  4766. * in byte 0 (LSB) and retry count for rate 3 is stored at byte 3
  4767. * (MSB)
  4768. */
  4769. __le32 rate_retries;
  4770. } __packed;
  4771. struct wmi_peer_fixed_rate_cmd {
  4772. /* unique id identifying the VDEV, generated by the caller */
  4773. __le32 vdev_id;
  4774. /* peer MAC address */
  4775. struct wmi_mac_addr peer_macaddr;
  4776. /* fixed rate */
  4777. struct wmi_fixed_rate peer_fixed_rate;
  4778. } __packed;
  4779. #define WMI_MGMT_TID 17
  4780. struct wmi_addba_clear_resp_cmd {
  4781. /* unique id identifying the VDEV, generated by the caller */
  4782. __le32 vdev_id;
  4783. /* peer MAC address */
  4784. struct wmi_mac_addr peer_macaddr;
  4785. } __packed;
  4786. struct wmi_addba_send_cmd {
  4787. /* unique id identifying the VDEV, generated by the caller */
  4788. __le32 vdev_id;
  4789. /* peer MAC address */
  4790. struct wmi_mac_addr peer_macaddr;
  4791. /* Tid number */
  4792. __le32 tid;
  4793. /* Buffer/Window size*/
  4794. __le32 buffersize;
  4795. } __packed;
  4796. struct wmi_delba_send_cmd {
  4797. /* unique id identifying the VDEV, generated by the caller */
  4798. __le32 vdev_id;
  4799. /* peer MAC address */
  4800. struct wmi_mac_addr peer_macaddr;
  4801. /* Tid number */
  4802. __le32 tid;
  4803. /* Is Initiator */
  4804. __le32 initiator;
  4805. /* Reason code */
  4806. __le32 reasoncode;
  4807. } __packed;
  4808. struct wmi_addba_setresponse_cmd {
  4809. /* unique id identifying the vdev, generated by the caller */
  4810. __le32 vdev_id;
  4811. /* peer mac address */
  4812. struct wmi_mac_addr peer_macaddr;
  4813. /* Tid number */
  4814. __le32 tid;
  4815. /* status code */
  4816. __le32 statuscode;
  4817. } __packed;
  4818. struct wmi_send_singleamsdu_cmd {
  4819. /* unique id identifying the vdev, generated by the caller */
  4820. __le32 vdev_id;
  4821. /* peer mac address */
  4822. struct wmi_mac_addr peer_macaddr;
  4823. /* Tid number */
  4824. __le32 tid;
  4825. } __packed;
  4826. enum wmi_peer_smps_state {
  4827. WMI_PEER_SMPS_PS_NONE = 0x0,
  4828. WMI_PEER_SMPS_STATIC = 0x1,
  4829. WMI_PEER_SMPS_DYNAMIC = 0x2
  4830. };
  4831. enum wmi_peer_chwidth {
  4832. WMI_PEER_CHWIDTH_20MHZ = 0,
  4833. WMI_PEER_CHWIDTH_40MHZ = 1,
  4834. WMI_PEER_CHWIDTH_80MHZ = 2,
  4835. };
  4836. enum wmi_peer_param {
  4837. WMI_PEER_SMPS_STATE = 0x1, /* see %wmi_peer_smps_state */
  4838. WMI_PEER_AMPDU = 0x2,
  4839. WMI_PEER_AUTHORIZE = 0x3,
  4840. WMI_PEER_CHAN_WIDTH = 0x4,
  4841. WMI_PEER_NSS = 0x5,
  4842. WMI_PEER_USE_4ADDR = 0x6,
  4843. WMI_PEER_DUMMY_VAR = 0xff, /* dummy parameter for STA PS workaround */
  4844. };
  4845. struct wmi_peer_set_param_cmd {
  4846. __le32 vdev_id;
  4847. struct wmi_mac_addr peer_macaddr;
  4848. __le32 param_id;
  4849. __le32 param_value;
  4850. } __packed;
  4851. #define MAX_SUPPORTED_RATES 128
  4852. struct wmi_rate_set {
  4853. /* total number of rates */
  4854. __le32 num_rates;
  4855. /*
  4856. * rates (each 8bit value) packed into a 32 bit word.
  4857. * the rates are filled from least significant byte to most
  4858. * significant byte.
  4859. */
  4860. __le32 rates[(MAX_SUPPORTED_RATES/4)+1];
  4861. } __packed;
  4862. struct wmi_rate_set_arg {
  4863. unsigned int num_rates;
  4864. u8 rates[MAX_SUPPORTED_RATES];
  4865. };
  4866. /*
  4867. * NOTE: It would bea good idea to represent the Tx MCS
  4868. * info in one word and Rx in another word. This is split
  4869. * into multiple words for convenience
  4870. */
  4871. struct wmi_vht_rate_set {
  4872. __le32 rx_max_rate; /* Max Rx data rate */
  4873. __le32 rx_mcs_set; /* Negotiated RX VHT rates */
  4874. __le32 tx_max_rate; /* Max Tx data rate */
  4875. __le32 tx_mcs_set; /* Negotiated TX VHT rates */
  4876. } __packed;
  4877. struct wmi_vht_rate_set_arg {
  4878. u32 rx_max_rate;
  4879. u32 rx_mcs_set;
  4880. u32 tx_max_rate;
  4881. u32 tx_mcs_set;
  4882. };
  4883. struct wmi_peer_set_rates_cmd {
  4884. /* peer MAC address */
  4885. struct wmi_mac_addr peer_macaddr;
  4886. /* legacy rate set */
  4887. struct wmi_rate_set peer_legacy_rates;
  4888. /* ht rate set */
  4889. struct wmi_rate_set peer_ht_rates;
  4890. } __packed;
  4891. struct wmi_peer_set_q_empty_callback_cmd {
  4892. /* unique id identifying the VDEV, generated by the caller */
  4893. __le32 vdev_id;
  4894. /* peer MAC address */
  4895. struct wmi_mac_addr peer_macaddr;
  4896. __le32 callback_enable;
  4897. } __packed;
  4898. #define WMI_PEER_AUTH 0x00000001
  4899. #define WMI_PEER_QOS 0x00000002
  4900. #define WMI_PEER_NEED_PTK_4_WAY 0x00000004
  4901. #define WMI_PEER_NEED_GTK_2_WAY 0x00000010
  4902. #define WMI_PEER_APSD 0x00000800
  4903. #define WMI_PEER_HT 0x00001000
  4904. #define WMI_PEER_40MHZ 0x00002000
  4905. #define WMI_PEER_STBC 0x00008000
  4906. #define WMI_PEER_LDPC 0x00010000
  4907. #define WMI_PEER_DYN_MIMOPS 0x00020000
  4908. #define WMI_PEER_STATIC_MIMOPS 0x00040000
  4909. #define WMI_PEER_SPATIAL_MUX 0x00200000
  4910. #define WMI_PEER_VHT 0x02000000
  4911. #define WMI_PEER_80MHZ 0x04000000
  4912. #define WMI_PEER_VHT_2G 0x08000000
  4913. /*
  4914. * Peer rate capabilities.
  4915. *
  4916. * This is of interest to the ratecontrol
  4917. * module which resides in the firmware. The bit definitions are
  4918. * consistent with that defined in if_athrate.c.
  4919. */
  4920. #define WMI_RC_DS_FLAG 0x01
  4921. #define WMI_RC_CW40_FLAG 0x02
  4922. #define WMI_RC_SGI_FLAG 0x04
  4923. #define WMI_RC_HT_FLAG 0x08
  4924. #define WMI_RC_RTSCTS_FLAG 0x10
  4925. #define WMI_RC_TX_STBC_FLAG 0x20
  4926. #define WMI_RC_RX_STBC_FLAG 0xC0
  4927. #define WMI_RC_RX_STBC_FLAG_S 6
  4928. #define WMI_RC_WEP_TKIP_FLAG 0x100
  4929. #define WMI_RC_TS_FLAG 0x200
  4930. #define WMI_RC_UAPSD_FLAG 0x400
  4931. /* Maximum listen interval supported by hw in units of beacon interval */
  4932. #define ATH10K_MAX_HW_LISTEN_INTERVAL 5
  4933. struct wmi_common_peer_assoc_complete_cmd {
  4934. struct wmi_mac_addr peer_macaddr;
  4935. __le32 vdev_id;
  4936. __le32 peer_new_assoc; /* 1=assoc, 0=reassoc */
  4937. __le32 peer_associd; /* 16 LSBs */
  4938. __le32 peer_flags;
  4939. __le32 peer_caps; /* 16 LSBs */
  4940. __le32 peer_listen_intval;
  4941. __le32 peer_ht_caps;
  4942. __le32 peer_max_mpdu;
  4943. __le32 peer_mpdu_density; /* 0..16 */
  4944. __le32 peer_rate_caps;
  4945. struct wmi_rate_set peer_legacy_rates;
  4946. struct wmi_rate_set peer_ht_rates;
  4947. __le32 peer_nss; /* num of spatial streams */
  4948. __le32 peer_vht_caps;
  4949. __le32 peer_phymode;
  4950. struct wmi_vht_rate_set peer_vht_rates;
  4951. };
  4952. struct wmi_main_peer_assoc_complete_cmd {
  4953. struct wmi_common_peer_assoc_complete_cmd cmd;
  4954. /* HT Operation Element of the peer. Five bytes packed in 2
  4955. * INT32 array and filled from lsb to msb. */
  4956. __le32 peer_ht_info[2];
  4957. } __packed;
  4958. struct wmi_10_1_peer_assoc_complete_cmd {
  4959. struct wmi_common_peer_assoc_complete_cmd cmd;
  4960. } __packed;
  4961. #define WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX_LSB 0
  4962. #define WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX_MASK 0x0f
  4963. #define WMI_PEER_ASSOC_INFO0_MAX_NSS_LSB 4
  4964. #define WMI_PEER_ASSOC_INFO0_MAX_NSS_MASK 0xf0
  4965. struct wmi_10_2_peer_assoc_complete_cmd {
  4966. struct wmi_common_peer_assoc_complete_cmd cmd;
  4967. __le32 info0; /* WMI_PEER_ASSOC_INFO0_ */
  4968. } __packed;
  4969. struct wmi_peer_assoc_complete_arg {
  4970. u8 addr[ETH_ALEN];
  4971. u32 vdev_id;
  4972. bool peer_reassoc;
  4973. u16 peer_aid;
  4974. u32 peer_flags; /* see %WMI_PEER_ */
  4975. u16 peer_caps;
  4976. u32 peer_listen_intval;
  4977. u32 peer_ht_caps;
  4978. u32 peer_max_mpdu;
  4979. u32 peer_mpdu_density; /* 0..16 */
  4980. u32 peer_rate_caps; /* see %WMI_RC_ */
  4981. struct wmi_rate_set_arg peer_legacy_rates;
  4982. struct wmi_rate_set_arg peer_ht_rates;
  4983. u32 peer_num_spatial_streams;
  4984. u32 peer_vht_caps;
  4985. enum wmi_phy_mode peer_phymode;
  4986. struct wmi_vht_rate_set_arg peer_vht_rates;
  4987. };
  4988. struct wmi_peer_add_wds_entry_cmd {
  4989. /* peer MAC address */
  4990. struct wmi_mac_addr peer_macaddr;
  4991. /* wds MAC addr */
  4992. struct wmi_mac_addr wds_macaddr;
  4993. } __packed;
  4994. struct wmi_peer_remove_wds_entry_cmd {
  4995. /* wds MAC addr */
  4996. struct wmi_mac_addr wds_macaddr;
  4997. } __packed;
  4998. struct wmi_peer_q_empty_callback_event {
  4999. /* peer MAC address */
  5000. struct wmi_mac_addr peer_macaddr;
  5001. } __packed;
  5002. /*
  5003. * Channel info WMI event
  5004. */
  5005. struct wmi_chan_info_event {
  5006. __le32 err_code;
  5007. __le32 freq;
  5008. __le32 cmd_flags;
  5009. __le32 noise_floor;
  5010. __le32 rx_clear_count;
  5011. __le32 cycle_count;
  5012. } __packed;
  5013. struct wmi_10_4_chan_info_event {
  5014. __le32 err_code;
  5015. __le32 freq;
  5016. __le32 cmd_flags;
  5017. __le32 noise_floor;
  5018. __le32 rx_clear_count;
  5019. __le32 cycle_count;
  5020. __le32 chan_tx_pwr_range;
  5021. __le32 chan_tx_pwr_tp;
  5022. __le32 rx_frame_count;
  5023. } __packed;
  5024. struct wmi_peer_sta_kickout_event {
  5025. struct wmi_mac_addr peer_macaddr;
  5026. } __packed;
  5027. #define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0)
  5028. #define WMI_CHAN_INFO_FLAG_PRE_COMPLETE BIT(1)
  5029. /* Beacon filter wmi command info */
  5030. #define BCN_FLT_MAX_SUPPORTED_IES 256
  5031. #define BCN_FLT_MAX_ELEMS_IE_LIST (BCN_FLT_MAX_SUPPORTED_IES / 32)
  5032. struct bss_bcn_stats {
  5033. __le32 vdev_id;
  5034. __le32 bss_bcnsdropped;
  5035. __le32 bss_bcnsdelivered;
  5036. } __packed;
  5037. struct bcn_filter_stats {
  5038. __le32 bcns_dropped;
  5039. __le32 bcns_delivered;
  5040. __le32 activefilters;
  5041. struct bss_bcn_stats bss_stats;
  5042. } __packed;
  5043. struct wmi_add_bcn_filter_cmd {
  5044. u32 vdev_id;
  5045. u32 ie_map[BCN_FLT_MAX_ELEMS_IE_LIST];
  5046. } __packed;
  5047. enum wmi_sta_keepalive_method {
  5048. WMI_STA_KEEPALIVE_METHOD_NULL_FRAME = 1,
  5049. WMI_STA_KEEPALIVE_METHOD_UNSOLICITATED_ARP_RESPONSE = 2,
  5050. };
  5051. #define WMI_STA_KEEPALIVE_INTERVAL_DISABLE 0
  5052. /* Firmware crashes if keepalive interval exceeds this limit */
  5053. #define WMI_STA_KEEPALIVE_INTERVAL_MAX_SECONDS 0xffff
  5054. /* note: ip4 addresses are in network byte order, i.e. big endian */
  5055. struct wmi_sta_keepalive_arp_resp {
  5056. __be32 src_ip4_addr;
  5057. __be32 dest_ip4_addr;
  5058. struct wmi_mac_addr dest_mac_addr;
  5059. } __packed;
  5060. struct wmi_sta_keepalive_cmd {
  5061. __le32 vdev_id;
  5062. __le32 enabled;
  5063. __le32 method; /* WMI_STA_KEEPALIVE_METHOD_ */
  5064. __le32 interval; /* in seconds */
  5065. struct wmi_sta_keepalive_arp_resp arp_resp;
  5066. } __packed;
  5067. struct wmi_sta_keepalive_arg {
  5068. u32 vdev_id;
  5069. u32 enabled;
  5070. u32 method;
  5071. u32 interval;
  5072. __be32 src_ip4_addr;
  5073. __be32 dest_ip4_addr;
  5074. const u8 dest_mac_addr[ETH_ALEN];
  5075. };
  5076. enum wmi_force_fw_hang_type {
  5077. WMI_FORCE_FW_HANG_ASSERT = 1,
  5078. WMI_FORCE_FW_HANG_NO_DETECT,
  5079. WMI_FORCE_FW_HANG_CTRL_EP_FULL,
  5080. WMI_FORCE_FW_HANG_EMPTY_POINT,
  5081. WMI_FORCE_FW_HANG_STACK_OVERFLOW,
  5082. WMI_FORCE_FW_HANG_INFINITE_LOOP,
  5083. };
  5084. #define WMI_FORCE_FW_HANG_RANDOM_TIME 0xFFFFFFFF
  5085. struct wmi_force_fw_hang_cmd {
  5086. __le32 type;
  5087. __le32 delay_ms;
  5088. } __packed;
  5089. enum ath10k_dbglog_level {
  5090. ATH10K_DBGLOG_LEVEL_VERBOSE = 0,
  5091. ATH10K_DBGLOG_LEVEL_INFO = 1,
  5092. ATH10K_DBGLOG_LEVEL_WARN = 2,
  5093. ATH10K_DBGLOG_LEVEL_ERR = 3,
  5094. };
  5095. /* VAP ids to enable dbglog */
  5096. #define ATH10K_DBGLOG_CFG_VAP_LOG_LSB 0
  5097. #define ATH10K_DBGLOG_CFG_VAP_LOG_MASK 0x0000ffff
  5098. /* to enable dbglog in the firmware */
  5099. #define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_LSB 16
  5100. #define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_MASK 0x00010000
  5101. /* timestamp resolution */
  5102. #define ATH10K_DBGLOG_CFG_RESOLUTION_LSB 17
  5103. #define ATH10K_DBGLOG_CFG_RESOLUTION_MASK 0x000E0000
  5104. /* number of queued messages before sending them to the host */
  5105. #define ATH10K_DBGLOG_CFG_REPORT_SIZE_LSB 20
  5106. #define ATH10K_DBGLOG_CFG_REPORT_SIZE_MASK 0x0ff00000
  5107. /*
  5108. * Log levels to enable. This defines the minimum level to enable, this is
  5109. * not a bitmask. See enum ath10k_dbglog_level for the values.
  5110. */
  5111. #define ATH10K_DBGLOG_CFG_LOG_LVL_LSB 28
  5112. #define ATH10K_DBGLOG_CFG_LOG_LVL_MASK 0x70000000
  5113. /*
  5114. * Note: this is a cleaned up version of a struct firmware uses. For
  5115. * example, config_valid was hidden inside an array.
  5116. */
  5117. struct wmi_dbglog_cfg_cmd {
  5118. /* bitmask to hold mod id config*/
  5119. __le32 module_enable;
  5120. /* see ATH10K_DBGLOG_CFG_ */
  5121. __le32 config_enable;
  5122. /* mask of module id bits to be changed */
  5123. __le32 module_valid;
  5124. /* mask of config bits to be changed, see ATH10K_DBGLOG_CFG_ */
  5125. __le32 config_valid;
  5126. } __packed;
  5127. enum wmi_roam_reason {
  5128. WMI_ROAM_REASON_BETTER_AP = 1,
  5129. WMI_ROAM_REASON_BEACON_MISS = 2,
  5130. WMI_ROAM_REASON_LOW_RSSI = 3,
  5131. WMI_ROAM_REASON_SUITABLE_AP_FOUND = 4,
  5132. WMI_ROAM_REASON_HO_FAILED = 5,
  5133. /* keep last */
  5134. WMI_ROAM_REASON_MAX,
  5135. };
  5136. struct wmi_roam_ev {
  5137. __le32 vdev_id;
  5138. __le32 reason;
  5139. } __packed;
  5140. #define ATH10K_FRAGMT_THRESHOLD_MIN 540
  5141. #define ATH10K_FRAGMT_THRESHOLD_MAX 2346
  5142. #define WMI_MAX_EVENT 0x1000
  5143. /* Maximum number of pending TXed WMI packets */
  5144. #define WMI_SKB_HEADROOM sizeof(struct wmi_cmd_hdr)
  5145. /* By default disable power save for IBSS */
  5146. #define ATH10K_DEFAULT_ATIM 0
  5147. #define WMI_MAX_MEM_REQS 16
  5148. struct wmi_scan_ev_arg {
  5149. __le32 event_type; /* %WMI_SCAN_EVENT_ */
  5150. __le32 reason; /* %WMI_SCAN_REASON_ */
  5151. __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
  5152. __le32 scan_req_id;
  5153. __le32 scan_id;
  5154. __le32 vdev_id;
  5155. };
  5156. struct wmi_mgmt_rx_ev_arg {
  5157. __le32 channel;
  5158. __le32 snr;
  5159. __le32 rate;
  5160. __le32 phy_mode;
  5161. __le32 buf_len;
  5162. __le32 status; /* %WMI_RX_STATUS_ */
  5163. };
  5164. struct wmi_ch_info_ev_arg {
  5165. __le32 err_code;
  5166. __le32 freq;
  5167. __le32 cmd_flags;
  5168. __le32 noise_floor;
  5169. __le32 rx_clear_count;
  5170. __le32 cycle_count;
  5171. __le32 chan_tx_pwr_range;
  5172. __le32 chan_tx_pwr_tp;
  5173. __le32 rx_frame_count;
  5174. };
  5175. struct wmi_vdev_start_ev_arg {
  5176. __le32 vdev_id;
  5177. __le32 req_id;
  5178. __le32 resp_type; /* %WMI_VDEV_RESP_ */
  5179. __le32 status;
  5180. };
  5181. struct wmi_peer_kick_ev_arg {
  5182. const u8 *mac_addr;
  5183. };
  5184. struct wmi_swba_ev_arg {
  5185. __le32 vdev_map;
  5186. struct wmi_tim_info_arg tim_info[WMI_MAX_AP_VDEV];
  5187. const struct wmi_p2p_noa_info *noa_info[WMI_MAX_AP_VDEV];
  5188. };
  5189. struct wmi_phyerr_ev_arg {
  5190. u32 tsf_timestamp;
  5191. u16 freq1;
  5192. u16 freq2;
  5193. u8 rssi_combined;
  5194. u8 chan_width_mhz;
  5195. u8 phy_err_code;
  5196. u16 nf_chains[4];
  5197. u32 buf_len;
  5198. const u8 *buf;
  5199. u8 hdr_len;
  5200. };
  5201. struct wmi_phyerr_hdr_arg {
  5202. u32 num_phyerrs;
  5203. u32 tsf_l32;
  5204. u32 tsf_u32;
  5205. u32 buf_len;
  5206. const void *phyerrs;
  5207. };
  5208. struct wmi_svc_rdy_ev_arg {
  5209. __le32 min_tx_power;
  5210. __le32 max_tx_power;
  5211. __le32 ht_cap;
  5212. __le32 vht_cap;
  5213. __le32 sw_ver0;
  5214. __le32 sw_ver1;
  5215. __le32 fw_build;
  5216. __le32 phy_capab;
  5217. __le32 num_rf_chains;
  5218. __le32 eeprom_rd;
  5219. __le32 num_mem_reqs;
  5220. const __le32 *service_map;
  5221. size_t service_map_len;
  5222. const struct wlan_host_mem_req *mem_reqs[WMI_MAX_MEM_REQS];
  5223. };
  5224. struct wmi_rdy_ev_arg {
  5225. __le32 sw_version;
  5226. __le32 abi_version;
  5227. __le32 status;
  5228. const u8 *mac_addr;
  5229. };
  5230. struct wmi_roam_ev_arg {
  5231. __le32 vdev_id;
  5232. __le32 reason;
  5233. __le32 rssi;
  5234. };
  5235. struct wmi_pdev_temperature_event {
  5236. /* temperature value in Celcius degree */
  5237. __le32 temperature;
  5238. } __packed;
  5239. /* WOW structures */
  5240. enum wmi_wow_wakeup_event {
  5241. WOW_BMISS_EVENT = 0,
  5242. WOW_BETTER_AP_EVENT,
  5243. WOW_DEAUTH_RECVD_EVENT,
  5244. WOW_MAGIC_PKT_RECVD_EVENT,
  5245. WOW_GTK_ERR_EVENT,
  5246. WOW_FOURWAY_HSHAKE_EVENT,
  5247. WOW_EAPOL_RECVD_EVENT,
  5248. WOW_NLO_DETECTED_EVENT,
  5249. WOW_DISASSOC_RECVD_EVENT,
  5250. WOW_PATTERN_MATCH_EVENT,
  5251. WOW_CSA_IE_EVENT,
  5252. WOW_PROBE_REQ_WPS_IE_EVENT,
  5253. WOW_AUTH_REQ_EVENT,
  5254. WOW_ASSOC_REQ_EVENT,
  5255. WOW_HTT_EVENT,
  5256. WOW_RA_MATCH_EVENT,
  5257. WOW_HOST_AUTO_SHUTDOWN_EVENT,
  5258. WOW_IOAC_MAGIC_EVENT,
  5259. WOW_IOAC_SHORT_EVENT,
  5260. WOW_IOAC_EXTEND_EVENT,
  5261. WOW_IOAC_TIMER_EVENT,
  5262. WOW_DFS_PHYERR_RADAR_EVENT,
  5263. WOW_BEACON_EVENT,
  5264. WOW_CLIENT_KICKOUT_EVENT,
  5265. WOW_EVENT_MAX,
  5266. };
  5267. #define C2S(x) case x: return #x
  5268. static inline const char *wow_wakeup_event(enum wmi_wow_wakeup_event ev)
  5269. {
  5270. switch (ev) {
  5271. C2S(WOW_BMISS_EVENT);
  5272. C2S(WOW_BETTER_AP_EVENT);
  5273. C2S(WOW_DEAUTH_RECVD_EVENT);
  5274. C2S(WOW_MAGIC_PKT_RECVD_EVENT);
  5275. C2S(WOW_GTK_ERR_EVENT);
  5276. C2S(WOW_FOURWAY_HSHAKE_EVENT);
  5277. C2S(WOW_EAPOL_RECVD_EVENT);
  5278. C2S(WOW_NLO_DETECTED_EVENT);
  5279. C2S(WOW_DISASSOC_RECVD_EVENT);
  5280. C2S(WOW_PATTERN_MATCH_EVENT);
  5281. C2S(WOW_CSA_IE_EVENT);
  5282. C2S(WOW_PROBE_REQ_WPS_IE_EVENT);
  5283. C2S(WOW_AUTH_REQ_EVENT);
  5284. C2S(WOW_ASSOC_REQ_EVENT);
  5285. C2S(WOW_HTT_EVENT);
  5286. C2S(WOW_RA_MATCH_EVENT);
  5287. C2S(WOW_HOST_AUTO_SHUTDOWN_EVENT);
  5288. C2S(WOW_IOAC_MAGIC_EVENT);
  5289. C2S(WOW_IOAC_SHORT_EVENT);
  5290. C2S(WOW_IOAC_EXTEND_EVENT);
  5291. C2S(WOW_IOAC_TIMER_EVENT);
  5292. C2S(WOW_DFS_PHYERR_RADAR_EVENT);
  5293. C2S(WOW_BEACON_EVENT);
  5294. C2S(WOW_CLIENT_KICKOUT_EVENT);
  5295. C2S(WOW_EVENT_MAX);
  5296. default:
  5297. return NULL;
  5298. }
  5299. }
  5300. enum wmi_wow_wake_reason {
  5301. WOW_REASON_UNSPECIFIED = -1,
  5302. WOW_REASON_NLOD = 0,
  5303. WOW_REASON_AP_ASSOC_LOST,
  5304. WOW_REASON_LOW_RSSI,
  5305. WOW_REASON_DEAUTH_RECVD,
  5306. WOW_REASON_DISASSOC_RECVD,
  5307. WOW_REASON_GTK_HS_ERR,
  5308. WOW_REASON_EAP_REQ,
  5309. WOW_REASON_FOURWAY_HS_RECV,
  5310. WOW_REASON_TIMER_INTR_RECV,
  5311. WOW_REASON_PATTERN_MATCH_FOUND,
  5312. WOW_REASON_RECV_MAGIC_PATTERN,
  5313. WOW_REASON_P2P_DISC,
  5314. WOW_REASON_WLAN_HB,
  5315. WOW_REASON_CSA_EVENT,
  5316. WOW_REASON_PROBE_REQ_WPS_IE_RECV,
  5317. WOW_REASON_AUTH_REQ_RECV,
  5318. WOW_REASON_ASSOC_REQ_RECV,
  5319. WOW_REASON_HTT_EVENT,
  5320. WOW_REASON_RA_MATCH,
  5321. WOW_REASON_HOST_AUTO_SHUTDOWN,
  5322. WOW_REASON_IOAC_MAGIC_EVENT,
  5323. WOW_REASON_IOAC_SHORT_EVENT,
  5324. WOW_REASON_IOAC_EXTEND_EVENT,
  5325. WOW_REASON_IOAC_TIMER_EVENT,
  5326. WOW_REASON_ROAM_HO,
  5327. WOW_REASON_DFS_PHYERR_RADADR_EVENT,
  5328. WOW_REASON_BEACON_RECV,
  5329. WOW_REASON_CLIENT_KICKOUT_EVENT,
  5330. WOW_REASON_DEBUG_TEST = 0xFF,
  5331. };
  5332. static inline const char *wow_reason(enum wmi_wow_wake_reason reason)
  5333. {
  5334. switch (reason) {
  5335. C2S(WOW_REASON_UNSPECIFIED);
  5336. C2S(WOW_REASON_NLOD);
  5337. C2S(WOW_REASON_AP_ASSOC_LOST);
  5338. C2S(WOW_REASON_LOW_RSSI);
  5339. C2S(WOW_REASON_DEAUTH_RECVD);
  5340. C2S(WOW_REASON_DISASSOC_RECVD);
  5341. C2S(WOW_REASON_GTK_HS_ERR);
  5342. C2S(WOW_REASON_EAP_REQ);
  5343. C2S(WOW_REASON_FOURWAY_HS_RECV);
  5344. C2S(WOW_REASON_TIMER_INTR_RECV);
  5345. C2S(WOW_REASON_PATTERN_MATCH_FOUND);
  5346. C2S(WOW_REASON_RECV_MAGIC_PATTERN);
  5347. C2S(WOW_REASON_P2P_DISC);
  5348. C2S(WOW_REASON_WLAN_HB);
  5349. C2S(WOW_REASON_CSA_EVENT);
  5350. C2S(WOW_REASON_PROBE_REQ_WPS_IE_RECV);
  5351. C2S(WOW_REASON_AUTH_REQ_RECV);
  5352. C2S(WOW_REASON_ASSOC_REQ_RECV);
  5353. C2S(WOW_REASON_HTT_EVENT);
  5354. C2S(WOW_REASON_RA_MATCH);
  5355. C2S(WOW_REASON_HOST_AUTO_SHUTDOWN);
  5356. C2S(WOW_REASON_IOAC_MAGIC_EVENT);
  5357. C2S(WOW_REASON_IOAC_SHORT_EVENT);
  5358. C2S(WOW_REASON_IOAC_EXTEND_EVENT);
  5359. C2S(WOW_REASON_IOAC_TIMER_EVENT);
  5360. C2S(WOW_REASON_ROAM_HO);
  5361. C2S(WOW_REASON_DFS_PHYERR_RADADR_EVENT);
  5362. C2S(WOW_REASON_BEACON_RECV);
  5363. C2S(WOW_REASON_CLIENT_KICKOUT_EVENT);
  5364. C2S(WOW_REASON_DEBUG_TEST);
  5365. default:
  5366. return NULL;
  5367. }
  5368. }
  5369. #undef C2S
  5370. struct wmi_wow_ev_arg {
  5371. u32 vdev_id;
  5372. u32 flag;
  5373. enum wmi_wow_wake_reason wake_reason;
  5374. u32 data_len;
  5375. };
  5376. #define WOW_MIN_PATTERN_SIZE 1
  5377. #define WOW_MAX_PATTERN_SIZE 148
  5378. #define WOW_MAX_PKT_OFFSET 128
  5379. enum wmi_tdls_state {
  5380. WMI_TDLS_DISABLE,
  5381. WMI_TDLS_ENABLE_PASSIVE,
  5382. WMI_TDLS_ENABLE_ACTIVE,
  5383. };
  5384. enum wmi_tdls_peer_state {
  5385. WMI_TDLS_PEER_STATE_PEERING,
  5386. WMI_TDLS_PEER_STATE_CONNECTED,
  5387. WMI_TDLS_PEER_STATE_TEARDOWN,
  5388. };
  5389. struct wmi_tdls_peer_update_cmd_arg {
  5390. u32 vdev_id;
  5391. enum wmi_tdls_peer_state peer_state;
  5392. u8 addr[ETH_ALEN];
  5393. };
  5394. #define WMI_TDLS_MAX_SUPP_OPER_CLASSES 32
  5395. struct wmi_tdls_peer_capab_arg {
  5396. u8 peer_uapsd_queues;
  5397. u8 peer_max_sp;
  5398. u32 buff_sta_support;
  5399. u32 off_chan_support;
  5400. u32 peer_curr_operclass;
  5401. u32 self_curr_operclass;
  5402. u32 peer_chan_len;
  5403. u32 peer_operclass_len;
  5404. u8 peer_operclass[WMI_TDLS_MAX_SUPP_OPER_CLASSES];
  5405. u32 is_peer_responder;
  5406. u32 pref_offchan_num;
  5407. u32 pref_offchan_bw;
  5408. };
  5409. enum wmi_txbf_conf {
  5410. WMI_TXBF_CONF_UNSUPPORTED,
  5411. WMI_TXBF_CONF_BEFORE_ASSOC,
  5412. WMI_TXBF_CONF_AFTER_ASSOC,
  5413. };
  5414. struct ath10k;
  5415. struct ath10k_vif;
  5416. struct ath10k_fw_stats_pdev;
  5417. struct ath10k_fw_stats_peer;
  5418. int ath10k_wmi_attach(struct ath10k *ar);
  5419. void ath10k_wmi_detach(struct ath10k *ar);
  5420. int ath10k_wmi_wait_for_service_ready(struct ath10k *ar);
  5421. int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar);
  5422. struct sk_buff *ath10k_wmi_alloc_skb(struct ath10k *ar, u32 len);
  5423. int ath10k_wmi_connect(struct ath10k *ar);
  5424. struct sk_buff *ath10k_wmi_alloc_skb(struct ath10k *ar, u32 len);
  5425. int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
  5426. int ath10k_wmi_cmd_send_nowait(struct ath10k *ar, struct sk_buff *skb,
  5427. u32 cmd_id);
  5428. void ath10k_wmi_start_scan_init(struct ath10k *ar, struct wmi_start_scan_arg *);
  5429. void ath10k_wmi_pull_pdev_stats_base(const struct wmi_pdev_stats_base *src,
  5430. struct ath10k_fw_stats_pdev *dst);
  5431. void ath10k_wmi_pull_pdev_stats_tx(const struct wmi_pdev_stats_tx *src,
  5432. struct ath10k_fw_stats_pdev *dst);
  5433. void ath10k_wmi_pull_pdev_stats_rx(const struct wmi_pdev_stats_rx *src,
  5434. struct ath10k_fw_stats_pdev *dst);
  5435. void ath10k_wmi_pull_pdev_stats_extra(const struct wmi_pdev_stats_extra *src,
  5436. struct ath10k_fw_stats_pdev *dst);
  5437. void ath10k_wmi_pull_peer_stats(const struct wmi_peer_stats *src,
  5438. struct ath10k_fw_stats_peer *dst);
  5439. void ath10k_wmi_put_host_mem_chunks(struct ath10k *ar,
  5440. struct wmi_host_mem_chunks *chunks);
  5441. void ath10k_wmi_put_start_scan_common(struct wmi_start_scan_common *cmn,
  5442. const struct wmi_start_scan_arg *arg);
  5443. void ath10k_wmi_set_wmm_param(struct wmi_wmm_params *params,
  5444. const struct wmi_wmm_params_arg *arg);
  5445. void ath10k_wmi_put_wmi_channel(struct wmi_channel *ch,
  5446. const struct wmi_channel_arg *arg);
  5447. int ath10k_wmi_start_scan_verify(const struct wmi_start_scan_arg *arg);
  5448. int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb);
  5449. int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb);
  5450. void ath10k_wmi_event_chan_info(struct ath10k *ar, struct sk_buff *skb);
  5451. void ath10k_wmi_event_echo(struct ath10k *ar, struct sk_buff *skb);
  5452. int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb);
  5453. void ath10k_wmi_event_update_stats(struct ath10k *ar, struct sk_buff *skb);
  5454. void ath10k_wmi_event_vdev_start_resp(struct ath10k *ar, struct sk_buff *skb);
  5455. void ath10k_wmi_event_vdev_stopped(struct ath10k *ar, struct sk_buff *skb);
  5456. void ath10k_wmi_event_peer_sta_kickout(struct ath10k *ar, struct sk_buff *skb);
  5457. void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb);
  5458. void ath10k_wmi_event_tbttoffset_update(struct ath10k *ar, struct sk_buff *skb);
  5459. void ath10k_wmi_event_dfs(struct ath10k *ar,
  5460. struct wmi_phyerr_ev_arg *phyerr, u64 tsf);
  5461. void ath10k_wmi_event_spectral_scan(struct ath10k *ar,
  5462. struct wmi_phyerr_ev_arg *phyerr,
  5463. u64 tsf);
  5464. void ath10k_wmi_event_phyerr(struct ath10k *ar, struct sk_buff *skb);
  5465. void ath10k_wmi_event_roam(struct ath10k *ar, struct sk_buff *skb);
  5466. void ath10k_wmi_event_profile_match(struct ath10k *ar, struct sk_buff *skb);
  5467. void ath10k_wmi_event_debug_print(struct ath10k *ar, struct sk_buff *skb);
  5468. void ath10k_wmi_event_pdev_qvit(struct ath10k *ar, struct sk_buff *skb);
  5469. void ath10k_wmi_event_wlan_profile_data(struct ath10k *ar, struct sk_buff *skb);
  5470. void ath10k_wmi_event_rtt_measurement_report(struct ath10k *ar,
  5471. struct sk_buff *skb);
  5472. void ath10k_wmi_event_tsf_measurement_report(struct ath10k *ar,
  5473. struct sk_buff *skb);
  5474. void ath10k_wmi_event_rtt_error_report(struct ath10k *ar, struct sk_buff *skb);
  5475. void ath10k_wmi_event_wow_wakeup_host(struct ath10k *ar, struct sk_buff *skb);
  5476. void ath10k_wmi_event_dcs_interference(struct ath10k *ar, struct sk_buff *skb);
  5477. void ath10k_wmi_event_pdev_tpc_config(struct ath10k *ar, struct sk_buff *skb);
  5478. void ath10k_wmi_event_pdev_ftm_intg(struct ath10k *ar, struct sk_buff *skb);
  5479. void ath10k_wmi_event_gtk_offload_status(struct ath10k *ar,
  5480. struct sk_buff *skb);
  5481. void ath10k_wmi_event_gtk_rekey_fail(struct ath10k *ar, struct sk_buff *skb);
  5482. void ath10k_wmi_event_delba_complete(struct ath10k *ar, struct sk_buff *skb);
  5483. void ath10k_wmi_event_addba_complete(struct ath10k *ar, struct sk_buff *skb);
  5484. void ath10k_wmi_event_vdev_install_key_complete(struct ath10k *ar,
  5485. struct sk_buff *skb);
  5486. void ath10k_wmi_event_inst_rssi_stats(struct ath10k *ar, struct sk_buff *skb);
  5487. void ath10k_wmi_event_vdev_standby_req(struct ath10k *ar, struct sk_buff *skb);
  5488. void ath10k_wmi_event_vdev_resume_req(struct ath10k *ar, struct sk_buff *skb);
  5489. void ath10k_wmi_event_service_ready(struct ath10k *ar, struct sk_buff *skb);
  5490. int ath10k_wmi_event_ready(struct ath10k *ar, struct sk_buff *skb);
  5491. int ath10k_wmi_op_pull_phyerr_ev(struct ath10k *ar, const void *phyerr_buf,
  5492. int left_len, struct wmi_phyerr_ev_arg *arg);
  5493. #endif /* _WMI_H_ */