wmi.h 187 KB

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