wmi.h 188 KB

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