wmi_unified_param.h 177 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414
  1. /*
  2. * Copyright (c) 2016 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /*
  27. * This file contains the API definitions for the Unified Wireless Module
  28. * Interface (WMI).
  29. */
  30. #ifndef _WMI_UNIFIED_PARAM_H_
  31. #define _WMI_UNIFIED_PARAM_H_
  32. #include "wmi_unified.h"
  33. #define IEEE80211_ADDR_LEN 6 /* size of 802.11 address */
  34. #define WMI_MAC_MAX_SSID_LENGTH 32
  35. #define WMI_SCAN_MAX_NUM_SSID 0x0A
  36. #define mgmt_tx_dl_frm_len 64
  37. #define WMI_SMPS_MASK_LOWER_16BITS 0xFF
  38. #define WMI_SMPS_MASK_UPPER_3BITS 0x7
  39. #define WMI_SMPS_PARAM_VALUE_S 29
  40. #define WMI_MAX_NUM_ARGS 8
  41. /* The size of the utc time in bytes. */
  42. #define WMI_SIZE_UTC_TIME (10)
  43. /* The size of the utc time error in bytes. */
  44. #define WMI_SIZE_UTC_TIME_ERROR (5)
  45. #define WMI_MCC_MIN_CHANNEL_QUOTA 20
  46. #define WMI_MCC_MAX_CHANNEL_QUOTA 80
  47. #define WMI_MCC_MIN_NON_ZERO_CHANNEL_LATENCY 30
  48. #define WMI_BEACON_TX_BUFFER_SIZE (512)
  49. #define WMI_WIFI_SCANNING_MAC_OUI_LENGTH 3
  50. #define WMI_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS 64
  51. #define WMI_RSSI_THOLD_DEFAULT -300
  52. #define WMI_NLO_FREQ_THRESH 1000
  53. #define WMI_SEC_TO_MSEC(sec) (sec * 1000)
  54. #define WMI_MSEC_TO_USEC(msec) (msec * 1000)
  55. #define WMI_ETH_LEN 64
  56. #define WMI_QOS_NUM_TSPEC_MAX 2
  57. #define WMI_QOS_NUM_AC_MAX 4
  58. #define WMI_IPV4_ADDR_LEN 4
  59. #define WMI_KEEP_ALIVE_NULL_PKT 1
  60. #define WMI_KEEP_ALIVE_UNSOLICIT_ARP_RSP 2
  61. #define WMI_MAC_MAX_KEY_LENGTH 32
  62. #define WMI_KRK_KEY_LEN 16
  63. #ifdef WLAN_FEATURE_ROAM_OFFLOAD
  64. #define WMI_BTK_KEY_LEN 32
  65. #define WMI_ROAM_R0KH_ID_MAX_LEN 48
  66. #define WMI_ROAM_SCAN_PSK_SIZE 32
  67. #endif
  68. #define WMI_NOISE_FLOOR_DBM_DEFAULT (-96)
  69. #define WMI_MAC_IPV6_ADDR_LEN 16
  70. #ifdef WLAN_NS_OFFLOAD
  71. /* support only one IPv6 offload */
  72. #define WMI_MAC_NS_OFFLOAD_SIZE 1
  73. /* Number of target IP V6 addresses for NS offload */
  74. #define WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA 16
  75. #define WMI_IPV6_ADDR_VALID 1
  76. #endif /* WLAN_NS_OFFLOAD */
  77. #define WMI_EXTSCAN_MAX_HOTLIST_SSIDS 8
  78. #define WMI_ROAM_MAX_CHANNELS 80
  79. #ifdef FEATURE_WLAN_EXTSCAN
  80. #define WMI_MAX_EXTSCAN_MSG_SIZE 1536
  81. #define WMI_EXTSCAN_REST_TIME 100
  82. #define WMI_EXTSCAN_MAX_SCAN_TIME 50000
  83. #define WMI_EXTSCAN_BURST_DURATION 150
  84. #endif
  85. #define WMI_SCAN_NPROBES_DEFAULT (2)
  86. #define WMI_SEC_TO_MSEC(sec) (sec * 1000) /* sec to msec */
  87. #define WMI_MSEC_TO_USEC(msec) (msec * 1000) /* msec to usec */
  88. #define WMI_NLO_FREQ_THRESH 1000 /* in MHz */
  89. #define MAX_UTF_EVENT_LENGTH 2048
  90. #define MAX_WMI_UTF_LEN 252
  91. #define MAX_WMI_QVIT_LEN 252
  92. #define THERMAL_LEVELS 4
  93. #define WMI_HOST_BCN_FLT_MAX_SUPPORTED_IES 256
  94. #define WMI_HOST_BCN_FLT_MAX_ELEMS_IE_LIST \
  95. (WMI_HOST_BCN_FLT_MAX_SUPPORTED_IES/32)
  96. #define LTEU_MAX_BINS 10
  97. #define ATF_ACTIVED_MAX_CLIENTS 50
  98. #define ATF_ACTIVED_MAX_ATFGROUPS 8
  99. #define CTL_5G_SIZE 1536
  100. #define CTL_2G_SIZE 684
  101. #define MAX_CTL_SIZE (CTL_5G_SIZE > CTL_2G_SIZE ? CTL_5G_SIZE : CTL_2G_SIZE)
  102. #define IEEE80211_MICBUF_SIZE (8+8)
  103. #define IEEE80211_TID_SIZE 17
  104. #define WME_NUM_AC 4
  105. #define SMART_ANT_MODE_SERIAL 0
  106. #define SMART_ANT_MODE_PARALLEL 1
  107. #define IEEE80211_WEP_NKID 4 /* number of key ids */
  108. #define WPI_IV_LEN 16
  109. #define WMI_SCAN_MAX_NUM_BSSID 10
  110. #define MAX_CHANS 1023
  111. #define TARGET_OEM_CONFIGURE_LCI 0x0A
  112. #define RTT_LCI_ALTITUDE_MASK 0x3FFFFFFF
  113. #define TARGET_OEM_CONFIGURE_LCR 0x09
  114. #define RTT_TIMEOUT_MS 180
  115. #define MAX_SUPPORTED_RATES 128
  116. #define WMI_HOST_MAX_BUFFER_SIZE 1712
  117. #define WMI_HAL_MAX_SANTENNA 4
  118. #define WMI_HOST_F_MS(_v, _f) \
  119. (((_v) & (_f)) >> (_f##_S))
  120. #define WMI_HOST_F_RMW(_var, _v, _f) \
  121. do { \
  122. (_var) &= ~(_f); \
  123. (_var) |= (((_v) << (_f##_S)) & (_f)); \
  124. } while (0)
  125. /* TXBF capabilities masks */
  126. #define WMI_HOST_TXBF_CONF_SU_TX_BFEE_S 0
  127. #define WMI_HOST_TXBF_CONF_SU_TX_BFEE_M 0x1
  128. #define WMI_HOST_TXBF_CONF_SU_TX_BFEE \
  129. (WMI_HOST_TXBF_CONF_SU_TX_BFEE_M << WMI_HOST_TXBF_CONF_SU_TX_BFEE_S)
  130. #define WMI_HOST_TXBF_CONF_SU_TX_BFEE_GET(x) \
  131. WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_SU_TX_BFEE)
  132. #define WMI_HOST_TXBF_CONF_SU_TX_BFEE_SET(x, z) \
  133. WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_SU_TX_BFEE)
  134. #define WMI_HOST_TXBF_CONF_MU_TX_BFEE_S 1
  135. #define WMI_HOST_TXBF_CONF_MU_TX_BFEE_M 0x1
  136. #define WMI_HOST_TXBF_CONF_MU_TX_BFEE \
  137. (WMI_HOST_TXBF_CONF_MU_TX_BFEE_M << WMI_HOST_TXBF_CONF_MU_TX_BFEE_S)
  138. #define WMI_HOST_TXBF_CONF_MU_TX_BFEE_GET(x) \
  139. WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_MU_TX_BFEE)
  140. #define WMI_HOST_TXBF_CONF_MU_TX_BFEE_SET(x, z) \
  141. WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_MU_TX_BFEE)
  142. #define WMI_HOST_TXBF_CONF_SU_TX_BFER_S 2
  143. #define WMI_HOST_TXBF_CONF_SU_TX_BFER_M 0x1
  144. #define WMI_HOST_TXBF_CONF_SU_TX_BFER \
  145. (WMI_HOST_TXBF_CONF_SU_TX_BFER_M << WMI_HOST_TXBF_CONF_SU_TX_BFER_S)
  146. #define WMI_HOST_TXBF_CONF_SU_TX_BFER_GET(x) \
  147. WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_SU_TX_BFER)
  148. #define WMI_HOST_TXBF_CONF_SU_TX_BFER_SET(x, z) \
  149. WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_SU_TX_BFER)
  150. #define WMI_HOST_TXBF_CONF_MU_TX_BFER_S 3
  151. #define WMI_HOST_TXBF_CONF_MU_TX_BFER_M 0x1
  152. #define WMI_HOST_TXBF_CONF_MU_TX_BFER \
  153. (WMI_HOST_TXBF_CONF_MU_TX_BFER_M << WMI_HOST_TXBF_CONF_MU_TX_BFER_S)
  154. #define WMI_HOST_TXBF_CONF_MU_TX_BFER_GET(x) \
  155. WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_MU_TX_BFER)
  156. #define WMI_HOST_TXBF_CONF_MU_TX_BFER_SET(x, z) \
  157. WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_MU_TX_BFER)
  158. #define WMI_HOST_TXBF_CONF_STS_CAP_S 4
  159. #define WMI_HOST_TXBF_CONF_STS_CAP_M 0x7
  160. #define WMI_HOST_TXBF_CONF_STS_CAP \
  161. (WMI_HOST_TXBF_CONF_STS_CAP_M << WMI_HOST_TXBF_CONF_STS_CAP_S)
  162. #define WMI_HOST_TXBF_CONF_STS_CAP_GET(x) \
  163. WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_STS_CAP);
  164. #define WMI_HOST_TXBF_CONF_STS_CAP_SET(x, z) \
  165. WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_STS_CAP)
  166. #define WMI_HOST_TXBF_CONF_IMPLICIT_BF_S 7
  167. #define WMI_HOST_TXBF_CONF_IMPLICIT_BF_M 0x1
  168. #define WMI_HOST_TXBF_CONF_IMPLICIT_BF \
  169. (WMI_HOST_TXBF_CONF_IMPLICIT_BF_M << WMI_HOST_TXBF_CONF_IMPLICIT_BF_S)
  170. #define WMI_HOST_TXBF_CONF_IMPLICIT_BF_GET(x) \
  171. WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_IMPLICIT_BF)
  172. #define WMI_HOST_TXBF_CONF_IMPLICIT_BF_SET(x, z) \
  173. WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_IMPLICIT_BF)
  174. #define WMI_HOST_TXBF_CONF_BF_SND_DIM_S 8
  175. #define WMI_HOST_TXBF_CONF_BF_SND_DIM_M 0x7
  176. #define WMI_HOST_TXBF_CONF_BF_SND_DIM \
  177. (WMI_HOST_TXBF_CONF_BF_SND_DIM_M << WMI_HOST_TXBF_CONF_BF_SND_DIM_S)
  178. #define WMI_HOST_TXBF_CONF_BF_SND_DIM_GET(x) \
  179. WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_BF_SND_DIM)
  180. #define WMI_HOST_TXBF_CONF_BF_SND_DIM_SET(x, z) \
  181. WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_BF_SND_DIM)
  182. #define WMI_HOST_TPC_RATE_MAX 160
  183. #define WMI_HOST_TPC_TX_NUM_CHAIN 4
  184. #define WMI_HOST_RXG_CAL_CHAN_MAX 4
  185. #define WMI_HOST_MAX_NUM_CHAINS 4
  186. #define WMI_MAX_NUM_OF_RATE_THRESH 4
  187. #include "qdf_atomic.h"
  188. #ifdef BIG_ENDIAN_HOST
  189. /* This API is used in copying in elements to WMI message,
  190. since WMI message uses multilpes of 4 bytes, This API
  191. converts length into multiples of 4 bytes, and performs copy
  192. */
  193. #define WMI_HOST_IF_MSG_COPY_CHAR_ARRAY(destp, srcp, len) do { \
  194. int j; \
  195. u_int32_t *src, *dest; \
  196. src = (u_int32_t *)srcp; \
  197. dest = (u_int32_t *)destp; \
  198. for (j = 0; j < roundup(len, sizeof(u_int32_t))/4; j++) { \
  199. *(dest+j) = qdf_le32_to_cpu(*(src+j)); \
  200. } \
  201. } while (0)
  202. #else
  203. #define WMI_HOST_IF_MSG_COPY_CHAR_ARRAY(destp, srcp, len) OS_MEMCPY(destp,\
  204. srcp, len)
  205. #endif
  206. /** macro to convert MAC address from WMI word format to char array */
  207. #define WMI_HOST_MAC_ADDR_TO_CHAR_ARRAY(pwmi_mac_addr, c_macaddr) do { \
  208. (c_macaddr)[0] = ((pwmi_mac_addr)->mac_addr31to0) & 0xff; \
  209. (c_macaddr)[1] = (((pwmi_mac_addr)->mac_addr31to0) >> 8) & 0xff; \
  210. (c_macaddr)[2] = (((pwmi_mac_addr)->mac_addr31to0) >> 16) & 0xff; \
  211. (c_macaddr)[3] = (((pwmi_mac_addr)->mac_addr31to0) >> 24) & 0xff; \
  212. (c_macaddr)[4] = ((pwmi_mac_addr)->mac_addr47to32) & 0xff; \
  213. (c_macaddr)[5] = (((pwmi_mac_addr)->mac_addr47to32) >> 8) & 0xff; \
  214. } while (0)
  215. #define TARGET_INIT_STATUS_SUCCESS 0x0
  216. #define TARGET_INIT_STATUS_GEN_FAILED 0x1
  217. #define TARGET_GET_INIT_STATUS_REASON(status) ((status) & 0xffff)
  218. #define TARGET_GET_INIT_STATUS_MODULE_ID(status) (((status) >> 16) & 0xffff)
  219. typedef uint32_t TARGET_INIT_STATUS;
  220. typedef enum {
  221. WMI_HOST_MODE_11A = 0, /* 11a Mode */
  222. WMI_HOST_MODE_11G = 1, /* 11b/g Mode */
  223. WMI_HOST_MODE_11B = 2, /* 11b Mode */
  224. WMI_HOST_MODE_11GONLY = 3, /* 11g only Mode */
  225. WMI_HOST_MODE_11NA_HT20 = 4, /* 11a HT20 mode */
  226. WMI_HOST_MODE_11NG_HT20 = 5, /* 11g HT20 mode */
  227. WMI_HOST_MODE_11NA_HT40 = 6, /* 11a HT40 mode */
  228. WMI_HOST_MODE_11NG_HT40 = 7, /* 11g HT40 mode */
  229. WMI_HOST_MODE_11AC_VHT20 = 8,
  230. WMI_HOST_MODE_11AC_VHT40 = 9,
  231. WMI_HOST_MODE_11AC_VHT80 = 10,
  232. WMI_HOST_MODE_11AC_VHT20_2G = 11,
  233. WMI_HOST_MODE_11AC_VHT40_2G = 12,
  234. WMI_HOST_MODE_11AC_VHT80_2G = 13,
  235. WMI_HOST_MODE_11AC_VHT80_80 = 14,
  236. WMI_HOST_MODE_11AC_VHT160 = 15,
  237. WMI_HOST_MODE_UNKNOWN = 16,
  238. WMI_HOST_MODE_MAX = 16
  239. } WMI_HOST_WLAN_PHY_MODE;
  240. /**
  241. * enum wmi_dwelltime_adaptive_mode: dwelltime_mode
  242. * @WMI_DWELL_MODE_DEFAULT: Use firmware default mode
  243. * @WMI_DWELL_MODE_CONSERVATIVE: Conservative adaptive mode
  244. * @WMI_DWELL_MODE_MODERATE: Moderate adaptive mode
  245. * @WMI_DWELL_MODE_AGGRESSIVE: Aggressive adaptive mode
  246. * @WMI_DWELL_MODE_STATIC: static adaptive mode
  247. */
  248. enum wmi_dwelltime_adaptive_mode {
  249. WMI_DWELL_MODE_DEFAULT = 0,
  250. WMI_DWELL_MODE_CONSERVATIVE = 1,
  251. WMI_DWELL_MODE_MODERATE = 2,
  252. WMI_DWELL_MODE_AGGRESSIVE = 3,
  253. WMI_DWELL_MODE_STATIC = 4
  254. };
  255. #define MAX_NUM_CHAN 128
  256. /**
  257. * struct vdev_create_params - vdev create cmd parameter
  258. * @if_id: interface id
  259. * @type: interface type
  260. * @subtype: interface subtype
  261. */
  262. struct vdev_create_params {
  263. uint8_t if_id;
  264. uint32_t type;
  265. uint32_t subtype;
  266. };
  267. /**
  268. * struct vdev_delete_params - vdev delete cmd parameter
  269. * @if_id: interface id
  270. */
  271. struct vdev_delete_params {
  272. uint8_t if_id;
  273. };
  274. /**
  275. * struct channel_param - Channel paramters with all
  276. * info required by target.
  277. * @chan_id: channel id
  278. * @pwr: channel power
  279. * @mhz: channel frequency
  280. * @half_rate: is half rate
  281. * @quarter_rate: is quarter rate
  282. * @dfs_set: is dfs channel
  283. * @dfs_set_cfreq2: is secondary freq dfs channel
  284. * @is_chan_passive: is this passive channel
  285. * @allow_ht: HT allowed in chan
  286. * @allow_vht: VHT allowed on chan
  287. * @phy_mode: phymode (vht80 or ht40 or ...)
  288. * @cfreq1: centre frequency on primary
  289. * @cfreq2: centre frequency on secondary
  290. * @maxpower: max power for channel
  291. * @minpower: min power for channel
  292. * @maxreqpower: Max regulatory power
  293. * @antennamac: Max antenna
  294. * @reg_class_id: Regulatory class id.
  295. */
  296. struct channel_param {
  297. uint8_t chan_id;
  298. uint8_t pwr;
  299. uint32_t mhz;
  300. uint32_t half_rate:1,
  301. quarter_rate:1,
  302. dfs_set:1,
  303. dfs_set_cfreq2:1,
  304. is_chan_passive:1,
  305. allow_ht:1,
  306. allow_vht:1;
  307. uint32_t phy_mode;
  308. uint32_t cfreq1;
  309. uint32_t cfreq2;
  310. int8_t maxpower;
  311. int8_t minpower;
  312. int8_t maxregpower;
  313. uint8_t antennamax;
  314. uint8_t reg_class_id;
  315. };
  316. /**
  317. * struct vdev_stop_params - vdev stop cmd parameter
  318. * @vdev_id: vdev id
  319. */
  320. struct vdev_stop_params {
  321. uint8_t vdev_id;
  322. };
  323. /**
  324. * struct vdev_up_params - vdev up cmd parameter
  325. * @vdev_id: vdev id
  326. * @assoc_id: association id
  327. */
  328. struct vdev_up_params {
  329. uint8_t vdev_id;
  330. uint16_t assoc_id;
  331. };
  332. /**
  333. * struct vdev_down_params - vdev down cmd parameter
  334. * @vdev_id: vdev id
  335. */
  336. struct vdev_down_params {
  337. uint8_t vdev_id;
  338. };
  339. /**
  340. * struct mac_ssid - mac ssid structure
  341. * @length:
  342. * @mac_ssid[WMI_MAC_MAX_SSID_LENGTH]:
  343. */
  344. struct mac_ssid {
  345. uint8_t length;
  346. uint8_t mac_ssid[WMI_MAC_MAX_SSID_LENGTH];
  347. } qdf_packed;
  348. /**
  349. * struct vdev_start_params - vdev start cmd parameter
  350. * @vdev_id: vdev id
  351. * @chan_freq: channel frequency
  352. * @chan_mode: channel mode
  353. * @band_center_freq1: center freq 1
  354. * @band_center_freq2: center freq 2
  355. * @flags: flags to set like pmf_enabled etc.
  356. * @is_dfs: flag to check if dfs enabled
  357. * @beacon_intval: beacon interval
  358. * @dtim_period: dtim period
  359. * @max_txpow: max tx power
  360. * @is_restart: flag to check if it is vdev
  361. * @ssid: ssid and ssid length info
  362. * @preferred_tx_streams: preferred tx streams
  363. * @preferred_rx_streams: preferred rx streams
  364. * @intr_update: flag to check if need to update
  365. * required wma interface params
  366. * @intr_ssid: pointer to wma interface ssid
  367. * @intr_flags: poiter to wma interface flags
  368. * @requestor_id: to update requestor id
  369. * @disable_hw_ack: to update disable hw ack flag
  370. * @info: to update channel info
  371. * @reg_info_1: to update min power, max power,
  372. * reg power and reg class id
  373. * @reg_info_2: to update antennamax
  374. * @oper_mode: Operating mode
  375. * @dfs_pri_multiplier: DFS primary multiplier
  376. * allow pulse if they are within multiple of PRI for the radar type
  377. * @dot11_mode: Phy mode (VHT20/VHT80...)
  378. * @disable_hw_ack: Disable hw ack if chan is dfs channel for cac
  379. * @channel_param: Channel params required by target.
  380. */
  381. struct vdev_start_params {
  382. uint8_t vdev_id;
  383. uint32_t chan_freq;
  384. uint32_t chan_mode;
  385. uint32_t band_center_freq1;
  386. uint32_t band_center_freq2;
  387. uint32_t flags;
  388. bool is_dfs;
  389. uint32_t beacon_intval;
  390. uint32_t dtim_period;
  391. int32_t max_txpow;
  392. bool is_restart;
  393. bool is_half_rate;
  394. bool is_quarter_rate;
  395. uint32_t dis_hw_ack;
  396. uint32_t flag_dfs;
  397. uint8_t hidden_ssid;
  398. uint8_t pmf_enabled;
  399. struct mac_ssid ssid;
  400. uint32_t num_noa_descriptors;
  401. uint32_t preferred_rx_streams;
  402. uint32_t preferred_tx_streams;
  403. #ifdef WMI_NON_TLV_SUPPORT
  404. uint8_t oper_mode;
  405. int32_t dfs_pri_multiplier;
  406. uint8_t dot11_mode;
  407. uint8_t disable_hw_ack;
  408. struct channel_param channel;
  409. #endif
  410. };
  411. /**
  412. * struct hidden_ssid_vdev_restart_params -
  413. * vdev restart cmd parameter
  414. * @session_id: session id
  415. * @ssid_len: ssid length
  416. * @ssid: ssid
  417. * @flags: flags
  418. * @requestor_id: requestor id
  419. * @disable_hw_ack: flag to disable hw ack feature
  420. * @mhz: channel frequency
  421. * @band_center_freq1: center freq 1
  422. * @band_center_freq2: center freq 2
  423. * @info: channel info
  424. * @reg_info_1: contains min power, max power,
  425. * reg power and reg class id
  426. * @reg_info_2: contains antennamax
  427. * @hidden_ssid_restart_in_progress:
  428. * flag to check if restart is in progress
  429. */
  430. struct hidden_ssid_vdev_restart_params {
  431. uint8_t session_id;
  432. uint32_t ssid_len;
  433. uint32_t ssid[8];
  434. uint32_t flags;
  435. uint32_t requestor_id;
  436. uint32_t disable_hw_ack;
  437. uint32_t mhz;
  438. uint32_t band_center_freq1;
  439. uint32_t band_center_freq2;
  440. uint32_t info;
  441. uint32_t reg_info_1;
  442. uint32_t reg_info_2;
  443. qdf_atomic_t hidden_ssid_restart_in_progress;
  444. };
  445. /**
  446. * struct vdev_set_params - vdev set cmd parameter
  447. * @if_id: vdev id
  448. * @param_id: parameter id
  449. * @param_value: parameter value
  450. */
  451. struct vdev_set_params {
  452. uint32_t if_id;
  453. uint32_t param_id;
  454. uint32_t param_value;
  455. };
  456. /**
  457. * struct vdev_install_key_params - vdev key set cmd parameter
  458. * @wk_keylen: key length
  459. * @wk_flags: key flags
  460. * @ic_cipher: cipher
  461. * @if_id: vdev id
  462. * @is_group_key: Group key
  463. * @wk_keyix: key index
  464. * @def_keyid: default key index
  465. * @wk_keytsc: Key TSC
  466. * @wk_keyrsc: key RSC
  467. * @key_data: pounter to key data
  468. * @force_none: force
  469. * @is_host_based_crypt: Host based encrypt
  470. * @is_xmit_or_recv_key: xmit or recieve key
  471. * @wk_recviv: WAPI recv IV
  472. * @wk_txiv: WAPI TX IV
  473. */
  474. struct vdev_install_key_params {
  475. uint8_t wk_keylen;
  476. uint16_t wk_flags;
  477. uint8_t ic_cipher;
  478. uint8_t if_id;
  479. bool is_group_key;
  480. uint16_t wk_keyix;
  481. uint8_t def_keyid;
  482. uint64_t wk_keytsc;
  483. uint64_t *wk_keyrsc;
  484. uint8_t *key_data;
  485. uint8_t force_none;
  486. bool is_host_based_crypt;
  487. bool is_xmit_or_recv_key;
  488. #if ATH_SUPPORT_WAPI
  489. uint8_t *wk_recviv;
  490. uint32_t *wk_txiv;
  491. #endif
  492. };
  493. /**
  494. * struct peer_delete_params - peer delete cmd parameter
  495. * @vdev_id: vdev id
  496. */
  497. struct peer_delete_params {
  498. uint8_t vdev_id;
  499. };
  500. /**
  501. * struct peer_flush_params - peer flush cmd parameter
  502. * @peer_tid_bitmap: peer tid bitmap
  503. * @vdev_id: vdev id
  504. */
  505. struct peer_flush_params {
  506. uint32_t peer_tid_bitmap;
  507. uint8_t vdev_id;
  508. };
  509. /**
  510. * struct peer_set_params - peer set cmd parameter
  511. * @param_id: parameter id
  512. * @param_value: parameter value
  513. * @vdev_id: vdev id
  514. */
  515. struct peer_set_params {
  516. uint32_t param_id;
  517. uint32_t param_value;
  518. uint32_t vdev_id;
  519. };
  520. /**
  521. * struct peer_create_params - peer create cmd parameter
  522. * @peer_addr: peer mac addr
  523. * @peer_type: peer type
  524. * @vdev_id: vdev id
  525. */
  526. struct peer_create_params {
  527. const uint8_t *peer_addr;
  528. uint32_t peer_type;
  529. uint32_t vdev_id;
  530. };
  531. /**
  532. * struct peer_remove_params - peer remove cmd parameter
  533. * @bssid: bss id
  534. * @vdev_id: vdev id
  535. * @roam_synch_in_progress: flag to indicate if roaming is in progress
  536. */
  537. struct peer_remove_params {
  538. uint8_t *bssid;
  539. uint8_t vdev_id;
  540. bool roam_synch_in_progress;
  541. };
  542. /**
  543. * Stats ID enums defined in host
  544. */
  545. typedef enum {
  546. WMI_HOST_REQUEST_PEER_STAT = 0x01,
  547. WMI_HOST_REQUEST_AP_STAT = 0x02,
  548. WMI_HOST_REQUEST_PDEV_STAT = 0x04,
  549. WMI_HOST_REQUEST_VDEV_STAT = 0x08,
  550. WMI_HOST_REQUEST_BCNFLT_STAT = 0x10,
  551. WMI_HOST_REQUEST_VDEV_RATE_STAT = 0x20,
  552. WMI_HOST_REQUEST_INST_STAT = 0x40,
  553. WMI_HOST_REQUEST_PEER_EXTD_STAT = 0x80,
  554. WMI_HOST_REQUEST_VDEV_EXTD_STAT = 0x100,
  555. } wmi_host_stats_id;
  556. typedef struct {
  557. uint16_t cfg_retry_count;
  558. uint16_t retry_count;
  559. } wmi_host_inst_rssi_args;
  560. /**
  561. * struct stats_request_params - stats_request cmd parameter
  562. * @stats_id: statistics id
  563. * @vdev_id: vdev id
  564. * @wmi_host_inst_rssi_args: Instantaneous rssi stats args
  565. */
  566. struct stats_request_params {
  567. uint32_t stats_id;
  568. uint32_t vdev_id;
  569. #ifdef WMI_NON_TLV_SUPPORT
  570. wmi_host_inst_rssi_args rssi_args;
  571. #endif
  572. };
  573. /**
  574. * struct bss_chan_info_request_params - BSS chan info params
  575. * @param: parameter value
  576. */
  577. struct bss_chan_info_request_params {
  578. uint32_t param;
  579. };
  580. /**
  581. * struct green_ap_ps_params - green ap ps cmd parameter
  582. * @value: parameter value
  583. */
  584. struct green_ap_ps_params {
  585. uint32_t value;
  586. };
  587. /**
  588. * struct wow_cmd_params - wow cmd parameter
  589. * @enable: wow enable or disable flag
  590. * @can_suspend_link: flag to indicate if link can be suspended
  591. * @pause_iface_config: interface config
  592. */
  593. struct wow_cmd_params {
  594. bool enable;
  595. bool can_suspend_link;
  596. uint8_t pause_iface_config;
  597. };
  598. /**
  599. * struct wow_add_wakeup_params - wow wakeup parameter
  600. * @type: param type
  601. */
  602. struct wow_add_wakeup_params {
  603. uint32_t type;
  604. };
  605. /**
  606. * struct wow_add_wakeup_pattern_params - Add WoW pattern params
  607. * @pattern_bytes: pointer to pattern bytes
  608. * @mask_bytes: pointer to mask bytes
  609. * @pattern_len: pattern length
  610. * @pattern_id: pattern id
  611. */
  612. struct wow_add_wakeup_pattern_params {
  613. uint8_t *pattern_bytes;
  614. uint8_t *mask_bytes;
  615. uint32_t pattern_len;
  616. uint32_t pattern_id;
  617. };
  618. /**
  619. * struct wow_remove_wakeup_pattern params - WoW remove pattern param
  620. * @pattern_bytes: pointer to pattern bytes
  621. * @mask_bytes: Mask bytes
  622. * @pattern_id: pattern identifier
  623. */
  624. struct wow_remove_wakeup_pattern_params {
  625. uint32_t *pattern_bytes;
  626. uint32_t *mask_bytes;
  627. uint32_t pattern_id;
  628. };
  629. /**
  630. * struct packet_enable_params - packet enable cmd parameter
  631. * @vdev_id: vdev id
  632. * @enable: flag to indicate if parameter can be enabled or disabled
  633. */
  634. struct packet_enable_params {
  635. uint8_t vdev_id;
  636. bool enable;
  637. };
  638. /**
  639. * struct suspend_params - suspend cmd parameter
  640. * @disable_target_intr: disable target interrupt
  641. */
  642. struct suspend_params {
  643. uint8_t disable_target_intr;
  644. };
  645. /**
  646. * struct pdev_params - pdev set cmd parameter
  647. * @param_id: parameter id
  648. * @param_value: parameter value
  649. */
  650. struct pdev_params {
  651. uint32_t param_id;
  652. uint32_t param_value;
  653. };
  654. /**
  655. * struct beacon_tmpl_params - beacon template cmd parameter
  656. * @vdev_id: vdev id
  657. * @tim_ie_offset: tim ie offset
  658. * @tmpl_len: beacon template length
  659. * @tmpl_len_aligned: beacon template alignment
  660. * @frm: beacon template parameter
  661. */
  662. struct beacon_tmpl_params {
  663. uint8_t vdev_id;
  664. uint32_t tim_ie_offset;
  665. uint32_t tmpl_len;
  666. uint32_t tmpl_len_aligned;
  667. uint8_t *frm;
  668. };
  669. #ifndef WMI_NON_TLV_SUPPORT
  670. /**
  671. * struct beacon_params - beacon cmd parameter
  672. * @vdev_id: vdev id
  673. * @tim_ie_offset: tim ie offset
  674. * @tmpl_len: beacon template length
  675. * @tmpl_len_aligned: beacon template alignment
  676. * @frm: beacon template parameter
  677. */
  678. struct beacon_params {
  679. uint8_t vdev_id;
  680. uint32_t tim_ie_offset;
  681. uint32_t tmpl_len;
  682. uint32_t tmpl_len_aligned;
  683. uint8_t *frm;
  684. };
  685. #else
  686. /**
  687. * struct beacon_params - beacon cmd parameter
  688. * @vdev_id: vdev id
  689. * @beaconInterval: Beacon interval
  690. * @wbuf: beacon buffer
  691. * @frame_ctrl: frame control field
  692. * @bcn_txant: beacon antenna
  693. * @is_dtim_count_zero: is it dtim beacon
  694. * @is_bitctl_reqd: is Bit control required
  695. * @is_high_latency: Is this high latency target
  696. */
  697. struct beacon_params {
  698. uint8_t vdev_id;
  699. uint16_t beaconInterval;
  700. qdf_nbuf_t wbuf;
  701. uint16_t frame_ctrl;
  702. uint32_t bcn_txant;
  703. bool is_dtim_count_zero;
  704. bool is_bitctl_reqd;
  705. bool is_high_latency;
  706. };
  707. #endif
  708. /**
  709. * struct bcn_prb_template_params - beacon probe template parameter
  710. * @vdev_id: vdev id
  711. * @buf_len: Template length
  712. * @caps: capabilities field
  713. * @erp: ERP field
  714. */
  715. struct bcn_prb_template_params {
  716. uint8_t vdev_id;
  717. int buf_len;
  718. uint16_t caps;
  719. uint8_t erp;
  720. };
  721. #define WMI_MAX_SUPPORTED_RATES 128
  722. /**
  723. * struct target_rate_set - Rate set bitmap
  724. * @num_rate: number of rates in rates bitmap
  725. * @rates: rates (each 8bit value) packed into a 32 bit word.
  726. * the rates are filled from least significant byte to most
  727. * significant byte.
  728. */
  729. typedef struct {
  730. uint32_t num_rates;
  731. uint32_t rates[(WMI_MAX_SUPPORTED_RATES / 4) + 1];
  732. } target_rate_set;
  733. /**
  734. * struct peer_assoc_params - peer assoc cmd parameter
  735. * @peer_macaddr: peer mac address
  736. * @vdev_id: vdev id
  737. * @peer_new_assoc: peer association type
  738. * @peer_associd: peer association id
  739. * @peer_flags: peer flags
  740. * @peer_caps: peer capabalities
  741. * @peer_listen_intval: peer listen interval
  742. * @peer_ht_caps: HT capabalities
  743. * @peer_max_mpdu: 0 : 8k , 1 : 16k, 2 : 32k, 3 : 64k
  744. * @peer_mpdu_density: 3 : 0~7 : 2^(11nAMPDUdensity -4)
  745. * @peer_rate_caps: peer rate capabalities
  746. * @peer_nss: peer nss
  747. * @peer_phymode: peer phymode
  748. * @peer_ht_info: peer HT info
  749. * @peer_legacy_rates: peer legacy rates
  750. * @peer_ht_rates: peer ht rates
  751. * @rx_max_rate: max rx rates
  752. * @rx_mcs_set: rx mcs
  753. * @tx_max_rate: max tx rates
  754. * @tx_mcs_set: tx mcs
  755. * @vht_capable: VHT capabalities
  756. * @tx_max_mcs_nss: max tx MCS and NSS
  757. * @peer_bw_rxnss_override: Peer BW RX NSS overriden or not.
  758. * @is_pmf_enabled: PMF enabled
  759. * @is_wme_set: WME enabled
  760. * @qos_flag: QoS Flags
  761. * @apsd_flag: APSD flags
  762. * @ht_flag: HT flags
  763. * @bw_40: 40 capabale
  764. * @bw_80: 80 capabale
  765. * @bw_160: 160 capabale
  766. * @stbc_flag: STBC flag
  767. * @ldpc_flag: LDPC flag
  768. * @static_mimops_flag: statis MIMO PS flags
  769. * @dynamic_mimops_flag: Dynamic MIMO PS flags
  770. * @spatial_mux_flag: spatial MUX flags
  771. * @vht_flag: VHT flags
  772. * @vht_ng_flag: VHT on 11N/G flags
  773. * @need_ptk_4_way: Needs 4 way handshake
  774. * @need_gtk_2_way: Needs 2 way GTK
  775. * @auth_flag: Is peer authenticated
  776. * @safe_mode_enabled: Safe enabled for this peer
  777. * @amsdu_disable: AMSDU disble
  778. * @peer_mac: Peer mac address
  779. */
  780. struct peer_assoc_params {
  781. wmi_mac_addr peer_macaddr;
  782. uint32_t vdev_id;
  783. uint32_t peer_new_assoc;
  784. uint32_t peer_associd;
  785. uint32_t peer_flags;
  786. uint32_t peer_caps;
  787. uint32_t peer_listen_intval;
  788. uint32_t peer_ht_caps;
  789. uint32_t peer_max_mpdu;
  790. uint32_t peer_mpdu_density;
  791. uint32_t peer_rate_caps;
  792. uint32_t peer_nss;
  793. uint32_t peer_vht_caps;
  794. uint32_t peer_phymode;
  795. uint32_t peer_ht_info[2];
  796. #ifndef WMI_NON_TLV_SUPPORT
  797. wmi_rate_set peer_legacy_rates;
  798. wmi_rate_set peer_ht_rates;
  799. #else
  800. target_rate_set peer_legacy_rates;
  801. target_rate_set peer_ht_rates;
  802. #endif
  803. uint32_t rx_max_rate;
  804. uint32_t rx_mcs_set;
  805. uint32_t tx_max_rate;
  806. uint32_t tx_mcs_set;
  807. uint8_t vht_capable;
  808. #ifdef WMI_NON_TLV_SUPPORT
  809. uint32_t tx_max_mcs_nss;
  810. uint32_t peer_bw_rxnss_override;
  811. bool is_pmf_enabled;
  812. bool is_wme_set;
  813. bool qos_flag;
  814. bool apsd_flag;
  815. bool ht_flag;
  816. bool bw_40;
  817. bool bw_80;
  818. bool bw_160;
  819. bool stbc_flag;
  820. bool ldpc_flag;
  821. bool static_mimops_flag;
  822. bool dynamic_mimops_flag;
  823. bool spatial_mux_flag;
  824. bool vht_flag;
  825. bool vht_ng_flag;
  826. bool need_ptk_4_way;
  827. bool need_gtk_2_way;
  828. bool auth_flag;
  829. bool safe_mode_enabled;
  830. bool amsdu_disable;
  831. /* Use common structure */
  832. uint8_t peer_mac[IEEE80211_ADDR_LEN];
  833. #endif
  834. };
  835. /**
  836. * struct sta_ps_params - sta ps cmd parameter
  837. * @vdev_id: vdev id
  838. * @param: sta ps paramter
  839. * @value: sta ps parameter value
  840. */
  841. struct sta_ps_params {
  842. uint32_t vdev_id;
  843. uint32_t param;
  844. uint32_t value;
  845. };
  846. /**
  847. * struct ap_ps_params - ap ps cmd parameter
  848. * @vdev_id: vdev id
  849. * @param: ap ps paramter
  850. * @value: ap ps paramter value
  851. */
  852. struct ap_ps_params {
  853. uint32_t vdev_id;
  854. uint32_t param;
  855. uint32_t value;
  856. };
  857. #define WMI_HOST_SCAN_CHAN_FREQ_SHIFT 0
  858. #define WMI_HOST_SCAN_CHAN_FREQ_MASK 0xffff
  859. #define WMI_HOST_SCAN_CHAN_MODE_SHIFT 16
  860. #define WMI_HOST_SCAN_CHAN_MODE_MASK 0xff
  861. /**
  862. * struct scan_start_params - start scan cmd parameter
  863. * @scan_id: scan id
  864. * @scan_req_id: requeted scan id
  865. * @vdev_id: vdev id
  866. * @scan_priority: scan priority
  867. * @notify_scan_events: flag to indicate if scan to be notified
  868. * @dwell_time_active: active dwell time
  869. * @dwell_time_passive: passive dwell time
  870. * @min_rest_time: min rest time
  871. * @max_rest_time: max rest time
  872. * @repeat_probe_time: repeat probe time
  873. * @probe_spacing_time: probe spacing time
  874. * @idle_time: idle time
  875. * @max_scan_time: max scan time
  876. * @probe_delay: probe delay
  877. * @scan_ctrl_flags: scan control flag
  878. * @burst_duration: burst duration
  879. * @num_chan: no of channel
  880. * @num_bssid: no of bssid
  881. * @num_ssids: no of ssid
  882. * @ie_len: ie length
  883. * @n_probes: no of probe
  884. * @chan_list: channel list
  885. * @ie_len_with_pad: ie length with padding
  886. * @num_ssid: no of ssid
  887. * @sid: pointer to mac_ssid structure
  888. * @uie_fieldOffset: ie field offset
  889. * @mac_add_bytes: mac address bytes
  890. * @is_strict_pscan_en: Is this a strict passive scan
  891. * @is_promiscous_mode: Is promiscous mode
  892. * @is_phy_error: is Phy error
  893. * @add_cck_rates: Add cck rates
  894. * @chan_stat_enable: channel stats enabled
  895. * @offchan_tx_mgmt: Offchan tx scan
  896. * @offchan_tx_data: offchan tx data
  897. * @add_bcast_probe_reqd: Add bcast probe request
  898. * @bssid_list: Lisst of bssid to scan
  899. * @ie_data: IE data buffer pointer
  900. * @passive_flag: Is this passive scan
  901. */
  902. struct scan_start_params {
  903. uint32_t scan_id;
  904. uint32_t scan_req_id;
  905. uint32_t vdev_id;
  906. uint32_t scan_priority;
  907. uint32_t notify_scan_events;
  908. uint32_t dwell_time_active;
  909. uint32_t dwell_time_passive;
  910. uint32_t min_rest_time;
  911. uint32_t max_rest_time;
  912. uint32_t repeat_probe_time;
  913. uint32_t probe_spacing_time;
  914. uint32_t idle_time;
  915. uint32_t max_scan_time;
  916. uint32_t probe_delay;
  917. uint32_t scan_ctrl_flags;
  918. uint32_t burst_duration;
  919. uint32_t num_chan;
  920. uint32_t num_bssid;
  921. uint32_t num_ssids;
  922. uint32_t ie_len;
  923. uint32_t n_probes;
  924. uint32_t *chan_list;
  925. uint32_t ie_len_with_pad;
  926. struct mac_ssid ssid[WMI_SCAN_MAX_NUM_SSID];
  927. uint8_t *ie_base;
  928. uint16_t uie_fieldOffset;
  929. uint8_t mac_add_bytes[IEEE80211_ADDR_LEN];
  930. #ifdef WMI_NON_TLV_SUPPORT
  931. bool is_strict_pscan_en;
  932. bool is_promiscous_mode;
  933. bool is_phy_error;
  934. bool add_cck_rates;
  935. bool chan_stat_enable;
  936. bool offchan_tx_mgmt;
  937. bool offchan_tx_data;
  938. bool add_bcast_probe_reqd;
  939. uint8_t bssid_list[WMI_SCAN_MAX_NUM_BSSID][IEEE80211_ADDR_LEN];
  940. uint8_t *ie_data;
  941. int passive_flag;
  942. #endif
  943. };
  944. /**
  945. * struct scan_stop_params - stop scan cmd parameter
  946. * @requestor: scan requestor
  947. * @scan_id: scan id
  948. * @req_type: scan request type
  949. * @vdev_id: vdev id
  950. * @all_scans: Stop all scans
  951. * @vap_scans: stop vap scans
  952. * @specific_scan: specific scan
  953. * @flags: scan flags
  954. * @ss_scan_id: ss scan id
  955. */
  956. struct scan_stop_params {
  957. uint32_t requestor;
  958. uint32_t scan_id;
  959. uint32_t req_type;
  960. uint32_t vdev_id;
  961. #ifdef WMI_NON_TLV_SUPPORT
  962. bool all_scans;
  963. bool vap_scans;
  964. bool specific_scan;
  965. uint32_t flags;
  966. uint32_t ss_scan_id;
  967. #endif
  968. };
  969. /**
  970. * struct scan_chan_list_params - scan channel list cmd parameter
  971. * @num_scan_chans: no of scan channels
  972. * @chan_info: pointer to wmi channel info
  973. */
  974. #ifndef WMI_NON_TLV_SUPPORT
  975. struct scan_chan_list_params {
  976. uint8_t num_scan_chans;
  977. wmi_channel *chan_info;
  978. };
  979. #else
  980. /**
  981. * struct scan_chan_list_params - scan channel list cmd parameter
  982. * @num_chan: no of scan channels
  983. * @nallchans: nall chans
  984. * @ch_param: pointer to channel_paramw
  985. */
  986. struct scan_chan_list_params {
  987. uint8_t num_chan;
  988. uint16_t nallchans;
  989. struct channel_param ch_param[1];
  990. };
  991. #endif
  992. /**
  993. * struct fw_hang_params - fw hang command parameters
  994. * @type: 0:unused 1: ASSERT, 2:not respond detect command, 3:simulate ep-full
  995. * @delay_time_ms: 0xffffffff means the simulate will delay for random time (0 ~0xffffffff ms)
  996. */
  997. struct fw_hang_params {
  998. uint32_t type;
  999. uint32_t delay_time_ms;
  1000. };
  1001. /**
  1002. * struct pdev_utf_params - pdev utf command parameters
  1003. * @utf_payload:
  1004. * @len:
  1005. * @is_ar900b: is it 900b target
  1006. */
  1007. struct pdev_utf_params {
  1008. uint8_t *utf_payload;
  1009. uint32_t len;
  1010. #ifdef WMI_NON_TLV_SUPPORT
  1011. bool is_ar900b;
  1012. #endif
  1013. };
  1014. /*Adding this due to dependency on wmi_unified.h
  1015. */
  1016. typedef struct {
  1017. uint32_t len;
  1018. uint32_t msgref;
  1019. uint32_t segmentInfo;
  1020. } QVIT_SEG_HDR_INFO_STRUCT;
  1021. struct pdev_qvit_params {
  1022. uint8_t *utf_payload;
  1023. uint32_t len;
  1024. };
  1025. /**
  1026. * struct crash_inject - crash inject command parameters
  1027. * @type: crash inject type
  1028. * @delay_time_ms: time in milliseconds for FW to delay the crash
  1029. */
  1030. struct crash_inject {
  1031. uint32_t type;
  1032. uint32_t delay_time_ms;
  1033. };
  1034. /**
  1035. * struct dbglog_params - fw deboglog command parameters
  1036. * @param: command parameter
  1037. * @val: parameter value
  1038. * @module_id_bitmap: fixed length module id bitmap
  1039. * @bitmap_len: module id bitmap length
  1040. * @cfgvalid: cfgvalid
  1041. */
  1042. struct dbglog_params {
  1043. uint32_t param;
  1044. uint32_t val;
  1045. uint32_t *module_id_bitmap;
  1046. uint32_t bitmap_len;
  1047. #ifdef WMI_NON_TLV_SUPPORT
  1048. uint32_t cfgvalid[2];
  1049. #endif
  1050. };
  1051. /**
  1052. * struct seg_hdr_info - header info
  1053. * @len: length
  1054. * @msgref: message refrence
  1055. * @segmentInfo: segment info
  1056. * @pad: padding
  1057. */
  1058. struct seg_hdr_info {
  1059. uint32_t len;
  1060. uint32_t msgref;
  1061. uint32_t segmentInfo;
  1062. uint32_t pad;
  1063. };
  1064. /**
  1065. * struct wmi_mgmt_params - wmi mgmt cmd paramters
  1066. * @tx_frame: management tx frame
  1067. * @frm_len: frame length
  1068. * @vdev_id: vdev id
  1069. * @tx_complete_cb: tx download callback handler
  1070. * @tx_ota_post_proc_cb: OTA complition handler
  1071. * @chanfreq: channel frequency
  1072. * @pdata: frame data
  1073. * @wmi_desc: command descriptor
  1074. * @desc_id: descriptor id relyaed back by target
  1075. * @macaddr - macaddr of peer
  1076. */
  1077. struct wmi_mgmt_params {
  1078. void *tx_frame;
  1079. uint16_t frm_len;
  1080. uint8_t vdev_id;
  1081. uint16_t chanfreq;
  1082. void *pdata;
  1083. uint16_t desc_id;
  1084. uint8_t *macaddr;
  1085. #ifndef WMI_NON_TLV_SUPPORT
  1086. /* Following elements should be moved to WMA
  1087. */
  1088. void *tx_complete_cb;
  1089. void *tx_ota_post_proc_cb;
  1090. struct wmi_desc_t *wmi_desc;
  1091. void *qdf_ctx;
  1092. #endif
  1093. };
  1094. /**
  1095. * struct p2p_ps_params - P2P powersave related params
  1096. * @opp_ps: opportunistic power save
  1097. * @ctwindow: CT window
  1098. * @count: count
  1099. * @duration: duration
  1100. * @interval: interval
  1101. * @single_noa_duration: single shot noa duration
  1102. * @ps_selection: power save selection
  1103. * @session_id: session id
  1104. */
  1105. struct p2p_ps_params {
  1106. uint8_t opp_ps;
  1107. uint32_t ctwindow;
  1108. uint8_t count;
  1109. uint32_t duration;
  1110. uint32_t interval;
  1111. uint32_t single_noa_duration;
  1112. uint8_t ps_selection;
  1113. uint8_t session_id;
  1114. };
  1115. /**
  1116. * struct ta_uapsd_trig_params - uapsd trigger parameter
  1117. * @vdevid: vdev id
  1118. * @peer_addr: peer address
  1119. * @auto_triggerparam: trigger parameters
  1120. * @num_ac: no of access category
  1121. */
  1122. struct sta_uapsd_trig_params {
  1123. uint32_t vdevid;
  1124. uint8_t peer_addr[IEEE80211_ADDR_LEN];
  1125. uint8_t *auto_triggerparam;
  1126. uint32_t num_ac;
  1127. };
  1128. /**
  1129. * struct ocb_utc_param
  1130. * @vdev_id: session id
  1131. * @utc_time: number of nanoseconds from Jan 1st 1958
  1132. * @time_error: the error in the UTC time. All 1's for unknown
  1133. */
  1134. struct ocb_utc_param {
  1135. uint32_t vdev_id;
  1136. uint8_t utc_time[WMI_SIZE_UTC_TIME];
  1137. uint8_t time_error[WMI_SIZE_UTC_TIME_ERROR];
  1138. };
  1139. /**
  1140. * struct ocb_timing_advert_param
  1141. * @vdev_id: session id
  1142. * @chan_freq: frequency on which to advertise
  1143. * @repeat_rate: the number of times it will send TA in 5 seconds
  1144. * @timestamp_offset: offset of the timestamp field in the TA frame
  1145. * @time_value_offset: offset of the time_value field in the TA frame
  1146. * @template_length: size in bytes of the TA frame
  1147. * @template_value: the TA frame
  1148. */
  1149. struct ocb_timing_advert_param {
  1150. uint32_t vdev_id;
  1151. uint32_t chan_freq;
  1152. uint32_t repeat_rate;
  1153. uint32_t timestamp_offset;
  1154. uint32_t time_value_offset;
  1155. uint32_t template_length;
  1156. uint8_t *template_value;
  1157. };
  1158. /**
  1159. * struct dcc_get_stats_param
  1160. * @vdev_id: session id
  1161. * @channel_count: number of dcc channels
  1162. * @request_array_len: size in bytes of the request array
  1163. * @request_array: the request array
  1164. */
  1165. struct dcc_get_stats_param {
  1166. uint32_t vdev_id;
  1167. uint32_t channel_count;
  1168. uint32_t request_array_len;
  1169. void *request_array;
  1170. };
  1171. /**
  1172. * struct dcc_update_ndl_param
  1173. * @vdev_id: session id
  1174. * @channel_count: number of channels to be updated
  1175. * @dcc_ndl_chan_list_len: size in bytes of the ndl_chan array
  1176. * @dcc_ndl_chan_list: the ndl_chan array
  1177. * @dcc_ndl_active_state_list_len: size in bytes of the active_state array
  1178. * @dcc_ndl_active_state_list: the active state array
  1179. */
  1180. struct dcc_update_ndl_param {
  1181. uint32_t vdev_id;
  1182. uint32_t channel_count;
  1183. uint32_t dcc_ndl_chan_list_len;
  1184. void *dcc_ndl_chan_list;
  1185. uint32_t dcc_ndl_active_state_list_len;
  1186. void *dcc_ndl_active_state_list;
  1187. };
  1188. /**
  1189. * struct ocb_config_sched
  1190. * @chan_freq: frequency of the channel
  1191. * @total_duration: duration of the schedule
  1192. * @guard_interval: guard interval on the start of the schedule
  1193. */
  1194. struct ocb_config_sched {
  1195. uint32_t chan_freq;
  1196. uint32_t total_duration;
  1197. uint32_t guard_interval;
  1198. };
  1199. /**
  1200. * OCB structures
  1201. */
  1202. #define WMI_NUM_AC (4)
  1203. #define WMI_OCB_CHANNEL_MAX (5)
  1204. #define WMI_MAX_NUM_AC 4
  1205. struct wmi_ocb_qos_params {
  1206. uint8_t aifsn;
  1207. uint8_t cwmin;
  1208. uint8_t cwmax;
  1209. };
  1210. /**
  1211. * struct ocb_config_channel
  1212. * @chan_freq: frequency of the channel
  1213. * @bandwidth: bandwidth of the channel, either 10 or 20 MHz
  1214. * @mac_address: MAC address assigned to this channel
  1215. * @qos_params: QoS parameters
  1216. * @max_pwr: maximum transmit power of the channel (dBm)
  1217. * @min_pwr: minimum transmit power of the channel (dBm)
  1218. * @reg_pwr: maximum transmit power specified by the regulatory domain (dBm)
  1219. * @antenna_max: maximum antenna gain specified by the regulatory domain (dB)
  1220. */
  1221. struct ocb_config_channel {
  1222. uint32_t chan_freq;
  1223. uint32_t bandwidth;
  1224. struct qdf_mac_addr mac_address;
  1225. struct wmi_ocb_qos_params qos_params[WMI_MAX_NUM_AC];
  1226. uint32_t max_pwr;
  1227. uint32_t min_pwr;
  1228. uint8_t reg_pwr;
  1229. uint8_t antenna_max;
  1230. uint16_t flags;
  1231. };
  1232. /**
  1233. * struct ocb_config_param
  1234. * @session_id: session id
  1235. * @channel_count: number of channels
  1236. * @schedule_size: size of the channel schedule
  1237. * @flags: reserved
  1238. * @channels: array of OCB channels
  1239. * @schedule: array of OCB schedule elements
  1240. * @dcc_ndl_chan_list_len: size of the ndl_chan array
  1241. * @dcc_ndl_chan_list: array of dcc channel info
  1242. * @dcc_ndl_active_state_list_len: size of the active state array
  1243. * @dcc_ndl_active_state_list: array of active states
  1244. * @adapter: the OCB adapter
  1245. * @dcc_stats_callback: callback for the response event
  1246. */
  1247. struct ocb_config_param {
  1248. uint8_t session_id;
  1249. uint32_t channel_count;
  1250. uint32_t schedule_size;
  1251. uint32_t flags;
  1252. struct ocb_config_channel *channels;
  1253. struct ocb_config_sched *schedule;
  1254. uint32_t dcc_ndl_chan_list_len;
  1255. void *dcc_ndl_chan_list;
  1256. uint32_t dcc_ndl_active_state_list_len;
  1257. void *dcc_ndl_active_state_list;
  1258. };
  1259. enum wmi_peer_rate_report_cond_phy_type {
  1260. WMI_PEER_RATE_REPORT_COND_11B = 0,
  1261. WMI_PEER_RATE_REPORT_COND_11A_G,
  1262. WMI_PEER_RATE_REPORT_COND_11N,
  1263. WMI_PEER_RATE_REPORT_COND_11AC,
  1264. WMI_PEER_RATE_REPORT_COND_MAX_NUM
  1265. };
  1266. /**
  1267. * struct report_rate_delta - peer specific parameters
  1268. * @percent: percentage
  1269. * @delta_min: rate min delta
  1270. */
  1271. struct report_rate_delta {
  1272. A_UINT32 percent; /* in unit of 12.5% */
  1273. A_UINT32 delta_min; /* in unit of Mbps */
  1274. };
  1275. /**
  1276. * struct report_rate_per_phy - per phy report parameters
  1277. * @cond_flags: condition flag val
  1278. * @delta: rate delta
  1279. * @report_rate_threshold: rate threshold
  1280. */
  1281. struct report_rate_per_phy {
  1282. /*
  1283. * PEER_RATE_REPORT_COND_FLAG_DELTA,
  1284. * PEER_RATE_REPORT_COND_FLAG_THRESHOLD
  1285. * Any of these two conditions or both of
  1286. * them can be set.
  1287. */
  1288. A_UINT32 cond_flags;
  1289. struct report_rate_delta delta;
  1290. /*
  1291. * In unit of Mbps. There are at most 4 thresholds
  1292. * If the threshold count is less than 4, set zero to
  1293. * the one following the last threshold
  1294. */
  1295. A_UINT32 report_rate_threshold[WMI_MAX_NUM_OF_RATE_THRESH];
  1296. };
  1297. /**
  1298. * struct peer_rate_report_params - peer rate report parameters
  1299. * @rate_report_enable: enable rate report param
  1300. * @backoff_time: backoff time
  1301. * @timer_period: timer
  1302. * @report_per_phy: report per phy type
  1303. */
  1304. struct wmi_peer_rate_report_params {
  1305. A_UINT32 rate_report_enable;
  1306. A_UINT32 backoff_time; /* in unit of msecond */
  1307. A_UINT32 timer_period; /* in unit of msecond */
  1308. /*
  1309. *In the following field, the array index means the phy type,
  1310. * please see enum wmi_peer_rate_report_cond_phy_type for detail
  1311. */
  1312. struct report_rate_per_phy report_per_phy[
  1313. WMI_PEER_RATE_REPORT_COND_MAX_NUM];
  1314. };
  1315. /**
  1316. * struct t_thermal_cmd_params - thermal command parameters
  1317. * @min_temp: minimum temprature
  1318. * @max_temp: maximum temprature
  1319. * @thermal_enable: thermal enable
  1320. */
  1321. struct thermal_cmd_params {
  1322. uint16_t min_temp;
  1323. uint16_t max_temp;
  1324. uint8_t thermal_enable;
  1325. };
  1326. #define WMI_LRO_IPV4_SEED_ARR_SZ 5
  1327. #define WMI_LRO_IPV6_SEED_ARR_SZ 11
  1328. /**
  1329. * struct wmi_lro_config_cmd_t - set LRO init parameters
  1330. * @lro_enable: indicates whether lro is enabled
  1331. * @tcp_flag: If the TCP flags from the packet do not match
  1332. * the values in this field after masking with TCP flags mask
  1333. * below, packet is not LRO eligible
  1334. * @tcp_flag_mask: field for comparing the TCP values provided
  1335. * above with the TCP flags field in the received packet
  1336. * @toeplitz_hash_ipv4: contains seed needed to compute the flow id
  1337. * 5-tuple toeplitz hash for ipv4 packets
  1338. * @toeplitz_hash_ipv6: contains seed needed to compute the flow id
  1339. * 5-tuple toeplitz hash for ipv6 packets
  1340. */
  1341. struct wmi_lro_config_cmd_t {
  1342. uint32_t lro_enable;
  1343. uint32_t tcp_flag:9,
  1344. tcp_flag_mask:9;
  1345. uint32_t toeplitz_hash_ipv4[WMI_LRO_IPV4_SEED_ARR_SZ];
  1346. uint32_t toeplitz_hash_ipv6[WMI_LRO_IPV6_SEED_ARR_SZ];
  1347. };
  1348. /**
  1349. * struct gtx_config_t - GTX config
  1350. * @gtx_rt_mask: for HT and VHT rate masks
  1351. * @gtx_usrcfg: host request for GTX mask
  1352. * @gtx_threshold: PER Threshold (default: 10%)
  1353. * @gtx_margin: PER margin (default: 2%)
  1354. * @gtx_tcpstep: TCP step (default: 1)
  1355. * @gtx_tpcMin: TCP min (default: 5)
  1356. * @gtx_bwmask: BW mask (20/40/80/160 Mhz)
  1357. */
  1358. struct wmi_gtx_config {
  1359. uint32_t gtx_rt_mask[2];
  1360. uint32_t gtx_usrcfg;
  1361. uint32_t gtx_threshold;
  1362. uint32_t gtx_margin;
  1363. uint32_t gtx_tpcstep;
  1364. uint32_t gtx_tpcmin;
  1365. uint32_t gtx_bwmask;
  1366. };
  1367. /**
  1368. * struct wmi_probe_resp_params - send probe response parameters
  1369. * @bssId: BSSID
  1370. * @pProbeRespTemplate: probe response template
  1371. * @probeRespTemplateLen: probe response template length
  1372. * @ucProxyProbeReqValidIEBmap: valid IE bitmap
  1373. */
  1374. struct wmi_probe_resp_params {
  1375. uint8_t bssId[IEEE80211_ADDR_LEN];
  1376. uint8_t *pProbeRespTemplate;
  1377. uint32_t probeRespTemplateLen;
  1378. uint32_t ucProxyProbeReqValidIEBmap[8];
  1379. };
  1380. /* struct set_key_params: structure containing
  1381. * installation key parameters
  1382. * @vdev_id: vdev id
  1383. * @key_len: key length
  1384. * @key_idx: key index
  1385. * @peer_mac: peer mac address
  1386. * @key_flags: key flags, 0:pairwise key, 1:group key, 2:static key
  1387. * @key_cipher: key cipher based on security mode
  1388. * @key_txmic_len: tx mic length
  1389. * @key_rxmic_len: rx mic length
  1390. * @rx_iv: receive IV, applicable only in case of WAPI
  1391. * @tx_iv: transmit IV, applicable only in case of WAPI
  1392. * @key_data: key data
  1393. */
  1394. struct set_key_params {
  1395. uint8_t vdev_id;
  1396. uint16_t key_len;
  1397. uint32_t key_idx;
  1398. uint8_t peer_mac[IEEE80211_ADDR_LEN];
  1399. uint32_t key_flags;
  1400. uint32_t key_cipher;
  1401. uint32_t key_txmic_len;
  1402. uint32_t key_rxmic_len;
  1403. #ifdef FEATURE_WLAN_WAPI
  1404. uint8_t rx_iv[16];
  1405. uint8_t tx_iv[16];
  1406. #endif
  1407. uint8_t key_data[WMI_MAC_MAX_KEY_LENGTH];
  1408. };
  1409. /**
  1410. * struct sta_params - sta keep alive parameters
  1411. * @vdev_id: vdev id
  1412. * @method: keep alive method
  1413. * @timeperiod: time to keep alive
  1414. * @hostv4addr: host ipv4 address
  1415. * @destv4addr: destination ipv4 address
  1416. * @destmac: destination mac address
  1417. */
  1418. struct sta_params {
  1419. uint8_t vdev_id;
  1420. uint32_t method;
  1421. uint32_t timeperiod;
  1422. uint8_t *hostv4addr;
  1423. uint8_t *destv4addr;
  1424. uint8_t *destmac;
  1425. };
  1426. /**
  1427. * struct gateway_update_req_param - gateway parameter update request
  1428. * @request_id: request id
  1429. * @session_id: session id
  1430. * @max_retries: Max ARP/NS retry attempts
  1431. * @timeout: Retry interval
  1432. * @ipv4_addr_type: on ipv4 network
  1433. * @ipv6_addr_type: on ipv6 network
  1434. * @gw_mac_addr: gateway mac addr
  1435. * @ipv4_addr: ipv4 addr
  1436. * @ipv6_addr: ipv6 addr
  1437. */
  1438. struct gateway_update_req_param {
  1439. uint32_t request_id;
  1440. uint32_t session_id;
  1441. uint32_t max_retries;
  1442. uint32_t timeout;
  1443. uint32_t ipv4_addr_type;
  1444. uint32_t ipv6_addr_type;
  1445. struct qdf_mac_addr gw_mac_addr;
  1446. uint8_t ipv4_addr[QDF_IPV4_ADDR_SIZE];
  1447. uint8_t ipv6_addr[QDF_IPV6_ADDR_SIZE];
  1448. };
  1449. /**
  1450. * struct rssi_monitor_param - rssi monitoring
  1451. * @request_id: request id
  1452. * @session_id: session id
  1453. * @min_rssi: minimum rssi
  1454. * @max_rssi: maximum rssi
  1455. * @control: flag to indicate start or stop
  1456. */
  1457. struct rssi_monitor_param {
  1458. uint32_t request_id;
  1459. uint32_t session_id;
  1460. int8_t min_rssi;
  1461. int8_t max_rssi;
  1462. bool control;
  1463. };
  1464. /**
  1465. * struct scan_mac_oui - oui paramters
  1466. * @oui: oui parameters
  1467. */
  1468. struct scan_mac_oui {
  1469. uint8_t oui[WMI_WIFI_SCANNING_MAC_OUI_LENGTH];
  1470. };
  1471. #define WMI_PASSPOINT_REALM_LEN 256
  1472. #define WMI_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM 16
  1473. #define WMI_PASSPOINT_PLMN_LEN 3
  1474. /**
  1475. * struct wifi_passpoint_network_param - passpoint network block
  1476. * @id: identifier of this network block
  1477. * @realm: null terminated UTF8 encoded realm, 0 if unspecified
  1478. * @roaming_consortium_ids: roaming consortium ids to match, 0s if unspecified
  1479. * @plmn: mcc/mnc combination as per rules, 0s if unspecified
  1480. */
  1481. struct wifi_passpoint_network_param {
  1482. uint32_t id;
  1483. uint8_t realm[WMI_PASSPOINT_REALM_LEN];
  1484. int64_t roaming_consortium_ids[WMI_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM];
  1485. uint8_t plmn[WMI_PASSPOINT_PLMN_LEN];
  1486. };
  1487. /**
  1488. * struct wifi_passpoint_req_param - passpoint request
  1489. * @request_id: request identifier
  1490. * @num_networks: number of networks
  1491. * @networks: passpoint networks
  1492. */
  1493. struct wifi_passpoint_req_param {
  1494. uint32_t request_id;
  1495. uint32_t session_id;
  1496. uint32_t num_networks;
  1497. struct wifi_passpoint_network_param networks[];
  1498. };
  1499. /* struct mobility_domain_info - structure containing
  1500. * mobility domain info
  1501. * @mdie_present: mobility domain present or not
  1502. * @mobility_domain: mobility domain
  1503. */
  1504. struct mobility_domain_info {
  1505. uint8_t mdie_present;
  1506. uint16_t mobility_domain;
  1507. };
  1508. /* struct roam_offload_scan_params - structure
  1509. * containing roaming offload scan parameters
  1510. * @is_roam_req_valid: flag to tell whether roam req
  1511. * is valid or NULL
  1512. * @mode: stores flags for scan
  1513. * @vdev_id: vdev id
  1514. * @roam_offload_enabled: flag for offload enable
  1515. * @psk_pmk: pre shared key/pairwise master key
  1516. * @pmk_len: length of PMK
  1517. * @prefer_5ghz: prefer select 5G candidate
  1518. * @roam_rssi_cat_gap: gap for every category bucket
  1519. * @select_5ghz_margin: select 5 Ghz margin
  1520. * @krk: KRK
  1521. * @btk: BTK
  1522. * @reassoc_failure_timeout: reassoc failure timeout
  1523. * @rokh_id_length: r0kh id length
  1524. * @rokh_id: r0kh id
  1525. * @roam_key_mgmt_offload_enabled: roam offload flag
  1526. * @auth_mode: authentication mode
  1527. * @is_ese_assoc: flag to determine ese assoc
  1528. * @mdid: mobility domain info
  1529. * @roam_offload_params: roam offload tlv params
  1530. */
  1531. struct roam_offload_scan_params {
  1532. uint8_t is_roam_req_valid;
  1533. uint32_t mode;
  1534. uint32_t vdev_id;
  1535. #ifdef WLAN_FEATURE_ROAM_OFFLOAD
  1536. uint8_t roam_offload_enabled;
  1537. uint8_t psk_pmk[WMI_ROAM_SCAN_PSK_SIZE];
  1538. uint32_t pmk_len;
  1539. uint8_t prefer_5ghz;
  1540. uint8_t roam_rssi_cat_gap;
  1541. uint8_t select_5ghz_margin;
  1542. uint8_t krk[WMI_KRK_KEY_LEN];
  1543. uint8_t btk[WMI_BTK_KEY_LEN];
  1544. uint32_t reassoc_failure_timeout;
  1545. uint32_t rokh_id_length;
  1546. uint8_t rokh_id[WMI_ROAM_R0KH_ID_MAX_LEN];
  1547. uint8_t roam_key_mgmt_offload_enabled;
  1548. int auth_mode;
  1549. #endif
  1550. bool is_ese_assoc;
  1551. struct mobility_domain_info mdid;
  1552. #ifndef WMI_NON_TLV_SUPPORT
  1553. /* THis is not available in non tlv target.
  1554. * please remove this and replace with a host based
  1555. * structure */
  1556. wmi_roam_offload_tlv_param roam_offload_params;
  1557. #endif
  1558. };
  1559. /* struct roam_offload_scan_rssi_params - structure containing
  1560. * parameters for roam offload scan based on RSSI
  1561. * @rssi_thresh: rssi threshold
  1562. * @rssi_thresh_diff: difference in rssi threshold
  1563. * @hi_rssi_scan_max_count: 5G scan max count
  1564. * @hi_rssi_scan_rssi_delta: 5G scan rssi change threshold value
  1565. * @hi_rssi_scan_rssi_ub: 5G scan upper bound
  1566. * @raise_rssi_thresh_5g: flag to determine penalty and boost thresholds
  1567. * @session_id: vdev id
  1568. * @penalty_threshold_5g: RSSI threshold below which 5GHz RSSI is penalized
  1569. * @boost_threshold_5g: RSSI threshold above which 5GHz RSSI is favored
  1570. * @raise_factor_5g: factor by which 5GHz RSSI is boosted
  1571. * @drop_factor_5g: factor by which 5GHz RSSI is penalized
  1572. * @max_raise_rssi_5g: maximum boost that can be applied to a 5GHz RSSI
  1573. * @max_drop_rssi_5g: maximum penalty that can be applied to a 5GHz RSSI
  1574. * @good_rssi_threshold: RSSI below which roam is kicked in by background
  1575. * scan although rssi is still good
  1576. * @roam_earlystop_thres_min: Minimum RSSI threshold value for early stop,
  1577. * unit is dB above NF
  1578. * @roam_earlystop_thres_max: Maximum RSSI threshold value for early stop,
  1579. * unit is dB above NF
  1580. * @dense_rssi_thresh_offset: dense roam RSSI threshold difference
  1581. * @dense_min_aps_cnt: dense roam minimum APs
  1582. * @initial_dense_status: dense status detected by host
  1583. * @traffic_threshold: dense roam RSSI threshold
  1584. */
  1585. struct roam_offload_scan_rssi_params {
  1586. int8_t rssi_thresh;
  1587. uint8_t rssi_thresh_diff;
  1588. uint32_t hi_rssi_scan_max_count;
  1589. uint32_t hi_rssi_scan_rssi_delta;
  1590. int32_t hi_rssi_scan_rssi_ub;
  1591. int raise_rssi_thresh_5g;
  1592. uint8_t session_id;
  1593. uint32_t penalty_threshold_5g;
  1594. uint32_t boost_threshold_5g;
  1595. uint8_t raise_factor_5g;
  1596. uint8_t drop_factor_5g;
  1597. int max_raise_rssi_5g;
  1598. int max_drop_rssi_5g;
  1599. uint32_t good_rssi_threshold;
  1600. uint32_t roam_earlystop_thres_min;
  1601. uint32_t roam_earlystop_thres_max;
  1602. int dense_rssi_thresh_offset;
  1603. int dense_min_aps_cnt;
  1604. int initial_dense_status;
  1605. int traffic_threshold;
  1606. };
  1607. /**
  1608. * struct wifi_epno_network - enhanced pno network block
  1609. * @ssid: ssid
  1610. * @rssi_threshold: threshold for considering this SSID as found, required
  1611. * granularity for this threshold is 4dBm to 8dBm
  1612. * @flags: WIFI_PNO_FLAG_XXX
  1613. * @auth_bit_field: auth bit field for matching WPA IE
  1614. */
  1615. struct wifi_epno_network_params {
  1616. struct mac_ssid ssid;
  1617. int8_t rssi_threshold;
  1618. uint8_t flags;
  1619. uint8_t auth_bit_field;
  1620. };
  1621. /**
  1622. * struct wifi_enhanched_pno_params - enhanced pno network params
  1623. * @num_networks: number of ssids
  1624. * @networks: PNO networks
  1625. */
  1626. struct wifi_enhanched_pno_params {
  1627. uint32_t request_id;
  1628. uint32_t session_id;
  1629. uint32_t num_networks;
  1630. struct wifi_epno_network_params networks[];
  1631. };
  1632. enum {
  1633. WMI_AP_RX_DATA_OFFLOAD = 0x00,
  1634. WMI_STA_RX_DATA_OFFLOAD = 0x01,
  1635. };
  1636. /**
  1637. * enum extscan_report_events_type - extscan report events type
  1638. * @EXTSCAN_REPORT_EVENTS_BUFFER_FULL: report only when scan history is % full
  1639. * @EXTSCAN_REPORT_EVENTS_EACH_SCAN: report a scan completion event after scan
  1640. * @EXTSCAN_REPORT_EVENTS_FULL_RESULTS: forward scan results
  1641. * (beacons/probe responses + IEs)
  1642. * in real time to HAL, in addition to completion events.
  1643. * Note: To keep backward compatibility,
  1644. * fire completion events regardless of REPORT_EVENTS_EACH_SCAN.
  1645. * @EXTSCAN_REPORT_EVENTS_NO_BATCH: controls batching,
  1646. * 0 => batching, 1 => no batching
  1647. */
  1648. enum wmi_extscan_report_events_type {
  1649. WMI_EXTSCAN_REPORT_EVENTS_BUFFER_FULL = 0x00,
  1650. WMI_EXTSCAN_REPORT_EVENTS_EACH_SCAN = 0x01,
  1651. WMI_EXTSCAN_REPORT_EVENTS_FULL_RESULTS = 0x02,
  1652. WMI_EXTSCAN_REPORT_EVENTS_NO_BATCH = 0x04,
  1653. };
  1654. /**
  1655. * struct ipa_offload_control_params - ipa offload parameters
  1656. * @offload_type: ipa offload type
  1657. * @vdev_id: vdev id
  1658. * @enable: ipa offload enable/disable
  1659. */
  1660. struct ipa_offload_control_params {
  1661. uint32_t offload_type;
  1662. uint32_t vdev_id;
  1663. uint32_t enable;
  1664. };
  1665. /**
  1666. * struct extscan_capabilities_params - ext scan capablities
  1667. * @request_id: request_id
  1668. * @session_id: session_id
  1669. */
  1670. struct extscan_capabilities_params {
  1671. uint32_t request_id;
  1672. uint8_t session_id;
  1673. };
  1674. /**
  1675. * struct extscan_capabilities_reset_params - ext scan capablities reset parameter
  1676. * @request_id: request_id
  1677. * @session_id: session_id
  1678. */
  1679. struct extscan_capabilities_reset_params {
  1680. uint32_t request_id;
  1681. uint8_t session_id;
  1682. };
  1683. /**
  1684. * struct extscan_bssid_hotlist_reset_params - ext scan hotlist reset parameter
  1685. * @request_id: request_id
  1686. * @session_id: session_id
  1687. */
  1688. struct extscan_bssid_hotlist_reset_params {
  1689. uint32_t request_id;
  1690. uint8_t session_id;
  1691. };
  1692. /**
  1693. * struct extscan_stop_req_params - ext scan stop parameter
  1694. * @request_id: request_id
  1695. * @session_id: session_id
  1696. */
  1697. struct extscan_stop_req_params {
  1698. uint32_t request_id;
  1699. uint8_t session_id;
  1700. };
  1701. /**
  1702. * struct ap_threshold_params - ap threshold parameter
  1703. * @bssid: mac address
  1704. * @low: low threshold
  1705. * @high: high threshold
  1706. */
  1707. struct ap_threshold_params {
  1708. struct qdf_mac_addr bssid;
  1709. int32_t low;
  1710. int32_t high;
  1711. };
  1712. /**
  1713. * struct extscan_set_sig_changereq_params - ext scan channel parameter
  1714. * @request_id: mac address
  1715. * @session_id: low threshold
  1716. * @rssi_sample_size: Number of samples for averaging RSSI
  1717. * @lostap_sample_size: Number of missed samples to confirm AP loss
  1718. * @min_breaching: Number of APs breaching threshold required for firmware
  1719. * @num_ap: no of scanned ap
  1720. * @ap: ap threshold parameter
  1721. */
  1722. struct extscan_set_sig_changereq_params {
  1723. uint32_t request_id;
  1724. uint8_t session_id;
  1725. uint32_t rssi_sample_size;
  1726. uint32_t lostap_sample_size;
  1727. uint32_t min_breaching;
  1728. uint32_t num_ap;
  1729. struct ap_threshold_params ap[WMI_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS];
  1730. };
  1731. /**
  1732. * struct extscan_cached_result_params - ext scan cached parameter
  1733. * @request_id: mac address
  1734. * @session_id: low threshold
  1735. * @flush: cached results flush
  1736. */
  1737. struct extscan_cached_result_params {
  1738. uint32_t request_id;
  1739. uint8_t session_id;
  1740. bool flush;
  1741. };
  1742. #ifdef FEATURE_WLAN_SCAN_PNO
  1743. /* Set PNO */
  1744. #define WMI_PNO_MAX_NETW_CHANNELS 26
  1745. #define WMI_PNO_MAX_NETW_CHANNELS_EX 60
  1746. #define WMI_PNO_MAX_SUPP_NETWORKS 16
  1747. /*
  1748. * size based of dot11 declaration without extra IEs as we will not carry those
  1749. * for PNO
  1750. */
  1751. #define WMI_PNO_MAX_PB_REQ_SIZE 450
  1752. #define WMI_PNO_24G_DEFAULT_CH 1
  1753. #define WMI_PNO_5G_DEFAULT_CH 36
  1754. /**
  1755. * enum pno_mode - pno mode types
  1756. * @WMI_PNO_MODE_IMMEDIATE: immidiate mode
  1757. * @WMI_PNO_MODE_ON_SUSPEND: suspend on mode
  1758. * @WMI_PNO_MODE_ON_RESUME: resume on mode
  1759. * @WMI_PNO_MODE_MAX: max range
  1760. */
  1761. enum pno_mode {
  1762. WMI_PNO_MODE_IMMEDIATE,
  1763. WMI_PNO_MODE_ON_SUSPEND,
  1764. WMI_PNO_MODE_ON_RESUME,
  1765. WMI_PNO_MODE_MAX
  1766. };
  1767. /**
  1768. * struct pno_nw_type - pno nw type
  1769. * @ssid: mac ssid
  1770. * @authentication: authentication type
  1771. * @encryption: encryption type
  1772. * @bcastNetwType: broadcast nw type
  1773. * @ucChannelCount: uc channel count
  1774. * @aChannels: pno channel
  1775. * @rssiThreshold: rssi threshold
  1776. */
  1777. struct pno_nw_type {
  1778. struct mac_ssid ssid;
  1779. uint32_t authentication;
  1780. uint32_t encryption;
  1781. uint32_t bcastNetwType;
  1782. uint8_t ucChannelCount;
  1783. uint8_t aChannels[WMI_PNO_MAX_NETW_CHANNELS_EX];
  1784. int32_t rssiThreshold;
  1785. };
  1786. /**
  1787. * struct pno_scan_req_params - PNO Scan request structure
  1788. * @enable: flag to enable or disable
  1789. * @modePNO: PNO Mode
  1790. * @ucNetworksCount: Number of networks
  1791. * @aNetworks: Preferred network list
  1792. * @sessionId: Session identifier
  1793. * @fast_scan_period: Fast Scan period
  1794. * @slow_scan_period: Slow scan period
  1795. * @fast_scan_max_cycles: Fast scan max cycles
  1796. * @us24GProbeTemplateLen: 2.4G probe template length
  1797. * @p24GProbeTemplate: 2.4G probe template
  1798. * @us5GProbeTemplateLen: 5G probe template length
  1799. * @p5GProbeTemplate: 5G probe template
  1800. * @pno_channel_prediction: PNO channel prediction feature status
  1801. * @top_k_num_of_channels: top K number of channels are used for tanimoto
  1802. * distance calculation.
  1803. * @stationary_thresh: threshold value to determine that the STA is stationary.
  1804. * @pnoscan_adaptive_dwell_mode: adaptive dwelltime mode for pno scan
  1805. * @channel_prediction_full_scan: periodic timer upon which a full scan needs
  1806. * to be triggered.
  1807. */
  1808. struct pno_scan_req_params {
  1809. uint8_t enable;
  1810. enum pno_mode modePNO;
  1811. uint8_t ucNetworksCount;
  1812. struct pno_nw_type aNetworks[WMI_PNO_MAX_SUPP_NETWORKS];
  1813. uint8_t sessionId;
  1814. uint32_t fast_scan_period;
  1815. uint32_t slow_scan_period;
  1816. uint8_t fast_scan_max_cycles;
  1817. uint32_t active_min_time;
  1818. uint32_t active_max_time;
  1819. uint32_t passive_min_time;
  1820. uint32_t passive_max_time;
  1821. uint16_t us24GProbeTemplateLen;
  1822. uint8_t p24GProbeTemplate[WMI_PNO_MAX_PB_REQ_SIZE];
  1823. uint16_t us5GProbeTemplateLen;
  1824. uint8_t p5GProbeTemplate[WMI_PNO_MAX_PB_REQ_SIZE];
  1825. #ifdef FEATURE_WLAN_SCAN_PNO
  1826. bool pno_channel_prediction;
  1827. uint8_t top_k_num_of_channels;
  1828. uint8_t stationary_thresh;
  1829. enum wmi_dwelltime_adaptive_mode pnoscan_adaptive_dwell_mode;
  1830. uint32_t channel_prediction_full_scan;
  1831. #endif
  1832. };
  1833. #endif /* FEATURE_WLAN_SCAN_PNO */
  1834. #define WMI_WLAN_EXTSCAN_MAX_CHANNELS 36
  1835. #define WMI_WLAN_EXTSCAN_MAX_BUCKETS 16
  1836. #define WMI_WLAN_EXTSCAN_MAX_HOTLIST_APS 128
  1837. #define WMI_WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS 64
  1838. #define WMI_EXTSCAN_MAX_HOTLIST_SSIDS 8
  1839. /**
  1840. * struct wifi_scan_channelspec_params - wifi scan channel parameter
  1841. * @channel: Frequency in MHz
  1842. * @dwellTimeMs: dwell time
  1843. * @flush: cached results flush
  1844. * @passive: passive scan
  1845. * @chnlClass: channel class
  1846. */
  1847. struct wifi_scan_channelspec_params {
  1848. uint32_t channel;
  1849. uint32_t dwellTimeMs;
  1850. bool passive;
  1851. uint8_t chnlClass;
  1852. };
  1853. /**
  1854. * enum wmi_wifi_band - wifi band
  1855. * @WMI_WIFI_BAND_UNSPECIFIED: unspecified band
  1856. * @WMI_WIFI_BAND_BG: 2.4 GHz
  1857. * @WMI_WIFI_BAND_A: 5 GHz without DFS
  1858. * @WMI_WIFI_BAND_ABG: 2.4 GHz + 5 GHz; no DFS
  1859. * @WMI_WIFI_BAND_A_DFS_ONLY: 5 GHz DFS only
  1860. * @WMI_WIFI_BAND_A_WITH_DFS: 5 GHz with DFS
  1861. * @WMI_WIFI_BAND_ABG_WITH_DFS: 2.4 GHz + 5 GHz with DFS
  1862. * @WMI_WIFI_BAND_MAX: max range
  1863. */
  1864. enum wmi_wifi_band {
  1865. WMI_WIFI_BAND_UNSPECIFIED,
  1866. WMI_WIFI_BAND_BG = 1,
  1867. WMI_WIFI_BAND_A = 2,
  1868. WMI_WIFI_BAND_ABG = 3,
  1869. WMI_WIFI_BAND_A_DFS_ONLY = 4,
  1870. /* 5 is reserved */
  1871. WMI_WIFI_BAND_A_WITH_DFS = 6,
  1872. WMI_WIFI_BAND_ABG_WITH_DFS = 7,
  1873. /* Keep it last */
  1874. WMI_WIFI_BAND_MAX
  1875. };
  1876. /**
  1877. * struct wifi_scan_bucket_params - wifi scan bucket spec
  1878. * @bucket: bucket identifier
  1879. * @band: wifi band
  1880. * @period: Desired period, in millisecond; if this is too
  1881. * low, the firmware should choose to generate results as fast as
  1882. * it can instead of failing the command byte
  1883. * for exponential backoff bucket this is the min_period
  1884. * @reportEvents: 0 => normal reporting (reporting rssi history
  1885. * only, when rssi history buffer is % full)
  1886. * 1 => same as 0 + report a scan completion event after scanning
  1887. * this bucket
  1888. * 2 => same as 1 + forward scan results
  1889. * (beacons/probe responses + IEs) in real time to HAL
  1890. * @max_period: if max_period is non zero or different than period,
  1891. * then this bucket is an exponential backoff bucket and
  1892. * the scan period will grow exponentially as per formula:
  1893. * actual_period(N) = period ^ (N/(step_count+1)) to a
  1894. * maximum period of max_period
  1895. * @exponent: for exponential back off bucket: multiplier:
  1896. * new_period = old_period * exponent
  1897. * @step_count: for exponential back off bucket, number of scans performed
  1898. * at a given period and until the exponent is applied
  1899. * @numChannels: channels to scan; these may include DFS channels
  1900. * Note that a given channel may appear in multiple buckets
  1901. * @min_dwell_time_active: per bucket minimum active dwell time
  1902. * @max_dwell_time_active: per bucket maximum active dwell time
  1903. * @min_dwell_time_passive: per bucket minimum passive dwell time
  1904. * @max_dwell_time_passive: per bucket maximum passive dwell time
  1905. * @channels: Channel list
  1906. */
  1907. struct wifi_scan_bucket_params {
  1908. uint8_t bucket;
  1909. enum wmi_wifi_band band;
  1910. uint32_t period;
  1911. uint32_t reportEvents;
  1912. uint32_t max_period;
  1913. uint32_t exponent;
  1914. uint32_t step_count;
  1915. uint32_t numChannels;
  1916. uint32_t min_dwell_time_active;
  1917. uint32_t max_dwell_time_active;
  1918. uint32_t min_dwell_time_passive;
  1919. uint32_t max_dwell_time_passive;
  1920. struct wifi_scan_channelspec_params channels[WMI_WLAN_EXTSCAN_MAX_CHANNELS];
  1921. };
  1922. /**
  1923. * struct wifi_scan_cmd_req_params - wifi scan command request params
  1924. * @basePeriod: base timer period
  1925. * @maxAPperScan: max ap per scan
  1926. * @report_threshold_percent: report threshold
  1927. * in %, when buffer is this much full, wake up host
  1928. * @report_threshold_num_scans: report threshold number of scans
  1929. * in number of scans, wake up host after these many scans
  1930. * @requestId: request id
  1931. * @sessionId: session id
  1932. * @numBuckets: number of buckets
  1933. * @min_dwell_time_active: per bucket minimum active dwell time
  1934. * @max_dwell_time_active: per bucket maximum active dwell time
  1935. * @min_dwell_time_passive: per bucket minimum passive dwell time
  1936. * @max_dwell_time_passive: per bucket maximum passive dwell time
  1937. * @configuration_flags: configuration flags
  1938. * @extscan_adaptive_dwell_mode: adaptive dwelltime mode for extscan
  1939. * @buckets: buckets array
  1940. */
  1941. struct wifi_scan_cmd_req_params {
  1942. uint32_t basePeriod;
  1943. uint32_t maxAPperScan;
  1944. uint32_t report_threshold_percent;
  1945. uint32_t report_threshold_num_scans;
  1946. uint32_t requestId;
  1947. uint8_t sessionId;
  1948. uint32_t numBuckets;
  1949. uint32_t min_dwell_time_active;
  1950. uint32_t max_dwell_time_active;
  1951. uint32_t min_dwell_time_passive;
  1952. uint32_t max_dwell_time_passive;
  1953. uint32_t configuration_flags;
  1954. enum wmi_dwelltime_adaptive_mode extscan_adaptive_dwell_mode;
  1955. struct wifi_scan_bucket_params buckets[WMI_WLAN_EXTSCAN_MAX_BUCKETS];
  1956. };
  1957. #define WMI_CFG_VALID_CHANNEL_LIST_LEN 100
  1958. /**
  1959. * struct plm_req_params - plm req parameter
  1960. * @diag_token: Dialog token
  1961. * @meas_token: measurement token
  1962. * @num_bursts: total number of bursts
  1963. * @burst_int: burst interval in seconds
  1964. * @meas_duration:in TU's,STA goes off-ch
  1965. * @burst_len: no of times the STA should cycle through PLM ch list
  1966. * @desired_tx_pwr: desired tx power
  1967. * @mac_addr: MC dest addr
  1968. * @plm_num_ch: channel numbers
  1969. * @plm_ch_list: channel list
  1970. * @session_id: session id
  1971. * @enable: enable/disable
  1972. */
  1973. struct plm_req_params {
  1974. uint16_t diag_token;
  1975. uint16_t meas_token;
  1976. uint16_t num_bursts;
  1977. uint16_t burst_int;
  1978. uint16_t meas_duration;
  1979. /* no of times the STA should cycle through PLM ch list */
  1980. uint8_t burst_len;
  1981. int8_t desired_tx_pwr;
  1982. struct qdf_mac_addr mac_addr;
  1983. /* no of channels */
  1984. uint8_t plm_num_ch;
  1985. /* channel numbers */
  1986. uint8_t plm_ch_list[WMI_CFG_VALID_CHANNEL_LIST_LEN];
  1987. uint8_t session_id;
  1988. bool enable;
  1989. };
  1990. #define MAX_SSID_ALLOWED_LIST 4
  1991. #define MAX_BSSID_AVOID_LIST 16
  1992. #define MAX_BSSID_FAVORED 16
  1993. /**
  1994. * struct mac_ts_info_tfc - mac ts info parameters
  1995. * @burstSizeDefn: burst size
  1996. * @reserved: reserved
  1997. * @ackPolicy: ack policy
  1998. * @psb: psb
  1999. * @aggregation: aggregation
  2000. * @accessPolicy: access policy
  2001. * @direction: direction
  2002. * @tsid: direction
  2003. * @trafficType: traffic type
  2004. */
  2005. struct mac_ts_info_tfc {
  2006. #ifndef ANI_LITTLE_BIT_ENDIAN
  2007. uint8_t burstSizeDefn:1;
  2008. uint8_t reserved:7;
  2009. #else
  2010. uint8_t reserved:7;
  2011. uint8_t burstSizeDefn:1;
  2012. #endif
  2013. #ifndef ANI_LITTLE_BIT_ENDIAN
  2014. uint16_t ackPolicy:2;
  2015. uint16_t userPrio:3;
  2016. uint16_t psb:1;
  2017. uint16_t aggregation:1;
  2018. uint16_t accessPolicy:2;
  2019. uint16_t direction:2;
  2020. uint16_t tsid:4;
  2021. uint16_t trafficType:1;
  2022. #else
  2023. uint16_t trafficType:1;
  2024. uint16_t tsid:4;
  2025. uint16_t direction:2;
  2026. uint16_t accessPolicy:2;
  2027. uint16_t aggregation:1;
  2028. uint16_t psb:1;
  2029. uint16_t userPrio:3;
  2030. uint16_t ackPolicy:2;
  2031. #endif
  2032. } qdf_packed;
  2033. /**
  2034. * struct mac_ts_info_sch - mac ts info schedule parameters
  2035. * @rsvd: reserved
  2036. * @schedule: schedule bit
  2037. */
  2038. struct mac_ts_info_sch {
  2039. #ifndef ANI_LITTLE_BIT_ENDIAN
  2040. uint8_t rsvd:7;
  2041. uint8_t schedule:1;
  2042. #else
  2043. uint8_t schedule:1;
  2044. uint8_t rsvd:7;
  2045. #endif
  2046. } qdf_packed;
  2047. /**
  2048. * struct mac_ts_info_sch - mac ts info schedule parameters
  2049. * @traffic: mac tfc parameter
  2050. * @schedule: mac schedule parameters
  2051. */
  2052. struct mac_ts_info {
  2053. struct mac_ts_info_tfc traffic;
  2054. struct mac_ts_info_sch schedule;
  2055. } qdf_packed;
  2056. /**
  2057. * struct mac_tspec_ie - mac ts spec
  2058. * @type: type
  2059. * @length: length
  2060. * @tsinfo: tsinfo
  2061. * @nomMsduSz: nomMsduSz
  2062. * @maxMsduSz: maxMsduSz
  2063. * @minSvcInterval: minSvcInterval
  2064. * @maxSvcInterval: maxSvcInterval
  2065. * @inactInterval: inactInterval
  2066. * @suspendInterval: suspendInterval
  2067. * @svcStartTime: svcStartTime
  2068. * @minDataRate: minDataRate
  2069. * @meanDataRate: meanDataRate
  2070. * @peakDataRate: peakDataRate
  2071. * @maxBurstSz: maxBurstSz
  2072. * @delayBound: delayBound
  2073. * @minPhyRate: minPhyRate
  2074. * @surplusBw: surplusBw
  2075. * @mediumTime: mediumTime
  2076. */
  2077. struct mac_tspec_ie {
  2078. uint8_t type;
  2079. uint8_t length;
  2080. struct mac_ts_info tsinfo;
  2081. uint16_t nomMsduSz;
  2082. uint16_t maxMsduSz;
  2083. uint32_t minSvcInterval;
  2084. uint32_t maxSvcInterval;
  2085. uint32_t inactInterval;
  2086. uint32_t suspendInterval;
  2087. uint32_t svcStartTime;
  2088. uint32_t minDataRate;
  2089. uint32_t meanDataRate;
  2090. uint32_t peakDataRate;
  2091. uint32_t maxBurstSz;
  2092. uint32_t delayBound;
  2093. uint32_t minPhyRate;
  2094. uint16_t surplusBw;
  2095. uint16_t mediumTime;
  2096. } qdf_packed;
  2097. /**
  2098. * struct add_ts_param - ADDTS related parameters
  2099. * @staIdx: station index
  2100. * @tspecIdx: TSPEC handler uniquely identifying a TSPEC for a STA in a BSS
  2101. * @tspec: tspec value
  2102. * @status: CDF status
  2103. * @sessionId: session id
  2104. * @tsm_interval: TSM interval period passed from UMAC to WMI
  2105. * @setRICparams: RIC parameters
  2106. * @sme_session_id: sme session id
  2107. */
  2108. struct add_ts_param {
  2109. uint16_t staIdx;
  2110. uint16_t tspecIdx;
  2111. struct mac_tspec_ie tspec;
  2112. QDF_STATUS status;
  2113. uint8_t sessionId;
  2114. #ifdef FEATURE_WLAN_ESE
  2115. uint16_t tsm_interval;
  2116. #endif /* FEATURE_WLAN_ESE */
  2117. #ifdef WLAN_FEATURE_ROAM_OFFLOAD
  2118. uint8_t setRICparams;
  2119. #endif /* WLAN_FEATURE_ROAM_OFFLOAD */
  2120. uint8_t sme_session_id;
  2121. };
  2122. /**
  2123. * struct delts_req_info - DELTS request parameter
  2124. * @tsinfo: ts info
  2125. * @tspec: ts spec
  2126. * @wmeTspecPresent: wme ts spec flag
  2127. * @wsmTspecPresent: wsm ts spec flag
  2128. * @lleTspecPresent: lle ts spec flag
  2129. */
  2130. struct delts_req_info {
  2131. struct mac_ts_info tsinfo;
  2132. struct mac_tspec_ie tspec;
  2133. uint8_t wmeTspecPresent:1;
  2134. uint8_t wsmTspecPresent:1;
  2135. uint8_t lleTspecPresent:1;
  2136. };
  2137. /**
  2138. * struct del_ts_params - DELTS related parameters
  2139. * @staIdx: station index
  2140. * @tspecIdx: TSPEC identifier uniquely identifying a TSPEC for a STA in a BSS
  2141. * @bssId: BSSID
  2142. * @sessionId: session id
  2143. * @userPrio: user priority
  2144. * @delTsInfo: DELTS info
  2145. * @setRICparams: RIC parameters
  2146. */
  2147. struct del_ts_params {
  2148. uint16_t staIdx;
  2149. uint16_t tspecIdx;
  2150. uint8_t bssId[IEEE80211_ADDR_LEN];
  2151. uint8_t sessionId;
  2152. uint8_t userPrio;
  2153. #ifdef WLAN_FEATURE_ROAM_OFFLOAD
  2154. struct delts_req_info delTsInfo;
  2155. uint8_t setRICparams;
  2156. #endif /* WLAN_FEATURE_ROAM_OFFLOAD */
  2157. };
  2158. /**
  2159. * struct ll_stats_clear_params - ll stats clear parameter
  2160. * @req_id: request id
  2161. * @sta_id: sta id
  2162. * @stats_clear_mask: stats clear mask
  2163. * @stop_req: stop request
  2164. */
  2165. struct ll_stats_clear_params {
  2166. uint32_t req_id;
  2167. uint8_t sta_id;
  2168. uint32_t stats_clear_mask;
  2169. uint8_t stop_req;
  2170. };
  2171. /**
  2172. * struct ll_stats_set_params - ll stats get parameter
  2173. * @req_id: request id
  2174. * @sta_id: sta id
  2175. * @mpdu_size_threshold: mpdu sixe threshold
  2176. * @aggressive_statistics_gathering: aggressive_statistics_gathering
  2177. */
  2178. struct ll_stats_set_params {
  2179. uint32_t req_id;
  2180. uint8_t sta_id;
  2181. uint32_t mpdu_size_threshold;
  2182. uint32_t aggressive_statistics_gathering;
  2183. };
  2184. /**
  2185. * struct ll_stats_get_params - ll stats parameter
  2186. * @req_id: request id
  2187. * @sta_id: sta id
  2188. * @param_id_mask: param is mask
  2189. */
  2190. struct ll_stats_get_params {
  2191. uint32_t req_id;
  2192. uint8_t sta_id;
  2193. uint32_t param_id_mask;
  2194. };
  2195. /**
  2196. * struct pe_stats_req - pe stats parameter
  2197. * @msg_type: message type is same as the request type
  2198. * @msg_len: length of the entire request
  2199. * @sta_id: Per STA stats request must contain valid
  2200. * @stats_mask: categories of stats requested
  2201. * @session_id: wsm ts spec flag
  2202. */
  2203. struct pe_stats_req {
  2204. /* Common for all types are requests */
  2205. uint16_t msg_type;
  2206. uint16_t msg_len;
  2207. uint32_t sta_id;
  2208. /* categories of stats requested. look at ePEStatsMask */
  2209. uint32_t stats_mask;
  2210. uint8_t session_id;
  2211. };
  2212. /**
  2213. * struct link_status_params - link stats parameter
  2214. * @msg_type: message type is same as the request type
  2215. * @msg_len: length of the entire request
  2216. * @link_status: wme ts spec flag
  2217. * @session_id: wsm ts spec flag
  2218. */
  2219. struct link_status_params {
  2220. uint16_t msg_type;
  2221. uint16_t msg_len;
  2222. uint8_t link_status;
  2223. uint8_t session_id;
  2224. };
  2225. /**
  2226. * struct dhcp_stop_ind_params - DHCP Stop indication message
  2227. * @msgtype: message type is same as the request type
  2228. * @msglen: length of the entire request
  2229. * @device_mode: Mode of the device(ex:STA, AP)
  2230. * @adapter_macaddr: MAC address of the adapter
  2231. * @peer_macaddr: MAC address of the connected peer
  2232. */
  2233. struct dhcp_stop_ind_params {
  2234. uint16_t msgtype;
  2235. uint16_t msglen;
  2236. uint8_t device_mode;
  2237. struct qdf_mac_addr adapter_macaddr;
  2238. struct qdf_mac_addr peer_macaddr;
  2239. };
  2240. /**
  2241. * struct aggr_add_ts_param - ADDTS parameters
  2242. * @staIdx: station index
  2243. * @tspecIdx: TSPEC handler uniquely identifying a TSPEC for a STA in a BSS
  2244. * @tspec: tspec value
  2245. * @status: CDF status
  2246. * @sessionId: session id
  2247. */
  2248. struct aggr_add_ts_param {
  2249. uint16_t staIdx;
  2250. uint16_t tspecIdx;
  2251. struct mac_tspec_ie tspec[WMI_QOS_NUM_AC_MAX];
  2252. QDF_STATUS status[WMI_QOS_NUM_AC_MAX];
  2253. uint8_t sessionId;
  2254. };
  2255. #define WMI_MAX_FILTER_TEST_DATA_LEN 8
  2256. #define WMI_MAX_NUM_MULTICAST_ADDRESS 240
  2257. #define WMI_MAX_NUM_FILTERS 20
  2258. #define WMI_MAX_NUM_TESTS_PER_FILTER 10
  2259. /**
  2260. * enum packet_filter_type - packet filter type
  2261. * @WMI_RCV_FILTER_TYPE_INVALID: invalid type
  2262. * @WMI_RCV_FILTER_TYPE_FILTER_PKT: filter packet type
  2263. * @WMI_RCV_FILTER_TYPE_BUFFER_PKT: buffer packet type
  2264. * @WMI_RCV_FILTER_TYPE_MAX_ENUM_SIZE: max enum size
  2265. */
  2266. enum packet_filter_type {
  2267. WMI_RCV_FILTER_TYPE_INVALID,
  2268. WMI_RCV_FILTER_TYPE_FILTER_PKT,
  2269. WMI_RCV_FILTER_TYPE_BUFFER_PKT,
  2270. WMI_RCV_FILTER_TYPE_MAX_ENUM_SIZE
  2271. };
  2272. /**
  2273. * enum packet_protocol_type - packet protocol type
  2274. * @WMI_FILTER_HDR_TYPE_INVALID: invalid type
  2275. * @WMI_FILTER_HDR_TYPE_MAC: mac type
  2276. * @WMI_FILTER_HDR_TYPE_ARP: trp type
  2277. * @WMI_FILTER_HDR_TYPE_IPV4: ipv4 type
  2278. * @WMI_FILTER_HDR_TYPE_IPV6: ipv6 type
  2279. * @WMI_FILTER_HDR_TYPE_UDP: udp type
  2280. * @WMI_FILTER_HDR_TYPE_MAX: max type
  2281. */
  2282. enum packet_protocol_type {
  2283. WMI_FILTER_HDR_TYPE_INVALID,
  2284. WMI_FILTER_HDR_TYPE_MAC,
  2285. WMI_FILTER_HDR_TYPE_ARP,
  2286. WMI_FILTER_HDR_TYPE_IPV4,
  2287. WMI_FILTER_HDR_TYPE_IPV6,
  2288. WMI_FILTER_HDR_TYPE_UDP,
  2289. WMI_FILTER_HDR_TYPE_MAX
  2290. };
  2291. /**
  2292. * enum packet_filter_comp_type - packet filter comparison type
  2293. * @WMI_FILTER_CMP_TYPE_INVALID: invalid type
  2294. * @WMI_FILTER_CMP_TYPE_EQUAL: type equal
  2295. * @WMI_FILTER_CMP_TYPE_MASK_EQUAL: mask equal
  2296. * @WMI_FILTER_CMP_TYPE_NOT_EQUAL: type not equal
  2297. * @WMI_FILTER_CMP_TYPE_MASK_NOT_EQUAL: mask not equal
  2298. * @WMI_FILTER_CMP_TYPE_MAX: max type
  2299. */
  2300. enum packet_filter_comp_type {
  2301. WMI_FILTER_CMP_TYPE_INVALID,
  2302. WMI_FILTER_CMP_TYPE_EQUAL,
  2303. WMI_FILTER_CMP_TYPE_MASK_EQUAL,
  2304. WMI_FILTER_CMP_TYPE_NOT_EQUAL,
  2305. WMI_FILTER_CMP_TYPE_MASK_NOT_EQUAL,
  2306. WMI_FILTER_CMP_TYPE_MAX
  2307. };
  2308. /**
  2309. * struct rcv_pkt_filter_params - recieve packet filter parameters
  2310. * @protocolLayer - protocol layer
  2311. * @cmpFlag - comparison flag
  2312. * @dataLength - data length
  2313. * @dataOffset - data offset
  2314. * @reserved - resserved
  2315. * @compareData - compare data
  2316. * @dataMask - data mask
  2317. */
  2318. struct rcv_pkt_filter_params {
  2319. enum packet_protocol_type protocolLayer;
  2320. enum packet_filter_comp_type cmpFlag;
  2321. uint16_t dataLength;
  2322. uint8_t dataOffset;
  2323. uint8_t reserved;
  2324. uint8_t compareData[WMI_MAX_FILTER_TEST_DATA_LEN];
  2325. uint8_t dataMask[WMI_MAX_FILTER_TEST_DATA_LEN];
  2326. };
  2327. /**
  2328. * struct rcv_pkt_filter_config - recieve packet filter info
  2329. * @filterId - filter id
  2330. * @filterType - filter type
  2331. * @numFieldParams - no of fields
  2332. * @coalesceTime - reserved parameter
  2333. * @self_macaddr - self mac address
  2334. * @bssid - Bssid of the connected AP
  2335. * @paramsData - data parameter
  2336. */
  2337. struct rcv_pkt_filter_config {
  2338. uint8_t filterId;
  2339. enum packet_filter_type filterType;
  2340. uint32_t numFieldParams;
  2341. uint32_t coalesceTime;
  2342. struct qdf_mac_addr self_macaddr;
  2343. struct qdf_mac_addr bssid;
  2344. struct rcv_pkt_filter_params paramsData[WMI_MAX_NUM_TESTS_PER_FILTER];
  2345. };
  2346. /**
  2347. * struct vdev_ie_info_param - IE info
  2348. * @vdev_id - vdev for which the IE is being sent
  2349. * @ie_id - ID of the IE
  2350. * @length - length of the IE data
  2351. * @data - IE data
  2352. *
  2353. * This structure is used to store the IE information.
  2354. */
  2355. struct vdev_ie_info_param {
  2356. uint32_t vdev_id;
  2357. uint32_t ie_id;
  2358. uint32_t length;
  2359. uint8_t *data;
  2360. };
  2361. #define WMI_MAX_NUM_FW_SEGMENTS 4
  2362. /**
  2363. * struct fw_dump_seg_req_param - individual segment details
  2364. * @seg_id - segment id.
  2365. * @seg_start_addr_lo - lower address of the segment.
  2366. * @seg_start_addr_hi - higher address of the segment.
  2367. * @seg_length - length of the segment.
  2368. * @dst_addr_lo - lower address of the destination buffer.
  2369. * @dst_addr_hi - higher address of the destination buffer.
  2370. *
  2371. * This structure carries the information to firmware about the
  2372. * individual segments. This structure is part of firmware memory
  2373. * dump request.
  2374. */
  2375. struct fw_dump_seg_req_param {
  2376. uint8_t seg_id;
  2377. uint32_t seg_start_addr_lo;
  2378. uint32_t seg_start_addr_hi;
  2379. uint32_t seg_length;
  2380. uint32_t dst_addr_lo;
  2381. uint32_t dst_addr_hi;
  2382. };
  2383. /**
  2384. * struct fw_dump_req_param - firmware memory dump request details.
  2385. * @request_id - request id.
  2386. * @num_seg - requested number of segments.
  2387. * @fw_dump_seg_req - individual segment information.
  2388. *
  2389. * This structure carries information about the firmware
  2390. * memory dump request.
  2391. */
  2392. struct fw_dump_req_param {
  2393. uint32_t request_id;
  2394. uint32_t num_seg;
  2395. struct fw_dump_seg_req_param segment[WMI_MAX_NUM_FW_SEGMENTS];
  2396. };
  2397. #define WMI_TDLS_MAX_SUPP_CHANNELS 128
  2398. #define WMI_TDLS_MAX_SUPP_OPER_CLASSES 32
  2399. #define WMI_2_4_GHZ_MAX_FREQ 3000
  2400. /**
  2401. * struct tdls_update_ch_params - channel parameters
  2402. * @chanId: ID of the channel
  2403. * @pwr: power level
  2404. * @dfsSet: is dfs supported or not
  2405. * @half_rate: is the channel operating at 10MHz
  2406. * @quarter_rate: is the channel operating at 5MHz
  2407. */
  2408. struct tdls_update_ch_params {
  2409. uint8_t chanId;
  2410. uint8_t pwr;
  2411. bool dfsSet;
  2412. bool half_rate;
  2413. bool quarter_rate;
  2414. };
  2415. /**
  2416. * struct tdls_peer_cap_params - TDLS peer capablities parameters
  2417. * @isPeerResponder: is peer responder or not
  2418. * @peerUapsdQueue: peer uapsd queue
  2419. * @peerMaxSp: peer max SP value
  2420. * @peerBuffStaSupport: peer buffer sta supported or not
  2421. * @peerOffChanSupport: peer offchannel support
  2422. * @peerCurrOperClass: peer current operating class
  2423. * @selfCurrOperClass: self current operating class
  2424. * @peerChanLen: peer channel length
  2425. * @peerChan: peer channel list
  2426. * @peerOperClassLen: peer operating class length
  2427. * @peerOperClass: peer operating class
  2428. * @prefOffChanNum: peer offchannel number
  2429. * @prefOffChanBandwidth: peer offchannel bandwidth
  2430. * @opClassForPrefOffChan: operating class for offchannel
  2431. */
  2432. struct tdls_peer_cap_params {
  2433. uint8_t isPeerResponder;
  2434. uint8_t peerUapsdQueue;
  2435. uint8_t peerMaxSp;
  2436. uint8_t peerBuffStaSupport;
  2437. uint8_t peerOffChanSupport;
  2438. uint8_t peerCurrOperClass;
  2439. uint8_t selfCurrOperClass;
  2440. uint8_t peerChanLen;
  2441. struct tdls_update_ch_params peerChan[WMI_TDLS_MAX_SUPP_CHANNELS];
  2442. uint8_t peerOperClassLen;
  2443. uint8_t peerOperClass[WMI_TDLS_MAX_SUPP_OPER_CLASSES];
  2444. uint8_t prefOffChanNum;
  2445. uint8_t prefOffChanBandwidth;
  2446. uint8_t opClassForPrefOffChan;
  2447. };
  2448. /**
  2449. * struct tdls_peer_state_params - TDLS peer state parameters
  2450. * @vdevId: vdev id
  2451. * @peerMacAddr: peer mac address
  2452. * @peerCap: peer capabality
  2453. */
  2454. struct tdls_peer_state_params {
  2455. uint32_t vdevId;
  2456. uint8_t peerMacAddr[IEEE80211_ADDR_LEN];
  2457. uint32_t peerState;
  2458. struct tdls_peer_cap_params peerCap;
  2459. };
  2460. /**
  2461. * struct wmi_tdls_params - TDLS parameters
  2462. * @vdev_id: vdev id
  2463. * @tdls_state: TDLS state
  2464. * @notification_interval_ms: notification inerval
  2465. * @tx_discovery_threshold: tx discovery threshold
  2466. * @tx_teardown_threshold: tx teardown threashold
  2467. * @rssi_teardown_threshold: RSSI teardown threshold
  2468. * @rssi_delta: RSSI delta
  2469. * @tdls_options: TDLS options
  2470. * @peer_traffic_ind_window: raffic indication window
  2471. * @peer_traffic_response_timeout: traffic response timeout
  2472. * @puapsd_mask: uapsd mask
  2473. * @puapsd_inactivity_time: uapsd inactivity time
  2474. * @puapsd_rx_frame_threshold: uapsd rx frame threshold
  2475. * @teardown_notification_ms: tdls teardown notification interval
  2476. * @tdls_peer_kickout_threshold: tdls packet threshold for
  2477. * peer kickout operation
  2478. */
  2479. struct wmi_tdls_params {
  2480. uint32_t vdev_id;
  2481. uint32_t tdls_state;
  2482. uint32_t notification_interval_ms;
  2483. uint32_t tx_discovery_threshold;
  2484. uint32_t tx_teardown_threshold;
  2485. int32_t rssi_teardown_threshold;
  2486. int32_t rssi_delta;
  2487. uint32_t tdls_options;
  2488. uint32_t peer_traffic_ind_window;
  2489. uint32_t peer_traffic_response_timeout;
  2490. uint32_t puapsd_mask;
  2491. uint32_t puapsd_inactivity_time;
  2492. uint32_t puapsd_rx_frame_threshold;
  2493. uint32_t teardown_notification_ms;
  2494. uint32_t tdls_peer_kickout_threshold;
  2495. };
  2496. /**
  2497. * struct tdls_chan_switch_params - channel switch parameter structure
  2498. * @vdev_id: vdev ID
  2499. * @peer_mac_addr: Peer mac address
  2500. * @tdls_off_ch_bw_offset: Target off-channel bandwitdh offset
  2501. * @tdls_off_ch: Target Off Channel
  2502. * @oper_class: Operating class for target channel
  2503. * @is_responder: Responder or initiator
  2504. */
  2505. struct tdls_channel_switch_params {
  2506. uint32_t vdev_id;
  2507. uint8_t peer_mac_addr[IEEE80211_ADDR_LEN];
  2508. uint16_t tdls_off_ch_bw_offset;
  2509. uint8_t tdls_off_ch;
  2510. uint8_t tdls_sw_mode;
  2511. uint8_t oper_class;
  2512. uint8_t is_responder;
  2513. };
  2514. /**
  2515. * struct dhcp_offload_info_params - dhcp offload parameters
  2516. * @vdev_id: request data length
  2517. * @dhcpSrvOffloadEnabled: dhcp offload enabled
  2518. * @dhcpClientNum: dhcp client no
  2519. * @dhcpSrvIP: dhcp server ip
  2520. */
  2521. struct dhcp_offload_info_params {
  2522. uint32_t vdev_id;
  2523. uint32_t dhcpSrvOffloadEnabled;
  2524. uint32_t dhcpClientNum;
  2525. uint32_t dhcpSrvIP;
  2526. };
  2527. /**
  2528. * struct nan_req_params - NAN request params
  2529. * @request_data_len: request data length
  2530. * @request_data: request data
  2531. */
  2532. struct nan_req_params {
  2533. uint16_t request_data_len;
  2534. uint8_t request_data[];
  2535. };
  2536. /**
  2537. * struct app_type2_params - app type2parameter
  2538. * @vdev_id: vdev id
  2539. * @rc4_key: rc4 key
  2540. * @rc4_key_len: rc4 key length
  2541. * @ip_id: NC id
  2542. * @ip_device_ip: NC IP addres
  2543. * @ip_server_ip: Push server IP address
  2544. * @tcp_src_port: NC TCP port
  2545. * @tcp_dst_port: Push server TCP port
  2546. * @tcp_seq: tcp sequence
  2547. * @tcp_ack_seq: tcp ack sequence
  2548. * @keepalive_init: Initial ping interval
  2549. * @keepalive_min: Minimum ping interval
  2550. * @keepalive_max: Maximum ping interval
  2551. * @keepalive_inc: Increment of ping interval
  2552. * @gateway_mac: gateway mac address
  2553. * @tcp_tx_timeout_val: tcp tx timeout value
  2554. * @tcp_rx_timeout_val: tcp rx timeout value
  2555. */
  2556. struct app_type2_params {
  2557. uint8_t vdev_id;
  2558. uint8_t rc4_key[16];
  2559. uint32_t rc4_key_len;
  2560. /** ip header parameter */
  2561. uint32_t ip_id;
  2562. uint32_t ip_device_ip;
  2563. uint32_t ip_server_ip;
  2564. /** tcp header parameter */
  2565. uint16_t tcp_src_port;
  2566. uint16_t tcp_dst_port;
  2567. uint32_t tcp_seq;
  2568. uint32_t tcp_ack_seq;
  2569. uint32_t keepalive_init;
  2570. uint32_t keepalive_min;
  2571. uint32_t keepalive_max;
  2572. uint32_t keepalive_inc;
  2573. struct qdf_mac_addr gateway_mac;
  2574. uint32_t tcp_tx_timeout_val;
  2575. uint32_t tcp_rx_timeout_val;
  2576. };
  2577. /**
  2578. * struct app_type1_params - app type1 parameter
  2579. * @vdev_id: vdev id
  2580. * @wakee_mac_addr: mac address
  2581. * @identification_id: identification id
  2582. * @password: password
  2583. * @id_length: id length
  2584. * @pass_length: password length
  2585. */
  2586. struct app_type1_params {
  2587. uint8_t vdev_id;
  2588. struct qdf_mac_addr wakee_mac_addr;
  2589. uint8_t identification_id[8];
  2590. uint8_t password[16];
  2591. uint32_t id_length;
  2592. uint32_t pass_length;
  2593. };
  2594. /**
  2595. * enum wmi_ext_wow_type - wow type
  2596. * @WMI_EXT_WOW_TYPE_APP_TYPE1: only enable wakeup for app type1
  2597. * @WMI_EXT_WOW_TYPE_APP_TYPE2: only enable wakeup for app type2
  2598. * @WMI_EXT_WOW_TYPE_APP_TYPE1_2: enable wakeup for app type1&2
  2599. */
  2600. enum wmi_ext_wow_type {
  2601. WMI_EXT_WOW_TYPE_APP_TYPE1,
  2602. WMI_EXT_WOW_TYPE_APP_TYPE2,
  2603. WMI_EXT_WOW_TYPE_APP_TYPE1_2,
  2604. };
  2605. /**
  2606. * struct ext_wow_params - ext wow parameters
  2607. * @vdev_id: vdev id
  2608. * @type: wow type
  2609. * @wakeup_pin_num: wake up gpio no
  2610. */
  2611. struct ext_wow_params {
  2612. uint8_t vdev_id;
  2613. enum wmi_ext_wow_type type;
  2614. uint32_t wakeup_pin_num;
  2615. };
  2616. /**
  2617. * struct stats_ext_params - ext stats request
  2618. * @vdev_id: vdev id
  2619. * @request_data_len: request data length
  2620. * @request_data: request data
  2621. */
  2622. struct stats_ext_params {
  2623. uint32_t vdev_id;
  2624. uint32_t request_data_len;
  2625. uint8_t request_data[];
  2626. };
  2627. #define WMI_PERIODIC_TX_PTRN_MAX_SIZE 1536
  2628. /**
  2629. * struct periodic_tx_pattern - periodic tx pattern
  2630. * @mac_address: MAC Address for the adapter
  2631. * @ucPtrnId: Pattern ID
  2632. * @ucPtrnSize: Pattern size
  2633. * @usPtrnIntervalMs: in ms
  2634. * @ucPattern: Pattern buffer
  2635. */
  2636. struct periodic_tx_pattern {
  2637. struct qdf_mac_addr mac_address;
  2638. uint8_t ucPtrnId;
  2639. uint16_t ucPtrnSize;
  2640. uint32_t usPtrnIntervalMs;
  2641. uint8_t ucPattern[WMI_PERIODIC_TX_PTRN_MAX_SIZE];
  2642. };
  2643. #define WMI_GTK_OFFLOAD_KEK_BYTES 16
  2644. #define WMI_GTK_OFFLOAD_KCK_BYTES 16
  2645. #define WMI_GTK_OFFLOAD_ENABLE 0
  2646. #define WMI_GTK_OFFLOAD_DISABLE 1
  2647. /**
  2648. * struct gtk_offload_params - gtk offload parameters
  2649. * @ulFlags: optional flags
  2650. * @aKCK: Key confirmation key
  2651. * @aKEK: key encryption key
  2652. * @ullKeyReplayCounter: replay counter
  2653. * @bssid: bss id
  2654. */
  2655. struct gtk_offload_params {
  2656. uint32_t ulFlags;
  2657. uint8_t aKCK[WMI_GTK_OFFLOAD_KCK_BYTES];
  2658. uint8_t aKEK[WMI_GTK_OFFLOAD_KEK_BYTES];
  2659. uint64_t ullKeyReplayCounter;
  2660. struct qdf_mac_addr bssid;
  2661. };
  2662. /**
  2663. * struct flashing_req_params - led flashing parameter
  2664. * @reqId: request id
  2665. * @pattern_id: pattern identifier. 0: disconnected 1: connected
  2666. * @led_x0: led flashing parameter0
  2667. * @led_x1: led flashing parameter1
  2668. */
  2669. struct flashing_req_params {
  2670. uint32_t req_id;
  2671. uint32_t pattern_id;
  2672. uint32_t led_x0;
  2673. uint32_t led_x1;
  2674. };
  2675. #define MAX_MEM_CHUNKS 32
  2676. /**
  2677. * struct wmi_host_mem_chunk - host memory chunk structure
  2678. * @vaddr: Pointer to virtual address
  2679. * @paddr: Physical address
  2680. * @memctx: qdf memory context for mapped address.
  2681. * @len: length of chunk
  2682. * @req_id: request id from target
  2683. */
  2684. struct wmi_host_mem_chunk {
  2685. uint32_t *vaddr;
  2686. uint32_t paddr;
  2687. qdf_dma_mem_context(memctx);
  2688. uint32_t len;
  2689. uint32_t req_id;
  2690. };
  2691. /**
  2692. * struct target_resource_config - Resource config given to target
  2693. * This structure is union of wmi_resource_config defined
  2694. * by both TLV and non-TLV target.
  2695. */
  2696. struct target_resource_config {
  2697. uint32_t num_vdevs;
  2698. uint32_t num_peers;
  2699. uint32_t num_active_peers;
  2700. uint32_t num_offload_peers;
  2701. uint32_t num_offload_reorder_buffs;
  2702. uint32_t num_peer_keys;
  2703. uint32_t num_tids;
  2704. uint32_t ast_skid_limit;
  2705. uint32_t tx_chain_mask;
  2706. uint32_t rx_chain_mask;
  2707. uint32_t rx_timeout_pri[4];
  2708. uint32_t rx_decap_mode;
  2709. uint32_t scan_max_pending_req;
  2710. uint32_t bmiss_offload_max_vdev;
  2711. uint32_t roam_offload_max_vdev;
  2712. uint32_t roam_offload_max_ap_profiles;
  2713. uint32_t num_mcast_groups;
  2714. uint32_t num_mcast_table_elems;
  2715. uint32_t mcast2ucast_mode;
  2716. uint32_t tx_dbg_log_size;
  2717. uint32_t num_wds_entries;
  2718. uint32_t dma_burst_size;
  2719. uint32_t mac_aggr_delim;
  2720. uint32_t rx_skip_defrag_timeout_dup_detection_check;
  2721. uint32_t vow_config;
  2722. uint32_t gtk_offload_max_vdev;
  2723. uint32_t num_msdu_desc; /* Number of msdu desc */
  2724. uint32_t max_frag_entries;
  2725. /* End common */
  2726. /* Added in MCL */
  2727. uint32_t num_tdls_vdevs;
  2728. uint32_t num_tdls_conn_table_entries;
  2729. uint32_t beacon_tx_offload_max_vdev;
  2730. uint32_t num_multicast_filter_entries;
  2731. uint32_t num_wow_filters;
  2732. uint32_t num_keep_alive_pattern;
  2733. uint32_t keep_alive_pattern_size;
  2734. uint32_t max_tdls_concurrent_sleep_sta;
  2735. uint32_t max_tdls_concurrent_buffer_sta;
  2736. uint32_t wmi_send_separate;
  2737. uint32_t num_ocb_vdevs;
  2738. uint32_t num_ocb_channels;
  2739. uint32_t num_ocb_schedules;
  2740. };
  2741. /**
  2742. * struct wmi_wifi_start_log - Structure to store the params sent to start/
  2743. * stop logging
  2744. * @name: Attribute which indicates the type of logging like per packet
  2745. * statistics, connectivity etc.
  2746. * @verbose_level: Verbose level which can be 0,1,2,3
  2747. * @flag: Flag field for future use
  2748. */
  2749. struct wmi_wifi_start_log {
  2750. uint32_t ring_id;
  2751. uint32_t verbose_level;
  2752. uint32_t flag;
  2753. };
  2754. /**
  2755. * struct wmi_pcl_list - Format of PCL
  2756. * @pcl_list: List of preferred channels
  2757. * @weight_list: Weights of the PCL
  2758. * @pcl_len: Number of channels in the PCL
  2759. */
  2760. struct wmi_pcl_list {
  2761. uint8_t pcl_list[128];
  2762. uint8_t weight_list[128];
  2763. uint32_t pcl_len;
  2764. };
  2765. /**
  2766. * struct wmi_pcl_chan_weights - Params to get the valid weighed list
  2767. * @pcl_list: Preferred channel list already sorted in the order of preference
  2768. * @pcl_len: Length of the PCL
  2769. * @saved_chan_list: Valid channel list updated as part of
  2770. * WMA_UPDATE_CHAN_LIST_REQ
  2771. * @saved_num_chan: Length of the valid channel list
  2772. * @weighed_valid_list: Weights of the valid channel list. This will have one
  2773. * to one mapping with valid_chan_list. FW expects channel order and size to be
  2774. * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID.
  2775. * @weight_list: Weights assigned by policy manager
  2776. */
  2777. struct wmi_pcl_chan_weights {
  2778. uint8_t pcl_list[MAX_NUM_CHAN];
  2779. uint32_t pcl_len;
  2780. uint8_t saved_chan_list[MAX_NUM_CHAN];
  2781. uint32_t saved_num_chan;
  2782. uint8_t weighed_valid_list[MAX_NUM_CHAN];
  2783. uint8_t weight_list[MAX_NUM_CHAN];
  2784. };
  2785. /**
  2786. * struct wmi_hw_mode_params - HW mode params
  2787. * @mac0_tx_ss: MAC0 Tx spatial stream
  2788. * @mac0_rx_ss: MAC0 Rx spatial stream
  2789. * @mac1_tx_ss: MAC1 Tx spatial stream
  2790. * @mac1_rx_ss: MAC1 Rx spatial stream
  2791. * @mac0_bw: MAC0 bandwidth
  2792. * @mac1_bw: MAC1 bandwidth
  2793. * @dbs_cap: DBS capabality
  2794. * @agile_dfs_cap: Agile DFS capabality
  2795. */
  2796. struct wmi_hw_mode_params {
  2797. uint8_t mac0_tx_ss;
  2798. uint8_t mac0_rx_ss;
  2799. uint8_t mac1_tx_ss;
  2800. uint8_t mac1_rx_ss;
  2801. uint8_t mac0_bw;
  2802. uint8_t mac1_bw;
  2803. uint8_t dbs_cap;
  2804. uint8_t agile_dfs_cap;
  2805. };
  2806. /**
  2807. * struct wmi_dual_mac_config - Dual MAC configuration
  2808. * @scan_config: Scan configuration
  2809. * @fw_mode_config: FW mode configuration
  2810. * @set_dual_mac_cb: Callback function to be executed on response to the command
  2811. */
  2812. struct wmi_dual_mac_config {
  2813. uint32_t scan_config;
  2814. uint32_t fw_mode_config;
  2815. void *set_dual_mac_cb;
  2816. };
  2817. #ifdef WLAN_NS_OFFLOAD
  2818. /**
  2819. * struct ns_offload_req_params - ns offload request paramter
  2820. * @srcIPv6Addr: src ipv6 address
  2821. * @selfIPv6Addr: self ipv6 address
  2822. * @targetIPv6Addr: target ipv6 address
  2823. * @self_macaddr: self mac address
  2824. * @srcIPv6AddrValid: src ipv6 address valid flag
  2825. * @targetIPv6AddrValid: target ipv6 address valid flag
  2826. * @slotIdx: slot index
  2827. */
  2828. struct ns_offload_req_params {
  2829. uint8_t srcIPv6Addr[WMI_MAC_IPV6_ADDR_LEN];
  2830. uint8_t selfIPv6Addr[WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][WMI_MAC_IPV6_ADDR_LEN];
  2831. uint8_t targetIPv6Addr[WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][WMI_MAC_IPV6_ADDR_LEN];
  2832. struct qdf_mac_addr self_macaddr;
  2833. uint8_t srcIPv6AddrValid;
  2834. uint8_t targetIPv6AddrValid[WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA];
  2835. uint8_t slotIdx;
  2836. };
  2837. #endif /* WLAN_NS_OFFLOAD */
  2838. /**
  2839. * struct host_offload_req_param - arp offload parameter
  2840. * @offloadType: offload type
  2841. * @enableOrDisable: enable or disable
  2842. * @num_ns_offload_count: offload count
  2843. */
  2844. struct host_offload_req_param {
  2845. uint8_t offloadType;
  2846. uint8_t enableOrDisable;
  2847. uint32_t num_ns_offload_count;
  2848. union {
  2849. uint8_t hostIpv4Addr[WMI_IPV4_ADDR_LEN];
  2850. uint8_t hostIpv6Addr[WMI_MAC_IPV6_ADDR_LEN];
  2851. } params;
  2852. #ifdef WLAN_NS_OFFLOAD
  2853. struct ns_offload_req_params nsOffloadInfo;
  2854. #endif /* WLAN_NS_OFFLOAD */
  2855. struct qdf_mac_addr bssid;
  2856. };
  2857. /**
  2858. * struct ssid_hotlist_param - param for SSID Hotlist
  2859. * @ssid: SSID which is being hotlisted
  2860. * @band: Band in which the given SSID should be scanned
  2861. * @rssi_low: Low bound on RSSI
  2862. * @rssi_high: High bound on RSSI
  2863. */
  2864. struct ssid_hotlist_param {
  2865. struct mac_ssid ssid;
  2866. uint8_t band;
  2867. int32_t rssi_low;
  2868. int32_t rssi_high;
  2869. };
  2870. /**
  2871. * struct roam_scan_filter_params - Structure holding roaming scan
  2872. * parameters
  2873. * @len: length
  2874. * @op_bitmap: bitmap to determine reason of roaming
  2875. * @session_id: vdev id
  2876. * @num_bssid_black_list: The number of BSSID's that we should
  2877. * avoid connecting to. It is like a
  2878. * blacklist of BSSID's.
  2879. * @num_ssid_white_list: The number of SSID profiles that are
  2880. * in the Whitelist. When roaming, we
  2881. * consider the BSSID's with this SSID
  2882. * also for roaming apart from the connected one's
  2883. * @num_bssid_preferred_list: Number of BSSID's which have a preference over
  2884. * others
  2885. * @bssid_avoid_list: Blacklist SSID's
  2886. * @ssid_allowed_list: Whitelist SSID's
  2887. * @bssid_favored: Favorable BSSID's
  2888. * @bssid_favored_factor: RSSI to be added to this BSSID to prefer it
  2889. *
  2890. * This structure holds all the key parameters related to
  2891. * initial connection and roaming connections.
  2892. */
  2893. struct roam_scan_filter_params {
  2894. uint32_t len;
  2895. uint32_t op_bitmap;
  2896. uint8_t session_id;
  2897. uint32_t num_bssid_black_list;
  2898. uint32_t num_ssid_white_list;
  2899. uint32_t num_bssid_preferred_list;
  2900. struct qdf_mac_addr bssid_avoid_list[MAX_BSSID_AVOID_LIST];
  2901. struct mac_ssid ssid_allowed_list[MAX_SSID_ALLOWED_LIST];
  2902. struct qdf_mac_addr bssid_favored[MAX_BSSID_FAVORED];
  2903. uint8_t bssid_favored_factor[MAX_BSSID_FAVORED];
  2904. };
  2905. /**
  2906. * struct ssid_hotlist_request_params - set SSID hotlist request struct
  2907. * @request_id: ID of the request
  2908. * @session_id: ID of the session
  2909. * @lost_ssid_sample_size: Number of consecutive scans in which the SSID
  2910. * must not be seen in order to consider the SSID "lost"
  2911. * @ssid_count: Number of valid entries in the @ssids array
  2912. * @ssids: Array that defines the SSIDs that are in the hotlist
  2913. */
  2914. struct ssid_hotlist_request_params {
  2915. uint32_t request_id;
  2916. uint8_t session_id;
  2917. uint32_t lost_ssid_sample_size;
  2918. uint32_t ssid_count;
  2919. struct ssid_hotlist_param ssids[WMI_EXTSCAN_MAX_HOTLIST_SSIDS];
  2920. };
  2921. /**
  2922. * struct wmi_unit_test_cmd - unit test command parameters
  2923. * @vdev_id: vdev id
  2924. * @module_id: module id
  2925. * @num_args: number of arguments
  2926. * @args: arguments
  2927. */
  2928. struct wmi_unit_test_cmd {
  2929. uint32_t vdev_id;
  2930. uint32_t module_id;
  2931. uint32_t num_args;
  2932. uint32_t args[WMI_MAX_NUM_ARGS];
  2933. };
  2934. /**
  2935. * struct wmi_roam_invoke_cmd - roam invoke command
  2936. * @vdev_id: vdev id
  2937. * @bssid: mac address
  2938. * @channel: channel
  2939. */
  2940. struct wmi_roam_invoke_cmd {
  2941. uint32_t vdev_id;
  2942. uint8_t bssid[IEEE80211_ADDR_LEN];
  2943. uint32_t channel;
  2944. };
  2945. /**
  2946. * struct ext_scan_setbssi_hotlist_params - set hotlist request
  2947. * @requestId: request identifier
  2948. * @sessionId: session identifier
  2949. * @lost_ap_sample_size: number of samples to confirm AP loss
  2950. * @numAp: Number of hotlist APs
  2951. * @ap: hotlist APs
  2952. */
  2953. struct ext_scan_setbssi_hotlist_params {
  2954. uint32_t requestId;
  2955. uint8_t sessionId;
  2956. uint32_t lost_ap_sample_size;
  2957. uint32_t numAp;
  2958. struct ap_threshold_params ap[WMI_WLAN_EXTSCAN_MAX_HOTLIST_APS];
  2959. };
  2960. /**
  2961. * struct TARGET_HAL_REG_CAPABILITIES - This is replication of REG table
  2962. * structure defined by target. This is added here to remove dependency
  2963. * on FW headers so that host can be agnostic to different defintions in
  2964. * both the targets.
  2965. */
  2966. typedef struct {
  2967. uint32_t eeprom_rd; /* regdomain value specified in EEPROM */
  2968. uint32_t eeprom_rd_ext; /* regdomain */
  2969. uint32_t regcap1; /* CAP1 capabilities bit map */
  2970. uint32_t regcap2; /* REGDMN EEPROM CAP */
  2971. uint32_t wireless_modes; /* REGDMN MODE */
  2972. uint32_t low_2ghz_chan;
  2973. uint32_t high_2ghz_chan;
  2974. uint32_t low_5ghz_chan;
  2975. uint32_t high_5ghz_chan;
  2976. } TARGET_HAL_REG_CAPABILITIES;
  2977. /**
  2978. * struct host_mem_req - Host memory request paramseters request by target
  2979. * @req_id: Request id to identify the request.
  2980. * @unit_size: Size of single unit requested.
  2981. * @num_unit_info: Memory chunk info
  2982. * @num_units: number of units requested.
  2983. */
  2984. typedef struct {
  2985. uint32_t req_id;
  2986. uint32_t unit_size;
  2987. uint32_t num_unit_info;
  2988. uint32_t num_units;
  2989. } host_mem_req;
  2990. #define WMI_HOST_DSCP_MAP_MAX (64)
  2991. /**
  2992. * struct wmi_host_ext_resource_config - Extended resource config
  2993. * @host_platform_config: Host plaform configuration.
  2994. * @fw_featuew_bitmap: FW feature requested bitmap.
  2995. */
  2996. typedef struct {
  2997. uint32_t host_platform_config;
  2998. #define WMI_HOST_FW_FEATURE_LTEU_SUPPORT 0x0001
  2999. #define WMI_HOST_FW_FEATURE_COEX_GPIO_SUPPORT 0x0002
  3000. #define WMI_HOST_FW_FEATURE_AUX_RADIO_SPECTRAL_INTF 0x0004
  3001. #define WMI_HOST_FW_FEATURE_AUX_RADIO_CHAN_LOAD_INTF 0x0008
  3002. #define WMI_HOST_FW_FEATURE_BSS_CHANNEL_INFO_64 0x0010
  3003. #define WMI_HOST_FW_FEATURE_PEER_STATS 0x0020
  3004. #define WMI_HOST_FW_FEATURE_VDEV_STATS 0x0040
  3005. /**
  3006. * @brief fw_feature_bitmask - Enable/Disable features in FW
  3007. * @details
  3008. * The bits in fw_feature_bitmask are used as shown by the masks below:
  3009. * 0x0001 - LTEU Config enable/disable
  3010. * 0x0002 - COEX GPIO Config enable/disable
  3011. * 0x0004 - Aux Radio enhancement for spectral scan enable/disable
  3012. * 0x0008 - Aux Radio enhancement for chan load scan enable/disable
  3013. * 0x0010 - BSS channel info stats enable/disable
  3014. * The features in question are enabled by setting
  3015. * the feature's bit to 1,
  3016. * or disabled by setting the feature's bit to 0.
  3017. */
  3018. uint32_t fw_feature_bitmap;
  3019. /* add new members here */
  3020. } wmi_host_ext_resource_config;
  3021. /**
  3022. * struct set_neighbour_rx_params - Neighbour RX params
  3023. * @vdev_id: vdev id
  3024. * @idx: index of param
  3025. * @action: action
  3026. * @type: Type of param
  3027. */
  3028. struct set_neighbour_rx_params {
  3029. uint8_t vdev_id;
  3030. uint32_t idx;
  3031. uint32_t action;
  3032. uint32_t type;
  3033. };
  3034. /**
  3035. * struct set_fwtest_params - FW test params
  3036. * @arg: FW param id
  3037. * @value: value
  3038. */
  3039. struct set_fwtest_params {
  3040. uint32_t arg;
  3041. uint32_t value;
  3042. };
  3043. /**
  3044. * struct config_ratemask_params - ratemask config parameters
  3045. * @vdev_id: vdev id
  3046. * @type: Type
  3047. * @lower32: Lower 32 bits
  3048. * @higher32: Hogher 32 bits
  3049. */
  3050. struct config_ratemask_params {
  3051. uint8_t vdev_id;
  3052. uint8_t type;
  3053. uint32_t lower32;
  3054. uint32_t higher32;
  3055. };
  3056. /**
  3057. * struct peer_add_wds_entry_params - WDS peer entry add params
  3058. * @dest_addr: Pointer to destination macaddr
  3059. * @peer_addr: Pointer to peer mac addr
  3060. * @flags: flags
  3061. */
  3062. struct peer_add_wds_entry_params {
  3063. const uint8_t *dest_addr;
  3064. uint8_t *peer_addr;
  3065. uint32_t flags;
  3066. };
  3067. /**
  3068. * struct peer_del_wds_entry_params - WDS peer entry del params
  3069. * @dest_addr: Pointer to destination macaddr
  3070. */
  3071. struct peer_del_wds_entry_params {
  3072. uint8_t *dest_addr;
  3073. };
  3074. /**
  3075. * struct peer_updatewds_entry_params - WDS peer entry update params
  3076. * @wds_macaddr: Pointer to destination macaddr
  3077. * @peer_add: Pointer to peer mac addr
  3078. * @flags: flags
  3079. */
  3080. struct peer_update_wds_entry_params {
  3081. uint8_t *wds_macaddr;
  3082. uint8_t *peer_macaddr;
  3083. uint32_t flags;
  3084. };
  3085. /**
  3086. * struct set_ps_mode_params - PS mode params
  3087. * @vdev_id: vdev id
  3088. * @psmode: PS mode
  3089. */
  3090. struct set_ps_mode_params {
  3091. uint8_t vdev_id;
  3092. uint8_t psmode;
  3093. };
  3094. /**
  3095. * @struct tt_level_config - Set Thermal throttlling config
  3096. * @tmplwm: Temperature low water mark
  3097. * @tmphwm: Temperature high water mark
  3098. * @dcoffpercent: dc off percentage
  3099. * @priority: priority
  3100. */
  3101. typedef struct {
  3102. uint32_t tmplwm;
  3103. uint32_t tmphwm;
  3104. uint32_t dcoffpercent;
  3105. uint32_t priority;
  3106. } tt_level_config;
  3107. /**
  3108. * struct thermal_mitigation_params - Thermal mitigation params
  3109. * @enable: Enable/Disable Thermal mitigation
  3110. * @dc: DC
  3111. * @dc_per_event: DC per event
  3112. * @tt_level_config: TT level config params
  3113. */
  3114. struct thermal_mitigation_params {
  3115. uint32_t enable;
  3116. uint32_t dc;
  3117. uint32_t dc_per_event;
  3118. tt_level_config levelconf[THERMAL_LEVELS];
  3119. };
  3120. /**
  3121. * struct smart_ant_enable_params - Smart antenna params
  3122. * @enable: Enable/Disable
  3123. * @mode: SA mode
  3124. * @rx_antenna: RX antenna config
  3125. * @gpio_pin : GPIO pin config
  3126. * @gpio_func : GPIO function config
  3127. */
  3128. struct smart_ant_enable_params {
  3129. uint32_t enable;
  3130. uint32_t mode;
  3131. uint32_t rx_antenna;
  3132. uint32_t gpio_pin[WMI_HAL_MAX_SANTENNA];
  3133. uint32_t gpio_func[WMI_HAL_MAX_SANTENNA];
  3134. };
  3135. /**
  3136. * struct smart_ant_rx_ant_params - RX antenna params
  3137. * @antenna: RX antenna
  3138. */
  3139. struct smart_ant_rx_ant_params {
  3140. uint32_t antenna;
  3141. };
  3142. /**
  3143. * struct smart_ant_tx_ant_params - TX antenna param
  3144. * @antenna_array: Antenna arry
  3145. * @vdev_id: VDEV id
  3146. */
  3147. struct smart_ant_tx_ant_params {
  3148. uint32_t *antenna_array;
  3149. uint8_t vdev_id;
  3150. };
  3151. /**
  3152. * struct smart_ant_training_info_params - SA training params
  3153. * @vdev_id: VDEV id
  3154. * @rate_array: Rates array
  3155. * @antenna_array: Antenna array
  3156. * @numpkts: num packets for training
  3157. */
  3158. struct smart_ant_training_info_params {
  3159. uint8_t vdev_id;
  3160. uint32_t *rate_array;
  3161. uint32_t *antenna_array;
  3162. uint32_t numpkts;
  3163. };
  3164. /**
  3165. * struct smart_ant_node_config_params - SA node config params
  3166. * @vdev_id: VDEV id
  3167. * @cmd_id: Command id
  3168. * @args_count: Arguments count
  3169. */
  3170. struct smart_ant_node_config_params {
  3171. uint8_t vdev_id;
  3172. uint32_t cmd_id;
  3173. uint16_t args_count;
  3174. uint32_t *args_arr;
  3175. };
  3176. /**
  3177. * struct smart_ant_enable_tx_feedback_params - SA tx feeback params
  3178. * @enable: Enable TX feedback for SA
  3179. */
  3180. struct smart_ant_enable_tx_feedback_params {
  3181. int enable;
  3182. };
  3183. /**
  3184. * struct vdev_spectral_configure_params - SPectral config params
  3185. * @vdev_id: VDEV id
  3186. * @count: count
  3187. * @period: period
  3188. * @spectral_pri: Spectral priority
  3189. * @fft_size: FFT size
  3190. * @gc_enable: GC enable
  3191. * @restart_enable: restart enabled
  3192. * @noise_floor_ref: Noise floor reference
  3193. * @init_delay: Init delays
  3194. * @nb_tone_thr: NB tone threshold
  3195. * @str_bin_thr: STR BIN threshold
  3196. * @wb_rpt_mode: WB BIN threshold
  3197. * @rssi_rpt_mode: RSSI report mode
  3198. * @rssi_thr: RSSI threshold
  3199. * @pwr_format: Power format
  3200. * @rpt_mode: Report mdoe
  3201. * @bin_scale: BIN scale
  3202. * @dBm_adj: DBM adjust
  3203. * @chn_mask: chain mask
  3204. */
  3205. struct vdev_spectral_configure_params {
  3206. uint8_t vdev_id;
  3207. uint16_t count;
  3208. uint16_t period;
  3209. uint16_t spectral_pri;
  3210. uint16_t fft_size;
  3211. uint16_t gc_enable;
  3212. uint16_t restart_enable;
  3213. uint16_t noise_floor_ref;
  3214. uint16_t init_delay;
  3215. uint16_t nb_tone_thr;
  3216. uint16_t str_bin_thr;
  3217. uint16_t wb_rpt_mode;
  3218. uint16_t rssi_rpt_mode;
  3219. uint16_t rssi_thr;
  3220. uint16_t pwr_format;
  3221. uint16_t rpt_mode;
  3222. uint16_t bin_scale;
  3223. uint16_t dBm_adj;
  3224. uint16_t chn_mask;
  3225. };
  3226. /**
  3227. * struct vdev_spectral_enable_params - Spectral enabled params
  3228. * @vdev_id: VDEV id
  3229. * @active_valid: Active valid
  3230. * @active: active
  3231. * @enabled_valid: Enabled valid
  3232. * @enabled: enabled
  3233. */
  3234. struct vdev_spectral_enable_params {
  3235. uint8_t vdev_id;
  3236. uint8_t active_valid;
  3237. uint8_t active;
  3238. uint8_t enabled_valid;
  3239. uint8_t enabled;
  3240. };
  3241. /**
  3242. * struct pdev_set_regdomain_params - PDEV set reg domain params
  3243. * @currentRDinuse: Current Reg domain
  3244. * @currentRD2G: Current Reg domain 2G
  3245. * @currentRD5G: Current Reg domain 5G
  3246. * @ctl_2G: CTL 2G
  3247. * @ctl_5G: CTL 5G
  3248. * @dfsDomain: DFS domain
  3249. */
  3250. struct pdev_set_regdomain_params {
  3251. uint16_t currentRDinuse;
  3252. uint16_t currentRD2G;
  3253. uint16_t currentRD5G;
  3254. uint32_t ctl_2G;
  3255. uint32_t ctl_5G;
  3256. uint8_t dfsDomain;
  3257. };
  3258. /**
  3259. * struct set_quiet_mode_params - Set quiet mode params
  3260. * @enabled: Enabled
  3261. * @period: Quite period
  3262. * @intval: Quite interval
  3263. * @duration: Quite duration
  3264. * @offset: offset
  3265. */
  3266. struct set_quiet_mode_params {
  3267. uint8_t enabled;
  3268. uint8_t period;
  3269. uint16_t intval;
  3270. uint16_t duration;
  3271. uint16_t offset;
  3272. };
  3273. /**
  3274. * struct set_beacon_filter_params - Set beacon filter params
  3275. * @vdev_id: VDEV id
  3276. * @ie: Pointer to IE fields
  3277. */
  3278. struct set_beacon_filter_params {
  3279. uint8_t vdev_id;
  3280. uint32_t *ie;
  3281. };
  3282. /**
  3283. * struct remove_beacon_filter_params - Remove beacon filter params
  3284. * @vdev_id: VDEV id
  3285. */
  3286. struct remove_beacon_filter_params {
  3287. uint8_t vdev_id;
  3288. };
  3289. /**
  3290. * struct mgmt_params - Mgmt params
  3291. * @vdev_id: vdev id
  3292. * @buf_len: lenght of frame buffer
  3293. * @wbuf: frame buffer
  3294. */
  3295. struct mgmt_params {
  3296. int vdev_id;
  3297. uint32_t buf_len;
  3298. qdf_nbuf_t wbuf;
  3299. };
  3300. /**
  3301. * struct addba_clearresponse_params - Addba clear response params
  3302. * @vdev_id: VDEV id
  3303. */
  3304. struct addba_clearresponse_params {
  3305. uint8_t vdev_id;
  3306. };
  3307. /**
  3308. * struct addba_send_params - ADDBA send params
  3309. * @vdev_id: vdev id
  3310. * @tidno: TID
  3311. * @buffersize: buffer size
  3312. */
  3313. struct addba_send_params {
  3314. uint8_t vdev_id;
  3315. uint8_t tidno;
  3316. uint16_t buffersize;
  3317. };
  3318. /**
  3319. * struct delba_send_params - DELBA send params
  3320. * @vdev_id: vdev id
  3321. * @tidno: TID
  3322. * @initiator: initiator
  3323. * @reasoncode: reason code
  3324. */
  3325. struct delba_send_params {
  3326. uint8_t vdev_id;
  3327. uint8_t tidno;
  3328. uint8_t initiator;
  3329. uint16_t reasoncode;
  3330. };
  3331. /**
  3332. * struct addba_setresponse_arams - Set ADDBA response params
  3333. * @vdev_id: vdev id
  3334. * @tidno: TID
  3335. * @statuscode: status code in response
  3336. */
  3337. struct addba_setresponse_params {
  3338. uint8_t vdev_id;
  3339. uint8_t tidno;
  3340. uint16_t statuscode;
  3341. };
  3342. /**
  3343. * struct singleamsdu_params - Single AMSDU params
  3344. * @vdev_id: vdev is
  3345. * @tidno: TID
  3346. */
  3347. struct singleamsdu_params {
  3348. uint8_t vdev_id;
  3349. uint8_t tidno;
  3350. };
  3351. /**
  3352. * struct set_qbosst_params - Set QBOOST params
  3353. * @vdev_id: vdev id
  3354. * @value: value
  3355. */
  3356. struct set_qboost_params {
  3357. uint8_t vdev_id;
  3358. uint32_t value;
  3359. };
  3360. /**
  3361. * struct mu_scan_params - MU scan params
  3362. * @id: id
  3363. * @type: type
  3364. * @duration: Duration
  3365. * @lteu_tx_power: LTEU tx power
  3366. */
  3367. struct mu_scan_params {
  3368. uint8_t id;
  3369. uint8_t type;
  3370. uint32_t duration;
  3371. uint32_t lteu_tx_power;
  3372. };
  3373. /**
  3374. * struct lteu_config_params - LTEU config params
  3375. * @lteu_gpio_start: start MU/AP scan after GPIO toggle
  3376. * @lteu_num_bins: no. of elements in the following arrays
  3377. * @use_actual_nf: whether to use the actual NF obtained or a hardcoded one
  3378. * @lteu_weight: weights for MU algo
  3379. * @lteu_thresh: thresholds for MU algo
  3380. * @lteu_gamma: gamma's for MU algo
  3381. * @lteu_scan_timeout: timeout in ms to gpio toggle
  3382. * @alpha_num_ssid: alpha for num active bssid calculation
  3383. * @wifi_tx_power: Wifi Tx power
  3384. */
  3385. struct lteu_config_params {
  3386. uint8_t lteu_gpio_start;
  3387. uint8_t lteu_num_bins;
  3388. uint8_t use_actual_nf;
  3389. uint32_t lteu_weight[LTEU_MAX_BINS];
  3390. uint32_t lteu_thresh[LTEU_MAX_BINS];
  3391. uint32_t lteu_gamma[LTEU_MAX_BINS];
  3392. uint32_t lteu_scan_timeout;
  3393. uint32_t alpha_num_bssid;
  3394. uint32_t wifi_tx_power;
  3395. };
  3396. struct wmi_macaddr_t {
  3397. /** upper 4 bytes of MAC address */
  3398. uint32_t mac_addr31to0;
  3399. /** lower 2 bytes of MAC address */
  3400. uint32_t mac_addr47to32;
  3401. };
  3402. /**
  3403. * struct atf_peer_info - ATF peer info params
  3404. * @peer_macaddr: peer mac addr
  3405. * @percentage_peer: percentage of air time for this peer
  3406. */
  3407. typedef struct {
  3408. struct wmi_macaddr_t peer_macaddr;
  3409. uint32_t percentage_peer;
  3410. } atf_peer_info;
  3411. /**
  3412. * struct set_atf_params - ATF params
  3413. * @num_peers: number of peers
  3414. * @atf_peer_info: ATF peer info
  3415. */
  3416. struct set_atf_params {
  3417. uint32_t num_peers;
  3418. atf_peer_info peer_info[ATF_ACTIVED_MAX_CLIENTS];
  3419. };
  3420. /**
  3421. * struct atf_peer_ext_info - ATF peer ext info params
  3422. * @peer_macaddr: peer mac address
  3423. * @group_index: group index
  3424. * @atf_index_reserved: ATF index rsvd
  3425. */
  3426. typedef struct {
  3427. struct wmi_macaddr_t peer_macaddr;
  3428. uint32_t group_index;
  3429. uint32_t atf_index_reserved;
  3430. } atf_peer_ext_info;
  3431. /**
  3432. * struct atf_peer_request_params - ATF peer req params
  3433. * @num_peers: number of peers
  3434. * @atf_peer_ext_info: ATF peer ext info
  3435. */
  3436. struct atf_peer_request_params {
  3437. uint32_t num_peers;
  3438. atf_peer_ext_info peer_ext_info[ATF_ACTIVED_MAX_CLIENTS];
  3439. };
  3440. /**
  3441. * struct atf_group_info - ATF group info params
  3442. * @percentage_group: Percentage AT for group
  3443. * @atf_group_units_reserved: ATF group information
  3444. */
  3445. typedef struct {
  3446. uint32_t percentage_group;
  3447. uint32_t atf_group_units_reserved;
  3448. } atf_group_info;
  3449. /**
  3450. * struct atf_grouping_params - ATF grouping params
  3451. * @num_groups: number of groups
  3452. * @group_inf: Group informaition
  3453. */
  3454. struct atf_grouping_params {
  3455. uint32_t num_groups;
  3456. atf_group_info group_info[ATF_ACTIVED_MAX_ATFGROUPS];
  3457. };
  3458. /**
  3459. * struct wlan_profile_params - WLAN profile params
  3460. * @param_id: param id
  3461. * @profile_id: profile id
  3462. * @enable: enable
  3463. */
  3464. struct wlan_profile_params {
  3465. uint32_t param_id;
  3466. uint32_t profile_id;
  3467. uint32_t enable;
  3468. };
  3469. /* struct ht_ie_params - HT IE params
  3470. * @ie_len: IE length
  3471. * @ie_data: pointer to IE data
  3472. */
  3473. struct ht_ie_params {
  3474. uint32_t ie_len;
  3475. uint8_t *ie_data;
  3476. };
  3477. /* struct vht_ie_params - VHT IE params
  3478. * @ie_len: IE length
  3479. * @ie_data: pointer to IE data
  3480. */
  3481. struct vht_ie_params {
  3482. uint32_t ie_len;
  3483. uint8_t *ie_data;
  3484. };
  3485. /**
  3486. * struct wmi_host_wmeParams - WME params
  3487. * @wmep_acm: ACM paramete
  3488. * @wmep_aifsn: AIFSN parameters
  3489. * @wmep_logcwmin: cwmin in exponential form
  3490. * @wmep_logcwmax: cwmax in exponential form
  3491. * @wmep_txopLimit: txopLimit
  3492. * @wmep_noackPolicy: No-Ack Policy: 0=ack, 1=no-ack
  3493. */
  3494. struct wmi_host_wmeParams {
  3495. u_int8_t wmep_acm;
  3496. u_int8_t wmep_aifsn;
  3497. u_int8_t wmep_logcwmin;
  3498. u_int8_t wmep_logcwmax;
  3499. u_int16_t wmep_txopLimit;
  3500. u_int8_t wmep_noackPolicy;
  3501. };
  3502. /**
  3503. * struct wmm_update_params - WMM update params
  3504. * @wmep_array: WME params for each AC
  3505. */
  3506. struct wmm_update_params {
  3507. struct wmi_host_wmeParams *wmep_array;
  3508. };
  3509. /**
  3510. * struct ant_switch_tbl_params - Antenna switch table params
  3511. * @ant_ctrl_common1: ANtenna control common param 1
  3512. * @ant_ctrl_common2: Antenna control commn param 2
  3513. */
  3514. struct ant_switch_tbl_params {
  3515. uint32_t ant_ctrl_common1;
  3516. uint32_t ant_ctrl_common2;
  3517. };
  3518. /**
  3519. * struct ratepwr_table_params - Rate power table params
  3520. * @ratepwr_tbl: pointer to rate power table
  3521. * @ratepwr_len: rate power table len
  3522. */
  3523. struct ratepwr_table_params {
  3524. uint8_t *ratepwr_tbl;
  3525. uint16_t ratepwr_len;
  3526. };
  3527. /**
  3528. * struct ctl_table_params - Ctl table params
  3529. * @ctl_array: pointer to ctl array
  3530. * @ctl_len: ctl length
  3531. * @is_acfg_ctl: is acfg_ctl table
  3532. */
  3533. struct ctl_table_params {
  3534. uint8_t *ctl_array;
  3535. uint16_t ctl_len;
  3536. bool is_acfg_ctl;
  3537. };
  3538. /**
  3539. * struct mimogain_table_params - MIMO gain table params
  3540. * @array_gain: pointer to array gain table
  3541. * @tbl_len: table length
  3542. * @multichain_gain_bypass: bypass multichain gain
  3543. */
  3544. struct mimogain_table_params {
  3545. uint8_t *array_gain;
  3546. uint16_t tbl_len;
  3547. bool multichain_gain_bypass;
  3548. };
  3549. /**
  3550. * struct ratepwr_chainmask_params - Rate power chainmask params
  3551. * @ratepwr_chain_tbl: pointer to ratepwr chain table
  3552. * @num_rate: number of rate in table
  3553. * @pream_type: preamble type
  3554. * @ops: ops
  3555. */
  3556. struct ratepwr_chainmsk_params {
  3557. uint32_t *ratepwr_chain_tbl;
  3558. uint16_t num_rate;
  3559. uint8_t pream_type;
  3560. uint8_t ops;
  3561. };
  3562. struct macaddr_params {
  3563. uint8_t *macaddr;
  3564. };
  3565. /**
  3566. * struct acparams_params - acparams config structure
  3567. * @ac: AC to configure
  3568. * @use_rts: Use rts for this AC
  3569. * @aggrsize_scaling: Aggregrate size scaling for the AC
  3570. * @min_kbps: min kbps req
  3571. */
  3572. struct acparams_params {
  3573. uint8_t ac;
  3574. uint8_t use_rts;
  3575. uint8_t aggrsize_scaling;
  3576. uint32_t min_kbps;
  3577. };
  3578. /**
  3579. * struct vap_dscp_tid_map_params - DSCP tid map params
  3580. * @vdev_id: vdev id
  3581. * @dscp_to_tid_map: pointer to arry of tid to dscp map table
  3582. */
  3583. struct vap_dscp_tid_map_params {
  3584. uint8_t vdev_id;
  3585. uint32_t *dscp_to_tid_map;
  3586. };
  3587. /**
  3588. * struct proxy_ast_reserve_params - Proxy AST reserve params
  3589. * @macaddr: macaddr for proxy ast entry
  3590. */
  3591. struct proxy_ast_reserve_params {
  3592. uint8_t *macaddr;
  3593. };
  3594. /**
  3595. * struct fips_params - FIPS params config
  3596. * @key: pointer to key
  3597. * @key_len: length of key
  3598. * @data: pointer data buf
  3599. * @data_len: lenght of sata buf
  3600. * @mode: mode
  3601. * @op: operation
  3602. */
  3603. struct fips_params {
  3604. uint8_t *key;
  3605. uint32_t key_len;
  3606. uint8_t *data;
  3607. uint32_t data_len;
  3608. uint32_t mode;
  3609. uint32_t op;
  3610. };
  3611. /**
  3612. * struct mcast_group_update_param - Mcast group table update to target
  3613. * @action: Addition/deletion
  3614. * @wildcard: iwldcard table entry?
  3615. * @mcast_ip_addr: mcast ip address to be updated
  3616. * @mcast_ip_addr_bytes: mcast ip addr bytes
  3617. * @ucast_mac_addr: ucast peer mac subscribed to mcast ip
  3618. * @filter_mode: filter mode
  3619. * @nsrcs: number of entries in source list
  3620. * @srcs: source mac accpted
  3621. * @mask: mask
  3622. * @vap_id: vdev id
  3623. * @is_action_delete: is delete
  3624. * @is_filter_mode_snoop:
  3625. * @is_mcast_addr_len:
  3626. */
  3627. struct mcast_group_update_params {
  3628. int action;
  3629. int wildcard;
  3630. uint8_t *mcast_ip_addr;
  3631. int mcast_ip_addr_bytes;
  3632. uint8_t *ucast_mac_addr;
  3633. uint8_t filter_mode;
  3634. uint8_t nsrcs;
  3635. uint8_t *srcs;
  3636. uint8_t *mask;
  3637. uint8_t vap_id;
  3638. bool is_action_delete;
  3639. bool is_filter_mode_snoop;
  3640. bool is_mcast_addr_len;
  3641. };
  3642. /**
  3643. * struct periodic_chan_stats_param - periodic channel stats req param
  3644. * @stats_period: stats period update
  3645. * @enable: enable/disable
  3646. */
  3647. struct periodic_chan_stats_params {
  3648. uint32_t stats_period;
  3649. bool enable;
  3650. };
  3651. /**
  3652. * struct packet_power_info_params - packet power info params
  3653. * @rate_flags: rate flags
  3654. * @nss: number of spatial streams
  3655. * @preamble: preamble
  3656. * @hw_rate:
  3657. */
  3658. struct packet_power_info_params {
  3659. uint16_t rate_flags;
  3660. uint16_t nss;
  3661. uint16_t preamble;
  3662. uint16_t hw_rate;
  3663. };
  3664. /**
  3665. * WMI_GPIO_CONFIG_CMDID
  3666. */
  3667. enum {
  3668. WMI_HOST_GPIO_PULL_NONE,
  3669. WMI_HOST_GPIO_PULL_UP,
  3670. WMI_HOST_GPIO_PULL_DOWN,
  3671. };
  3672. /**
  3673. * WMI_GPIO_INTTYPE
  3674. */
  3675. enum {
  3676. WMI_HOST_GPIO_INTTYPE_DISABLE,
  3677. WMI_HOST_GPIO_INTTYPE_RISING_EDGE,
  3678. WMI_HOST_GPIO_INTTYPE_FALLING_EDGE,
  3679. WMI_HOST_GPIO_INTTYPE_BOTH_EDGE,
  3680. WMI_HOST_GPIO_INTTYPE_LEVEL_LOW,
  3681. WMI_HOST_GPIO_INTTYPE_LEVEL_HIGH
  3682. };
  3683. /**
  3684. * struct wmi_host_gpio_input_event - GPIO input event structure
  3685. * @gpio_num: GPIO number which changed state
  3686. */
  3687. typedef struct {
  3688. uint32_t gpio_num; /* GPIO number which changed state */
  3689. } wmi_host_gpio_input_event;
  3690. /**
  3691. * struct gpio_config_params - GPIO config params
  3692. * @gpio_num: GPIO number to config
  3693. * @input: input/output
  3694. * @pull_type: pull type
  3695. * @intr_mode: int mode
  3696. */
  3697. struct gpio_config_params {
  3698. uint32_t gpio_num;
  3699. uint32_t input;
  3700. uint32_t pull_type;
  3701. uint32_t intr_mode;
  3702. };
  3703. /**
  3704. * struct gpio_output_params - GPIO output params
  3705. * @gpio_num: GPIO number to configure
  3706. * @set: set/reset
  3707. */
  3708. struct gpio_output_params {
  3709. uint32_t gpio_num;
  3710. uint32_t set;
  3711. };
  3712. #define WMI_HOST_RTT_REPORT_CFR 0
  3713. #define WMI_HOST_RTT_NO_REPORT_CFR 1
  3714. #define WMI_HOST_RTT_AGGREGATE_REPORT_NON_CFR 2
  3715. /**
  3716. * struct rtt_meas_req_test_params
  3717. * @peer: peer mac address
  3718. * @req_frame_type: RTT request frame type
  3719. * @req_bw: requested bandwidth
  3720. * @req_preamble: Preamble
  3721. * @req_num_req: num of requests
  3722. * @req_report_type: report type
  3723. * @num_measurements: number of measurements
  3724. * @asap_mode: priority
  3725. * @lci_requested: LCI requested
  3726. * @loc_civ_requested:
  3727. * @channel_param: channel param
  3728. * @req_id: requested id
  3729. */
  3730. struct rtt_meas_req_test_params {
  3731. uint8_t peer[IEEE80211_ADDR_LEN];
  3732. int req_frame_type;
  3733. int req_bw;
  3734. int req_preamble;
  3735. int req_num_req;
  3736. int req_report_type;
  3737. uint32_t num_measurements;
  3738. uint32_t asap_mode;
  3739. uint32_t lci_requested;
  3740. uint32_t loc_civ_requested;
  3741. struct channel_param channel;
  3742. uint8_t req_id;
  3743. };
  3744. /**
  3745. * struct rtt_meas_req_params - RTT measurement request params
  3746. * @req_id: Request id
  3747. * @vdev_id: vdev id
  3748. * @sta_mac_addr: pointer to station mac address
  3749. * @spoof_mac_addr: pointer to spoof mac address
  3750. * @is_mode_na: 11NA
  3751. * @is_mode_ac: AC
  3752. * @is_bw_20: 20
  3753. * @is_bw_40: 40
  3754. * @is_bw_80: 80
  3755. * @num_probe_rqst: number of probe request
  3756. * @channel_param: channel param
  3757. */
  3758. struct rtt_meas_req_params {
  3759. uint8_t req_id;
  3760. uint8_t vdev_id;
  3761. uint8_t *sta_mac_addr;
  3762. uint8_t *spoof_mac_addr;
  3763. bool is_mode_na;
  3764. bool is_mode_ac;
  3765. bool is_bw_20;
  3766. bool is_bw_40;
  3767. bool is_bw_80;
  3768. uint32_t num_probe_rqst;
  3769. struct channel_param channel;
  3770. };
  3771. /**
  3772. * struct lci_set_params - LCI params
  3773. * @lci_data: pointer to LCI data
  3774. * @latitude_unc: latitude
  3775. * @latitude_0_12: bits 0 to 1 of latitude
  3776. * @latitude_2_33: bits 2 to 33 of latitude
  3777. * @longitude_unc: longitude
  3778. * @longitude_0_1: bits 0 to 1 of longitude
  3779. * @longitude_2_33: bits 2 to 33 of longitude
  3780. * @altitude_type: altitude type
  3781. * @altitude_unc_0_3: altitude bits 0 - 3
  3782. * @altitude_unc_4_5: altitude bits 4 - 5
  3783. * @altitude: altitude
  3784. * @datum: dataum
  3785. * @reg_loc_agmt:
  3786. * @reg_loc_dse:
  3787. * @dep_sta:
  3788. * @version: version
  3789. */
  3790. struct lci_set_params {
  3791. void *lci_data;
  3792. uint8_t latitude_unc:6,
  3793. latitude_0_1:2;
  3794. uint32_t latitude_2_33;
  3795. uint8_t longitude_unc:6,
  3796. longitude_0_1:2;
  3797. uint32_t longitude_2_33;
  3798. uint8_t altitude_type:4,
  3799. altitude_unc_0_3:4;
  3800. uint32_t altitude_unc_4_5:2,
  3801. altitude:30;
  3802. uint8_t datum:3,
  3803. reg_loc_agmt:1,
  3804. reg_loc_dse:1,
  3805. dep_sta:1,
  3806. version:2;
  3807. };
  3808. /**
  3809. * struct lcr_set_params - LCR params
  3810. * @lcr_data: pointer to lcr data
  3811. */
  3812. struct lcr_set_params {
  3813. void *lcr_data;
  3814. };
  3815. /**
  3816. * struct rtt_keepalive_req_params - RTT keepalive params
  3817. * @macaddr: pointer to macaddress
  3818. * @req_id: Request id
  3819. * @vdev_id: vdev id
  3820. * @stop: start/stop
  3821. */
  3822. struct rtt_keepalive_req_params {
  3823. uint8_t *macaddr;
  3824. uint8_t req_id;
  3825. uint8_t vdev_id;
  3826. bool stop;
  3827. };
  3828. /**
  3829. * struct wmi_host_stats_event - Stats event params
  3830. * @stats_id: stats id of type wmi_host_stats_event
  3831. * @num_pdev_stats: number of pdev stats event structures 0 or 1
  3832. * @num_pdev_ext_stats: number of pdev ext stats event structures
  3833. * @num_vdev_stats: number of vdev stats
  3834. * @num_peer_stats: number of peer stats event structures 0 or max peers
  3835. * @num_bcnflt_stats: number of beacon filter stats
  3836. * @num_chan_stats: number of channel stats
  3837. */
  3838. typedef struct {
  3839. wmi_host_stats_id stats_id;
  3840. uint32_t num_pdev_stats;
  3841. uint32_t num_pdev_ext_stats;
  3842. uint32_t num_vdev_stats;
  3843. uint32_t num_peer_stats;
  3844. uint32_t num_bcnflt_stats;
  3845. uint32_t num_chan_stats;
  3846. } wmi_host_stats_event;
  3847. /**
  3848. * struct wmi_host_mac_addr - host mac addr 2 word representation of MAC addr
  3849. * @mac_addr31to0: upper 4 bytes of MAC address
  3850. * @mac_addr47to32: lower 2 bytes of MAC address
  3851. */
  3852. typedef struct {
  3853. uint32_t mac_addr31to0;
  3854. uint32_t mac_addr47to32;
  3855. } wmi_host_mac_addr;
  3856. /**
  3857. * struct wmi_host_peer_extd_stats - peer extd stats event structure
  3858. * @peer_macaddr: Peer mac address
  3859. * @inactive_time: inactive time in secs
  3860. * @peer_chain_rssi: peer rssi
  3861. * @rx_duration: RX duration
  3862. * @peer_tx_bytes: TX bytes
  3863. * @peer_rx_bytes: RX bytes
  3864. * @last_tx_rate_code: Tx rate code of last frame
  3865. * @last_tx_power: Tx power latest
  3866. * @atf_tokens_allocated: atf tokens allocated
  3867. * @atf_tokens_utilized: atf tokens utilized
  3868. * @reserved: for future use
  3869. */
  3870. typedef struct {
  3871. wmi_host_mac_addr peer_macaddr;
  3872. uint32_t inactive_time;
  3873. uint32_t peer_chain_rssi;
  3874. uint32_t rx_duration;
  3875. uint32_t peer_tx_bytes;
  3876. uint32_t peer_rx_bytes;
  3877. uint32_t last_tx_rate_code;
  3878. uint32_t last_tx_power;
  3879. uint32_t atf_tokens_allocated;
  3880. uint32_t atf_tokens_utilized;
  3881. uint32_t reserved[4];
  3882. } wmi_host_peer_extd_stats;
  3883. /**
  3884. * struct wmi_host_pdev_ext_stats - peer ext stats structure
  3885. * @rx_rssi_comb: RX rssi
  3886. * @rx_rssi_chain0: RX rssi chain 0
  3887. * @rx_rssi_chain1: RX rssi chain 1
  3888. * @rx_rssi_chain2: RX rssi chain 2
  3889. * @rx_rssi_chain3: RX rssi chain 3
  3890. * @rx_mcs: RX MCS array
  3891. * @tx_mcs: TX MCS array
  3892. * @ack_rssi: Ack rssi
  3893. */
  3894. typedef struct {
  3895. uint32_t rx_rssi_comb;
  3896. uint32_t rx_rssi_chain0;
  3897. uint32_t rx_rssi_chain1;
  3898. uint32_t rx_rssi_chain2;
  3899. uint32_t rx_rssi_chain3;
  3900. uint32_t rx_mcs[10];
  3901. uint32_t tx_mcs[10];
  3902. uint32_t ack_rssi;
  3903. } wmi_host_pdev_ext_stats;
  3904. /**
  3905. * struct wmi_host_dbg_tx_stats - Debug stats
  3906. * @comp_queued: Num HTT cookies queued to dispatch list
  3907. * @comp_delivered: Num HTT cookies dispatched
  3908. * @msdu_enqued: Num MSDU queued to WAL
  3909. * @mpdu_enqued: Num MPDU queue to WAL
  3910. * @wmm_drop: Num MSDUs dropped by WMM limit
  3911. * @local_enqued: Num Local frames queued
  3912. * @local_freed: Num Local frames done
  3913. * @hw_queued: Num queued to HW
  3914. * @hw_reaped: Num PPDU reaped from HW
  3915. * @underrun: Num underruns
  3916. * @hw_paused: HW Paused.
  3917. * @tx_abort: Num PPDUs cleaned up in TX abort
  3918. * @mpdus_requed: Num MPDUs requed by SW
  3919. * @tx_ko: excessive retries
  3920. * @tx_xretry:
  3921. * @data_rc: data hw rate code
  3922. * @self_triggers: Scheduler self triggers
  3923. * @sw_retry_failure: frames dropped due to excessive sw retries
  3924. * @illgl_rate_phy_err: illegal rate phy errors
  3925. * @pdev_cont_xretry: wal pdev continous xretry
  3926. * @pdev_tx_timeout: wal pdev continous xretry
  3927. * @pdev_resets: wal pdev resets
  3928. * @stateless_tid_alloc_failure: frames dropped due to non-availability of
  3929. * stateless TIDs
  3930. * @phy_underrun: PhY/BB underrun
  3931. * @txop_ovf: MPDU is more than txop limit
  3932. * @seq_posted: Number of Sequences posted
  3933. * @seq_failed_queueing: Number of Sequences failed queueing
  3934. * @seq_completed: Number of Sequences completed
  3935. * @seq_restarted: Number of Sequences restarted
  3936. * @mu_seq_posted: Number of MU Sequences posted
  3937. * @mpdus_sw_flush: Num MPDUs flushed by SW, HWPAUSED, SW TXABORT
  3938. * (Reset,channel change)
  3939. * @mpdus_hw_filter: Num MPDUs filtered by HW, all filter condition
  3940. * (TTL expired)
  3941. * @mpdus_truncated: Num MPDUs truncated by PDG (TXOP, TBTT,
  3942. * PPDU_duration based on rate, dyn_bw)
  3943. * @mpdus_ack_failed: Num MPDUs that was tried but didn't receive ACK or BA
  3944. * @mpdus_expired: Num MPDUs that was dropped du to expiry.
  3945. * @mc_dropr: Num mc drops
  3946. */
  3947. typedef struct {
  3948. int32_t comp_queued;
  3949. int32_t comp_delivered;
  3950. int32_t msdu_enqued;
  3951. int32_t mpdu_enqued;
  3952. int32_t wmm_drop;
  3953. int32_t local_enqued;
  3954. int32_t local_freed;
  3955. int32_t hw_queued;
  3956. int32_t hw_reaped;
  3957. int32_t underrun;
  3958. uint32_t hw_paused;
  3959. int32_t tx_abort;
  3960. int32_t mpdus_requed;
  3961. uint32_t tx_ko;
  3962. uint32_t tx_xretry;
  3963. uint32_t data_rc;
  3964. uint32_t self_triggers;
  3965. uint32_t sw_retry_failure;
  3966. uint32_t illgl_rate_phy_err;
  3967. uint32_t pdev_cont_xretry;
  3968. uint32_t pdev_tx_timeout;
  3969. uint32_t pdev_resets;
  3970. uint32_t stateless_tid_alloc_failure;
  3971. uint32_t phy_underrun;
  3972. uint32_t txop_ovf;
  3973. uint32_t seq_posted;
  3974. uint32_t seq_failed_queueing;
  3975. uint32_t seq_completed;
  3976. uint32_t seq_restarted;
  3977. uint32_t mu_seq_posted;
  3978. int32_t mpdus_sw_flush;
  3979. int32_t mpdus_hw_filter;
  3980. int32_t mpdus_truncated;
  3981. int32_t mpdus_ack_failed;
  3982. int32_t mpdus_expired;
  3983. uint32_t mc_drop;
  3984. } wmi_host_dbg_tx_stats;
  3985. /**
  3986. * struct wmi_host_dbg_rx_stats - RX Debug stats
  3987. * @mid_ppdu_route_change: Cnts any change in ring routing mid-ppdu
  3988. * @status_rcvd: Total number of statuses processed
  3989. * @r0_frags: Extra frags on rings 0
  3990. * @r1_frags: Extra frags on rings 1
  3991. * @r2_frags: Extra frags on rings 2
  3992. * @r3_frags: Extra frags on rings 3
  3993. * @htt_msdus: MSDUs delivered to HTT
  3994. * @htt_mpdus: MPDUs delivered to HTT
  3995. * @loc_msdus: MSDUs delivered to local stack
  3996. * @loc_mpdus: MPDUS delivered to local stack
  3997. * @oversize_amsdu: AMSDUs that have more MSDUs than the status ring size
  3998. * @phy_errs: Number of PHY errors
  3999. * @phy_err_drop: Number of PHY errors drops
  4000. * @mpdu_errs: Number of mpdu errors - FCS, MIC, ENC etc.
  4001. * @pdev_rx_timeout: Number of rx inactivity timeouts
  4002. * @rx_ovfl_errs: Number of rx overflow errors.
  4003. */
  4004. typedef struct {
  4005. int32_t mid_ppdu_route_change;
  4006. int32_t status_rcvd;
  4007. int32_t r0_frags;
  4008. int32_t r1_frags;
  4009. int32_t r2_frags;
  4010. int32_t r3_frags;
  4011. int32_t htt_msdus;
  4012. int32_t htt_mpdus;
  4013. int32_t loc_msdus;
  4014. int32_t loc_mpdus;
  4015. int32_t oversize_amsdu;
  4016. int32_t phy_errs;
  4017. int32_t phy_err_drop;
  4018. int32_t mpdu_errs;
  4019. uint32_t pdev_rx_timeout;
  4020. int32_t rx_ovfl_errs;
  4021. } wmi_host_dbg_rx_stats;
  4022. /** struct wmi_host_dbg_mem_stats - memory stats
  4023. * @iram_free_size: IRAM free size on target
  4024. * @dram_free_size: DRAM free size on target
  4025. * @sram_free_size: SRAM free size on target
  4026. */
  4027. typedef struct {
  4028. uint32_t iram_free_size;
  4029. uint32_t dram_free_size;
  4030. /* Only Non-TLV */
  4031. uint32_t sram_free_size;
  4032. } wmi_host_dbg_mem_stats;
  4033. typedef struct {
  4034. /* Only TLV */
  4035. int32_t dummy;/* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
  4036. } wmi_host_dbg_peer_stats;
  4037. /**
  4038. * struct wmi_host_dbg_stats - host debug stats
  4039. * @tx: TX stats of type wmi_host_dbg_tx_stats
  4040. * @rx: RX stats of type wmi_host_dbg_rx_stats
  4041. * @mem: Memory stats of type wmi_host_dbg_mem_stats
  4042. * @peer: peer stats of type wmi_host_dbg_peer_stats
  4043. */
  4044. typedef struct {
  4045. wmi_host_dbg_tx_stats tx;
  4046. wmi_host_dbg_rx_stats rx;
  4047. wmi_host_dbg_mem_stats mem;
  4048. wmi_host_dbg_peer_stats peer;
  4049. } wmi_host_dbg_stats;
  4050. /**
  4051. * struct wmi_host_pdev_stats - PDEV stats
  4052. * @chan_nf: Channel noise floor
  4053. * @tx_frame_count: TX frame count
  4054. * @rx_frame_count: RX frame count
  4055. * @rx_clear_count: rx clear count
  4056. * @cycle_count: cycle count
  4057. * @phy_err_count: Phy error count
  4058. * @chan_tx_pwr: Channel Tx Power
  4059. * @pdev_stats: WAL dbg stats
  4060. * @ackRcvBad:
  4061. * @rtsBad:
  4062. * @rtsGood:
  4063. * @fcsBad:
  4064. * @noBeacons:
  4065. * @mib_int_count:
  4066. */
  4067. typedef struct {
  4068. int32_t chan_nf;
  4069. uint32_t tx_frame_count;
  4070. uint32_t rx_frame_count;
  4071. uint32_t rx_clear_count;
  4072. uint32_t cycle_count;
  4073. uint32_t phy_err_count;
  4074. uint32_t chan_tx_pwr;
  4075. wmi_host_dbg_stats pdev_stats;
  4076. uint32_t ackRcvBad;
  4077. uint32_t rtsBad;
  4078. uint32_t rtsGood;
  4079. uint32_t fcsBad;
  4080. uint32_t noBeacons;
  4081. uint32_t mib_int_count;
  4082. } wmi_host_pdev_stats;
  4083. /**
  4084. * struct wmi_host_snr_info - WMI host Signal to noise ration info
  4085. * @bcn_snr: beacon SNR
  4086. * @dat_snr: Data frames SNR
  4087. */
  4088. typedef struct {
  4089. int32_t bcn_snr;
  4090. int32_t dat_snr;
  4091. } wmi_host_snr_info;
  4092. #define WMI_HOST_MAX_TX_RATE_VALUES 10 /*Max Tx Rates */
  4093. #define WMI_HOST_MAX_RSSI_VALUES 10 /*Max Rssi values */
  4094. /* The WLAN_MAX_AC macro cannot be changed without breaking
  4095. * * WMI compatibility.
  4096. * * The maximum value of access category
  4097. * */
  4098. #define WMI_HOST_WLAN_MAX_AC 4
  4099. /**
  4100. * struct wmi_host_vdev_stats - vdev stats structure
  4101. * @vdev_id: unique id identifying the VDEV, generated by the caller
  4102. * Rest all Only TLV
  4103. * @vdev_snr: wmi_host_snr_info
  4104. * @tx_frm_cnt: Total number of packets(per AC) that were successfully
  4105. * transmitted (with and without retries,
  4106. * including multi-cast, broadcast)
  4107. * @rx_frm_cnt: Total number of packets that were successfully received
  4108. * (after appropriate filter rules including multi-cast, broadcast)
  4109. * @multiple_retry_cnt: The number of MSDU packets and MMPDU frames per AC
  4110. * that the 802.11 station successfully transmitted after
  4111. * more than one retransmission attempt
  4112. * @fail_cnt: Total number packets(per AC) failed to transmit
  4113. * @rts_fail_cnt: Total number of RTS/CTS sequence failures for transmission
  4114. * of a packet
  4115. * @rts_succ_cnt: Total number of RTS/CTS sequence success for transmission
  4116. * of a packet
  4117. * @rx_err_cnt: The receive error count. HAL will provide the
  4118. * RxP FCS error global
  4119. * @rx_discard_cnt: The sum of the receive error count and
  4120. * dropped-receive-buffer error count (FCS error)
  4121. * @ack_fail_cnt: Total number packets failed transmit because of no
  4122. * ACK from the remote entity
  4123. * @tx_rate_history:History of last ten transmit rate, in units of 500 kbit/sec
  4124. * @bcn_rssi_history: History of last ten Beacon rssi of the connected Bss
  4125. */
  4126. typedef struct {
  4127. uint32_t vdev_id;
  4128. /* Rest all Only TLV */
  4129. wmi_host_snr_info vdev_snr;
  4130. uint32_t tx_frm_cnt[WMI_HOST_WLAN_MAX_AC];
  4131. uint32_t rx_frm_cnt;
  4132. uint32_t multiple_retry_cnt[WMI_HOST_WLAN_MAX_AC];
  4133. uint32_t fail_cnt[WMI_HOST_WLAN_MAX_AC];
  4134. uint32_t rts_fail_cnt;
  4135. uint32_t rts_succ_cnt;
  4136. uint32_t rx_err_cnt;
  4137. uint32_t rx_discard_cnt;
  4138. uint32_t ack_fail_cnt;
  4139. uint32_t tx_rate_history[WMI_HOST_MAX_TX_RATE_VALUES];
  4140. uint32_t bcn_rssi_history[WMI_HOST_MAX_RSSI_VALUES];
  4141. } wmi_host_vdev_stats;
  4142. /**
  4143. * struct wmi_host_vdev_extd_stats - VDEV extended stats
  4144. * @vdev_id: unique id identifying the VDEV, generated by the caller
  4145. * @ppdu_aggr_cnt: No of Aggrs Queued to HW
  4146. * @ppdu_noack: No of PPDU's not Acked includes both aggr and nonaggr's
  4147. * @mpdu_queued: No of MPDU/Subframes's queued to HW in Aggregates
  4148. * @ppdu_nonaggr_cnt: No of NonAggr/MPDU/Subframes's queued to HW
  4149. * in Legacy NonAggregates
  4150. * @mpdu_sw_requed: No of MPDU/Subframes's SW requeued includes
  4151. * both Aggr and NonAggr
  4152. * @mpdu_suc_retry: No of MPDU/Subframes's transmitted Successfully
  4153. * after Single/mul HW retry
  4154. * @mpdu_suc_multitry: No of MPDU/Subframes's transmitted Success
  4155. * after Multiple HW retry
  4156. * @mpdu_fail_retry: No of MPDU/Subframes's failed transmission
  4157. * after Multiple HW retry
  4158. * @reserved[13]: for future extensions set to 0x0
  4159. */
  4160. typedef struct {
  4161. uint32_t vdev_id;
  4162. uint32_t ppdu_aggr_cnt;
  4163. uint32_t ppdu_noack;
  4164. uint32_t mpdu_queued;
  4165. uint32_t ppdu_nonaggr_cnt;
  4166. uint32_t mpdu_sw_requed;
  4167. uint32_t mpdu_suc_retry;
  4168. uint32_t mpdu_suc_multitry;
  4169. uint32_t mpdu_fail_retry;
  4170. uint32_t reserved[13];
  4171. } wmi_host_vdev_extd_stats;
  4172. /**
  4173. * struct wmi_host_peer_stats - peer stats
  4174. * @peer_macaddr: peer MAC address
  4175. * @peer_rssi: rssi
  4176. * @peer_rssi_seq_num: rssi sequence number
  4177. * @peer_tx_rate: last tx data rate used for peer
  4178. * @peer_rx_rate: last rx data rate used for peer
  4179. * @currentper: Current PER
  4180. * @retries: Retries happend during transmission
  4181. * @txratecount: Maximum Aggregation Size
  4182. * @max4msframelen: Max4msframelen of tx rates used
  4183. * @totalsubframes: Total no of subframes
  4184. * @txbytes: No of bytes transmitted to the client
  4185. * @nobuffs[4]: Packet Loss due to buffer overflows
  4186. * @excretries[4]: Packet Loss due to excessive retries
  4187. * @peer_rssi_changed: how many times peer's RSSI changed by a
  4188. * non-negligible amount
  4189. */
  4190. typedef struct {
  4191. wmi_host_mac_addr peer_macaddr;
  4192. uint32_t peer_rssi;
  4193. uint32_t peer_rssi_seq_num;
  4194. uint32_t peer_tx_rate;
  4195. uint32_t peer_rx_rate;
  4196. uint32_t currentper;
  4197. uint32_t retries;
  4198. uint32_t txratecount;
  4199. uint32_t max4msframelen;
  4200. uint32_t totalsubframes;
  4201. uint32_t txbytes;
  4202. uint32_t nobuffs[4];
  4203. uint32_t excretries[4];
  4204. uint32_t peer_rssi_changed;
  4205. } wmi_host_peer_stats;
  4206. typedef struct {
  4207. uint32_t dummy;
  4208. } wmi_host_bcnflt_stats;
  4209. /**
  4210. * struct wmi_host_chan_stats - WMI chan stats
  4211. * @chan_mhz: Primary channel freq of the channel for which stats are sent
  4212. * @sampling_period_us: Time spent on the channel
  4213. * @rx_clear_count: Aggregate duration over a sampling period for
  4214. * which channel activity was observed
  4215. * @tx_duration_us: Accumalation of the TX PPDU duration over a sampling period
  4216. * @rx_duration_us: Accumalation of the RX PPDU duration over a sampling period
  4217. */
  4218. typedef struct {
  4219. uint32_t chan_mhz;
  4220. uint32_t sampling_period_us;
  4221. uint32_t rx_clear_count;
  4222. uint32_t tx_duration_us;
  4223. uint32_t rx_duration_us;
  4224. } wmi_host_chan_stats;
  4225. #define WMI_EVENT_ID_INVALID 0
  4226. /**
  4227. * Host based ENUM IDs for events to abstract target enums for event_id
  4228. */
  4229. typedef enum {
  4230. wmi_service_ready_event_id = 0,
  4231. wmi_ready_event_id,
  4232. wmi_dbg_msg_event_id,
  4233. wmi_scan_event_id,
  4234. wmi_echo_event_id,
  4235. wmi_update_stats_event_id,
  4236. wmi_inst_rssi_stats_event_id,
  4237. wmi_vdev_start_resp_event_id,
  4238. wmi_vdev_standby_req_event_id,
  4239. wmi_vdev_resume_req_event_id,
  4240. wmi_vdev_stopped_event_id,
  4241. wmi_peer_sta_kickout_event_id,
  4242. wmi_host_swba_event_id,
  4243. wmi_tbttoffset_update_event_id,
  4244. wmi_mgmt_rx_event_id,
  4245. wmi_chan_info_event_id,
  4246. wmi_phyerr_event_id,
  4247. wmi_roam_event_id,
  4248. wmi_profile_match,
  4249. wmi_debug_print_event_id,
  4250. wmi_pdev_qvit_event_id,
  4251. wmi_wlan_profile_data_event_id,
  4252. wmi_rtt_meas_report_event_id,
  4253. wmi_tsf_meas_report_event_id,
  4254. wmi_rtt_error_report_event_id,
  4255. wmi_rtt_keepalive_event_id,
  4256. wmi_oem_cap_event_id,
  4257. wmi_oem_meas_report_event_id,
  4258. wmi_oem_report_event_id,
  4259. wmi_nan_event_id,
  4260. wmi_wow_wakeup_host_event_id,
  4261. wmi_gtk_offload_status_event_id,
  4262. wmi_gtk_rekey_fail_event_id,
  4263. wmi_dcs_interference_event_id,
  4264. wmi_pdev_tpc_config_event_id,
  4265. wmi_csa_handling_event_id,
  4266. wmi_gpio_input_event_id,
  4267. wmi_peer_ratecode_list_event_id,
  4268. wmi_generic_buffer_event_id,
  4269. wmi_mcast_buf_release_event_id,
  4270. wmi_mcast_list_ageout_event_id,
  4271. wmi_vdev_get_keepalive_event_id,
  4272. wmi_wds_peer_event_id,
  4273. wmi_peer_sta_ps_statechg_event_id,
  4274. wmi_pdev_fips_event_id,
  4275. wmi_tt_stats_event_id,
  4276. wmi_pdev_channel_hopping_event_id,
  4277. wmi_pdev_ani_cck_level_event_id,
  4278. wmi_pdev_ani_ofdm_level_event_id,
  4279. wmi_pdev_reserve_ast_entry_event_id,
  4280. wmi_pdev_nfcal_power_event_id,
  4281. wmi_pdev_tpc_event_id,
  4282. wmi_pdev_get_ast_info_event_id,
  4283. wmi_pdev_temperature_event_id,
  4284. wmi_pdev_nfcal_power_all_channels_event_id,
  4285. wmi_pdev_bss_chan_info_event_id,
  4286. wmi_mu_report_event_id,
  4287. wmi_pdev_utf_event_id,
  4288. wmi_pdev_dump_event_id,
  4289. wmi_tx_pause_event_id,
  4290. wmi_dfs_radar_event_id,
  4291. wmi_pdev_l1ss_track_event_id,
  4292. wmi_service_ready_ext_event_id,
  4293. wmi_vdev_install_key_complete_event_id,
  4294. wmi_vdev_mcc_bcn_intvl_change_req_event_id,
  4295. wmi_vdev_tsf_report_event_id,
  4296. wmi_peer_info_event_id,
  4297. wmi_peer_tx_fail_cnt_thr_event_id,
  4298. wmi_peer_estimated_linkspeed_event_id,
  4299. wmi_peer_state_event_id,
  4300. wmi_offload_bcn_tx_status_event_id,
  4301. wmi_offload_prob_resp_tx_status_event_id,
  4302. wmi_mgmt_tx_completion_event_id,
  4303. wmi_tx_delba_complete_event_id,
  4304. wmi_tx_addba_complete_event_id,
  4305. wmi_ba_rsp_ssn_event_id,
  4306. wmi_aggr_state_trig_event_id,
  4307. wmi_roam_synch_event_id,
  4308. wmi_p2p_disc_event_id,
  4309. wmi_p2p_noa_event_id,
  4310. wmi_pdev_resume_event_id,
  4311. wmi_do_wow_disable_ack_event_id,
  4312. wmi_wow_initial_wakeup_event_id,
  4313. wmi_stats_ext_event_id,
  4314. wmi_iface_link_stats_event_id,
  4315. wmi_peer_link_stats_event_id,
  4316. wmi_radio_link_stats_link,
  4317. wmi_update_fw_mem_dump_event_id,
  4318. wmi_diag_event_id_log_supported_event_id,
  4319. wmi_nlo_match_event_id,
  4320. wmi_nlo_scan_complete_event_id,
  4321. wmi_apfind_event_id,
  4322. wmi_passpoint_match_event_id,
  4323. wmi_chatter_pc_query_event_id,
  4324. wmi_pdev_ftm_intg_event_id,
  4325. wmi_wlan_freq_avoid_event_id,
  4326. wmi_thermal_mgmt_event_id,
  4327. wmi_diag_container_event_id,
  4328. wmi_host_auto_shutdown_event_id,
  4329. wmi_update_whal_mib_stats_event_id,
  4330. wmi_update_vdev_rate_stats_event_id,
  4331. wmi_diag_event_id,
  4332. wmi_ocb_set_sched_event_id,
  4333. wmi_dbg_mesg_flush_complete_event_id,
  4334. wmi_rssi_breach_event_id,
  4335. wmi_uploadh_event_id,
  4336. wmi_captureh_event_id,
  4337. wmi_rfkill_state_change_event_id,
  4338. wmi_tdls_peer_event_id,
  4339. wmi_batch_scan_enabled_event_id,
  4340. wmi_batch_scan_result_event_id,
  4341. wmi_lpi_result_event_id,
  4342. wmi_lpi_status_event_id,
  4343. wmi_lpi_handoff_event_id,
  4344. wmi_extscan_start_stop_event_id,
  4345. wmi_extscan_operation_event_id,
  4346. wmi_extscan_table_usage_event_id,
  4347. wmi_extscan_cached_results_event_id,
  4348. wmi_extscan_wlan_change_results_event_id,
  4349. wmi_extscan_hotlist_match_event_id,
  4350. wmi_extscan_capabilities_event_id,
  4351. wmi_extscan_hotlist_ssid_match_event_id,
  4352. wmi_mdns_stats_event_id,
  4353. wmi_sap_ofl_add_sta_event_id,
  4354. wmi_sap_ofl_del_sta_event_id,
  4355. wmi_ocb_set_config_resp_event_id,
  4356. wmi_ocb_get_tsf_timer_resp_event_id,
  4357. wmi_dcc_get_stats_resp_event_id,
  4358. wmi_dcc_update_ndl_resp_event_id,
  4359. wmi_dcc_stats_event_id,
  4360. wmi_soc_set_hw_mode_resp_event_id,
  4361. wmi_soc_hw_mode_transition_event_id,
  4362. wmi_soc_set_dual_mac_config_resp_event_id,
  4363. wmi_tx_data_traffic_ctrl_event_id,
  4364. wmi_events_max,
  4365. } wmi_conv_event_id;
  4366. #define WMI_UNAVAILABLE_PARAM 0
  4367. /**
  4368. * Host based ENUM IDs for PDEV params to abstract target enums
  4369. */
  4370. typedef enum {
  4371. wmi_pdev_param_tx_chain_mask = 0,
  4372. wmi_pdev_param_rx_chain_mask,
  4373. wmi_pdev_param_txpower_limit2g,
  4374. wmi_pdev_param_txpower_limit5g,
  4375. wmi_pdev_param_txpower_scale,
  4376. wmi_pdev_param_beacon_gen_mode,
  4377. wmi_pdev_param_beacon_tx_mode,
  4378. wmi_pdev_param_resmgr_offchan_mode,
  4379. wmi_pdev_param_protection_mode,
  4380. wmi_pdev_param_dynamic_bw,
  4381. wmi_pdev_param_non_agg_sw_retry_th,
  4382. wmi_pdev_param_agg_sw_retry_th,
  4383. wmi_pdev_param_sta_kickout_th,
  4384. wmi_pdev_param_ac_aggrsize_scaling,
  4385. wmi_pdev_param_ltr_enable,
  4386. wmi_pdev_param_ltr_ac_latency_be,
  4387. wmi_pdev_param_ltr_ac_latency_bk,
  4388. wmi_pdev_param_ltr_ac_latency_vi,
  4389. wmi_pdev_param_ltr_ac_latency_vo,
  4390. wmi_pdev_param_ltr_ac_latency_timeout,
  4391. wmi_pdev_param_ltr_sleep_override,
  4392. wmi_pdev_param_ltr_rx_override,
  4393. wmi_pdev_param_ltr_tx_activity_timeout,
  4394. wmi_pdev_param_l1ss_enable,
  4395. wmi_pdev_param_dsleep_enable,
  4396. wmi_pdev_param_pcielp_txbuf_flush,
  4397. wmi_pdev_param_pcielp_txbuf_watermark,
  4398. wmi_pdev_param_pcielp_txbuf_tmo_en,
  4399. wmi_pdev_param_pcielp_txbuf_tmo_value,
  4400. wmi_pdev_param_pdev_stats_update_period,
  4401. wmi_pdev_param_vdev_stats_update_period,
  4402. wmi_pdev_param_peer_stats_update_period,
  4403. wmi_pdev_param_bcnflt_stats_update_period,
  4404. wmi_pdev_param_pmf_qos,
  4405. wmi_pdev_param_arp_ac_override,
  4406. wmi_pdev_param_dcs,
  4407. wmi_pdev_param_ani_enable,
  4408. wmi_pdev_param_ani_poll_period,
  4409. wmi_pdev_param_ani_listen_period,
  4410. wmi_pdev_param_ani_ofdm_level,
  4411. wmi_pdev_param_ani_cck_level,
  4412. wmi_pdev_param_dyntxchain,
  4413. wmi_pdev_param_proxy_sta,
  4414. wmi_pdev_param_idle_ps_config,
  4415. wmi_pdev_param_power_gating_sleep,
  4416. wmi_pdev_param_aggr_burst,
  4417. wmi_pdev_param_rx_decap_mode,
  4418. wmi_pdev_param_fast_channel_reset,
  4419. wmi_pdev_param_burst_dur,
  4420. wmi_pdev_param_burst_enable,
  4421. wmi_pdev_param_smart_antenna_default_antenna,
  4422. wmi_pdev_param_igmpmld_override,
  4423. wmi_pdev_param_igmpmld_tid,
  4424. wmi_pdev_param_antenna_gain,
  4425. wmi_pdev_param_rx_filter,
  4426. wmi_pdev_set_mcast_to_ucast_tid,
  4427. wmi_pdev_param_proxy_sta_mode,
  4428. wmi_pdev_param_set_mcast2ucast_mode,
  4429. wmi_pdev_param_set_mcast2ucast_buffer,
  4430. wmi_pdev_param_remove_mcast2ucast_buffer,
  4431. wmi_pdev_peer_sta_ps_statechg_enable,
  4432. wmi_pdev_param_igmpmld_ac_override,
  4433. wmi_pdev_param_block_interbss,
  4434. wmi_pdev_param_set_disable_reset_cmdid,
  4435. wmi_pdev_param_set_msdu_ttl_cmdid,
  4436. wmi_pdev_param_set_ppdu_duration_cmdid,
  4437. wmi_pdev_param_txbf_sound_period_cmdid,
  4438. wmi_pdev_param_set_promisc_mode_cmdid,
  4439. wmi_pdev_param_set_burst_mode_cmdid,
  4440. wmi_pdev_param_en_stats,
  4441. wmi_pdev_param_mu_group_policy,
  4442. wmi_pdev_param_noise_detection,
  4443. wmi_pdev_param_noise_threshold,
  4444. wmi_pdev_param_dpd_enable,
  4445. wmi_pdev_param_set_mcast_bcast_echo,
  4446. wmi_pdev_param_atf_strict_sch,
  4447. wmi_pdev_param_atf_sched_duration,
  4448. wmi_pdev_param_ant_plzn,
  4449. wmi_pdev_param_mgmt_retry_limit,
  4450. wmi_pdev_param_sensitivity_level,
  4451. wmi_pdev_param_signed_txpower_2g,
  4452. wmi_pdev_param_signed_txpower_5g,
  4453. wmi_pdev_param_enable_per_tid_amsdu,
  4454. wmi_pdev_param_enable_per_tid_ampdu,
  4455. wmi_pdev_param_cca_threshold,
  4456. wmi_pdev_param_rts_fixed_rate,
  4457. wmi_pdev_param_cal_period,
  4458. wmi_pdev_param_pdev_reset,
  4459. wmi_pdev_param_wapi_mbssid_offset,
  4460. wmi_pdev_param_arp_srcaddr,
  4461. wmi_pdev_param_arp_dstaddr,
  4462. wmi_pdev_param_txpower_decr_db,
  4463. wmi_pdev_param_rx_batchmode,
  4464. wmi_pdev_param_packet_aggr_delay,
  4465. wmi_pdev_param_atf_obss_noise_sch,
  4466. wmi_pdev_param_atf_obss_noise_scaling_factor,
  4467. wmi_pdev_param_cust_txpower_scale,
  4468. wmi_pdev_param_atf_dynamic_enable,
  4469. wmi_pdev_param_atf_ssid_group_policy,
  4470. wmi_pdev_param_rfkill_enable,
  4471. wmi_pdev_param_hw_rfkill_config,
  4472. wmi_pdev_param_low_power_rf_enable,
  4473. wmi_pdev_param_l1ss_track,
  4474. wmi_pdev_param_hyst_en,
  4475. wmi_pdev_param_power_collapse_enable,
  4476. wmi_pdev_param_led_sys_state,
  4477. wmi_pdev_param_led_enable,
  4478. wmi_pdev_param_audio_over_wlan_latency,
  4479. wmi_pdev_param_audio_over_wlan_enable,
  4480. wmi_pdev_param_whal_mib_stats_update_enable,
  4481. wmi_pdev_param_vdev_rate_stats_update_period,
  4482. wmi_pdev_param_cts_cbw,
  4483. wmi_pdev_param_wnts_config,
  4484. wmi_pdev_param_adaptive_early_rx_enable,
  4485. wmi_pdev_param_adaptive_early_rx_min_sleep_slop,
  4486. wmi_pdev_param_adaptive_early_rx_inc_dec_step,
  4487. wmi_pdev_param_early_rx_fix_sleep_slop,
  4488. wmi_pdev_param_bmiss_based_adaptive_bto_enable,
  4489. wmi_pdev_param_bmiss_bto_min_bcn_timeout,
  4490. wmi_pdev_param_bmiss_bto_inc_dec_step,
  4491. wmi_pdev_param_bto_fix_bcn_timeout,
  4492. wmi_pdev_param_ce_based_adaptive_bto_enable,
  4493. wmi_pdev_param_ce_bto_combo_ce_value,
  4494. wmi_pdev_param_tx_chain_mask_2g,
  4495. wmi_pdev_param_rx_chain_mask_2g,
  4496. wmi_pdev_param_tx_chain_mask_5g,
  4497. wmi_pdev_param_rx_chain_mask_5g,
  4498. wmi_pdev_param_tx_chain_mask_cck,
  4499. wmi_pdev_param_tx_chain_mask_1ss,
  4500. wmi_pdev_param_max,
  4501. } wmi_conv_pdev_params_id;
  4502. /**
  4503. * Host based ENUM IDs for VDEV params to abstract target enums
  4504. */
  4505. typedef enum {
  4506. wmi_vdev_param_rts_threshold = 0,
  4507. wmi_vdev_param_fragmentation_threshold,
  4508. wmi_vdev_param_beacon_interval,
  4509. wmi_vdev_param_listen_interval,
  4510. wmi_vdev_param_multicast_rate,
  4511. wmi_vdev_param_mgmt_tx_rate,
  4512. wmi_vdev_param_slot_time,
  4513. wmi_vdev_param_preamble,
  4514. wmi_vdev_param_swba_time,
  4515. wmi_vdev_stats_update_period,
  4516. wmi_vdev_pwrsave_ageout_time,
  4517. wmi_vdev_host_swba_interval,
  4518. wmi_vdev_param_dtim_period,
  4519. wmi_vdev_oc_scheduler_air_time_limit,
  4520. wmi_vdev_param_wds,
  4521. wmi_vdev_param_atim_window,
  4522. wmi_vdev_param_bmiss_count_max,
  4523. wmi_vdev_param_bmiss_first_bcnt,
  4524. wmi_vdev_param_bmiss_final_bcnt,
  4525. wmi_vdev_param_feature_wmm,
  4526. wmi_vdev_param_chwidth,
  4527. wmi_vdev_param_chextoffset,
  4528. wmi_vdev_param_disable_htprotection,
  4529. wmi_vdev_param_sta_quickkickout,
  4530. wmi_vdev_param_mgmt_rate,
  4531. wmi_vdev_param_protection_mode,
  4532. wmi_vdev_param_fixed_rate,
  4533. wmi_vdev_param_sgi,
  4534. wmi_vdev_param_ldpc,
  4535. wmi_vdev_param_tx_stbc,
  4536. wmi_vdev_param_rx_stbc,
  4537. wmi_vdev_param_intra_bss_fwd,
  4538. wmi_vdev_param_def_keyid,
  4539. wmi_vdev_param_nss,
  4540. wmi_vdev_param_bcast_data_rate,
  4541. wmi_vdev_param_mcast_data_rate,
  4542. wmi_vdev_param_mcast_indicate,
  4543. wmi_vdev_param_dhcp_indicate,
  4544. wmi_vdev_param_unknown_dest_indicate,
  4545. wmi_vdev_param_ap_keepalive_min_idle_inactive_time_secs,
  4546. wmi_vdev_param_ap_keepalive_max_idle_inactive_time_secs,
  4547. wmi_vdev_param_ap_keepalive_max_unresponsive_time_secs,
  4548. wmi_vdev_param_ap_enable_nawds,
  4549. wmi_vdev_param_mcast2ucast_set,
  4550. wmi_vdev_param_enable_rtscts,
  4551. wmi_vdev_param_rc_num_retries,
  4552. wmi_vdev_param_txbf,
  4553. wmi_vdev_param_packet_powersave,
  4554. wmi_vdev_param_drop_unencry,
  4555. wmi_vdev_param_tx_encap_type,
  4556. wmi_vdev_param_ap_detect_out_of_sync_sleeping_sta_time_secs,
  4557. wmi_vdev_param_cabq_maxdur,
  4558. wmi_vdev_param_mfptest_set,
  4559. wmi_vdev_param_rts_fixed_rate,
  4560. wmi_vdev_param_vht_sgimask,
  4561. wmi_vdev_param_vht80_ratemask,
  4562. wmi_vdev_param_early_rx_adjust_enable,
  4563. wmi_vdev_param_early_rx_tgt_bmiss_num,
  4564. wmi_vdev_param_early_rx_bmiss_sample_cycle,
  4565. wmi_vdev_param_early_rx_slop_step,
  4566. wmi_vdev_param_early_rx_init_slop,
  4567. wmi_vdev_param_early_rx_adjust_pause,
  4568. wmi_vdev_param_proxy_sta,
  4569. wmi_vdev_param_meru_vc,
  4570. wmi_vdev_param_rx_decap_type,
  4571. wmi_vdev_param_bw_nss_ratemask,
  4572. wmi_vdev_param_sensor_ap,
  4573. wmi_vdev_param_beacon_rate,
  4574. wmi_vdev_param_dtim_enable_cts,
  4575. wmi_vdev_param_sta_kickout,
  4576. wmi_vdev_param_tx_pwrlimit,
  4577. wmi_vdev_param_snr_num_for_cal,
  4578. wmi_vdev_param_roam_fw_offload,
  4579. wmi_vdev_param_enable_rmc,
  4580. wmi_vdev_param_ibss_max_bcn_lost_ms,
  4581. wmi_vdev_param_max_rate,
  4582. wmi_vdev_param_early_rx_drift_sample,
  4583. wmi_vdev_param_set_ibss_tx_fail_cnt_thr,
  4584. wmi_vdev_param_ebt_resync_timeout,
  4585. wmi_vdev_param_aggr_trig_event_enable,
  4586. wmi_vdev_param_is_ibss_power_save_allowed,
  4587. wmi_vdev_param_is_power_collapse_allowed,
  4588. wmi_vdev_param_is_awake_on_txrx_enabled,
  4589. wmi_vdev_param_inactivity_cnt,
  4590. wmi_vdev_param_txsp_end_inactivity_time_ms,
  4591. wmi_vdev_param_dtim_policy,
  4592. wmi_vdev_param_ibss_ps_warmup_time_secs,
  4593. wmi_vdev_param_ibss_ps_1rx_chain_in_atim_window_enable,
  4594. wmi_vdev_param_rx_leak_window,
  4595. wmi_vdev_param_stats_avg_factor,
  4596. wmi_vdev_param_disconnect_th,
  4597. wmi_vdev_param_rtscts_rate,
  4598. wmi_vdev_param_mcc_rtscts_protection_enable,
  4599. wmi_vdev_param_mcc_broadcast_probe_enable,
  4600. wmi_vdev_param_max,
  4601. } wmi_conv_vdev_param_id;
  4602. /**
  4603. * Host based ENUM IDs for service bits to abstract target enums
  4604. */
  4605. typedef enum {
  4606. wmi_service_beacon_offload = 0,
  4607. wmi_service_scan_offload,
  4608. wmi_service_roam_offload,
  4609. wmi_service_bcn_miss_offload,
  4610. wmi_service_sta_pwrsave,
  4611. wmi_service_sta_advanced_pwrsave,
  4612. wmi_service_ap_uapsd,
  4613. wmi_service_ap_dfs,
  4614. wmi_service_11ac,
  4615. wmi_service_blockack,
  4616. wmi_service_phyerr,
  4617. wmi_service_bcn_filter,
  4618. wmi_service_rtt,
  4619. wmi_service_ratectrl,
  4620. wmi_service_wow,
  4621. wmi_service_ratectrl_cache,
  4622. wmi_service_iram_tids,
  4623. wmi_service_burst,
  4624. wmi_service_smart_antenna_sw_support,
  4625. wmi_service_gtk_offload,
  4626. wmi_service_scan_sch,
  4627. wmi_service_csa_offload,
  4628. wmi_service_chatter,
  4629. wmi_service_coex_freqavoid,
  4630. wmi_service_packet_power_save,
  4631. wmi_service_force_fw_hang,
  4632. wmi_service_smart_antenna_hw_support,
  4633. wmi_service_gpio,
  4634. wmi_sta_uapsd_basic_auto_trig,
  4635. wmi_sta_uapsd_var_auto_trig,
  4636. wmi_service_sta_keep_alive,
  4637. wmi_service_tx_encap,
  4638. wmi_service_ap_ps_detect_out_of_sync,
  4639. wmi_service_early_rx,
  4640. wmi_service_enhanced_proxy_sta,
  4641. wmi_service_tt,
  4642. wmi_service_atf,
  4643. wmi_service_peer_caching,
  4644. wmi_service_coex_gpio,
  4645. wmi_service_aux_spectral_intf,
  4646. wmi_service_aux_chan_load_intf,
  4647. wmi_service_bss_channel_info_64,
  4648. wmi_service_ext_res_cfg_support,
  4649. wmi_service_mesh,
  4650. wmi_service_restrt_chnl_support,
  4651. wmi_service_roam_scan_offload,
  4652. wmi_service_arpns_offload,
  4653. wmi_service_nlo,
  4654. wmi_service_sta_dtim_ps_modulated_dtim,
  4655. wmi_service_sta_smps,
  4656. wmi_service_fwtest,
  4657. wmi_service_sta_wmmac,
  4658. wmi_service_tdls,
  4659. wmi_service_mcc_bcn_interval_change,
  4660. wmi_service_adaptive_ocs,
  4661. wmi_service_ba_ssn_support,
  4662. wmi_service_filter_ipsec_natkeepalive,
  4663. wmi_service_wlan_hb,
  4664. wmi_service_lte_ant_share_support,
  4665. wmi_service_batch_scan,
  4666. wmi_service_qpower,
  4667. wmi_service_plmreq,
  4668. wmi_service_thermal_mgmt,
  4669. wmi_service_rmc,
  4670. wmi_service_mhf_offload,
  4671. wmi_service_coex_sar,
  4672. wmi_service_bcn_txrate_override,
  4673. wmi_service_nan,
  4674. wmi_service_l1ss_stat,
  4675. wmi_service_estimate_linkspeed,
  4676. wmi_service_obss_scan,
  4677. wmi_service_tdls_offchan,
  4678. wmi_service_tdls_uapsd_buffer_sta,
  4679. wmi_service_tdls_uapsd_sleep_sta,
  4680. wmi_service_ibss_pwrsave,
  4681. wmi_service_lpass,
  4682. wmi_service_extscan,
  4683. wmi_service_d0wow,
  4684. wmi_service_hsoffload,
  4685. wmi_service_roam_ho_offload,
  4686. wmi_service_rx_full_reorder,
  4687. wmi_service_dhcp_offload,
  4688. wmi_service_sta_rx_ipa_offload_support,
  4689. wmi_service_mdns_offload,
  4690. wmi_service_sap_auth_offload,
  4691. wmi_service_dual_band_simultaneous_support,
  4692. wmi_service_ocb,
  4693. wmi_service_ap_arpns_offload,
  4694. wmi_service_per_band_chainmask_support,
  4695. wmi_service_packet_filter_offload,
  4696. wmi_service_mgmt_tx_htt,
  4697. wmi_service_mgmt_tx_wmi,
  4698. wmi_service_ext_msg,
  4699. wmi_service_mawc,
  4700. wmi_service_peer_stats,
  4701. wmi_service_mesh_11s,
  4702. wmi_service_periodic_chan_stat_support,
  4703. wmi_service_tx_mode_push_only,
  4704. wmi_service_tx_mode_push_pull,
  4705. wmi_service_tx_mode_dynamic,
  4706. wmi_services_max,
  4707. } wmi_conv_service_ids;
  4708. #define WMI_SERVICE_UNAVAILABLE 0xFFFF
  4709. /**
  4710. * struct target_capability_info - Target capabilities in service ready
  4711. * @phy_capability: PHY capabilities
  4712. * @max_frag_entry: Maximum frag entries
  4713. * @num_rf_chains: Number of RF chains supported
  4714. * @ht_cap_info: HT cap info
  4715. * @vht_cap_info: VHT cap info
  4716. * @vht_supp_mcs: VHT Supported MCS
  4717. * @hw_min_tx_power: HW minimum tx power
  4718. * @hw_max_tx_power: HW maximum tx power
  4719. * @sys_cap_info: sys capability info
  4720. * @min_pkt_size_enable: Enterprise mode short pkt enable
  4721. * @max_bcn_ie_size: Max beacon and probe rsp IE offload size
  4722. * @max_num_scan_channels: Max scan channels
  4723. * @max_supported_macs: max supported MCS
  4724. * @wmi_fw_sub_feat_caps: FW sub feature capabilities
  4725. * @txrx_chainmask: TXRX chain mask
  4726. * @default_dbs_hw_mode_index: DBS hw mode index
  4727. * @num_msdu_desc: number of msdu desc
  4728. */
  4729. typedef struct {
  4730. uint32_t phy_capability;
  4731. uint32_t max_frag_entry;
  4732. uint32_t num_rf_chains;
  4733. uint32_t ht_cap_info;
  4734. uint32_t vht_cap_info;
  4735. uint32_t vht_supp_mcs;
  4736. uint32_t hw_min_tx_power;
  4737. uint32_t hw_max_tx_power;
  4738. uint32_t sys_cap_info;
  4739. uint32_t min_pkt_size_enable;
  4740. uint32_t max_bcn_ie_size;
  4741. uint32_t max_num_scan_channels;
  4742. uint32_t max_supported_macs;
  4743. uint32_t wmi_fw_sub_feat_caps;
  4744. uint32_t txrx_chainmask;
  4745. uint32_t default_dbs_hw_mode_index;
  4746. uint32_t num_msdu_desc;
  4747. } target_capability_info;
  4748. /**
  4749. * struct wmi_host_fw_ver - FW version in non-tlv target
  4750. * @sw_version: Versin info
  4751. * @sw_version_1: Second dword of version
  4752. */
  4753. struct wmi_host_fw_ver {
  4754. uint32_t sw_version;
  4755. uint32_t sw_version_1;
  4756. };
  4757. /**
  4758. * struct wmi_host_fw_abi_ver - FW version in non-tlv target
  4759. * @sw_version: Versin info
  4760. * @abi_version: ABI version
  4761. */
  4762. struct wmi_host_fw_abi_ver {
  4763. uint32_t sw_version;
  4764. uint32_t abi_version;
  4765. };
  4766. /**
  4767. * struct target_resource_config - Resource config sent from host to target
  4768. * abstracted out to include union of both configs
  4769. * @num_vdevs: Number vdevs configured
  4770. * @num_peers: Number of peers
  4771. * @num_active_peers: Number of active peers for peer cache
  4772. * @num_offload_peers: Number of offload peers
  4773. * @num_offload_reorder_buffs: number of offload reorder buffs
  4774. * @num_peer_keys: number of peer keys
  4775. * @num_tids: number of tids
  4776. * @ast_skid_limit: AST skid limit
  4777. * @tx_chain_mask: TX chain mask
  4778. * @rx_chain_mask: RX chain mask
  4779. * @rx_timeout_pri: RX reorder timeout per AC
  4780. * @rx_decap_mode: RX decap mode
  4781. * @scan_max_pending_req: Scan mac pending req
  4782. * @bmiss_offload_max_vdev: Beacom miss offload max vdevs
  4783. * @roam_offload_max_vdev: Roam offload max vdevs
  4784. * @roam_offload_max_ap_profiles: roam offload max ap profiles
  4785. * @num_mcast_groups: num mcast groups
  4786. * @num_mcast_table_elems: number of macst table elems
  4787. * @mcast2ucast_mode: mcast enhance mode
  4788. * @tx_dbg_log_size: DBG log buf size
  4789. * @num_wds_entries: number of WDS entries
  4790. * @dma_burst_size: DMA burst size.
  4791. * @mac_aggr_delim: Mac aggr delim
  4792. * @rx_skip_defrag_timeout_dup_detection_check: Defrag dup check in host?
  4793. * @vow_config: vow configuration
  4794. * @gtk_offload_max_vdev: Max vdevs for GTK offload
  4795. * @num_msdu_desc: Number of msdu desc
  4796. * @max_frag_entries: Max frag entries
  4797. * End common
  4798. * @max_peer_ext_stats: Max peer EXT stats
  4799. * @smart_ant_cap: Smart antenna capabilities
  4800. * @BK_Minfree: BIN configuration for BK traffic
  4801. * @BE_Minfree: BIN configuration for BE traffic
  4802. * @VI_Minfree: BIN configuration for VI traffic
  4803. * @VO_Minfree: BIN configuration for VO traffic
  4804. * @rx_batchmode: RX batch mode
  4805. * @tt_support: Thermal throttling support
  4806. * @atf_config: ATF config
  4807. * @iphdr_pad_config: ipheader pad config
  4808. * @qwrap_config: Qwrap configuration
  4809. * @alloc_frag_desc_for_data_pkt: Frag desc for data
  4810. * Added in MCL
  4811. * @num_tdls_vdevs:
  4812. * @num_tdls_conn_table_entries:
  4813. * @beacon_tx_offload_max_vdev:
  4814. * @num_multicast_filter_entries:
  4815. * @num_wow_filters:
  4816. * @num_keep_alive_pattern:
  4817. * @keep_alive_pattern_size:
  4818. * @max_tdls_concurrent_sleep_sta:
  4819. * @max_tdls_concurrent_buffer_sta:
  4820. * @wmi_send_separate:
  4821. * @num_ocb_vdevs:
  4822. * @num_ocb_channels:
  4823. * @num_ocb_schedules:
  4824. */
  4825. typedef struct {
  4826. uint32_t num_vdevs;
  4827. uint32_t num_peers;
  4828. uint32_t num_active_peers;
  4829. uint32_t num_offload_peers;
  4830. uint32_t num_offload_reorder_buffs;
  4831. uint32_t num_peer_keys;
  4832. uint32_t num_tids;
  4833. uint32_t ast_skid_limit;
  4834. uint32_t tx_chain_mask;
  4835. uint32_t rx_chain_mask;
  4836. uint32_t rx_timeout_pri[4];
  4837. uint32_t rx_decap_mode;
  4838. uint32_t scan_max_pending_req;
  4839. uint32_t bmiss_offload_max_vdev;
  4840. uint32_t roam_offload_max_vdev;
  4841. uint32_t roam_offload_max_ap_profiles;
  4842. uint32_t num_mcast_groups;
  4843. uint32_t num_mcast_table_elems;
  4844. uint32_t mcast2ucast_mode;
  4845. uint32_t tx_dbg_log_size;
  4846. uint32_t num_wds_entries;
  4847. uint32_t dma_burst_size;
  4848. uint32_t mac_aggr_delim;
  4849. uint32_t rx_skip_defrag_timeout_dup_detection_check;
  4850. uint32_t vow_config;
  4851. uint32_t gtk_offload_max_vdev;
  4852. uint32_t num_msdu_desc; /* Number of msdu desc */
  4853. uint32_t max_frag_entries;
  4854. /* End common */
  4855. /* Added for Beeliner */
  4856. uint32_t max_peer_ext_stats;
  4857. uint32_t smart_ant_cap;
  4858. uint32_t BK_Minfree;
  4859. uint32_t BE_Minfree;
  4860. uint32_t VI_Minfree;
  4861. uint32_t VO_Minfree;
  4862. uint32_t rx_batchmode;
  4863. uint32_t tt_support;
  4864. uint32_t atf_config;
  4865. uint32_t iphdr_pad_config;
  4866. uint32_t
  4867. qwrap_config:16,
  4868. alloc_frag_desc_for_data_pkt:16;
  4869. /* Added in MCL */
  4870. uint32_t num_tdls_vdevs;
  4871. uint32_t num_tdls_conn_table_entries;
  4872. uint32_t beacon_tx_offload_max_vdev;
  4873. uint32_t num_multicast_filter_entries;
  4874. uint32_t num_wow_filters;
  4875. uint32_t num_keep_alive_pattern;
  4876. uint32_t keep_alive_pattern_size;
  4877. uint32_t max_tdls_concurrent_sleep_sta;
  4878. uint32_t max_tdls_concurrent_buffer_sta;
  4879. uint32_t wmi_send_separate;
  4880. uint32_t num_ocb_vdevs;
  4881. uint32_t num_ocb_channels;
  4882. uint32_t num_ocb_schedules;
  4883. } target_resource_config;
  4884. /**
  4885. * struct wds_addr_event - WDS addr event structure
  4886. * @event_type: event type add/delete
  4887. * @peer_mac: peer mac
  4888. * @dest_mac: destination mac address
  4889. */
  4890. typedef struct {
  4891. uint32_t event_type[4];
  4892. u_int8_t peer_mac[IEEE80211_ADDR_LEN];
  4893. u_int8_t dest_mac[IEEE80211_ADDR_LEN];
  4894. } wds_addr_event_t;
  4895. /**
  4896. * Enum replicated for host abstraction with FW
  4897. */
  4898. typedef enum {
  4899. /* Event respose of START CMD */
  4900. WMI_HOST_VDEV_START_RESP_EVENT = 0,
  4901. /* Event respose of RESTART CMD */
  4902. WMI_HOST_VDEV_RESTART_RESP_EVENT,
  4903. } WMI_HOST_START_EVENT_PARAM;
  4904. /**
  4905. * struct wmi_host_vdev_start_resp - VDEV start response
  4906. * @vdev_id: vdev id
  4907. * @requestor_id: requestor id that requested the VDEV start request
  4908. * @resp_type: Respose of Event type START/RESTART
  4909. * @status: status of the response
  4910. * @chain_mask: Vdev chain mask
  4911. * @smps_mode: Vdev mimo power save mode
  4912. * @mac_id: mac_id field contains the MAC identifier that the
  4913. * VDEV is bound to. The valid range is 0 to (num_macs-1).
  4914. * @cfgd_tx_streams: Configured Transmit Streams
  4915. * @cfgd_rx_streams: Configured Receive Streams
  4916. */
  4917. typedef struct {
  4918. uint32_t vdev_id;
  4919. uint32_t requestor_id;
  4920. WMI_HOST_START_EVENT_PARAM resp_type;
  4921. uint32_t status;
  4922. uint32_t chain_mask;
  4923. uint32_t smps_mode;
  4924. uint32_t mac_id;
  4925. uint32_t cfgd_tx_streams;
  4926. uint32_t cfgd_rx_streams;
  4927. } wmi_host_vdev_start_resp;
  4928. #define WMI_HOST_ATH_MAX_ANTENNA 4
  4929. /**
  4930. * struct wmi_host_mgmt_rx_hdr - host mgmt header params
  4931. * @channel: channel on which this frame is received
  4932. * @snr: snr information used to cal rssi
  4933. * @rssi_ctl[WMI_HOST_ATH_MAX_ANTENNA]: RSSI of PRI 20MHz for each chain.
  4934. * @rate: Rate kbps
  4935. * @phy_mode: rx phy mode WLAN_PHY_MODE
  4936. * @buf_len: length of the frame
  4937. * @status: rx status
  4938. * @flags: information about the management frame e.g. can give a
  4939. * scan source for a scan result mgmt frame
  4940. * @rssi: combined RSSI, i.e. the sum of the snr + noise floor (dBm units)
  4941. * @tsf_delta:
  4942. */
  4943. typedef struct {
  4944. uint32_t channel;
  4945. uint32_t snr;
  4946. uint8_t rssi_ctl[WMI_HOST_ATH_MAX_ANTENNA];
  4947. uint32_t rate;
  4948. uint32_t phy_mode;
  4949. uint32_t buf_len;
  4950. uint32_t status;
  4951. uint32_t flags;
  4952. int32_t rssi;
  4953. uint32_t tsf_delta;
  4954. } wmi_host_mgmt_rx_hdr;
  4955. /**
  4956. * struct wmi_host_roam_event - host roam event param
  4957. * @vdev_id: vdev id
  4958. * @reason: roam reason
  4959. * @rssi: RSSI
  4960. */
  4961. typedef struct {
  4962. uint32_t vdev_id;
  4963. uint32_t reason;
  4964. uint32_t rssi;
  4965. } wmi_host_roam_event;
  4966. /**
  4967. * ENUM wmi_host_scan_event_type - Scan event type
  4968. */
  4969. enum wmi_host_scan_event_type {
  4970. WMI_HOST_SCAN_EVENT_STARTED = 0x1,
  4971. WMI_HOST_SCAN_EVENT_COMPLETED = 0x2,
  4972. WMI_HOST_SCAN_EVENT_BSS_CHANNEL = 0x4,
  4973. WMI_HOST_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
  4974. WMI_HOST_SCAN_EVENT_DEQUEUED = 0x10,
  4975. WMI_HOST_SCAN_EVENT_PREEMPTED = 0x20,
  4976. WMI_HOST_SCAN_EVENT_START_FAILED = 0x40,
  4977. WMI_HOST_SCAN_EVENT_RESTARTED = 0x80,
  4978. WMI_HOST_SCAN_EVENT_FOREIGN_CHANNEL_EXIT = 0x100,
  4979. WMI_HOST_SCAN_EVENT_INVALID = 0x200,
  4980. WMI_HOST_SCAN_EVENT_MAX = 0x8000
  4981. };
  4982. /**
  4983. * ENUM wmi_host_scan_completion_reason - Scan completion event type
  4984. */
  4985. enum wmi_host_scan_completion_reason {
  4986. /** scan related events */
  4987. WMI_HOST_SCAN_REASON_NONE = 0xFF,
  4988. WMI_HOST_SCAN_REASON_COMPLETED = 0,
  4989. WMI_HOST_SCAN_REASON_CANCELLED = 1,
  4990. WMI_HOST_SCAN_REASON_PREEMPTED = 2,
  4991. WMI_HOST_SCAN_REASON_TIMEDOUT = 3,
  4992. WMI_HOST_SCAN_REASON_INTERNAL_FAILURE = 4,
  4993. WMI_HOST_SCAN_REASON_MAX,
  4994. };
  4995. /**
  4996. * struct wmi_host_scan_event - Scan event response from target
  4997. * @event: event type
  4998. * @reason: Reason for event
  4999. * @channel_freq: channel frequency
  5000. * @requestor: requestor id
  5001. * @scan_id: scan id
  5002. * @vdev_id: vdev id
  5003. */
  5004. typedef struct {
  5005. uint32_t event;
  5006. uint32_t reason;
  5007. uint32_t channel_freq;
  5008. uint32_t requestor;
  5009. uint32_t scan_id;
  5010. uint32_t vdev_id;
  5011. } wmi_host_scan_event;
  5012. /**
  5013. * struct wmi_host_pdev_reserve_ast_entry_event - Reserve AST entry
  5014. * @result: result
  5015. */
  5016. typedef struct {
  5017. uint32_t result;
  5018. } wmi_host_pdev_reserve_ast_entry_event;
  5019. /**
  5020. * struct wmi_host_mcast_ageout_entry - mcast aged-out entry
  5021. * @grp_addr: IPv4/6 mcast group addr
  5022. * @vdev_id: vdev id
  5023. */
  5024. typedef struct {
  5025. uint8_t grp_addr[16];
  5026. uint32_t vdev_id;
  5027. } wmi_host_mcast_ageout_entry;
  5028. /**
  5029. * struct wmi_host_mcast_list_ageout_event - List of mcast entry aged-out
  5030. * @num_entry: Number of mcast entries timed-out
  5031. * @entry: List of wmi_host_mcast_ageout_entry
  5032. */
  5033. typedef struct {
  5034. uint32_t num_entry;
  5035. wmi_host_mcast_ageout_entry entry[1];
  5036. } wmi_host_mcast_list_ageout_event;
  5037. /**
  5038. * struct wmi_host_pdev_nfcal_power_all_channels_event - NF cal event data
  5039. * @nfdBr:
  5040. * chan0: {NFCalPower_chain0, NFCalPower_chain1,
  5041. * NFCalPower_chain2, NFCalPower_chain3},
  5042. * chan1: {NFCalPower_chain0, NFCalPower_chain1,
  5043. * NFCalPower_chain2, NFCalPower_chain3},
  5044. * chan2: {NFCalPower_chain0, NFCalPower_chain1,
  5045. * NFCalPower_chain2, NFCalPower_chain3},
  5046. * chan3: {NFCalPower_chain0, NFCalPower_chain1,
  5047. * NFCalPower_chain2, NFCalPower_chain3},
  5048. * @nfdBr:
  5049. * chan0: {NFCalPower_chain0, NFCalPower_chain1,
  5050. * NFCalPower_chain2, NFCalPower_chain3},
  5051. * chan1: {NFCalPower_chain0, NFCalPower_chain1,
  5052. * NFCalPower_chain2, NFCalPower_chain3},
  5053. * chan2: {NFCalPower_chain0, NFCalPower_chain1,
  5054. * NFCalPower_chain2, NFCalPower_chain3},
  5055. * chan3: {NFCalPower_chain0, NFCalPower_chain1,
  5056. * NFCalPower_chain2, NFCalPower_chain3},
  5057. * @freqNum: frequency number
  5058. */
  5059. typedef struct {
  5060. int8_t nfdBr[WMI_HOST_RXG_CAL_CHAN_MAX * WMI_HOST_MAX_NUM_CHAINS];
  5061. int8_t nfdBm[WMI_HOST_RXG_CAL_CHAN_MAX * WMI_HOST_MAX_NUM_CHAINS];
  5062. uint32_t freqNum[WMI_HOST_RXG_CAL_CHAN_MAX];
  5063. } wmi_host_pdev_nfcal_power_all_channels_event;
  5064. /**
  5065. * struct wmi_host_pdev_tpc_event - WMI host pdev TPC event
  5066. * @tpc:
  5067. */
  5068. typedef struct {
  5069. uint32_t tpc[1];
  5070. } wmi_host_pdev_tpc_event;
  5071. /**
  5072. * struct wmi_host_pdev_generic_buffer_event
  5073. * @buf_type: Buffer type
  5074. * @frag_id: Frag id
  5075. * @more_frag: more frags pending
  5076. * @buf_len: buffer length
  5077. * @buf_info: variable length buffer
  5078. */
  5079. typedef struct {
  5080. uint32_t buf_type;
  5081. uint32_t frag_id;
  5082. uint32_t more_frag;
  5083. uint32_t buf_len;
  5084. uint32_t buf_info[1];
  5085. } wmi_host_pdev_generic_buffer_event;
  5086. /**
  5087. * Enum for host buffer event
  5088. */
  5089. enum {
  5090. WMI_HOST_BUFFER_TYPE_RATEPWR_TABLE,
  5091. WMI_HOST_BUFFER_TYPE_CTL_TABLE,
  5092. };
  5093. /**
  5094. * struct wmi_host_pdev_tpc_config_event - host pdev tpc config event
  5095. * @regDomain:
  5096. * @chanFreq:
  5097. * @phyMode:
  5098. * @twiceAntennaReduction:
  5099. * @twiceMaxRDPower:
  5100. * @twiceAntennaGain:
  5101. * @powerLimit:
  5102. * @rateMax:
  5103. * @numTxChain:
  5104. * @ctl:
  5105. * @flags:
  5106. * @maxRegAllowedPower:
  5107. * @maxRegAllowedPowerAGCDD:
  5108. * @maxRegAllowedPowerAGSTBC:
  5109. * @maxRegAllowedPowerAGTXBF:
  5110. * @ratesArray:
  5111. */
  5112. typedef struct {
  5113. uint32_t regDomain;
  5114. uint32_t chanFreq;
  5115. uint32_t phyMode;
  5116. uint32_t twiceAntennaReduction;
  5117. uint32_t twiceMaxRDPower;
  5118. int32_t twiceAntennaGain;
  5119. uint32_t powerLimit;
  5120. uint32_t rateMax;
  5121. uint32_t numTxChain;
  5122. uint32_t ctl;
  5123. uint32_t flags;
  5124. int8_t maxRegAllowedPower[WMI_HOST_TPC_TX_NUM_CHAIN];
  5125. int8_t maxRegAllowedPowerAGCDD[WMI_HOST_TPC_TX_NUM_CHAIN][WMI_HOST_TPC_TX_NUM_CHAIN];
  5126. int8_t maxRegAllowedPowerAGSTBC[WMI_HOST_TPC_TX_NUM_CHAIN][WMI_HOST_TPC_TX_NUM_CHAIN];
  5127. int8_t maxRegAllowedPowerAGTXBF[WMI_HOST_TPC_TX_NUM_CHAIN][WMI_HOST_TPC_TX_NUM_CHAIN];
  5128. uint8_t ratesArray[WMI_HOST_TPC_RATE_MAX];
  5129. } wmi_host_pdev_tpc_config_event;
  5130. /**
  5131. * Enums for TPC event
  5132. */
  5133. typedef enum {
  5134. WMI_HOST_TPC_CONFIG_EVENT_FLAG_TABLE_CDD = 0x1,
  5135. WMI_HOST_TPC_CONFIG_EVENT_FLAG_TABLE_STBC = 0x2,
  5136. WMI_HOST_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF = 0x4,
  5137. } WMI_HOST_TPC_CONFIG_EVENT_FLAG;
  5138. /**
  5139. * Medium Utilization evaluation algorithms
  5140. * These algorithms can be complementary rather than exclusive.
  5141. */
  5142. typedef enum {
  5143. WMI_HOST_MU_BASIC_ALGO = 0x1,
  5144. WMI_HOST_MU_PER_BSSID_ALGO = 0x2,
  5145. WMI_HOST_MU_HIDDEN_NODE_ALGO = 0x4,
  5146. } WMI_HOST_MU_ALGO_TYPE;
  5147. /* max MU alg combinations supported by target */
  5148. #define WMI_HOST_MU_MAX_ALGO_TYPE 3
  5149. /**
  5150. * struct wmi_host_mu_report_event - WMI_MU_REPORT_EVENTID
  5151. * @mu_request_id: request id
  5152. * @status_reason: MU_STATUS_REASON
  5153. * @total_mu: MU_ALG_TYPE combinations
  5154. * @num_active_bssid: number of active bssid
  5155. */
  5156. typedef struct {
  5157. uint32_t mu_request_id;
  5158. uint32_t status_reason;
  5159. uint32_t total_mu[WMI_HOST_MU_MAX_ALGO_TYPE];
  5160. uint32_t num_active_bssid;
  5161. } wmi_host_mu_report_event;
  5162. /**
  5163. * struct wmi_host_mgmt_tx_compl_event - TX completion event
  5164. * @desc_id: from tx_send_cmd
  5165. * @status: WMI_MGMT_TX_COMP_STATUS_TYPE
  5166. */
  5167. typedef struct {
  5168. uint32_t desc_id;
  5169. uint32_t status;
  5170. } wmi_host_mgmt_tx_compl_event;
  5171. #define WMI_HOST_TIM_BITMAP_ARRAY_SIZE 17
  5172. /**
  5173. * struct wmi_host_tim_info - TIM info in SWBA event
  5174. * @tim_len: TIM length
  5175. * @tim_mcast:
  5176. * @tim_bitmap: TIM bitmap
  5177. * @tim_changed: TIM changed
  5178. * @tim_num_ps_pending: TIM num PS sta pending
  5179. */
  5180. typedef struct {
  5181. uint32_t tim_len;
  5182. uint32_t tim_mcast;
  5183. uint32_t tim_bitmap[WMI_HOST_TIM_BITMAP_ARRAY_SIZE];
  5184. uint32_t tim_changed;
  5185. uint32_t tim_num_ps_pending;
  5186. } wmi_host_tim_info;
  5187. /**
  5188. * struct wmi_host_p2p_noa_descriptor - NoA desc in SWBA event
  5189. * @type_count: Absence count
  5190. * @duration: NoA duration
  5191. * @interval: NoA interval
  5192. * @start_time: start time
  5193. */
  5194. typedef struct {
  5195. uint32_t type_count;
  5196. uint32_t duration;
  5197. uint32_t interval;
  5198. uint32_t start_time;
  5199. } wmi_host_p2p_noa_descriptor;
  5200. /* Maximum number of NOA Descriptors supported */
  5201. #define WMI_HOST_P2P_MAX_NOA_DESCRIPTORS 4
  5202. /**
  5203. * struct wmi_host_p2p_noa_info - p2p noa information
  5204. * @modified: NoA modified
  5205. * @index: Index
  5206. * @oppPS: Oppurtunstic ps
  5207. * @ctwindow: CT window
  5208. * @num_descriptors: number of descriptors
  5209. * @noa_descriptors: noa descriptors
  5210. */
  5211. typedef struct {
  5212. uint8_t modified;
  5213. uint8_t index;
  5214. uint8_t oppPS;
  5215. uint8_t ctwindow;
  5216. uint8_t num_descriptors;
  5217. wmi_host_p2p_noa_descriptor
  5218. noa_descriptors[WMI_HOST_P2P_MAX_NOA_DESCRIPTORS];
  5219. } wmi_host_p2p_noa_info;
  5220. /**
  5221. * struct wmi_host_peer_sta_kickout_event
  5222. * @peer_macaddr: peer mac address
  5223. * @reason: kickout reason
  5224. * @rssi: rssi
  5225. */
  5226. typedef struct {
  5227. uint8_t peer_macaddr[IEEE80211_ADDR_LEN];
  5228. uint32_t reason;
  5229. uint32_t rssi;
  5230. } wmi_host_peer_sta_kickout_event;
  5231. /**
  5232. * struct wmi_host_peer_sta_ps_statechange_event - ST ps state change event
  5233. * @peer_macaddr: peer mac address
  5234. * @peer_ps_stats: peer PS state
  5235. */
  5236. typedef struct {
  5237. uint8_t peer_macaddr[IEEE80211_ADDR_LEN];
  5238. uint32_t peer_ps_state;
  5239. } wmi_host_peer_sta_ps_statechange_event;
  5240. /* Maximum CCK, OFDM rates supported */
  5241. #define WMI_SA_MAX_CCK_OFDM_RATES 12
  5242. /* Maximum MCS rates supported; 4 rates in each dword */
  5243. #define WMI_SA_MAX_MCS_RATES 40
  5244. #define WMI_SA_MAX_RATE_COUNTERS 4
  5245. /* Maximum rate series used for transmission */
  5246. #define SA_MAX_RATE_SERIES 2
  5247. #define SA_MAX_LEGACY_RATE_DWORDS 3
  5248. #define SA_MAX_HT_RATE_DWORDS 10
  5249. #define SA_BYTES_IN_DWORD 4
  5250. #define SA_MASK_BYTE 0xff
  5251. /* TODO: ratecode_160 needs to add for future chips */
  5252. /**
  5253. * struct wmi_sa_rate_cap - smart antenna rat capabilities
  5254. * @ratecode_legacy: Rate code array for CCK OFDM
  5255. * @ratecode_20: Rate code array for 20MHz BW
  5256. * @ratecode_40: Rate code array for 40MHz BW
  5257. * @ratecode_80: Rate code array for 80MHz BW
  5258. * @ratecount: Max Rate count for each mode
  5259. */
  5260. typedef struct {
  5261. uint8_t ratecode_legacy[WMI_SA_MAX_CCK_OFDM_RATES];
  5262. uint8_t ratecode_20[WMI_SA_MAX_MCS_RATES];
  5263. uint8_t ratecode_40[WMI_SA_MAX_MCS_RATES];
  5264. uint8_t ratecode_80[WMI_SA_MAX_MCS_RATES];
  5265. uint8_t ratecount[WMI_SA_MAX_RATE_COUNTERS];
  5266. } wmi_sa_rate_cap;
  5267. /** Preamble types to be used with VDEV fixed rate configuration */
  5268. typedef enum {
  5269. WMI_HOST_RATE_PREAMBLE_OFDM,
  5270. WMI_HOST_RATE_PREAMBLE_CCK,
  5271. WMI_HOST_RATE_PREAMBLE_HT,
  5272. WMI_HOST_RATE_PREAMBLE_VHT,
  5273. } WMI_HOST_RATE_PREAMBLE;
  5274. #define WMI_HOST_FIXED_RATE_NONE (0xff)
  5275. /** slot time long */
  5276. #define WMI_HOST_VDEV_SLOT_TIME_LONG 0x1
  5277. /** slot time short */
  5278. #define WMI_HOST_VDEV_SLOT_TIME_SHORT 0x2
  5279. /** preablbe long */
  5280. #define WMI_HOST_VDEV_PREAMBLE_LONG 0x1
  5281. /** preablbe short */
  5282. #define WMI_HOST_VDEV_PREAMBLE_SHORT 0x2
  5283. /** found a better AP */
  5284. #define WMI_HOST_ROAM_REASON_BETTER_AP 0x1
  5285. /** beacon miss detected */
  5286. #define WMI_HOST_ROAM_REASON_BMISS 0x2
  5287. /** deauth/disassoc received */
  5288. #define WMI_HOST_ROAM_REASON_DEAUTH 0x2
  5289. /** connected AP's low rssi condition detected */
  5290. #define WMI_HOST_ROAM_REASON_LOW_RSSI 0x3
  5291. /** found another AP that matches SSID and Security profile in
  5292. * WMI_ROAM_AP_PROFILE, found during scan triggered upon FINAL_BMISS
  5293. */
  5294. #define WMI_HOST_ROAM_REASON_SUITABLE_AP 0x4
  5295. /** LFR3.0 roaming failed, indicate the disconnection to host */
  5296. #define WMI_HOST_ROAM_REASON_HO_FAILED 0x5
  5297. /** values for vdev_type */
  5298. #define WMI_HOST_VDEV_TYPE_AP 0x1
  5299. #define WMI_HOST_VDEV_TYPE_STA 0x2
  5300. #define WMI_HOST_VDEV_TYPE_IBSS 0x3
  5301. #define WMI_HOST_VDEV_TYPE_MONITOR 0x4
  5302. /** values for vdev_subtype */
  5303. #define WMI_HOST_VDEV_SUBTYPE_P2P_DEVICE 0x1
  5304. #define WMI_HOST_VDEV_SUBTYPE_P2P_CLIENT 0x2
  5305. #define WMI_HOST_VDEV_SUBTYPE_P2P_GO 0x3
  5306. #define WMI_HOST_VDEV_SUBTYPE_PROXY_STA 0x4
  5307. #define WMI_HOST_VDEV_SUBTYPE_MESH 0x5
  5308. #define WMI_HOST_MGMT_TID 17
  5309. /* Disable aging & learning */
  5310. #define WMI_HOST_WDS_FLAG_STATIC 0x1
  5311. /**
  5312. * Peer param enum abstracted from target
  5313. */
  5314. typedef enum {
  5315. /** mimo powersave state */
  5316. WMI_HOST_PEER_MIMO_PS_STATE = 0x1,
  5317. /** enable/disable AMPDU . initial value (enabled) */
  5318. WMI_HOST_PEER_AMPDU = 0x2,
  5319. /** authorize/unauthorize peer. initial value is unauthorized (0) */
  5320. WMI_HOST_PEER_AUTHORIZE = 0x3,
  5321. /** peer channel bandwidth */
  5322. WMI_HOST_PEER_CHWIDTH = 0x4,
  5323. /** peer NSS */
  5324. WMI_HOST_PEER_NSS = 0x5,
  5325. /** USE 4 ADDR */
  5326. WMI_HOST_PEER_USE_4ADDR = 0x6,
  5327. /** Enable extended peer stats */
  5328. WMI_HOST_PEER_EXT_STATS_ENABLE = 0x7,
  5329. /*Use FIXED Pwr */
  5330. WMI_HOST_PEER_USE_FIXED_PWR = 0x8,
  5331. /* Set peer fixed rate */
  5332. WMI_HOST_PEER_PARAM_FIXED_RATE = 0x9,
  5333. /* Whitelist peer TIDs */
  5334. WMI_HOST_PEER_SET_MU_WHITELIST = 0xa,
  5335. /* set group membership status */
  5336. WMI_HOST_PEER_MEMBERSHIP = 0xb,
  5337. WMI_HOST_PEER_USERPOS = 0xc,
  5338. } PEER_PARAM_ENUM;
  5339. #define WMI_HOST_PEER_MIMO_PS_NONE 0x0
  5340. #define WMI_HOST_PEER_MIMO_PS_STATIC 0x1
  5341. #define WMI_HOST_PEER_MIMO_PS_DYNAMIC 0x2
  5342. typedef enum {
  5343. HOST_PLATFORM_HIGH_PERF,
  5344. HOST_PLATFORM_LOW_PERF,
  5345. } HOST_PLATFORM_TYPE;
  5346. enum wmi_host_sta_ps_mode {
  5347. /** enable power save for the given STA VDEV */
  5348. WMI_HOST_STA_PS_MODE_DISABLED = 0,
  5349. /** disable power save for a given STA VDEV */
  5350. WMI_HOST_STA_PS_MODE_ENABLED = 1,
  5351. };
  5352. enum wmi_host_sta_powersave_param {
  5353. /**
  5354. * Controls how frames are retrievd from AP while STA is sleeping
  5355. *
  5356. * (see enum wmi_sta_ps_param_rx_wake_policy)
  5357. */
  5358. WMI_HOST_STA_PS_PARAM_RX_WAKE_POLICY = 0,
  5359. /**
  5360. * The STA will go active after this many TX
  5361. *
  5362. * (see enum wmi_sta_ps_param_tx_wake_threshold)
  5363. */
  5364. WMI_HOST_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
  5365. /**
  5366. * Number of PS-Poll to send before STA wakes up
  5367. *
  5368. * (see enum wmi_sta_ps_param_pspoll_count)
  5369. *
  5370. */
  5371. WMI_HOST_STA_PS_PARAM_PSPOLL_COUNT = 2,
  5372. /**
  5373. * TX/RX inactivity time in msec before going to sleep.
  5374. *
  5375. * The power save SM will monitor tx/rx activity on the VDEV, if no
  5376. * activity for the specified msec of the parameter
  5377. * the Power save SM will go to sleep.
  5378. */
  5379. WMI_HOST_STA_PS_PARAM_INACTIVITY_TIME = 3,
  5380. /**
  5381. * Set uapsd configuration.
  5382. *
  5383. * (see enum wmi_sta_ps_param_uapsd)
  5384. */
  5385. WMI_HOST_STA_PS_PARAM_UAPSD = 4,
  5386. };
  5387. /* prefix used by scan requestor ids on the host
  5388. * replicated here form wmi_unified.h*/
  5389. #define WMI_HOST_P_SCAN_REQUESTOR_ID_PREFIX 0xA000
  5390. /* prefix used by scan request ids generated on the host */
  5391. /* host cycles through the lower 12 bits to generate ids */
  5392. #define WMI_HOST_P_SCAN_REQ_ID_PREFIX 0xA000
  5393. #define WMI_HOST_RC_DS_FLAG 0x01 /* Dual stream flag */
  5394. #define WMI_HOST_RC_CW40_FLAG 0x02 /* CW 40 */
  5395. #define WMI_HOST_RC_SGI_FLAG 0x04 /* Short Guard Interval */
  5396. #define WMI_HOST_RC_HT_FLAG 0x08 /* HT */
  5397. #define WMI_HOST_RC_RTSCTS_FLAG 0x10 /* RTS-CTS */
  5398. #define WMI_HOST_RC_TX_STBC_FLAG 0x20 /* TX STBC */
  5399. #define WMI_HOST_RC_RX_STBC_FLAG 0xC0 /* RX STBC ,2 bits */
  5400. #define WMI_HOST_RC_RX_STBC_FLAG_S 6 /* RX STBC ,2 bits */
  5401. #define WMI_HOST_RC_WEP_TKIP_FLAG 0x100 /* WEP/TKIP encryption */
  5402. #define WMI_HOST_RC_TS_FLAG 0x200 /* Three stream flag */
  5403. #define WMI_HOST_RC_UAPSD_FLAG 0x400 /* UAPSD Rate Control */
  5404. /** HT Capabilities*/
  5405. #define WMI_HOST_HT_CAP_ENABLED 0x0001 /* HT Enabled/ disabled */
  5406. /* Short Guard Interval with HT20 */
  5407. #define WMI_HOST_HT_CAP_HT20_SGI 0x0002
  5408. #define WMI_HOST_HT_CAP_DYNAMIC_SMPS 0x0004 /* Dynamic MIMO powersave */
  5409. #define WMI_HOST_HT_CAP_TX_STBC 0x0008 /* B3 TX STBC */
  5410. #define WMI_HOST_HT_CAP_TX_STBC_MASK_SHIFT 3
  5411. #define WMI_HOST_HT_CAP_RX_STBC 0x0030 /* B4-B5 RX STBC */
  5412. #define WMI_HOST_HT_CAP_RX_STBC_MASK_SHIFT 4
  5413. #define WMI_HOST_HT_CAP_LDPC 0x0040 /* LDPC supported */
  5414. #define WMI_HOST_HT_CAP_L_SIG_TXOP_PROT 0x0080 /* L-SIG TXOP Protection */
  5415. #define WMI_HOST_HT_CAP_MPDU_DENSITY 0x0700 /* MPDU Density */
  5416. #define WMI_HOST_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8
  5417. #define WMI_HOST_HT_CAP_HT40_SGI 0x0800
  5418. #define WMI_HOST_HT_CAP_IBF_BFER 0x1000
  5419. /* These macros should be used when we wish to advertise STBC support for
  5420. * only 1SS or 2SS or 3SS. */
  5421. #define WMI_HOST_HT_CAP_RX_STBC_1SS 0x0010 /* B4-B5 RX STBC */
  5422. #define WMI_HOST_HT_CAP_RX_STBC_2SS 0x0020 /* B4-B5 RX STBC */
  5423. #define WMI_HOST_HT_CAP_RX_STBC_3SS 0x0030 /* B4-B5 RX STBC */
  5424. #define WMI_HOST_HT_CAP_DEFAULT_ALL (WMI_HOST_HT_CAP_ENABLED | \
  5425. WMI_HOST_HT_CAP_HT20_SGI | \
  5426. WMI_HOST_HT_CAP_HT40_SGI | \
  5427. WMI_HOST_HT_CAP_TX_STBC | \
  5428. WMI_HOST_HT_CAP_RX_STBC | \
  5429. WMI_HOST_HT_CAP_LDPC)
  5430. /* WMI_HOST_VHT_CAP_* these maps to ieee 802.11ac vht capability information
  5431. field. The fields not defined here are not supported, or reserved.
  5432. Do not change these masks and if you have to add new one follow the
  5433. bitmask as specified by 802.11ac draft.
  5434. */
  5435. #define WMI_HOST_VHT_CAP_MAX_MPDU_LEN_MASK 0x00000003
  5436. #define WMI_HOST_VHT_CAP_RX_LDPC 0x00000010
  5437. #define WMI_HOST_VHT_CAP_SGI_80MHZ 0x00000020
  5438. #define WMI_HOST_VHT_CAP_SGI_160MHZ 0x00000040
  5439. #define WMI_HOST_VHT_CAP_TX_STBC 0x00000080
  5440. #define WMI_HOST_VHT_CAP_RX_STBC_MASK 0x00000300
  5441. #define WMI_HOST_VHT_CAP_RX_STBC_MASK_SHIFT 8
  5442. #define WMI_HOST_VHT_CAP_SU_BFER 0x00000800
  5443. #define WMI_HOST_VHT_CAP_SU_BFEE 0x00001000
  5444. #define WMI_HOST_VHT_CAP_MAX_CS_ANT_MASK 0x0000E000
  5445. #define WMI_HOST_VHT_CAP_MAX_CS_ANT_MASK_SHIFT 13
  5446. #define WMI_HOST_VHT_CAP_MAX_SND_DIM_MASK 0x00070000
  5447. #define WMI_HOST_VHT_CAP_MAX_SND_DIM_MASK_SHIFT 16
  5448. #define WMI_HOST_VHT_CAP_MU_BFER 0x00080000
  5449. #define WMI_HOST_VHT_CAP_MU_BFEE 0x00100000
  5450. #define WMI_HOST_VHT_CAP_MAX_AMPDU_LEN_EXP 0x03800000
  5451. #define WMI_HOST_VHT_CAP_MAX_AMPDU_LEN_EXP_SHIT 23
  5452. #define WMI_HOST_VHT_CAP_RX_FIXED_ANT 0x10000000
  5453. #define WMI_HOST_VHT_CAP_TX_FIXED_ANT 0x20000000
  5454. #define WMI_HOST_VHT_CAP_MAX_MPDU_LEN_11454 0x00000002
  5455. /* These macros should be used when we wish to advertise STBC support for
  5456. * only 1SS or 2SS or 3SS. */
  5457. #define WMI_HOST_VHT_CAP_RX_STBC_1SS 0x00000100
  5458. #define WMI_HOST_VHT_CAP_RX_STBC_2SS 0x00000200
  5459. #define WMI_HOST_VHT_CAP_RX_STBC_3SS 0x00000300
  5460. #define WMI_HOST_VHT_CAP_DEFAULT_ALL (WMI_HOST_VHT_CAP_MAX_MPDU_LEN_11454 | \
  5461. WMI_HOST_VHT_CAP_SGI_80MHZ | \
  5462. WMI_HOST_VHT_CAP_TX_STBC | \
  5463. WMI_HOST_VHT_CAP_RX_STBC_MASK | \
  5464. WMI_HOST_VHT_CAP_RX_LDPC | \
  5465. WMI_HOST_VHT_CAP_MAX_AMPDU_LEN_EXP | \
  5466. WMI_HOST_VHT_CAP_RX_FIXED_ANT | \
  5467. WMI_HOST_VHT_CAP_TX_FIXED_ANT)
  5468. /* Interested readers refer to Rx/Tx MCS Map definition as defined in
  5469. 802.11ac
  5470. */
  5471. #define WMI_HOST_VHT_MAX_MCS_4_SS_MASK(r, ss) ((3 & (r)) << (((ss) - 1) << 1))
  5472. #define WMI_HOST_VHT_MAX_SUPP_RATE_MASK 0x1fff0000
  5473. #define WMI_HOST_VHT_MAX_SUPP_RATE_MASK_SHIFT 16
  5474. /** U-APSD configuration of peer station from (re)assoc request and TSPECs */
  5475. enum wmi_host_ap_ps_param_uapsd {
  5476. WMI_HOST_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
  5477. WMI_HOST_AP_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
  5478. WMI_HOST_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
  5479. WMI_HOST_AP_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
  5480. WMI_HOST_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
  5481. WMI_HOST_AP_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
  5482. WMI_HOST_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
  5483. WMI_HOST_AP_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
  5484. };
  5485. /** U-APSD maximum service period of peer station */
  5486. enum wmi_host_ap_ps_peer_param_max_sp {
  5487. WMI_HOST_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0,
  5488. WMI_HOST_AP_PS_PEER_PARAM_MAX_SP_2 = 1,
  5489. WMI_HOST_AP_PS_PEER_PARAM_MAX_SP_4 = 2,
  5490. WMI_HOST_AP_PS_PEER_PARAM_MAX_SP_6 = 3,
  5491. /* keep last! */
  5492. MAX_HOST_WMI_AP_PS_PEER_PARAM_MAX_SP,
  5493. };
  5494. #define WMI_HOST_UAPSD_AC_TYPE_DELI 0
  5495. #define WMI_HOST_UAPSD_AC_TYPE_TRIG 1
  5496. #define WMI_HOST_UAPSD_AC_BIT_MASK(ac, type) \
  5497. ((type == WMI_HOST_UAPSD_AC_TYPE_DELI) ? (1<<(ac<<1)) :\
  5498. (1<<((ac<<1)+1)))
  5499. enum wmi_host_ap_ps_peer_param_wnm_sleep {
  5500. WMI_HOST_AP_PS_PEER_PARAM_WNM_SLEEP_ENABLE,
  5501. WMI_HOST_AP_PS_PEER_PARAM_WNM_SLEEP_DISABLE,
  5502. };
  5503. enum wmi_host_ap_ps_peer_param {
  5504. /** Set uapsd configuration for a given peer.
  5505. *
  5506. * This will include the delivery and trigger enabled state for every AC.
  5507. * The host MLME needs to set this based on AP capability and stations
  5508. * request Set in the association request received from the station.
  5509. *
  5510. * Lower 8 bits of the value specify the UAPSD configuration.
  5511. *
  5512. * (see enum wmi_ap_ps_param_uapsd)
  5513. * The default value is 0.
  5514. */
  5515. WMI_HOST_AP_PS_PEER_PARAM_UAPSD = 0,
  5516. /**
  5517. * Set the service period for a UAPSD capable station
  5518. *
  5519. * The service period from wme ie in the (re)assoc request frame.
  5520. *
  5521. * (see enum wmi_ap_ps_peer_param_max_sp)
  5522. */
  5523. WMI_HOST_AP_PS_PEER_PARAM_MAX_SP = 1,
  5524. /** Time in seconds for aging out buffered frames
  5525. * for STA in power save */
  5526. WMI_HOST_AP_PS_PEER_PARAM_AGEOUT_TIME = 2,
  5527. /** Specify frame types that are considered SIFS
  5528. * RESP trigger frame */
  5529. WMI_HOST_AP_PS_PEER_PARAM_SIFS_RESP_FRMTYPE = 3,
  5530. /** Specifies the trigger state of TID.
  5531. * Valid only for UAPSD frame type */
  5532. WMI_HOST_AP_PS_PEER_PARAM_SIFS_RESP_UAPSD = 4,
  5533. /** Specifies the WNM sleep state of a STA */
  5534. WMI_HOST_AP_PS_PEER_PARAM_WNM_SLEEP = 5,
  5535. };
  5536. #define WMI_HOST_RXERR_CRC 0x01 /* CRC error on frame */
  5537. #define WMI_HOST_RXERR_DECRYPT 0x08 /* non-Michael decrypt error */
  5538. #define WMI_HOST_RXERR_MIC 0x10 /* Michael MIC decrypt error */
  5539. #define WMI_HOST_RXERR_KEY_CACHE_MISS 0x20 /* No/incorrect key matter in h/w */
  5540. enum wmi_host_sta_ps_param_uapsd {
  5541. WMI_HOST_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
  5542. WMI_HOST_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
  5543. WMI_HOST_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
  5544. WMI_HOST_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
  5545. WMI_HOST_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
  5546. WMI_HOST_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
  5547. WMI_HOST_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
  5548. WMI_HOST_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
  5549. };
  5550. enum wmi_host_sta_ps_param_rx_wake_policy {
  5551. /* Wake up when ever there is an RX activity on the VDEV. In this mode
  5552. * the Power save SM(state machine) will come out of sleep by either
  5553. * sending null frame (or) a data frame (with PS==0) in response to TIM
  5554. * bit set in the received beacon frame from AP.
  5555. */
  5556. WMI_HOST_STA_PS_RX_WAKE_POLICY_WAKE = 0,
  5557. /* Here the power save state machine will not wakeup in response to TIM
  5558. * bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD
  5559. * configuration setup by WMISET_PS_SET_UAPSD WMI command. When all
  5560. * access categories are delivery-enabled, the station will send a UAPSD
  5561. * trigger frame, otherwise it will send a PS-Poll.
  5562. */
  5563. WMI_HOST_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1,
  5564. };
  5565. enum wmi_host_sta_ps_param_pspoll_count {
  5566. WMI_HOST_STA_PS_PSPOLL_COUNT_NO_MAX = 0,
  5567. /* Values greater than 0 indicate the maximum numer of PS-Poll frames FW
  5568. * will send before waking up.
  5569. */
  5570. };
  5571. /** Number of tx frames/beacon that cause the power save SM to wake up.
  5572. *
  5573. * Value 1 causes the SM to wake up for every TX. Value 0 has a special
  5574. * meaning, It will cause the SM to never wake up. This is useful if you want
  5575. * to keep the system to sleep all the time for some kind of test mode . host
  5576. * can change this parameter any time. It will affect at the next tx frame.
  5577. */
  5578. enum wmi_host_sta_ps_param_tx_wake_threshold {
  5579. WMI_HOST_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0,
  5580. WMI_HOST_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1,
  5581. /* Values greater than one indicate that many TX attempts per beacon
  5582. * interval before the STA will wake up
  5583. */
  5584. };
  5585. /*
  5586. * Transmit power scale factor.
  5587. *
  5588. */
  5589. typedef enum {
  5590. WMI_HOST_TP_SCALE_MAX = 0, /* no scaling (default) */
  5591. WMI_HOST_TP_SCALE_50 = 1, /* 50% of max (-3 dBm) */
  5592. WMI_HOST_TP_SCALE_25 = 2, /* 25% of max (-6 dBm) */
  5593. WMI_HOST_TP_SCALE_12 = 3, /* 12% of max (-9 dBm) */
  5594. WMI_HOST_TP_SCALE_MIN = 4, /* min, but still on */
  5595. WMI_HOST_TP_SCALE_SIZE = 5, /* max num of enum */
  5596. } WMI_HOST_TP_SCALE;
  5597. enum {
  5598. WMI_HOST_RATEPWR_TABLE_OPS_SET,
  5599. WMI_HOST_RATEPWR_TABLE_OPS_GET,
  5600. };
  5601. /* reserved up through 0xF */
  5602. /**
  5603. * struct wmi_host_dcs_mib_stats - WLAN IM stats from target to host
  5604. * Below statistics are sent from target to host periodically.
  5605. * These are collected at target as long as target is running
  5606. * and target chip is not in sleep.
  5607. * @listen_time:
  5608. * @reg_tx_frame_cnt:
  5609. * @reg_rx_frame_cnt:
  5610. * @reg_rxclr_cnt:
  5611. * @reg_cycle_cnt: delta cycle count
  5612. * @reg_rxclr_ext_cnt:
  5613. * @reg_ofdm_phyerr_cnt:
  5614. * @reg_cck_phyerr_cnt: CCK err count since last reset, read from register
  5615. */
  5616. typedef struct _hp_dcs_mib_stats {
  5617. int32_t listen_time;
  5618. uint32_t reg_tx_frame_cnt;
  5619. uint32_t reg_rx_frame_cnt;
  5620. uint32_t reg_rxclr_cnt;
  5621. uint32_t reg_cycle_cnt;
  5622. uint32_t reg_rxclr_ext_cnt;
  5623. uint32_t reg_ofdm_phyerr_cnt;
  5624. uint32_t reg_cck_phyerr_cnt;
  5625. } wmi_host_dcs_mib_stats_t;
  5626. /**
  5627. * struct wmi_host_dcs_im_tgt_stats - DCS IM target stats
  5628. * @reg_tsf32: current running TSF from the TSF-1
  5629. * @last_ack_rssi: Known last frame rssi, in case of multiple stations, if
  5630. * and at different ranges, this would not gaurantee that
  5631. * this is the least rssi.
  5632. * @tx_waste_time: Sum of all the failed durations in the last
  5633. * one second interval.
  5634. * @rx_time: count how many times the hal_rxerr_phy is marked, in this
  5635. * time period
  5636. * @phyerr_cnt:
  5637. * @mib_stats: wmi_host_dcs_mib_stats_t - collected mib stats as explained
  5638. * in mib structure
  5639. */
  5640. typedef struct _wmi_host_dcs_im_tgt_stats {
  5641. uint32_t reg_tsf32;
  5642. uint32_t last_ack_rssi;
  5643. uint32_t tx_waste_time;
  5644. uint32_t rx_time;
  5645. uint32_t phyerr_cnt;
  5646. wmi_host_dcs_mib_stats_t mib_stats;
  5647. } wmi_host_dcs_im_tgt_stats_t;
  5648. /**
  5649. * Enum for pktlog req
  5650. */
  5651. typedef enum {
  5652. WMI_HOST_PKTLOG_EVENT_RX = 0x1,
  5653. WMI_HOST_PKTLOG_EVENT_TX = 0x2,
  5654. WMI_HOST_PKTLOG_EVENT_RCF = 0x4, /* Rate Control Find */
  5655. WMI_HOST_PKTLOG_EVENT_RCU = 0x8, /* Rate Control Update */
  5656. WMI_HOST_PKTLOG_EVENT_DBG_PRINT = 0x10, /* DEBUG prints */
  5657. /* To support Smart Antenna */
  5658. WMI_HOST_PKTLOG_EVENT_SMART_ANTENNA = 0x20,
  5659. WMI_HOST_PKTLOG_EVENT_H_INFO = 0x40,
  5660. WMI_HOST_PKTLOG_EVENT_STEERING = 0x80,
  5661. } WMI_HOST_PKTLOG_EVENT;
  5662. /**
  5663. * wmi_host_phyerr
  5664. *
  5665. */
  5666. #define WMI_HOST_PHY_ERROR_SPECTRAL_SCAN 0x26
  5667. #define WMI_HOST_PHY_ERROR_FALSE_RADAR_EXT 0x24
  5668. #define WMI_HOST_AR900B_DFS_PHYERR_MASK 0x4
  5669. #define WMI_HOST_AR900B_SPECTRAL_PHYERR_MASK 0x4000000
  5670. /**
  5671. * struct wmi_host_perchain_rssi_info - per chain RSSI info
  5672. * @rssi_pri20: RSSI on primary 20
  5673. * @rssi_sec20: RSSI on secomdary 20
  5674. * @rssi_sec40: RSSI secondary 40
  5675. * @rssi_sec80: RSSI secondary 80
  5676. */
  5677. typedef struct wmi_host_perchain_rssi_info {
  5678. int8_t rssi_pri20;
  5679. int8_t rssi_sec20;
  5680. int8_t rssi_sec40;
  5681. int8_t rssi_sec80;
  5682. } wmi_host_perchain_rssi_info_t;
  5683. /**
  5684. * struct _wmi_host_rf_info - RF measurement information
  5685. * @rssi_comb: RSSI Information
  5686. * @pc_rssi_info[4]: For now, we know we are getting information
  5687. * for only 4 chains at max. For future extensions
  5688. * use a define
  5689. * @noise_floor: Noise floor information
  5690. */
  5691. typedef struct _wmi_host_rf_info {
  5692. int8_t rssi_comb;
  5693. wmi_host_perchain_rssi_info_t pc_rssi_info[4];
  5694. int16_t noise_floor[4];
  5695. } wmi_host_rf_info_t;
  5696. /**
  5697. * struct _wmi_host_chan_info
  5698. * @center_freq1: center frequency 1 in MHz
  5699. * @center_freq2: center frequency 2 in MHz -valid only for
  5700. * 11ACVHT 80PLUS80 mode
  5701. * @chan_width: channel width in MHz
  5702. */
  5703. typedef struct _wmi_host_chan_info {
  5704. u_int16_t center_freq1;
  5705. u_int16_t center_freq2;
  5706. u_int8_t chan_width;
  5707. } wmi_host_chan_info_t;
  5708. /**
  5709. * struct wmi_host_phyerr
  5710. * @rf_info:
  5711. * @chan_info:
  5712. * @tsf64:
  5713. * @phy_err_code:
  5714. * @tsf_timestamp:
  5715. * @bufp:
  5716. * @buf_len:
  5717. * @phy_err_mask0:
  5718. * @phy_err_mask1:
  5719. */
  5720. typedef struct _wmi_host_phyerr {
  5721. wmi_host_rf_info_t rf_info;
  5722. wmi_host_chan_info_t chan_info;
  5723. uint64_t tsf64;
  5724. int32_t phy_err_code;
  5725. uint32_t tsf_timestamp;
  5726. uint8_t *bufp;
  5727. uint32_t buf_len;
  5728. uint32_t phy_err_mask0;
  5729. uint32_t phy_err_mask1;
  5730. } wmi_host_phyerr_t;
  5731. /**
  5732. * struct wmi_host_rtt_event_hdr
  5733. * @req_id: request id
  5734. * @status: status
  5735. * @meas_done: measurement done flag
  5736. * @meas_type: measurement type
  5737. * @report_type: report type
  5738. * @v3_status: v2 status
  5739. * @v3_finish:
  5740. * @v3_tm_start:
  5741. * @num_ap: number of AP
  5742. * @result: resuult
  5743. * @dest_mac: destination mac
  5744. */
  5745. typedef struct {
  5746. uint16_t req_id;
  5747. uint16_t status:1,
  5748. meas_done:1,
  5749. meas_type:3,
  5750. report_type:3,
  5751. v3_status:2,
  5752. v3_finish:1,
  5753. v3_tm_start:1,
  5754. num_ap:4;
  5755. uint16_t result;
  5756. uint8_t dest_mac[IEEE80211_ADDR_LEN];
  5757. } wmi_host_rtt_event_hdr;
  5758. /**
  5759. * struct wmi_host_rtt_meas_event - RTT measurement event
  5760. * @chain_mask:
  5761. * @bw:
  5762. * @rsvd:
  5763. * @txrxchain_mask: Bit:0-3:chain mask
  5764. * Bit 4-5: band width info
  5765. * 00 --Legacy 20, 01 --HT/VHT20
  5766. * 10 --HT/VHT40, 11 -- VHT80
  5767. * @tod: resolution of 0.1ns
  5768. * @toa: resolution of 0.1ns
  5769. * @t3:
  5770. * @t4:
  5771. * @rssi0:
  5772. * @rssi1:
  5773. * @rssi2:
  5774. * @rssi3:
  5775. */
  5776. typedef struct {
  5777. uint32_t chain_mask:3,
  5778. bw:2,
  5779. rsvd:27;
  5780. uint32_t txrxchain_mask;
  5781. uint64_t tod;
  5782. uint64_t toa;
  5783. uint64_t t3;
  5784. uint64_t t4;
  5785. uint32_t rssi0;
  5786. uint32_t rssi1;
  5787. uint32_t rssi2;
  5788. uint32_t rssi3;
  5789. } wmi_host_rtt_meas_event;
  5790. /*----RTT Report event definition ----*/
  5791. typedef enum {
  5792. /* rtt cmd header parsing error --terminate */
  5793. WMI_HOST_RTT_COMMAND_HEADER_ERROR = 0,
  5794. /* rtt body parsing error -- skip current STA REQ */
  5795. WMI_HOST_RTT_COMMAND_ERROR,
  5796. /* rtt no resource -- terminate */
  5797. WMI_HOST_RTT_MODULE_BUSY,
  5798. /* STA exceed the support limit -- only server the first n STA */
  5799. WMI_HOST_RTT_TOO_MANY_STA,
  5800. /* any allocate failure */
  5801. WMI_HOST_RTT_NO_RESOURCE,
  5802. /* can not find vdev with vdev ID - skip current STA REQ */
  5803. WMI_HOST_RTT_VDEV_ERROR,
  5804. /* Tx failure -- continiue and measure number */
  5805. WMI_HOST_RTT_TRANSIMISSION_ERROR,
  5806. /* wait for first TM timer expire-terminate current STA measurement */
  5807. WMI_HOST_RTT_TM_TIMER_EXPIRE,
  5808. /* we do not support RTT measurement with this type of frame */
  5809. WMI_HOST_RTT_FRAME_TYPE_NOSUPPORT,
  5810. /* whole RTT measurement timer expire-terminate
  5811. ** current STA measurement */
  5812. WMI_HOST_RTT_TIMER_EXPIRE,
  5813. /* channel swicth failed */
  5814. WMI_HOST_RTT_CHAN_SWITCH_ERROR,
  5815. /* TMR trans error, this dest peer will be skipped */
  5816. WMI_HOST_RTT_TMR_TRANS_ERROR,
  5817. /* V3 only. If both CFR and Token mismatch, do not report */
  5818. WMI_HOST_RTT_NO_REPORT_BAD_CFR_TOKEN,
  5819. /* For First TM, if CFR is bad, then do not report */
  5820. WMI_HOST_RTT_NO_REPORT_FIRST_TM_BAD_CFR,
  5821. /* do not allow report type2 mix with type 0, 1 */
  5822. WMI_HOST_RTT_REPORT_TYPE2_MIX,
  5823. /* LCI Configuration OK. - Responder only */
  5824. WMI_HOST_RTT_LCI_CFG_OK,
  5825. /* LCR configuration OK. - Responder only */
  5826. WMI_HOST_RTT_LCR_CFG_OK,
  5827. /* Bad configuration LCI (or) LCR request - Responder only */
  5828. WMI_HOST_RTT_CFG_ERROR,
  5829. WMI_HOST_WMI_RTT_REJECT_MAX,
  5830. } WMI_HOST_RTT_ERROR_INDICATOR;
  5831. typedef struct {
  5832. wmi_host_rtt_event_hdr hdr;
  5833. WMI_HOST_RTT_ERROR_INDICATOR reject_reason;
  5834. } wmi_host_rtt_error_report_event;
  5835. #if defined(AR9888)
  5836. typedef enum {
  5837. WMI_HOST_PROF_CPU_IDLE,
  5838. WMI_HOST_PROF_PPDU_PROC,
  5839. WMI_HOST_PROF_PPDU_POST,
  5840. WMI_HOST_PROF_HTT_TX_INPUT,
  5841. WMI_HOST_PROF_MSDU_ENQ,
  5842. WMI_HOST_PROF_PPDU_POST_HAL,
  5843. WMI_HOST_PROF_COMPUTE_TX_TIME,
  5844. /* Add new ID's above this. */
  5845. WMI_HOST_PROF_MAX_ID,
  5846. } wmi_host_profile_id_t;
  5847. #endif
  5848. #define WMI_HOST_WLAN_PROFILE_MAX_HIST 3
  5849. #define WMI_HOST_WLAN_PROFILE_MAX_BIN_CNT 32
  5850. #if defined(AR9888)
  5851. #define WMI_HOST_MAX_PROFILE WMI_HOST_PROF_MAX_ID
  5852. #else
  5853. #define WMI_HOST_MAX_PROFILE WMI_HOST_WLAN_PROFILE_MAX_BIN_CNT
  5854. #endif
  5855. /**
  5856. * struct wmi_host_wlan_profile - Host profile param
  5857. * @id: profile id
  5858. * @cnt: Count
  5859. * @tot:
  5860. * @min: minimum
  5861. * @max: Mac
  5862. * @hist_intvl: history interval
  5863. * @hist: profile data history
  5864. */
  5865. typedef struct {
  5866. uint32_t id;
  5867. uint32_t cnt;
  5868. uint32_t tot;
  5869. uint32_t min;
  5870. uint32_t max;
  5871. uint32_t hist_intvl;
  5872. uint32_t hist[WMI_HOST_WLAN_PROFILE_MAX_HIST];
  5873. } wmi_host_wlan_profile_t;
  5874. /**
  5875. * struct wmi_host_wlan_profile_ctx_t - profile context
  5876. * @tot: time in us
  5877. * @tx_msdu_cnt: MSDU TX count
  5878. * @tx_mpdu_cnt: MPDU tx count
  5879. * @tx_ppdu_cnt: PPDU tx count
  5880. * @rx_msdu_cnt: MSDU RX count
  5881. * @rx_mpdu_cnt: MPDU RXcount
  5882. * @bin_count: Bin count
  5883. */
  5884. typedef struct {
  5885. uint32_t tot;
  5886. uint32_t tx_msdu_cnt;
  5887. uint32_t tx_mpdu_cnt;
  5888. uint32_t tx_ppdu_cnt;
  5889. uint32_t rx_msdu_cnt;
  5890. uint32_t rx_mpdu_cnt;
  5891. uint32_t bin_count;
  5892. } wmi_host_wlan_profile_ctx_t;
  5893. /**
  5894. * struct wmi_host_chan_info_event - Channel info WMI event
  5895. * @err_code: Error code
  5896. * @freq: Channel freq
  5897. * @cmd_flags: Read flags
  5898. * @noise_floor: Noise Floor value
  5899. * @rx_clear_count: rx clear count
  5900. * @cycle_count: cycle count
  5901. * @chan_tx_pwr_range: channel tx power per range
  5902. * @chan_tx_pwr_tp: channel tx power per throughput
  5903. * @rx_frame_count: rx frame count
  5904. * @rx_11b_mode_data_duration: 11b mode data duration
  5905. */
  5906. typedef struct {
  5907. uint32_t err_code;
  5908. uint32_t freq;
  5909. uint32_t cmd_flags;
  5910. uint32_t noise_floor;
  5911. uint32_t rx_clear_count;
  5912. uint32_t cycle_count;
  5913. uint32_t chan_tx_pwr_range;
  5914. uint32_t chan_tx_pwr_tp;
  5915. uint32_t rx_frame_count;
  5916. uint32_t rx_11b_mode_data_duration;
  5917. } wmi_host_chan_info_event;
  5918. /**
  5919. * struct wmi_host_pdev_channel_hopping_event
  5920. * @noise_floor_report_iter: Noise threshold iterations with high values
  5921. * @noise_floor_total_iter: Total noise threshold iterations
  5922. */
  5923. typedef struct {
  5924. uint32_t noise_floor_report_iter;
  5925. uint32_t noise_floor_total_iter;
  5926. } wmi_host_pdev_channel_hopping_event;
  5927. /**
  5928. * struct wmi_host_pdev_bss_chan_info_event
  5929. * @freq: Units in MHz
  5930. * @noise_floor: units are dBm
  5931. * @rx_clear_count_low:
  5932. * @rx_clear_count_high:
  5933. * @cycle_count_low:
  5934. * @cycle_count_high:
  5935. * @tx_cycle_count_low:
  5936. * @tx_cycle_count_high:
  5937. * @rx_cycle_count_low:
  5938. * @rx_cycle_count_high:
  5939. * @rx_bss_cycle_count_low:
  5940. * @rx_bss_cycle_count_high:
  5941. * @reserved:
  5942. */
  5943. typedef struct {
  5944. uint32_t freq;
  5945. uint32_t noise_floor;
  5946. uint32_t rx_clear_count_low;
  5947. uint32_t rx_clear_count_high;
  5948. uint32_t cycle_count_low;
  5949. uint32_t cycle_count_high;
  5950. uint32_t tx_cycle_count_low;
  5951. uint32_t tx_cycle_count_high;
  5952. uint32_t rx_cycle_count_low;
  5953. uint32_t rx_cycle_count_high;
  5954. uint32_t rx_bss_cycle_count_low;
  5955. uint32_t rx_bss_cycle_count_high;
  5956. uint32_t reserved;
  5957. } wmi_host_pdev_bss_chan_info_event;
  5958. #define WMI_HOST_INST_STATS_INVALID_RSSI 0
  5959. /**
  5960. * struct wmi_host_inst_stats_resp
  5961. * @iRSSI: Instantaneous RSSI
  5962. * @peer_macaddr: peer mac address
  5963. */
  5964. typedef struct {
  5965. uint32_t iRSSI;
  5966. wmi_host_mac_addr peer_macaddr;
  5967. } wmi_host_inst_stats_resp;
  5968. /* Event definition and new structure addition to send event
  5969. * to host to block/unblock tx data traffic based on peer_ast_idx or vdev id
  5970. */
  5971. #define WMI_HOST_INVALID_PEER_AST_INDEX 0xffff
  5972. #define WMI_HOST_TX_DATA_TRAFFIC_CTRL_BLOCK 0x1
  5973. #define WMI_HOST_TX_DATA_TRAFFIC_CTRL_UNBLOCK 0x2
  5974. /**
  5975. * struct wmi_host_tx_data_traffic_ctrl_event
  5976. * @peer_ast_idx: For vdev based control, peer_ast_idx will be
  5977. * WMI_INVALID_PEER_AST_INDEX
  5978. * @vdev_id: only applies if peer_ast_idx == INVALID
  5979. * @ctrl_cmd: WMI_TX_DATA_TRAFFIC_CTRL_BLOCK or
  5980. * WMI_TX_DATA_TRAFFIC_CTRL_UNBLOCK
  5981. */
  5982. typedef struct {
  5983. uint32_t peer_ast_idx;
  5984. uint32_t vdev_id;
  5985. uint32_t ctrl_cmd;
  5986. } wmi_host_tx_data_traffic_ctrl_event;
  5987. /**
  5988. * struct wmi_host_ath_dcs_cw_int
  5989. * @channel: either number or freq in mhz
  5990. */
  5991. typedef struct {
  5992. uint32_t channel;
  5993. } wmi_host_ath_dcs_cw_int;
  5994. #define WMI_MAX_POWER_DBG_ARGS 8
  5995. /**
  5996. * struct wmi_power_dbg_params - power debug command parameter
  5997. * @pdev_id: subsystem identifier
  5998. * @module_id: parameter id
  5999. * @num_arg: no of arguments
  6000. * @args: arguments
  6001. */
  6002. struct wmi_power_dbg_params {
  6003. uint32_t pdev_id;
  6004. uint32_t module_id;
  6005. uint32_t num_args;
  6006. uint32_t args[WMI_MAX_POWER_DBG_ARGS];
  6007. };
  6008. /**
  6009. * struct wmi_adaptive_dwelltime_params - the adaptive dwelltime params
  6010. * @vdev_id: vdev id
  6011. * @is_enabled: Adaptive dwell time is enabled/disabled
  6012. * @dwelltime_mode: global default adaptive dwell mode
  6013. * @lpf_weight: weight to calculate the average low pass
  6014. * filter for channel congestion
  6015. * @passive_mon_intval: intval to monitor wifi activity in passive scan in msec
  6016. * @wifi_act_threshold: % of wifi activity used in passive scan 0-100
  6017. *
  6018. */
  6019. struct wmi_adaptive_dwelltime_params {
  6020. uint32_t vdev_id;
  6021. bool is_enabled;
  6022. enum wmi_dwelltime_adaptive_mode dwelltime_mode;
  6023. uint8_t lpf_weight;
  6024. uint8_t passive_mon_intval;
  6025. uint8_t wifi_act_threshold;
  6026. };
  6027. #endif /* _WMI_UNIFIED_PARAM_H_ */