wmi.h 191 KB

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