wmi.h 189 KB

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