wmi.h 203 KB

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