wmi.h 186 KB

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