wmi.h 135 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798
  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. enum wmi_service {
  70. WMI_SERVICE_BEACON_OFFLOAD = 0,
  71. WMI_SERVICE_SCAN_OFFLOAD,
  72. WMI_SERVICE_ROAM_OFFLOAD,
  73. WMI_SERVICE_BCN_MISS_OFFLOAD,
  74. WMI_SERVICE_STA_PWRSAVE,
  75. WMI_SERVICE_STA_ADVANCED_PWRSAVE,
  76. WMI_SERVICE_AP_UAPSD,
  77. WMI_SERVICE_AP_DFS,
  78. WMI_SERVICE_11AC,
  79. WMI_SERVICE_BLOCKACK,
  80. WMI_SERVICE_PHYERR,
  81. WMI_SERVICE_BCN_FILTER,
  82. WMI_SERVICE_RTT,
  83. WMI_SERVICE_RATECTRL,
  84. WMI_SERVICE_WOW,
  85. WMI_SERVICE_RATECTRL_CACHE,
  86. WMI_SERVICE_IRAM_TIDS,
  87. WMI_SERVICE_ARPNS_OFFLOAD,
  88. WMI_SERVICE_NLO,
  89. WMI_SERVICE_GTK_OFFLOAD,
  90. WMI_SERVICE_SCAN_SCH,
  91. WMI_SERVICE_CSA_OFFLOAD,
  92. WMI_SERVICE_CHATTER,
  93. WMI_SERVICE_COEX_FREQAVOID,
  94. WMI_SERVICE_PACKET_POWER_SAVE,
  95. WMI_SERVICE_FORCE_FW_HANG,
  96. WMI_SERVICE_GPIO,
  97. WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
  98. WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
  99. WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
  100. WMI_SERVICE_STA_KEEP_ALIVE,
  101. WMI_SERVICE_TX_ENCAP,
  102. WMI_SERVICE_BURST,
  103. WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT,
  104. WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT,
  105. /* keep last */
  106. WMI_SERVICE_MAX,
  107. };
  108. enum wmi_10x_service {
  109. WMI_10X_SERVICE_BEACON_OFFLOAD = 0,
  110. WMI_10X_SERVICE_SCAN_OFFLOAD,
  111. WMI_10X_SERVICE_ROAM_OFFLOAD,
  112. WMI_10X_SERVICE_BCN_MISS_OFFLOAD,
  113. WMI_10X_SERVICE_STA_PWRSAVE,
  114. WMI_10X_SERVICE_STA_ADVANCED_PWRSAVE,
  115. WMI_10X_SERVICE_AP_UAPSD,
  116. WMI_10X_SERVICE_AP_DFS,
  117. WMI_10X_SERVICE_11AC,
  118. WMI_10X_SERVICE_BLOCKACK,
  119. WMI_10X_SERVICE_PHYERR,
  120. WMI_10X_SERVICE_BCN_FILTER,
  121. WMI_10X_SERVICE_RTT,
  122. WMI_10X_SERVICE_RATECTRL,
  123. WMI_10X_SERVICE_WOW,
  124. WMI_10X_SERVICE_RATECTRL_CACHE,
  125. WMI_10X_SERVICE_IRAM_TIDS,
  126. WMI_10X_SERVICE_BURST,
  127. /* introduced in 10.2 */
  128. WMI_10X_SERVICE_SMART_ANTENNA_SW_SUPPORT,
  129. WMI_10X_SERVICE_FORCE_FW_HANG,
  130. WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT,
  131. };
  132. enum wmi_main_service {
  133. WMI_MAIN_SERVICE_BEACON_OFFLOAD = 0,
  134. WMI_MAIN_SERVICE_SCAN_OFFLOAD,
  135. WMI_MAIN_SERVICE_ROAM_OFFLOAD,
  136. WMI_MAIN_SERVICE_BCN_MISS_OFFLOAD,
  137. WMI_MAIN_SERVICE_STA_PWRSAVE,
  138. WMI_MAIN_SERVICE_STA_ADVANCED_PWRSAVE,
  139. WMI_MAIN_SERVICE_AP_UAPSD,
  140. WMI_MAIN_SERVICE_AP_DFS,
  141. WMI_MAIN_SERVICE_11AC,
  142. WMI_MAIN_SERVICE_BLOCKACK,
  143. WMI_MAIN_SERVICE_PHYERR,
  144. WMI_MAIN_SERVICE_BCN_FILTER,
  145. WMI_MAIN_SERVICE_RTT,
  146. WMI_MAIN_SERVICE_RATECTRL,
  147. WMI_MAIN_SERVICE_WOW,
  148. WMI_MAIN_SERVICE_RATECTRL_CACHE,
  149. WMI_MAIN_SERVICE_IRAM_TIDS,
  150. WMI_MAIN_SERVICE_ARPNS_OFFLOAD,
  151. WMI_MAIN_SERVICE_NLO,
  152. WMI_MAIN_SERVICE_GTK_OFFLOAD,
  153. WMI_MAIN_SERVICE_SCAN_SCH,
  154. WMI_MAIN_SERVICE_CSA_OFFLOAD,
  155. WMI_MAIN_SERVICE_CHATTER,
  156. WMI_MAIN_SERVICE_COEX_FREQAVOID,
  157. WMI_MAIN_SERVICE_PACKET_POWER_SAVE,
  158. WMI_MAIN_SERVICE_FORCE_FW_HANG,
  159. WMI_MAIN_SERVICE_GPIO,
  160. WMI_MAIN_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
  161. WMI_MAIN_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
  162. WMI_MAIN_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
  163. WMI_MAIN_SERVICE_STA_KEEP_ALIVE,
  164. WMI_MAIN_SERVICE_TX_ENCAP,
  165. };
  166. static inline char *wmi_service_name(int service_id)
  167. {
  168. #define SVCSTR(x) case x: return #x
  169. switch (service_id) {
  170. SVCSTR(WMI_SERVICE_BEACON_OFFLOAD);
  171. SVCSTR(WMI_SERVICE_SCAN_OFFLOAD);
  172. SVCSTR(WMI_SERVICE_ROAM_OFFLOAD);
  173. SVCSTR(WMI_SERVICE_BCN_MISS_OFFLOAD);
  174. SVCSTR(WMI_SERVICE_STA_PWRSAVE);
  175. SVCSTR(WMI_SERVICE_STA_ADVANCED_PWRSAVE);
  176. SVCSTR(WMI_SERVICE_AP_UAPSD);
  177. SVCSTR(WMI_SERVICE_AP_DFS);
  178. SVCSTR(WMI_SERVICE_11AC);
  179. SVCSTR(WMI_SERVICE_BLOCKACK);
  180. SVCSTR(WMI_SERVICE_PHYERR);
  181. SVCSTR(WMI_SERVICE_BCN_FILTER);
  182. SVCSTR(WMI_SERVICE_RTT);
  183. SVCSTR(WMI_SERVICE_RATECTRL);
  184. SVCSTR(WMI_SERVICE_WOW);
  185. SVCSTR(WMI_SERVICE_RATECTRL_CACHE);
  186. SVCSTR(WMI_SERVICE_IRAM_TIDS);
  187. SVCSTR(WMI_SERVICE_ARPNS_OFFLOAD);
  188. SVCSTR(WMI_SERVICE_NLO);
  189. SVCSTR(WMI_SERVICE_GTK_OFFLOAD);
  190. SVCSTR(WMI_SERVICE_SCAN_SCH);
  191. SVCSTR(WMI_SERVICE_CSA_OFFLOAD);
  192. SVCSTR(WMI_SERVICE_CHATTER);
  193. SVCSTR(WMI_SERVICE_COEX_FREQAVOID);
  194. SVCSTR(WMI_SERVICE_PACKET_POWER_SAVE);
  195. SVCSTR(WMI_SERVICE_FORCE_FW_HANG);
  196. SVCSTR(WMI_SERVICE_GPIO);
  197. SVCSTR(WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM);
  198. SVCSTR(WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG);
  199. SVCSTR(WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG);
  200. SVCSTR(WMI_SERVICE_STA_KEEP_ALIVE);
  201. SVCSTR(WMI_SERVICE_TX_ENCAP);
  202. SVCSTR(WMI_SERVICE_BURST);
  203. SVCSTR(WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT);
  204. SVCSTR(WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT);
  205. default:
  206. return NULL;
  207. }
  208. #undef SVCSTR
  209. }
  210. #define WMI_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id) \
  211. (__le32_to_cpu((wmi_svc_bmap)[(svc_id)/(sizeof(u32))]) & \
  212. BIT((svc_id)%(sizeof(u32))))
  213. #define SVCMAP(x, y) \
  214. do { \
  215. if (WMI_SERVICE_IS_ENABLED((in), (x))) \
  216. __set_bit(y, out); \
  217. } while (0)
  218. static inline void wmi_10x_svc_map(const __le32 *in, unsigned long *out)
  219. {
  220. SVCMAP(WMI_10X_SERVICE_BEACON_OFFLOAD,
  221. WMI_SERVICE_BEACON_OFFLOAD);
  222. SVCMAP(WMI_10X_SERVICE_SCAN_OFFLOAD,
  223. WMI_SERVICE_SCAN_OFFLOAD);
  224. SVCMAP(WMI_10X_SERVICE_ROAM_OFFLOAD,
  225. WMI_SERVICE_ROAM_OFFLOAD);
  226. SVCMAP(WMI_10X_SERVICE_BCN_MISS_OFFLOAD,
  227. WMI_SERVICE_BCN_MISS_OFFLOAD);
  228. SVCMAP(WMI_10X_SERVICE_STA_PWRSAVE,
  229. WMI_SERVICE_STA_PWRSAVE);
  230. SVCMAP(WMI_10X_SERVICE_STA_ADVANCED_PWRSAVE,
  231. WMI_SERVICE_STA_ADVANCED_PWRSAVE);
  232. SVCMAP(WMI_10X_SERVICE_AP_UAPSD,
  233. WMI_SERVICE_AP_UAPSD);
  234. SVCMAP(WMI_10X_SERVICE_AP_DFS,
  235. WMI_SERVICE_AP_DFS);
  236. SVCMAP(WMI_10X_SERVICE_11AC,
  237. WMI_SERVICE_11AC);
  238. SVCMAP(WMI_10X_SERVICE_BLOCKACK,
  239. WMI_SERVICE_BLOCKACK);
  240. SVCMAP(WMI_10X_SERVICE_PHYERR,
  241. WMI_SERVICE_PHYERR);
  242. SVCMAP(WMI_10X_SERVICE_BCN_FILTER,
  243. WMI_SERVICE_BCN_FILTER);
  244. SVCMAP(WMI_10X_SERVICE_RTT,
  245. WMI_SERVICE_RTT);
  246. SVCMAP(WMI_10X_SERVICE_RATECTRL,
  247. WMI_SERVICE_RATECTRL);
  248. SVCMAP(WMI_10X_SERVICE_WOW,
  249. WMI_SERVICE_WOW);
  250. SVCMAP(WMI_10X_SERVICE_RATECTRL_CACHE,
  251. WMI_SERVICE_RATECTRL_CACHE);
  252. SVCMAP(WMI_10X_SERVICE_IRAM_TIDS,
  253. WMI_SERVICE_IRAM_TIDS);
  254. SVCMAP(WMI_10X_SERVICE_BURST,
  255. WMI_SERVICE_BURST);
  256. SVCMAP(WMI_10X_SERVICE_SMART_ANTENNA_SW_SUPPORT,
  257. WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT);
  258. SVCMAP(WMI_10X_SERVICE_FORCE_FW_HANG,
  259. WMI_SERVICE_FORCE_FW_HANG);
  260. SVCMAP(WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT,
  261. WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT);
  262. }
  263. static inline void wmi_main_svc_map(const __le32 *in, unsigned long *out)
  264. {
  265. SVCMAP(WMI_MAIN_SERVICE_BEACON_OFFLOAD,
  266. WMI_SERVICE_BEACON_OFFLOAD);
  267. SVCMAP(WMI_MAIN_SERVICE_SCAN_OFFLOAD,
  268. WMI_SERVICE_SCAN_OFFLOAD);
  269. SVCMAP(WMI_MAIN_SERVICE_ROAM_OFFLOAD,
  270. WMI_SERVICE_ROAM_OFFLOAD);
  271. SVCMAP(WMI_MAIN_SERVICE_BCN_MISS_OFFLOAD,
  272. WMI_SERVICE_BCN_MISS_OFFLOAD);
  273. SVCMAP(WMI_MAIN_SERVICE_STA_PWRSAVE,
  274. WMI_SERVICE_STA_PWRSAVE);
  275. SVCMAP(WMI_MAIN_SERVICE_STA_ADVANCED_PWRSAVE,
  276. WMI_SERVICE_STA_ADVANCED_PWRSAVE);
  277. SVCMAP(WMI_MAIN_SERVICE_AP_UAPSD,
  278. WMI_SERVICE_AP_UAPSD);
  279. SVCMAP(WMI_MAIN_SERVICE_AP_DFS,
  280. WMI_SERVICE_AP_DFS);
  281. SVCMAP(WMI_MAIN_SERVICE_11AC,
  282. WMI_SERVICE_11AC);
  283. SVCMAP(WMI_MAIN_SERVICE_BLOCKACK,
  284. WMI_SERVICE_BLOCKACK);
  285. SVCMAP(WMI_MAIN_SERVICE_PHYERR,
  286. WMI_SERVICE_PHYERR);
  287. SVCMAP(WMI_MAIN_SERVICE_BCN_FILTER,
  288. WMI_SERVICE_BCN_FILTER);
  289. SVCMAP(WMI_MAIN_SERVICE_RTT,
  290. WMI_SERVICE_RTT);
  291. SVCMAP(WMI_MAIN_SERVICE_RATECTRL,
  292. WMI_SERVICE_RATECTRL);
  293. SVCMAP(WMI_MAIN_SERVICE_WOW,
  294. WMI_SERVICE_WOW);
  295. SVCMAP(WMI_MAIN_SERVICE_RATECTRL_CACHE,
  296. WMI_SERVICE_RATECTRL_CACHE);
  297. SVCMAP(WMI_MAIN_SERVICE_IRAM_TIDS,
  298. WMI_SERVICE_IRAM_TIDS);
  299. SVCMAP(WMI_MAIN_SERVICE_ARPNS_OFFLOAD,
  300. WMI_SERVICE_ARPNS_OFFLOAD);
  301. SVCMAP(WMI_MAIN_SERVICE_NLO,
  302. WMI_SERVICE_NLO);
  303. SVCMAP(WMI_MAIN_SERVICE_GTK_OFFLOAD,
  304. WMI_SERVICE_GTK_OFFLOAD);
  305. SVCMAP(WMI_MAIN_SERVICE_SCAN_SCH,
  306. WMI_SERVICE_SCAN_SCH);
  307. SVCMAP(WMI_MAIN_SERVICE_CSA_OFFLOAD,
  308. WMI_SERVICE_CSA_OFFLOAD);
  309. SVCMAP(WMI_MAIN_SERVICE_CHATTER,
  310. WMI_SERVICE_CHATTER);
  311. SVCMAP(WMI_MAIN_SERVICE_COEX_FREQAVOID,
  312. WMI_SERVICE_COEX_FREQAVOID);
  313. SVCMAP(WMI_MAIN_SERVICE_PACKET_POWER_SAVE,
  314. WMI_SERVICE_PACKET_POWER_SAVE);
  315. SVCMAP(WMI_MAIN_SERVICE_FORCE_FW_HANG,
  316. WMI_SERVICE_FORCE_FW_HANG);
  317. SVCMAP(WMI_MAIN_SERVICE_GPIO,
  318. WMI_SERVICE_GPIO);
  319. SVCMAP(WMI_MAIN_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
  320. WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM);
  321. SVCMAP(WMI_MAIN_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
  322. WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG);
  323. SVCMAP(WMI_MAIN_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
  324. WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG);
  325. SVCMAP(WMI_MAIN_SERVICE_STA_KEEP_ALIVE,
  326. WMI_SERVICE_STA_KEEP_ALIVE);
  327. SVCMAP(WMI_MAIN_SERVICE_TX_ENCAP,
  328. WMI_SERVICE_TX_ENCAP);
  329. }
  330. #undef SVCMAP
  331. /* 2 word representation of MAC addr */
  332. struct wmi_mac_addr {
  333. union {
  334. u8 addr[6];
  335. struct {
  336. u32 word0;
  337. u32 word1;
  338. } __packed;
  339. } __packed;
  340. } __packed;
  341. struct wmi_cmd_map {
  342. u32 init_cmdid;
  343. u32 start_scan_cmdid;
  344. u32 stop_scan_cmdid;
  345. u32 scan_chan_list_cmdid;
  346. u32 scan_sch_prio_tbl_cmdid;
  347. u32 pdev_set_regdomain_cmdid;
  348. u32 pdev_set_channel_cmdid;
  349. u32 pdev_set_param_cmdid;
  350. u32 pdev_pktlog_enable_cmdid;
  351. u32 pdev_pktlog_disable_cmdid;
  352. u32 pdev_set_wmm_params_cmdid;
  353. u32 pdev_set_ht_cap_ie_cmdid;
  354. u32 pdev_set_vht_cap_ie_cmdid;
  355. u32 pdev_set_dscp_tid_map_cmdid;
  356. u32 pdev_set_quiet_mode_cmdid;
  357. u32 pdev_green_ap_ps_enable_cmdid;
  358. u32 pdev_get_tpc_config_cmdid;
  359. u32 pdev_set_base_macaddr_cmdid;
  360. u32 vdev_create_cmdid;
  361. u32 vdev_delete_cmdid;
  362. u32 vdev_start_request_cmdid;
  363. u32 vdev_restart_request_cmdid;
  364. u32 vdev_up_cmdid;
  365. u32 vdev_stop_cmdid;
  366. u32 vdev_down_cmdid;
  367. u32 vdev_set_param_cmdid;
  368. u32 vdev_install_key_cmdid;
  369. u32 peer_create_cmdid;
  370. u32 peer_delete_cmdid;
  371. u32 peer_flush_tids_cmdid;
  372. u32 peer_set_param_cmdid;
  373. u32 peer_assoc_cmdid;
  374. u32 peer_add_wds_entry_cmdid;
  375. u32 peer_remove_wds_entry_cmdid;
  376. u32 peer_mcast_group_cmdid;
  377. u32 bcn_tx_cmdid;
  378. u32 pdev_send_bcn_cmdid;
  379. u32 bcn_tmpl_cmdid;
  380. u32 bcn_filter_rx_cmdid;
  381. u32 prb_req_filter_rx_cmdid;
  382. u32 mgmt_tx_cmdid;
  383. u32 prb_tmpl_cmdid;
  384. u32 addba_clear_resp_cmdid;
  385. u32 addba_send_cmdid;
  386. u32 addba_status_cmdid;
  387. u32 delba_send_cmdid;
  388. u32 addba_set_resp_cmdid;
  389. u32 send_singleamsdu_cmdid;
  390. u32 sta_powersave_mode_cmdid;
  391. u32 sta_powersave_param_cmdid;
  392. u32 sta_mimo_ps_mode_cmdid;
  393. u32 pdev_dfs_enable_cmdid;
  394. u32 pdev_dfs_disable_cmdid;
  395. u32 roam_scan_mode;
  396. u32 roam_scan_rssi_threshold;
  397. u32 roam_scan_period;
  398. u32 roam_scan_rssi_change_threshold;
  399. u32 roam_ap_profile;
  400. u32 ofl_scan_add_ap_profile;
  401. u32 ofl_scan_remove_ap_profile;
  402. u32 ofl_scan_period;
  403. u32 p2p_dev_set_device_info;
  404. u32 p2p_dev_set_discoverability;
  405. u32 p2p_go_set_beacon_ie;
  406. u32 p2p_go_set_probe_resp_ie;
  407. u32 p2p_set_vendor_ie_data_cmdid;
  408. u32 ap_ps_peer_param_cmdid;
  409. u32 ap_ps_peer_uapsd_coex_cmdid;
  410. u32 peer_rate_retry_sched_cmdid;
  411. u32 wlan_profile_trigger_cmdid;
  412. u32 wlan_profile_set_hist_intvl_cmdid;
  413. u32 wlan_profile_get_profile_data_cmdid;
  414. u32 wlan_profile_enable_profile_id_cmdid;
  415. u32 wlan_profile_list_profile_id_cmdid;
  416. u32 pdev_suspend_cmdid;
  417. u32 pdev_resume_cmdid;
  418. u32 add_bcn_filter_cmdid;
  419. u32 rmv_bcn_filter_cmdid;
  420. u32 wow_add_wake_pattern_cmdid;
  421. u32 wow_del_wake_pattern_cmdid;
  422. u32 wow_enable_disable_wake_event_cmdid;
  423. u32 wow_enable_cmdid;
  424. u32 wow_hostwakeup_from_sleep_cmdid;
  425. u32 rtt_measreq_cmdid;
  426. u32 rtt_tsf_cmdid;
  427. u32 vdev_spectral_scan_configure_cmdid;
  428. u32 vdev_spectral_scan_enable_cmdid;
  429. u32 request_stats_cmdid;
  430. u32 set_arp_ns_offload_cmdid;
  431. u32 network_list_offload_config_cmdid;
  432. u32 gtk_offload_cmdid;
  433. u32 csa_offload_enable_cmdid;
  434. u32 csa_offload_chanswitch_cmdid;
  435. u32 chatter_set_mode_cmdid;
  436. u32 peer_tid_addba_cmdid;
  437. u32 peer_tid_delba_cmdid;
  438. u32 sta_dtim_ps_method_cmdid;
  439. u32 sta_uapsd_auto_trig_cmdid;
  440. u32 sta_keepalive_cmd;
  441. u32 echo_cmdid;
  442. u32 pdev_utf_cmdid;
  443. u32 dbglog_cfg_cmdid;
  444. u32 pdev_qvit_cmdid;
  445. u32 pdev_ftm_intg_cmdid;
  446. u32 vdev_set_keepalive_cmdid;
  447. u32 vdev_get_keepalive_cmdid;
  448. u32 force_fw_hang_cmdid;
  449. u32 gpio_config_cmdid;
  450. u32 gpio_output_cmdid;
  451. };
  452. /*
  453. * wmi command groups.
  454. */
  455. enum wmi_cmd_group {
  456. /* 0 to 2 are reserved */
  457. WMI_GRP_START = 0x3,
  458. WMI_GRP_SCAN = WMI_GRP_START,
  459. WMI_GRP_PDEV,
  460. WMI_GRP_VDEV,
  461. WMI_GRP_PEER,
  462. WMI_GRP_MGMT,
  463. WMI_GRP_BA_NEG,
  464. WMI_GRP_STA_PS,
  465. WMI_GRP_DFS,
  466. WMI_GRP_ROAM,
  467. WMI_GRP_OFL_SCAN,
  468. WMI_GRP_P2P,
  469. WMI_GRP_AP_PS,
  470. WMI_GRP_RATE_CTRL,
  471. WMI_GRP_PROFILE,
  472. WMI_GRP_SUSPEND,
  473. WMI_GRP_BCN_FILTER,
  474. WMI_GRP_WOW,
  475. WMI_GRP_RTT,
  476. WMI_GRP_SPECTRAL,
  477. WMI_GRP_STATS,
  478. WMI_GRP_ARP_NS_OFL,
  479. WMI_GRP_NLO_OFL,
  480. WMI_GRP_GTK_OFL,
  481. WMI_GRP_CSA_OFL,
  482. WMI_GRP_CHATTER,
  483. WMI_GRP_TID_ADDBA,
  484. WMI_GRP_MISC,
  485. WMI_GRP_GPIO,
  486. };
  487. #define WMI_CMD_GRP(grp_id) (((grp_id) << 12) | 0x1)
  488. #define WMI_EVT_GRP_START_ID(grp_id) (((grp_id) << 12) | 0x1)
  489. #define WMI_CMD_UNSUPPORTED 0
  490. /* Command IDs and command events for MAIN FW. */
  491. enum wmi_cmd_id {
  492. WMI_INIT_CMDID = 0x1,
  493. /* Scan specific commands */
  494. WMI_START_SCAN_CMDID = WMI_CMD_GRP(WMI_GRP_SCAN),
  495. WMI_STOP_SCAN_CMDID,
  496. WMI_SCAN_CHAN_LIST_CMDID,
  497. WMI_SCAN_SCH_PRIO_TBL_CMDID,
  498. /* PDEV (physical device) specific commands */
  499. WMI_PDEV_SET_REGDOMAIN_CMDID = WMI_CMD_GRP(WMI_GRP_PDEV),
  500. WMI_PDEV_SET_CHANNEL_CMDID,
  501. WMI_PDEV_SET_PARAM_CMDID,
  502. WMI_PDEV_PKTLOG_ENABLE_CMDID,
  503. WMI_PDEV_PKTLOG_DISABLE_CMDID,
  504. WMI_PDEV_SET_WMM_PARAMS_CMDID,
  505. WMI_PDEV_SET_HT_CAP_IE_CMDID,
  506. WMI_PDEV_SET_VHT_CAP_IE_CMDID,
  507. WMI_PDEV_SET_DSCP_TID_MAP_CMDID,
  508. WMI_PDEV_SET_QUIET_MODE_CMDID,
  509. WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID,
  510. WMI_PDEV_GET_TPC_CONFIG_CMDID,
  511. WMI_PDEV_SET_BASE_MACADDR_CMDID,
  512. /* VDEV (virtual device) specific commands */
  513. WMI_VDEV_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_VDEV),
  514. WMI_VDEV_DELETE_CMDID,
  515. WMI_VDEV_START_REQUEST_CMDID,
  516. WMI_VDEV_RESTART_REQUEST_CMDID,
  517. WMI_VDEV_UP_CMDID,
  518. WMI_VDEV_STOP_CMDID,
  519. WMI_VDEV_DOWN_CMDID,
  520. WMI_VDEV_SET_PARAM_CMDID,
  521. WMI_VDEV_INSTALL_KEY_CMDID,
  522. /* peer specific commands */
  523. WMI_PEER_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_PEER),
  524. WMI_PEER_DELETE_CMDID,
  525. WMI_PEER_FLUSH_TIDS_CMDID,
  526. WMI_PEER_SET_PARAM_CMDID,
  527. WMI_PEER_ASSOC_CMDID,
  528. WMI_PEER_ADD_WDS_ENTRY_CMDID,
  529. WMI_PEER_REMOVE_WDS_ENTRY_CMDID,
  530. WMI_PEER_MCAST_GROUP_CMDID,
  531. /* beacon/management specific commands */
  532. WMI_BCN_TX_CMDID = WMI_CMD_GRP(WMI_GRP_MGMT),
  533. WMI_PDEV_SEND_BCN_CMDID,
  534. WMI_BCN_TMPL_CMDID,
  535. WMI_BCN_FILTER_RX_CMDID,
  536. WMI_PRB_REQ_FILTER_RX_CMDID,
  537. WMI_MGMT_TX_CMDID,
  538. WMI_PRB_TMPL_CMDID,
  539. /* commands to directly control BA negotiation directly from host. */
  540. WMI_ADDBA_CLEAR_RESP_CMDID = WMI_CMD_GRP(WMI_GRP_BA_NEG),
  541. WMI_ADDBA_SEND_CMDID,
  542. WMI_ADDBA_STATUS_CMDID,
  543. WMI_DELBA_SEND_CMDID,
  544. WMI_ADDBA_SET_RESP_CMDID,
  545. WMI_SEND_SINGLEAMSDU_CMDID,
  546. /* Station power save specific config */
  547. WMI_STA_POWERSAVE_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_STA_PS),
  548. WMI_STA_POWERSAVE_PARAM_CMDID,
  549. WMI_STA_MIMO_PS_MODE_CMDID,
  550. /** DFS-specific commands */
  551. WMI_PDEV_DFS_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_DFS),
  552. WMI_PDEV_DFS_DISABLE_CMDID,
  553. /* Roaming specific commands */
  554. WMI_ROAM_SCAN_MODE = WMI_CMD_GRP(WMI_GRP_ROAM),
  555. WMI_ROAM_SCAN_RSSI_THRESHOLD,
  556. WMI_ROAM_SCAN_PERIOD,
  557. WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
  558. WMI_ROAM_AP_PROFILE,
  559. /* offload scan specific commands */
  560. WMI_OFL_SCAN_ADD_AP_PROFILE = WMI_CMD_GRP(WMI_GRP_OFL_SCAN),
  561. WMI_OFL_SCAN_REMOVE_AP_PROFILE,
  562. WMI_OFL_SCAN_PERIOD,
  563. /* P2P specific commands */
  564. WMI_P2P_DEV_SET_DEVICE_INFO = WMI_CMD_GRP(WMI_GRP_P2P),
  565. WMI_P2P_DEV_SET_DISCOVERABILITY,
  566. WMI_P2P_GO_SET_BEACON_IE,
  567. WMI_P2P_GO_SET_PROBE_RESP_IE,
  568. WMI_P2P_SET_VENDOR_IE_DATA_CMDID,
  569. /* AP power save specific config */
  570. WMI_AP_PS_PEER_PARAM_CMDID = WMI_CMD_GRP(WMI_GRP_AP_PS),
  571. WMI_AP_PS_PEER_UAPSD_COEX_CMDID,
  572. /* Rate-control specific commands */
  573. WMI_PEER_RATE_RETRY_SCHED_CMDID =
  574. WMI_CMD_GRP(WMI_GRP_RATE_CTRL),
  575. /* WLAN Profiling commands. */
  576. WMI_WLAN_PROFILE_TRIGGER_CMDID = WMI_CMD_GRP(WMI_GRP_PROFILE),
  577. WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
  578. WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
  579. WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
  580. WMI_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
  581. /* Suspend resume command Ids */
  582. WMI_PDEV_SUSPEND_CMDID = WMI_CMD_GRP(WMI_GRP_SUSPEND),
  583. WMI_PDEV_RESUME_CMDID,
  584. /* Beacon filter commands */
  585. WMI_ADD_BCN_FILTER_CMDID = WMI_CMD_GRP(WMI_GRP_BCN_FILTER),
  586. WMI_RMV_BCN_FILTER_CMDID,
  587. /* WOW Specific WMI commands*/
  588. WMI_WOW_ADD_WAKE_PATTERN_CMDID = WMI_CMD_GRP(WMI_GRP_WOW),
  589. WMI_WOW_DEL_WAKE_PATTERN_CMDID,
  590. WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
  591. WMI_WOW_ENABLE_CMDID,
  592. WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
  593. /* RTT measurement related cmd */
  594. WMI_RTT_MEASREQ_CMDID = WMI_CMD_GRP(WMI_GRP_RTT),
  595. WMI_RTT_TSF_CMDID,
  596. /* spectral scan commands */
  597. WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID = WMI_CMD_GRP(WMI_GRP_SPECTRAL),
  598. WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
  599. /* F/W stats */
  600. WMI_REQUEST_STATS_CMDID = WMI_CMD_GRP(WMI_GRP_STATS),
  601. /* ARP OFFLOAD REQUEST*/
  602. WMI_SET_ARP_NS_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_ARP_NS_OFL),
  603. /* NS offload confid*/
  604. WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_NLO_OFL),
  605. /* GTK offload Specific WMI commands*/
  606. WMI_GTK_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_GTK_OFL),
  607. /* CSA offload Specific WMI commands*/
  608. WMI_CSA_OFFLOAD_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_CSA_OFL),
  609. WMI_CSA_OFFLOAD_CHANSWITCH_CMDID,
  610. /* Chatter commands*/
  611. WMI_CHATTER_SET_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_CHATTER),
  612. /* addba specific commands */
  613. WMI_PEER_TID_ADDBA_CMDID = WMI_CMD_GRP(WMI_GRP_TID_ADDBA),
  614. WMI_PEER_TID_DELBA_CMDID,
  615. /* set station mimo powersave method */
  616. WMI_STA_DTIM_PS_METHOD_CMDID,
  617. /* Configure the Station UAPSD AC Auto Trigger Parameters */
  618. WMI_STA_UAPSD_AUTO_TRIG_CMDID,
  619. /* STA Keep alive parameter configuration,
  620. Requires WMI_SERVICE_STA_KEEP_ALIVE */
  621. WMI_STA_KEEPALIVE_CMD,
  622. /* misc command group */
  623. WMI_ECHO_CMDID = WMI_CMD_GRP(WMI_GRP_MISC),
  624. WMI_PDEV_UTF_CMDID,
  625. WMI_DBGLOG_CFG_CMDID,
  626. WMI_PDEV_QVIT_CMDID,
  627. WMI_PDEV_FTM_INTG_CMDID,
  628. WMI_VDEV_SET_KEEPALIVE_CMDID,
  629. WMI_VDEV_GET_KEEPALIVE_CMDID,
  630. WMI_FORCE_FW_HANG_CMDID,
  631. /* GPIO Configuration */
  632. WMI_GPIO_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_GPIO),
  633. WMI_GPIO_OUTPUT_CMDID,
  634. };
  635. enum wmi_event_id {
  636. WMI_SERVICE_READY_EVENTID = 0x1,
  637. WMI_READY_EVENTID,
  638. /* Scan specific events */
  639. WMI_SCAN_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_SCAN),
  640. /* PDEV specific events */
  641. WMI_PDEV_TPC_CONFIG_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PDEV),
  642. WMI_CHAN_INFO_EVENTID,
  643. WMI_PHYERR_EVENTID,
  644. /* VDEV specific events */
  645. WMI_VDEV_START_RESP_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_VDEV),
  646. WMI_VDEV_STOPPED_EVENTID,
  647. WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID,
  648. /* peer specific events */
  649. WMI_PEER_STA_KICKOUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PEER),
  650. /* beacon/mgmt specific events */
  651. WMI_MGMT_RX_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MGMT),
  652. WMI_HOST_SWBA_EVENTID,
  653. WMI_TBTTOFFSET_UPDATE_EVENTID,
  654. /* ADDBA Related WMI Events*/
  655. WMI_TX_DELBA_COMPLETE_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_BA_NEG),
  656. WMI_TX_ADDBA_COMPLETE_EVENTID,
  657. /* Roam event to trigger roaming on host */
  658. WMI_ROAM_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_ROAM),
  659. WMI_PROFILE_MATCH,
  660. /* WoW */
  661. WMI_WOW_WAKEUP_HOST_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_WOW),
  662. /* RTT */
  663. WMI_RTT_MEASUREMENT_REPORT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_RTT),
  664. WMI_TSF_MEASUREMENT_REPORT_EVENTID,
  665. WMI_RTT_ERROR_REPORT_EVENTID,
  666. /* GTK offload */
  667. WMI_GTK_OFFLOAD_STATUS_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GTK_OFL),
  668. WMI_GTK_REKEY_FAIL_EVENTID,
  669. /* CSA IE received event */
  670. WMI_CSA_HANDLING_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_CSA_OFL),
  671. /* Misc events */
  672. WMI_ECHO_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MISC),
  673. WMI_PDEV_UTF_EVENTID,
  674. WMI_DEBUG_MESG_EVENTID,
  675. WMI_UPDATE_STATS_EVENTID,
  676. WMI_DEBUG_PRINT_EVENTID,
  677. WMI_DCS_INTERFERENCE_EVENTID,
  678. WMI_PDEV_QVIT_EVENTID,
  679. WMI_WLAN_PROFILE_DATA_EVENTID,
  680. WMI_PDEV_FTM_INTG_EVENTID,
  681. WMI_WLAN_FREQ_AVOID_EVENTID,
  682. WMI_VDEV_GET_KEEPALIVE_EVENTID,
  683. /* GPIO Event */
  684. WMI_GPIO_INPUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GPIO),
  685. };
  686. /* Command IDs and command events for 10.X firmware */
  687. enum wmi_10x_cmd_id {
  688. WMI_10X_START_CMDID = 0x9000,
  689. WMI_10X_END_CMDID = 0x9FFF,
  690. /* initialize the wlan sub system */
  691. WMI_10X_INIT_CMDID,
  692. /* Scan specific commands */
  693. WMI_10X_START_SCAN_CMDID = WMI_10X_START_CMDID,
  694. WMI_10X_STOP_SCAN_CMDID,
  695. WMI_10X_SCAN_CHAN_LIST_CMDID,
  696. WMI_10X_ECHO_CMDID,
  697. /* PDEV(physical device) specific commands */
  698. WMI_10X_PDEV_SET_REGDOMAIN_CMDID,
  699. WMI_10X_PDEV_SET_CHANNEL_CMDID,
  700. WMI_10X_PDEV_SET_PARAM_CMDID,
  701. WMI_10X_PDEV_PKTLOG_ENABLE_CMDID,
  702. WMI_10X_PDEV_PKTLOG_DISABLE_CMDID,
  703. WMI_10X_PDEV_SET_WMM_PARAMS_CMDID,
  704. WMI_10X_PDEV_SET_HT_CAP_IE_CMDID,
  705. WMI_10X_PDEV_SET_VHT_CAP_IE_CMDID,
  706. WMI_10X_PDEV_SET_BASE_MACADDR_CMDID,
  707. WMI_10X_PDEV_SET_DSCP_TID_MAP_CMDID,
  708. WMI_10X_PDEV_SET_QUIET_MODE_CMDID,
  709. WMI_10X_PDEV_GREEN_AP_PS_ENABLE_CMDID,
  710. WMI_10X_PDEV_GET_TPC_CONFIG_CMDID,
  711. /* VDEV(virtual device) specific commands */
  712. WMI_10X_VDEV_CREATE_CMDID,
  713. WMI_10X_VDEV_DELETE_CMDID,
  714. WMI_10X_VDEV_START_REQUEST_CMDID,
  715. WMI_10X_VDEV_RESTART_REQUEST_CMDID,
  716. WMI_10X_VDEV_UP_CMDID,
  717. WMI_10X_VDEV_STOP_CMDID,
  718. WMI_10X_VDEV_DOWN_CMDID,
  719. WMI_10X_VDEV_STANDBY_RESPONSE_CMDID,
  720. WMI_10X_VDEV_RESUME_RESPONSE_CMDID,
  721. WMI_10X_VDEV_SET_PARAM_CMDID,
  722. WMI_10X_VDEV_INSTALL_KEY_CMDID,
  723. /* peer specific commands */
  724. WMI_10X_PEER_CREATE_CMDID,
  725. WMI_10X_PEER_DELETE_CMDID,
  726. WMI_10X_PEER_FLUSH_TIDS_CMDID,
  727. WMI_10X_PEER_SET_PARAM_CMDID,
  728. WMI_10X_PEER_ASSOC_CMDID,
  729. WMI_10X_PEER_ADD_WDS_ENTRY_CMDID,
  730. WMI_10X_PEER_REMOVE_WDS_ENTRY_CMDID,
  731. WMI_10X_PEER_MCAST_GROUP_CMDID,
  732. /* beacon/management specific commands */
  733. WMI_10X_BCN_TX_CMDID,
  734. WMI_10X_BCN_PRB_TMPL_CMDID,
  735. WMI_10X_BCN_FILTER_RX_CMDID,
  736. WMI_10X_PRB_REQ_FILTER_RX_CMDID,
  737. WMI_10X_MGMT_TX_CMDID,
  738. /* commands to directly control ba negotiation directly from host. */
  739. WMI_10X_ADDBA_CLEAR_RESP_CMDID,
  740. WMI_10X_ADDBA_SEND_CMDID,
  741. WMI_10X_ADDBA_STATUS_CMDID,
  742. WMI_10X_DELBA_SEND_CMDID,
  743. WMI_10X_ADDBA_SET_RESP_CMDID,
  744. WMI_10X_SEND_SINGLEAMSDU_CMDID,
  745. /* Station power save specific config */
  746. WMI_10X_STA_POWERSAVE_MODE_CMDID,
  747. WMI_10X_STA_POWERSAVE_PARAM_CMDID,
  748. WMI_10X_STA_MIMO_PS_MODE_CMDID,
  749. /* set debug log config */
  750. WMI_10X_DBGLOG_CFG_CMDID,
  751. /* DFS-specific commands */
  752. WMI_10X_PDEV_DFS_ENABLE_CMDID,
  753. WMI_10X_PDEV_DFS_DISABLE_CMDID,
  754. /* QVIT specific command id */
  755. WMI_10X_PDEV_QVIT_CMDID,
  756. /* Offload Scan and Roaming related commands */
  757. WMI_10X_ROAM_SCAN_MODE,
  758. WMI_10X_ROAM_SCAN_RSSI_THRESHOLD,
  759. WMI_10X_ROAM_SCAN_PERIOD,
  760. WMI_10X_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
  761. WMI_10X_ROAM_AP_PROFILE,
  762. WMI_10X_OFL_SCAN_ADD_AP_PROFILE,
  763. WMI_10X_OFL_SCAN_REMOVE_AP_PROFILE,
  764. WMI_10X_OFL_SCAN_PERIOD,
  765. /* P2P specific commands */
  766. WMI_10X_P2P_DEV_SET_DEVICE_INFO,
  767. WMI_10X_P2P_DEV_SET_DISCOVERABILITY,
  768. WMI_10X_P2P_GO_SET_BEACON_IE,
  769. WMI_10X_P2P_GO_SET_PROBE_RESP_IE,
  770. /* AP power save specific config */
  771. WMI_10X_AP_PS_PEER_PARAM_CMDID,
  772. WMI_10X_AP_PS_PEER_UAPSD_COEX_CMDID,
  773. /* Rate-control specific commands */
  774. WMI_10X_PEER_RATE_RETRY_SCHED_CMDID,
  775. /* WLAN Profiling commands. */
  776. WMI_10X_WLAN_PROFILE_TRIGGER_CMDID,
  777. WMI_10X_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
  778. WMI_10X_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
  779. WMI_10X_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
  780. WMI_10X_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
  781. /* Suspend resume command Ids */
  782. WMI_10X_PDEV_SUSPEND_CMDID,
  783. WMI_10X_PDEV_RESUME_CMDID,
  784. /* Beacon filter commands */
  785. WMI_10X_ADD_BCN_FILTER_CMDID,
  786. WMI_10X_RMV_BCN_FILTER_CMDID,
  787. /* WOW Specific WMI commands*/
  788. WMI_10X_WOW_ADD_WAKE_PATTERN_CMDID,
  789. WMI_10X_WOW_DEL_WAKE_PATTERN_CMDID,
  790. WMI_10X_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
  791. WMI_10X_WOW_ENABLE_CMDID,
  792. WMI_10X_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
  793. /* RTT measurement related cmd */
  794. WMI_10X_RTT_MEASREQ_CMDID,
  795. WMI_10X_RTT_TSF_CMDID,
  796. /* transmit beacon by value */
  797. WMI_10X_PDEV_SEND_BCN_CMDID,
  798. /* F/W stats */
  799. WMI_10X_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
  800. WMI_10X_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
  801. WMI_10X_REQUEST_STATS_CMDID,
  802. /* GPIO Configuration */
  803. WMI_10X_GPIO_CONFIG_CMDID,
  804. WMI_10X_GPIO_OUTPUT_CMDID,
  805. WMI_10X_PDEV_UTF_CMDID = WMI_10X_END_CMDID - 1,
  806. };
  807. enum wmi_10x_event_id {
  808. WMI_10X_SERVICE_READY_EVENTID = 0x8000,
  809. WMI_10X_READY_EVENTID,
  810. WMI_10X_START_EVENTID = 0x9000,
  811. WMI_10X_END_EVENTID = 0x9FFF,
  812. /* Scan specific events */
  813. WMI_10X_SCAN_EVENTID = WMI_10X_START_EVENTID,
  814. WMI_10X_ECHO_EVENTID,
  815. WMI_10X_DEBUG_MESG_EVENTID,
  816. WMI_10X_UPDATE_STATS_EVENTID,
  817. /* Instantaneous RSSI event */
  818. WMI_10X_INST_RSSI_STATS_EVENTID,
  819. /* VDEV specific events */
  820. WMI_10X_VDEV_START_RESP_EVENTID,
  821. WMI_10X_VDEV_STANDBY_REQ_EVENTID,
  822. WMI_10X_VDEV_RESUME_REQ_EVENTID,
  823. WMI_10X_VDEV_STOPPED_EVENTID,
  824. /* peer specific events */
  825. WMI_10X_PEER_STA_KICKOUT_EVENTID,
  826. /* beacon/mgmt specific events */
  827. WMI_10X_HOST_SWBA_EVENTID,
  828. WMI_10X_TBTTOFFSET_UPDATE_EVENTID,
  829. WMI_10X_MGMT_RX_EVENTID,
  830. /* Channel stats event */
  831. WMI_10X_CHAN_INFO_EVENTID,
  832. /* PHY Error specific WMI event */
  833. WMI_10X_PHYERR_EVENTID,
  834. /* Roam event to trigger roaming on host */
  835. WMI_10X_ROAM_EVENTID,
  836. /* matching AP found from list of profiles */
  837. WMI_10X_PROFILE_MATCH,
  838. /* debug print message used for tracing FW code while debugging */
  839. WMI_10X_DEBUG_PRINT_EVENTID,
  840. /* VI spoecific event */
  841. WMI_10X_PDEV_QVIT_EVENTID,
  842. /* FW code profile data in response to profile request */
  843. WMI_10X_WLAN_PROFILE_DATA_EVENTID,
  844. /*RTT related event ID*/
  845. WMI_10X_RTT_MEASUREMENT_REPORT_EVENTID,
  846. WMI_10X_TSF_MEASUREMENT_REPORT_EVENTID,
  847. WMI_10X_RTT_ERROR_REPORT_EVENTID,
  848. WMI_10X_WOW_WAKEUP_HOST_EVENTID,
  849. WMI_10X_DCS_INTERFERENCE_EVENTID,
  850. /* TPC config for the current operating channel */
  851. WMI_10X_PDEV_TPC_CONFIG_EVENTID,
  852. WMI_10X_GPIO_INPUT_EVENTID,
  853. WMI_10X_PDEV_UTF_EVENTID = WMI_10X_END_EVENTID-1,
  854. };
  855. enum wmi_10_2_cmd_id {
  856. WMI_10_2_START_CMDID = 0x9000,
  857. WMI_10_2_END_CMDID = 0x9FFF,
  858. WMI_10_2_INIT_CMDID,
  859. WMI_10_2_START_SCAN_CMDID = WMI_10_2_START_CMDID,
  860. WMI_10_2_STOP_SCAN_CMDID,
  861. WMI_10_2_SCAN_CHAN_LIST_CMDID,
  862. WMI_10_2_ECHO_CMDID,
  863. WMI_10_2_PDEV_SET_REGDOMAIN_CMDID,
  864. WMI_10_2_PDEV_SET_CHANNEL_CMDID,
  865. WMI_10_2_PDEV_SET_PARAM_CMDID,
  866. WMI_10_2_PDEV_PKTLOG_ENABLE_CMDID,
  867. WMI_10_2_PDEV_PKTLOG_DISABLE_CMDID,
  868. WMI_10_2_PDEV_SET_WMM_PARAMS_CMDID,
  869. WMI_10_2_PDEV_SET_HT_CAP_IE_CMDID,
  870. WMI_10_2_PDEV_SET_VHT_CAP_IE_CMDID,
  871. WMI_10_2_PDEV_SET_BASE_MACADDR_CMDID,
  872. WMI_10_2_PDEV_SET_QUIET_MODE_CMDID,
  873. WMI_10_2_PDEV_GREEN_AP_PS_ENABLE_CMDID,
  874. WMI_10_2_PDEV_GET_TPC_CONFIG_CMDID,
  875. WMI_10_2_VDEV_CREATE_CMDID,
  876. WMI_10_2_VDEV_DELETE_CMDID,
  877. WMI_10_2_VDEV_START_REQUEST_CMDID,
  878. WMI_10_2_VDEV_RESTART_REQUEST_CMDID,
  879. WMI_10_2_VDEV_UP_CMDID,
  880. WMI_10_2_VDEV_STOP_CMDID,
  881. WMI_10_2_VDEV_DOWN_CMDID,
  882. WMI_10_2_VDEV_STANDBY_RESPONSE_CMDID,
  883. WMI_10_2_VDEV_RESUME_RESPONSE_CMDID,
  884. WMI_10_2_VDEV_SET_PARAM_CMDID,
  885. WMI_10_2_VDEV_INSTALL_KEY_CMDID,
  886. WMI_10_2_VDEV_SET_DSCP_TID_MAP_CMDID,
  887. WMI_10_2_PEER_CREATE_CMDID,
  888. WMI_10_2_PEER_DELETE_CMDID,
  889. WMI_10_2_PEER_FLUSH_TIDS_CMDID,
  890. WMI_10_2_PEER_SET_PARAM_CMDID,
  891. WMI_10_2_PEER_ASSOC_CMDID,
  892. WMI_10_2_PEER_ADD_WDS_ENTRY_CMDID,
  893. WMI_10_2_PEER_UPDATE_WDS_ENTRY_CMDID,
  894. WMI_10_2_PEER_REMOVE_WDS_ENTRY_CMDID,
  895. WMI_10_2_PEER_MCAST_GROUP_CMDID,
  896. WMI_10_2_BCN_TX_CMDID,
  897. WMI_10_2_BCN_PRB_TMPL_CMDID,
  898. WMI_10_2_BCN_FILTER_RX_CMDID,
  899. WMI_10_2_PRB_REQ_FILTER_RX_CMDID,
  900. WMI_10_2_MGMT_TX_CMDID,
  901. WMI_10_2_ADDBA_CLEAR_RESP_CMDID,
  902. WMI_10_2_ADDBA_SEND_CMDID,
  903. WMI_10_2_ADDBA_STATUS_CMDID,
  904. WMI_10_2_DELBA_SEND_CMDID,
  905. WMI_10_2_ADDBA_SET_RESP_CMDID,
  906. WMI_10_2_SEND_SINGLEAMSDU_CMDID,
  907. WMI_10_2_STA_POWERSAVE_MODE_CMDID,
  908. WMI_10_2_STA_POWERSAVE_PARAM_CMDID,
  909. WMI_10_2_STA_MIMO_PS_MODE_CMDID,
  910. WMI_10_2_DBGLOG_CFG_CMDID,
  911. WMI_10_2_PDEV_DFS_ENABLE_CMDID,
  912. WMI_10_2_PDEV_DFS_DISABLE_CMDID,
  913. WMI_10_2_PDEV_QVIT_CMDID,
  914. WMI_10_2_ROAM_SCAN_MODE,
  915. WMI_10_2_ROAM_SCAN_RSSI_THRESHOLD,
  916. WMI_10_2_ROAM_SCAN_PERIOD,
  917. WMI_10_2_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
  918. WMI_10_2_ROAM_AP_PROFILE,
  919. WMI_10_2_OFL_SCAN_ADD_AP_PROFILE,
  920. WMI_10_2_OFL_SCAN_REMOVE_AP_PROFILE,
  921. WMI_10_2_OFL_SCAN_PERIOD,
  922. WMI_10_2_P2P_DEV_SET_DEVICE_INFO,
  923. WMI_10_2_P2P_DEV_SET_DISCOVERABILITY,
  924. WMI_10_2_P2P_GO_SET_BEACON_IE,
  925. WMI_10_2_P2P_GO_SET_PROBE_RESP_IE,
  926. WMI_10_2_AP_PS_PEER_PARAM_CMDID,
  927. WMI_10_2_AP_PS_PEER_UAPSD_COEX_CMDID,
  928. WMI_10_2_PEER_RATE_RETRY_SCHED_CMDID,
  929. WMI_10_2_WLAN_PROFILE_TRIGGER_CMDID,
  930. WMI_10_2_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
  931. WMI_10_2_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
  932. WMI_10_2_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
  933. WMI_10_2_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
  934. WMI_10_2_PDEV_SUSPEND_CMDID,
  935. WMI_10_2_PDEV_RESUME_CMDID,
  936. WMI_10_2_ADD_BCN_FILTER_CMDID,
  937. WMI_10_2_RMV_BCN_FILTER_CMDID,
  938. WMI_10_2_WOW_ADD_WAKE_PATTERN_CMDID,
  939. WMI_10_2_WOW_DEL_WAKE_PATTERN_CMDID,
  940. WMI_10_2_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
  941. WMI_10_2_WOW_ENABLE_CMDID,
  942. WMI_10_2_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
  943. WMI_10_2_RTT_MEASREQ_CMDID,
  944. WMI_10_2_RTT_TSF_CMDID,
  945. WMI_10_2_RTT_KEEPALIVE_CMDID,
  946. WMI_10_2_PDEV_SEND_BCN_CMDID,
  947. WMI_10_2_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
  948. WMI_10_2_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
  949. WMI_10_2_REQUEST_STATS_CMDID,
  950. WMI_10_2_GPIO_CONFIG_CMDID,
  951. WMI_10_2_GPIO_OUTPUT_CMDID,
  952. WMI_10_2_VDEV_RATEMASK_CMDID,
  953. WMI_10_2_PDEV_SMART_ANT_ENABLE_CMDID,
  954. WMI_10_2_PDEV_SMART_ANT_SET_RX_ANTENNA_CMDID,
  955. WMI_10_2_PEER_SMART_ANT_SET_TX_ANTENNA_CMDID,
  956. WMI_10_2_PEER_SMART_ANT_SET_TRAIN_INFO_CMDID,
  957. WMI_10_2_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID,
  958. WMI_10_2_FORCE_FW_HANG_CMDID,
  959. WMI_10_2_PDEV_SET_ANTENNA_SWITCH_TABLE_CMDID,
  960. WMI_10_2_PDEV_SET_CTL_TABLE_CMDID,
  961. WMI_10_2_PDEV_SET_MIMOGAIN_TABLE_CMDID,
  962. WMI_10_2_PDEV_RATEPWR_TABLE_CMDID,
  963. WMI_10_2_PDEV_RATEPWR_CHAINMSK_TABLE_CMDID,
  964. WMI_10_2_PDEV_UTF_CMDID = WMI_10_2_END_CMDID - 1,
  965. };
  966. enum wmi_10_2_event_id {
  967. WMI_10_2_SERVICE_READY_EVENTID = 0x8000,
  968. WMI_10_2_READY_EVENTID,
  969. WMI_10_2_DEBUG_MESG_EVENTID,
  970. WMI_10_2_START_EVENTID = 0x9000,
  971. WMI_10_2_END_EVENTID = 0x9FFF,
  972. WMI_10_2_SCAN_EVENTID = WMI_10_2_START_EVENTID,
  973. WMI_10_2_ECHO_EVENTID,
  974. WMI_10_2_UPDATE_STATS_EVENTID,
  975. WMI_10_2_INST_RSSI_STATS_EVENTID,
  976. WMI_10_2_VDEV_START_RESP_EVENTID,
  977. WMI_10_2_VDEV_STANDBY_REQ_EVENTID,
  978. WMI_10_2_VDEV_RESUME_REQ_EVENTID,
  979. WMI_10_2_VDEV_STOPPED_EVENTID,
  980. WMI_10_2_PEER_STA_KICKOUT_EVENTID,
  981. WMI_10_2_HOST_SWBA_EVENTID,
  982. WMI_10_2_TBTTOFFSET_UPDATE_EVENTID,
  983. WMI_10_2_MGMT_RX_EVENTID,
  984. WMI_10_2_CHAN_INFO_EVENTID,
  985. WMI_10_2_PHYERR_EVENTID,
  986. WMI_10_2_ROAM_EVENTID,
  987. WMI_10_2_PROFILE_MATCH,
  988. WMI_10_2_DEBUG_PRINT_EVENTID,
  989. WMI_10_2_PDEV_QVIT_EVENTID,
  990. WMI_10_2_WLAN_PROFILE_DATA_EVENTID,
  991. WMI_10_2_RTT_MEASUREMENT_REPORT_EVENTID,
  992. WMI_10_2_TSF_MEASUREMENT_REPORT_EVENTID,
  993. WMI_10_2_RTT_ERROR_REPORT_EVENTID,
  994. WMI_10_2_RTT_KEEPALIVE_EVENTID,
  995. WMI_10_2_WOW_WAKEUP_HOST_EVENTID,
  996. WMI_10_2_DCS_INTERFERENCE_EVENTID,
  997. WMI_10_2_PDEV_TPC_CONFIG_EVENTID,
  998. WMI_10_2_GPIO_INPUT_EVENTID,
  999. WMI_10_2_PEER_RATECODE_LIST_EVENTID,
  1000. WMI_10_2_GENERIC_BUFFER_EVENTID,
  1001. WMI_10_2_MCAST_BUF_RELEASE_EVENTID,
  1002. WMI_10_2_MCAST_LIST_AGEOUT_EVENTID,
  1003. WMI_10_2_WDS_PEER_EVENTID,
  1004. WMI_10_2_PDEV_UTF_EVENTID = WMI_10_2_END_EVENTID - 1,
  1005. };
  1006. enum wmi_phy_mode {
  1007. MODE_11A = 0, /* 11a Mode */
  1008. MODE_11G = 1, /* 11b/g Mode */
  1009. MODE_11B = 2, /* 11b Mode */
  1010. MODE_11GONLY = 3, /* 11g only Mode */
  1011. MODE_11NA_HT20 = 4, /* 11a HT20 mode */
  1012. MODE_11NG_HT20 = 5, /* 11g HT20 mode */
  1013. MODE_11NA_HT40 = 6, /* 11a HT40 mode */
  1014. MODE_11NG_HT40 = 7, /* 11g HT40 mode */
  1015. MODE_11AC_VHT20 = 8,
  1016. MODE_11AC_VHT40 = 9,
  1017. MODE_11AC_VHT80 = 10,
  1018. /* MODE_11AC_VHT160 = 11, */
  1019. MODE_11AC_VHT20_2G = 11,
  1020. MODE_11AC_VHT40_2G = 12,
  1021. MODE_11AC_VHT80_2G = 13,
  1022. MODE_UNKNOWN = 14,
  1023. MODE_MAX = 14
  1024. };
  1025. static inline const char *ath10k_wmi_phymode_str(enum wmi_phy_mode mode)
  1026. {
  1027. switch (mode) {
  1028. case MODE_11A:
  1029. return "11a";
  1030. case MODE_11G:
  1031. return "11g";
  1032. case MODE_11B:
  1033. return "11b";
  1034. case MODE_11GONLY:
  1035. return "11gonly";
  1036. case MODE_11NA_HT20:
  1037. return "11na-ht20";
  1038. case MODE_11NG_HT20:
  1039. return "11ng-ht20";
  1040. case MODE_11NA_HT40:
  1041. return "11na-ht40";
  1042. case MODE_11NG_HT40:
  1043. return "11ng-ht40";
  1044. case MODE_11AC_VHT20:
  1045. return "11ac-vht20";
  1046. case MODE_11AC_VHT40:
  1047. return "11ac-vht40";
  1048. case MODE_11AC_VHT80:
  1049. return "11ac-vht80";
  1050. case MODE_11AC_VHT20_2G:
  1051. return "11ac-vht20-2g";
  1052. case MODE_11AC_VHT40_2G:
  1053. return "11ac-vht40-2g";
  1054. case MODE_11AC_VHT80_2G:
  1055. return "11ac-vht80-2g";
  1056. case MODE_UNKNOWN:
  1057. /* skip */
  1058. break;
  1059. /* no default handler to allow compiler to check that the
  1060. * enum is fully handled */
  1061. };
  1062. return "<unknown>";
  1063. }
  1064. #define WMI_CHAN_LIST_TAG 0x1
  1065. #define WMI_SSID_LIST_TAG 0x2
  1066. #define WMI_BSSID_LIST_TAG 0x3
  1067. #define WMI_IE_TAG 0x4
  1068. struct wmi_channel {
  1069. __le32 mhz;
  1070. __le32 band_center_freq1;
  1071. __le32 band_center_freq2; /* valid for 11ac, 80plus80 */
  1072. union {
  1073. __le32 flags; /* WMI_CHAN_FLAG_ */
  1074. struct {
  1075. u8 mode; /* only 6 LSBs */
  1076. } __packed;
  1077. } __packed;
  1078. union {
  1079. __le32 reginfo0;
  1080. struct {
  1081. /* note: power unit is 0.5 dBm */
  1082. u8 min_power;
  1083. u8 max_power;
  1084. u8 reg_power;
  1085. u8 reg_classid;
  1086. } __packed;
  1087. } __packed;
  1088. union {
  1089. __le32 reginfo1;
  1090. struct {
  1091. u8 antenna_max;
  1092. } __packed;
  1093. } __packed;
  1094. } __packed;
  1095. struct wmi_channel_arg {
  1096. u32 freq;
  1097. u32 band_center_freq1;
  1098. bool passive;
  1099. bool allow_ibss;
  1100. bool allow_ht;
  1101. bool allow_vht;
  1102. bool ht40plus;
  1103. bool chan_radar;
  1104. /* note: power unit is 0.5 dBm */
  1105. u32 min_power;
  1106. u32 max_power;
  1107. u32 max_reg_power;
  1108. u32 max_antenna_gain;
  1109. u32 reg_class_id;
  1110. enum wmi_phy_mode mode;
  1111. };
  1112. enum wmi_channel_change_cause {
  1113. WMI_CHANNEL_CHANGE_CAUSE_NONE = 0,
  1114. WMI_CHANNEL_CHANGE_CAUSE_CSA,
  1115. };
  1116. #define WMI_CHAN_FLAG_HT40_PLUS (1 << 6)
  1117. #define WMI_CHAN_FLAG_PASSIVE (1 << 7)
  1118. #define WMI_CHAN_FLAG_ADHOC_ALLOWED (1 << 8)
  1119. #define WMI_CHAN_FLAG_AP_DISABLED (1 << 9)
  1120. #define WMI_CHAN_FLAG_DFS (1 << 10)
  1121. #define WMI_CHAN_FLAG_ALLOW_HT (1 << 11)
  1122. #define WMI_CHAN_FLAG_ALLOW_VHT (1 << 12)
  1123. /* Indicate reason for channel switch */
  1124. #define WMI_CHANNEL_CHANGE_CAUSE_CSA (1 << 13)
  1125. #define WMI_MAX_SPATIAL_STREAM 3
  1126. /* HT Capabilities*/
  1127. #define WMI_HT_CAP_ENABLED 0x0001 /* HT Enabled/ disabled */
  1128. #define WMI_HT_CAP_HT20_SGI 0x0002 /* Short Guard Interval with HT20 */
  1129. #define WMI_HT_CAP_DYNAMIC_SMPS 0x0004 /* Dynamic MIMO powersave */
  1130. #define WMI_HT_CAP_TX_STBC 0x0008 /* B3 TX STBC */
  1131. #define WMI_HT_CAP_TX_STBC_MASK_SHIFT 3
  1132. #define WMI_HT_CAP_RX_STBC 0x0030 /* B4-B5 RX STBC */
  1133. #define WMI_HT_CAP_RX_STBC_MASK_SHIFT 4
  1134. #define WMI_HT_CAP_LDPC 0x0040 /* LDPC supported */
  1135. #define WMI_HT_CAP_L_SIG_TXOP_PROT 0x0080 /* L-SIG TXOP Protection */
  1136. #define WMI_HT_CAP_MPDU_DENSITY 0x0700 /* MPDU Density */
  1137. #define WMI_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8
  1138. #define WMI_HT_CAP_HT40_SGI 0x0800
  1139. #define WMI_HT_CAP_DEFAULT_ALL (WMI_HT_CAP_ENABLED | \
  1140. WMI_HT_CAP_HT20_SGI | \
  1141. WMI_HT_CAP_HT40_SGI | \
  1142. WMI_HT_CAP_TX_STBC | \
  1143. WMI_HT_CAP_RX_STBC | \
  1144. WMI_HT_CAP_LDPC)
  1145. /*
  1146. * WMI_VHT_CAP_* these maps to ieee 802.11ac vht capability information
  1147. * field. The fields not defined here are not supported, or reserved.
  1148. * Do not change these masks and if you have to add new one follow the
  1149. * bitmask as specified by 802.11ac draft.
  1150. */
  1151. #define WMI_VHT_CAP_MAX_MPDU_LEN_MASK 0x00000003
  1152. #define WMI_VHT_CAP_RX_LDPC 0x00000010
  1153. #define WMI_VHT_CAP_SGI_80MHZ 0x00000020
  1154. #define WMI_VHT_CAP_TX_STBC 0x00000080
  1155. #define WMI_VHT_CAP_RX_STBC_MASK 0x00000300
  1156. #define WMI_VHT_CAP_RX_STBC_MASK_SHIFT 8
  1157. #define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP 0x03800000
  1158. #define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP_SHIFT 23
  1159. #define WMI_VHT_CAP_RX_FIXED_ANT 0x10000000
  1160. #define WMI_VHT_CAP_TX_FIXED_ANT 0x20000000
  1161. /* The following also refer for max HT AMSDU */
  1162. #define WMI_VHT_CAP_MAX_MPDU_LEN_3839 0x00000000
  1163. #define WMI_VHT_CAP_MAX_MPDU_LEN_7935 0x00000001
  1164. #define WMI_VHT_CAP_MAX_MPDU_LEN_11454 0x00000002
  1165. #define WMI_VHT_CAP_DEFAULT_ALL (WMI_VHT_CAP_MAX_MPDU_LEN_11454 | \
  1166. WMI_VHT_CAP_RX_LDPC | \
  1167. WMI_VHT_CAP_SGI_80MHZ | \
  1168. WMI_VHT_CAP_TX_STBC | \
  1169. WMI_VHT_CAP_RX_STBC_MASK | \
  1170. WMI_VHT_CAP_MAX_AMPDU_LEN_EXP | \
  1171. WMI_VHT_CAP_RX_FIXED_ANT | \
  1172. WMI_VHT_CAP_TX_FIXED_ANT)
  1173. /*
  1174. * Interested readers refer to Rx/Tx MCS Map definition as defined in
  1175. * 802.11ac
  1176. */
  1177. #define WMI_VHT_MAX_MCS_4_SS_MASK(r, ss) ((3 & (r)) << (((ss) - 1) << 1))
  1178. #define WMI_VHT_MAX_SUPP_RATE_MASK 0x1fff0000
  1179. #define WMI_VHT_MAX_SUPP_RATE_MASK_SHIFT 16
  1180. enum {
  1181. REGDMN_MODE_11A = 0x00001, /* 11a channels */
  1182. REGDMN_MODE_TURBO = 0x00002, /* 11a turbo-only channels */
  1183. REGDMN_MODE_11B = 0x00004, /* 11b channels */
  1184. REGDMN_MODE_PUREG = 0x00008, /* 11g channels (OFDM only) */
  1185. REGDMN_MODE_11G = 0x00008, /* XXX historical */
  1186. REGDMN_MODE_108G = 0x00020, /* 11a+Turbo channels */
  1187. REGDMN_MODE_108A = 0x00040, /* 11g+Turbo channels */
  1188. REGDMN_MODE_XR = 0x00100, /* XR channels */
  1189. REGDMN_MODE_11A_HALF_RATE = 0x00200, /* 11A half rate channels */
  1190. REGDMN_MODE_11A_QUARTER_RATE = 0x00400, /* 11A quarter rate channels */
  1191. REGDMN_MODE_11NG_HT20 = 0x00800, /* 11N-G HT20 channels */
  1192. REGDMN_MODE_11NA_HT20 = 0x01000, /* 11N-A HT20 channels */
  1193. REGDMN_MODE_11NG_HT40PLUS = 0x02000, /* 11N-G HT40 + channels */
  1194. REGDMN_MODE_11NG_HT40MINUS = 0x04000, /* 11N-G HT40 - channels */
  1195. REGDMN_MODE_11NA_HT40PLUS = 0x08000, /* 11N-A HT40 + channels */
  1196. REGDMN_MODE_11NA_HT40MINUS = 0x10000, /* 11N-A HT40 - channels */
  1197. REGDMN_MODE_11AC_VHT20 = 0x20000, /* 5Ghz, VHT20 */
  1198. REGDMN_MODE_11AC_VHT40PLUS = 0x40000, /* 5Ghz, VHT40 + channels */
  1199. REGDMN_MODE_11AC_VHT40MINUS = 0x80000, /* 5Ghz VHT40 - channels */
  1200. REGDMN_MODE_11AC_VHT80 = 0x100000, /* 5Ghz, VHT80 channels */
  1201. REGDMN_MODE_ALL = 0xffffffff
  1202. };
  1203. #define REGDMN_CAP1_CHAN_HALF_RATE 0x00000001
  1204. #define REGDMN_CAP1_CHAN_QUARTER_RATE 0x00000002
  1205. #define REGDMN_CAP1_CHAN_HAL49GHZ 0x00000004
  1206. /* regulatory capabilities */
  1207. #define REGDMN_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040
  1208. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080
  1209. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U2 0x0100
  1210. #define REGDMN_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200
  1211. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400
  1212. #define REGDMN_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800
  1213. struct hal_reg_capabilities {
  1214. /* regdomain value specified in EEPROM */
  1215. __le32 eeprom_rd;
  1216. /*regdomain */
  1217. __le32 eeprom_rd_ext;
  1218. /* CAP1 capabilities bit map. */
  1219. __le32 regcap1;
  1220. /* REGDMN EEPROM CAP. */
  1221. __le32 regcap2;
  1222. /* REGDMN MODE */
  1223. __le32 wireless_modes;
  1224. __le32 low_2ghz_chan;
  1225. __le32 high_2ghz_chan;
  1226. __le32 low_5ghz_chan;
  1227. __le32 high_5ghz_chan;
  1228. } __packed;
  1229. enum wlan_mode_capability {
  1230. WHAL_WLAN_11A_CAPABILITY = 0x1,
  1231. WHAL_WLAN_11G_CAPABILITY = 0x2,
  1232. WHAL_WLAN_11AG_CAPABILITY = 0x3,
  1233. };
  1234. /* structure used by FW for requesting host memory */
  1235. struct wlan_host_mem_req {
  1236. /* ID of the request */
  1237. __le32 req_id;
  1238. /* size of the of each unit */
  1239. __le32 unit_size;
  1240. /* flags to indicate that
  1241. * the number units is dependent
  1242. * on number of resources(num vdevs num peers .. etc)
  1243. */
  1244. __le32 num_unit_info;
  1245. /*
  1246. * actual number of units to allocate . if flags in the num_unit_info
  1247. * indicate that number of units is tied to number of a particular
  1248. * resource to allocate then num_units filed is set to 0 and host
  1249. * will derive the number units from number of the resources it is
  1250. * requesting.
  1251. */
  1252. __le32 num_units;
  1253. } __packed;
  1254. /*
  1255. * The following struct holds optional payload for
  1256. * wmi_service_ready_event,e.g., 11ac pass some of the
  1257. * device capability to the host.
  1258. */
  1259. struct wmi_service_ready_event {
  1260. __le32 sw_version;
  1261. __le32 sw_version_1;
  1262. __le32 abi_version;
  1263. /* WMI_PHY_CAPABILITY */
  1264. __le32 phy_capability;
  1265. /* Maximum number of frag table entries that SW will populate less 1 */
  1266. __le32 max_frag_entry;
  1267. __le32 wmi_service_bitmap[16];
  1268. __le32 num_rf_chains;
  1269. /*
  1270. * The following field is only valid for service type
  1271. * WMI_SERVICE_11AC
  1272. */
  1273. __le32 ht_cap_info; /* WMI HT Capability */
  1274. __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
  1275. __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
  1276. __le32 hw_min_tx_power;
  1277. __le32 hw_max_tx_power;
  1278. struct hal_reg_capabilities hal_reg_capabilities;
  1279. __le32 sys_cap_info;
  1280. __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
  1281. /*
  1282. * Max beacon and Probe Response IE offload size
  1283. * (includes optional P2P IEs)
  1284. */
  1285. __le32 max_bcn_ie_size;
  1286. /*
  1287. * request to host to allocate a chuck of memory and pss it down to FW
  1288. * via WM_INIT. FW uses this as FW extesnsion memory for saving its
  1289. * data structures. Only valid for low latency interfaces like PCIE
  1290. * where FW can access this memory directly (or) by DMA.
  1291. */
  1292. __le32 num_mem_reqs;
  1293. struct wlan_host_mem_req mem_reqs[1];
  1294. } __packed;
  1295. /* This is the definition from 10.X firmware branch */
  1296. struct wmi_service_ready_event_10x {
  1297. __le32 sw_version;
  1298. __le32 abi_version;
  1299. /* WMI_PHY_CAPABILITY */
  1300. __le32 phy_capability;
  1301. /* Maximum number of frag table entries that SW will populate less 1 */
  1302. __le32 max_frag_entry;
  1303. __le32 wmi_service_bitmap[16];
  1304. __le32 num_rf_chains;
  1305. /*
  1306. * The following field is only valid for service type
  1307. * WMI_SERVICE_11AC
  1308. */
  1309. __le32 ht_cap_info; /* WMI HT Capability */
  1310. __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
  1311. __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
  1312. __le32 hw_min_tx_power;
  1313. __le32 hw_max_tx_power;
  1314. struct hal_reg_capabilities hal_reg_capabilities;
  1315. __le32 sys_cap_info;
  1316. __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
  1317. /*
  1318. * request to host to allocate a chuck of memory and pss it down to FW
  1319. * via WM_INIT. FW uses this as FW extesnsion memory for saving its
  1320. * data structures. Only valid for low latency interfaces like PCIE
  1321. * where FW can access this memory directly (or) by DMA.
  1322. */
  1323. __le32 num_mem_reqs;
  1324. struct wlan_host_mem_req mem_reqs[1];
  1325. } __packed;
  1326. #define WMI_SERVICE_READY_TIMEOUT_HZ (5*HZ)
  1327. #define WMI_UNIFIED_READY_TIMEOUT_HZ (5*HZ)
  1328. struct wmi_ready_event {
  1329. __le32 sw_version;
  1330. __le32 abi_version;
  1331. struct wmi_mac_addr mac_addr;
  1332. __le32 status;
  1333. } __packed;
  1334. struct wmi_resource_config {
  1335. /* number of virtual devices (VAPs) to support */
  1336. __le32 num_vdevs;
  1337. /* number of peer nodes to support */
  1338. __le32 num_peers;
  1339. /*
  1340. * In offload mode target supports features like WOW, chatter and
  1341. * other protocol offloads. In order to support them some
  1342. * functionalities like reorder buffering, PN checking need to be
  1343. * done in target. This determines maximum number of peers suported
  1344. * by target in offload mode
  1345. */
  1346. __le32 num_offload_peers;
  1347. /* For target-based RX reordering */
  1348. __le32 num_offload_reorder_bufs;
  1349. /* number of keys per peer */
  1350. __le32 num_peer_keys;
  1351. /* total number of TX/RX data TIDs */
  1352. __le32 num_tids;
  1353. /*
  1354. * max skid for resolving hash collisions
  1355. *
  1356. * The address search table is sparse, so that if two MAC addresses
  1357. * result in the same hash value, the second of these conflicting
  1358. * entries can slide to the next index in the address search table,
  1359. * and use it, if it is unoccupied. This ast_skid_limit parameter
  1360. * specifies the upper bound on how many subsequent indices to search
  1361. * over to find an unoccupied space.
  1362. */
  1363. __le32 ast_skid_limit;
  1364. /*
  1365. * the nominal chain mask for transmit
  1366. *
  1367. * The chain mask may be modified dynamically, e.g. to operate AP
  1368. * tx with a reduced number of chains if no clients are associated.
  1369. * This configuration parameter specifies the nominal chain-mask that
  1370. * should be used when not operating with a reduced set of tx chains.
  1371. */
  1372. __le32 tx_chain_mask;
  1373. /*
  1374. * the nominal chain mask for receive
  1375. *
  1376. * The chain mask may be modified dynamically, e.g. for a client
  1377. * to use a reduced number of chains for receive if the traffic to
  1378. * the client is low enough that it doesn't require downlink MIMO
  1379. * or antenna diversity.
  1380. * This configuration parameter specifies the nominal chain-mask that
  1381. * should be used when not operating with a reduced set of rx chains.
  1382. */
  1383. __le32 rx_chain_mask;
  1384. /*
  1385. * what rx reorder timeout (ms) to use for the AC
  1386. *
  1387. * Each WMM access class (voice, video, best-effort, background) will
  1388. * have its own timeout value to dictate how long to wait for missing
  1389. * rx MPDUs to arrive before flushing subsequent MPDUs that have
  1390. * already been received.
  1391. * This parameter specifies the timeout in milliseconds for each
  1392. * class.
  1393. */
  1394. __le32 rx_timeout_pri_vi;
  1395. __le32 rx_timeout_pri_vo;
  1396. __le32 rx_timeout_pri_be;
  1397. __le32 rx_timeout_pri_bk;
  1398. /*
  1399. * what mode the rx should decap packets to
  1400. *
  1401. * MAC can decap to RAW (no decap), native wifi or Ethernet types
  1402. * THis setting also determines the default TX behavior, however TX
  1403. * behavior can be modified on a per VAP basis during VAP init
  1404. */
  1405. __le32 rx_decap_mode;
  1406. /* what is the maximum number of scan requests that can be queued */
  1407. __le32 scan_max_pending_reqs;
  1408. /* maximum VDEV that could use BMISS offload */
  1409. __le32 bmiss_offload_max_vdev;
  1410. /* maximum VDEV that could use offload roaming */
  1411. __le32 roam_offload_max_vdev;
  1412. /* maximum AP profiles that would push to offload roaming */
  1413. __le32 roam_offload_max_ap_profiles;
  1414. /*
  1415. * how many groups to use for mcast->ucast conversion
  1416. *
  1417. * The target's WAL maintains a table to hold information regarding
  1418. * which peers belong to a given multicast group, so that if
  1419. * multicast->unicast conversion is enabled, the target can convert
  1420. * multicast tx frames to a series of unicast tx frames, to each
  1421. * peer within the multicast group.
  1422. This num_mcast_groups configuration parameter tells the target how
  1423. * many multicast groups to provide storage for within its multicast
  1424. * group membership table.
  1425. */
  1426. __le32 num_mcast_groups;
  1427. /*
  1428. * size to alloc for the mcast membership table
  1429. *
  1430. * This num_mcast_table_elems configuration parameter tells the
  1431. * target how many peer elements it needs to provide storage for in
  1432. * its multicast group membership table.
  1433. * These multicast group membership table elements are shared by the
  1434. * multicast groups stored within the table.
  1435. */
  1436. __le32 num_mcast_table_elems;
  1437. /*
  1438. * whether/how to do multicast->unicast conversion
  1439. *
  1440. * This configuration parameter specifies whether the target should
  1441. * perform multicast --> unicast conversion on transmit, and if so,
  1442. * what to do if it finds no entries in its multicast group
  1443. * membership table for the multicast IP address in the tx frame.
  1444. * Configuration value:
  1445. * 0 -> Do not perform multicast to unicast conversion.
  1446. * 1 -> Convert multicast frames to unicast, if the IP multicast
  1447. * address from the tx frame is found in the multicast group
  1448. * membership table. If the IP multicast address is not found,
  1449. * drop the frame.
  1450. * 2 -> Convert multicast frames to unicast, if the IP multicast
  1451. * address from the tx frame is found in the multicast group
  1452. * membership table. If the IP multicast address is not found,
  1453. * transmit the frame as multicast.
  1454. */
  1455. __le32 mcast2ucast_mode;
  1456. /*
  1457. * how much memory to allocate for a tx PPDU dbg log
  1458. *
  1459. * This parameter controls how much memory the target will allocate
  1460. * to store a log of tx PPDU meta-information (how large the PPDU
  1461. * was, when it was sent, whether it was successful, etc.)
  1462. */
  1463. __le32 tx_dbg_log_size;
  1464. /* how many AST entries to be allocated for WDS */
  1465. __le32 num_wds_entries;
  1466. /*
  1467. * MAC DMA burst size, e.g., For target PCI limit can be
  1468. * 0 -default, 1 256B
  1469. */
  1470. __le32 dma_burst_size;
  1471. /*
  1472. * Fixed delimiters to be inserted after every MPDU to
  1473. * account for interface latency to avoid underrun.
  1474. */
  1475. __le32 mac_aggr_delim;
  1476. /*
  1477. * determine whether target is responsible for detecting duplicate
  1478. * non-aggregate MPDU and timing out stale fragments.
  1479. *
  1480. * A-MPDU reordering is always performed on the target.
  1481. *
  1482. * 0: target responsible for frag timeout and dup checking
  1483. * 1: host responsible for frag timeout and dup checking
  1484. */
  1485. __le32 rx_skip_defrag_timeout_dup_detection_check;
  1486. /*
  1487. * Configuration for VoW :
  1488. * No of Video Nodes to be supported
  1489. * and Max no of descriptors for each Video link (node).
  1490. */
  1491. __le32 vow_config;
  1492. /* maximum VDEV that could use GTK offload */
  1493. __le32 gtk_offload_max_vdev;
  1494. /* Number of msdu descriptors target should use */
  1495. __le32 num_msdu_desc;
  1496. /*
  1497. * Max. number of Tx fragments per MSDU
  1498. * This parameter controls the max number of Tx fragments per MSDU.
  1499. * This is sent by the target as part of the WMI_SERVICE_READY event
  1500. * and is overriden by the OS shim as required.
  1501. */
  1502. __le32 max_frag_entries;
  1503. } __packed;
  1504. struct wmi_resource_config_10x {
  1505. /* number of virtual devices (VAPs) to support */
  1506. __le32 num_vdevs;
  1507. /* number of peer nodes to support */
  1508. __le32 num_peers;
  1509. /* number of keys per peer */
  1510. __le32 num_peer_keys;
  1511. /* total number of TX/RX data TIDs */
  1512. __le32 num_tids;
  1513. /*
  1514. * max skid for resolving hash collisions
  1515. *
  1516. * The address search table is sparse, so that if two MAC addresses
  1517. * result in the same hash value, the second of these conflicting
  1518. * entries can slide to the next index in the address search table,
  1519. * and use it, if it is unoccupied. This ast_skid_limit parameter
  1520. * specifies the upper bound on how many subsequent indices to search
  1521. * over to find an unoccupied space.
  1522. */
  1523. __le32 ast_skid_limit;
  1524. /*
  1525. * the nominal chain mask for transmit
  1526. *
  1527. * The chain mask may be modified dynamically, e.g. to operate AP
  1528. * tx with a reduced number of chains if no clients are associated.
  1529. * This configuration parameter specifies the nominal chain-mask that
  1530. * should be used when not operating with a reduced set of tx chains.
  1531. */
  1532. __le32 tx_chain_mask;
  1533. /*
  1534. * the nominal chain mask for receive
  1535. *
  1536. * The chain mask may be modified dynamically, e.g. for a client
  1537. * to use a reduced number of chains for receive if the traffic to
  1538. * the client is low enough that it doesn't require downlink MIMO
  1539. * or antenna diversity.
  1540. * This configuration parameter specifies the nominal chain-mask that
  1541. * should be used when not operating with a reduced set of rx chains.
  1542. */
  1543. __le32 rx_chain_mask;
  1544. /*
  1545. * what rx reorder timeout (ms) to use for the AC
  1546. *
  1547. * Each WMM access class (voice, video, best-effort, background) will
  1548. * have its own timeout value to dictate how long to wait for missing
  1549. * rx MPDUs to arrive before flushing subsequent MPDUs that have
  1550. * already been received.
  1551. * This parameter specifies the timeout in milliseconds for each
  1552. * class.
  1553. */
  1554. __le32 rx_timeout_pri_vi;
  1555. __le32 rx_timeout_pri_vo;
  1556. __le32 rx_timeout_pri_be;
  1557. __le32 rx_timeout_pri_bk;
  1558. /*
  1559. * what mode the rx should decap packets to
  1560. *
  1561. * MAC can decap to RAW (no decap), native wifi or Ethernet types
  1562. * THis setting also determines the default TX behavior, however TX
  1563. * behavior can be modified on a per VAP basis during VAP init
  1564. */
  1565. __le32 rx_decap_mode;
  1566. /* what is the maximum number of scan requests that can be queued */
  1567. __le32 scan_max_pending_reqs;
  1568. /* maximum VDEV that could use BMISS offload */
  1569. __le32 bmiss_offload_max_vdev;
  1570. /* maximum VDEV that could use offload roaming */
  1571. __le32 roam_offload_max_vdev;
  1572. /* maximum AP profiles that would push to offload roaming */
  1573. __le32 roam_offload_max_ap_profiles;
  1574. /*
  1575. * how many groups to use for mcast->ucast conversion
  1576. *
  1577. * The target's WAL maintains a table to hold information regarding
  1578. * which peers belong to a given multicast group, so that if
  1579. * multicast->unicast conversion is enabled, the target can convert
  1580. * multicast tx frames to a series of unicast tx frames, to each
  1581. * peer within the multicast group.
  1582. This num_mcast_groups configuration parameter tells the target how
  1583. * many multicast groups to provide storage for within its multicast
  1584. * group membership table.
  1585. */
  1586. __le32 num_mcast_groups;
  1587. /*
  1588. * size to alloc for the mcast membership table
  1589. *
  1590. * This num_mcast_table_elems configuration parameter tells the
  1591. * target how many peer elements it needs to provide storage for in
  1592. * its multicast group membership table.
  1593. * These multicast group membership table elements are shared by the
  1594. * multicast groups stored within the table.
  1595. */
  1596. __le32 num_mcast_table_elems;
  1597. /*
  1598. * whether/how to do multicast->unicast conversion
  1599. *
  1600. * This configuration parameter specifies whether the target should
  1601. * perform multicast --> unicast conversion on transmit, and if so,
  1602. * what to do if it finds no entries in its multicast group
  1603. * membership table for the multicast IP address in the tx frame.
  1604. * Configuration value:
  1605. * 0 -> Do not perform multicast to unicast conversion.
  1606. * 1 -> Convert multicast frames to unicast, if the IP multicast
  1607. * address from the tx frame is found in the multicast group
  1608. * membership table. If the IP multicast address is not found,
  1609. * drop the frame.
  1610. * 2 -> Convert multicast frames to unicast, if the IP multicast
  1611. * address from the tx frame is found in the multicast group
  1612. * membership table. If the IP multicast address is not found,
  1613. * transmit the frame as multicast.
  1614. */
  1615. __le32 mcast2ucast_mode;
  1616. /*
  1617. * how much memory to allocate for a tx PPDU dbg log
  1618. *
  1619. * This parameter controls how much memory the target will allocate
  1620. * to store a log of tx PPDU meta-information (how large the PPDU
  1621. * was, when it was sent, whether it was successful, etc.)
  1622. */
  1623. __le32 tx_dbg_log_size;
  1624. /* how many AST entries to be allocated for WDS */
  1625. __le32 num_wds_entries;
  1626. /*
  1627. * MAC DMA burst size, e.g., For target PCI limit can be
  1628. * 0 -default, 1 256B
  1629. */
  1630. __le32 dma_burst_size;
  1631. /*
  1632. * Fixed delimiters to be inserted after every MPDU to
  1633. * account for interface latency to avoid underrun.
  1634. */
  1635. __le32 mac_aggr_delim;
  1636. /*
  1637. * determine whether target is responsible for detecting duplicate
  1638. * non-aggregate MPDU and timing out stale fragments.
  1639. *
  1640. * A-MPDU reordering is always performed on the target.
  1641. *
  1642. * 0: target responsible for frag timeout and dup checking
  1643. * 1: host responsible for frag timeout and dup checking
  1644. */
  1645. __le32 rx_skip_defrag_timeout_dup_detection_check;
  1646. /*
  1647. * Configuration for VoW :
  1648. * No of Video Nodes to be supported
  1649. * and Max no of descriptors for each Video link (node).
  1650. */
  1651. __le32 vow_config;
  1652. /* Number of msdu descriptors target should use */
  1653. __le32 num_msdu_desc;
  1654. /*
  1655. * Max. number of Tx fragments per MSDU
  1656. * This parameter controls the max number of Tx fragments per MSDU.
  1657. * This is sent by the target as part of the WMI_SERVICE_READY event
  1658. * and is overriden by the OS shim as required.
  1659. */
  1660. __le32 max_frag_entries;
  1661. } __packed;
  1662. struct wmi_resource_config_10_2 {
  1663. struct wmi_resource_config_10x common;
  1664. __le32 max_peer_ext_stats;
  1665. __le32 smart_ant_cap; /* 0-disable, 1-enable */
  1666. __le32 bk_min_free;
  1667. __le32 be_min_free;
  1668. __le32 vi_min_free;
  1669. __le32 vo_min_free;
  1670. __le32 rx_batchmode; /* 0-disable, 1-enable */
  1671. } __packed;
  1672. #define NUM_UNITS_IS_NUM_VDEVS 0x1
  1673. #define NUM_UNITS_IS_NUM_PEERS 0x2
  1674. /* strucutre describing host memory chunk. */
  1675. struct host_memory_chunk {
  1676. /* id of the request that is passed up in service ready */
  1677. __le32 req_id;
  1678. /* the physical address the memory chunk */
  1679. __le32 ptr;
  1680. /* size of the chunk */
  1681. __le32 size;
  1682. } __packed;
  1683. struct wmi_init_cmd {
  1684. struct wmi_resource_config resource_config;
  1685. __le32 num_host_mem_chunks;
  1686. /*
  1687. * variable number of host memory chunks.
  1688. * This should be the last element in the structure
  1689. */
  1690. struct host_memory_chunk host_mem_chunks[1];
  1691. } __packed;
  1692. /* _10x stucture is from 10.X FW API */
  1693. struct wmi_init_cmd_10x {
  1694. struct wmi_resource_config_10x resource_config;
  1695. __le32 num_host_mem_chunks;
  1696. /*
  1697. * variable number of host memory chunks.
  1698. * This should be the last element in the structure
  1699. */
  1700. struct host_memory_chunk host_mem_chunks[1];
  1701. } __packed;
  1702. struct wmi_init_cmd_10_2 {
  1703. struct wmi_resource_config_10_2 resource_config;
  1704. __le32 num_host_mem_chunks;
  1705. /*
  1706. * variable number of host memory chunks.
  1707. * This should be the last element in the structure
  1708. */
  1709. struct host_memory_chunk host_mem_chunks[1];
  1710. } __packed;
  1711. struct wmi_chan_list_entry {
  1712. __le16 freq;
  1713. u8 phy_mode; /* valid for 10.2 only */
  1714. u8 reserved;
  1715. } __packed;
  1716. /* TLV for channel list */
  1717. struct wmi_chan_list {
  1718. __le32 tag; /* WMI_CHAN_LIST_TAG */
  1719. __le32 num_chan;
  1720. struct wmi_chan_list_entry channel_list[0];
  1721. } __packed;
  1722. struct wmi_bssid_list {
  1723. __le32 tag; /* WMI_BSSID_LIST_TAG */
  1724. __le32 num_bssid;
  1725. struct wmi_mac_addr bssid_list[0];
  1726. } __packed;
  1727. struct wmi_ie_data {
  1728. __le32 tag; /* WMI_IE_TAG */
  1729. __le32 ie_len;
  1730. u8 ie_data[0];
  1731. } __packed;
  1732. struct wmi_ssid {
  1733. __le32 ssid_len;
  1734. u8 ssid[32];
  1735. } __packed;
  1736. struct wmi_ssid_list {
  1737. __le32 tag; /* WMI_SSID_LIST_TAG */
  1738. __le32 num_ssids;
  1739. struct wmi_ssid ssids[0];
  1740. } __packed;
  1741. /* prefix used by scan requestor ids on the host */
  1742. #define WMI_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
  1743. /* prefix used by scan request ids generated on the host */
  1744. /* host cycles through the lower 12 bits to generate ids */
  1745. #define WMI_HOST_SCAN_REQ_ID_PREFIX 0xA000
  1746. #define WLAN_SCAN_PARAMS_MAX_SSID 16
  1747. #define WLAN_SCAN_PARAMS_MAX_BSSID 4
  1748. #define WLAN_SCAN_PARAMS_MAX_IE_LEN 256
  1749. /* Scan priority numbers must be sequential, starting with 0 */
  1750. enum wmi_scan_priority {
  1751. WMI_SCAN_PRIORITY_VERY_LOW = 0,
  1752. WMI_SCAN_PRIORITY_LOW,
  1753. WMI_SCAN_PRIORITY_MEDIUM,
  1754. WMI_SCAN_PRIORITY_HIGH,
  1755. WMI_SCAN_PRIORITY_VERY_HIGH,
  1756. WMI_SCAN_PRIORITY_COUNT /* number of priorities supported */
  1757. };
  1758. struct wmi_start_scan_cmd {
  1759. /* Scan ID */
  1760. __le32 scan_id;
  1761. /* Scan requestor ID */
  1762. __le32 scan_req_id;
  1763. /* VDEV id(interface) that is requesting scan */
  1764. __le32 vdev_id;
  1765. /* Scan Priority, input to scan scheduler */
  1766. __le32 scan_priority;
  1767. /* Scan events subscription */
  1768. __le32 notify_scan_events;
  1769. /* dwell time in msec on active channels */
  1770. __le32 dwell_time_active;
  1771. /* dwell time in msec on passive channels */
  1772. __le32 dwell_time_passive;
  1773. /*
  1774. * min time in msec on the BSS channel,only valid if atleast one
  1775. * VDEV is active
  1776. */
  1777. __le32 min_rest_time;
  1778. /*
  1779. * max rest time in msec on the BSS channel,only valid if at least
  1780. * one VDEV is active
  1781. */
  1782. /*
  1783. * the scanner will rest on the bss channel at least min_rest_time
  1784. * after min_rest_time the scanner will start checking for tx/rx
  1785. * activity on all VDEVs. if there is no activity the scanner will
  1786. * switch to off channel. if there is activity the scanner will let
  1787. * the radio on the bss channel until max_rest_time expires.at
  1788. * max_rest_time scanner will switch to off channel irrespective of
  1789. * activity. activity is determined by the idle_time parameter.
  1790. */
  1791. __le32 max_rest_time;
  1792. /*
  1793. * time before sending next set of probe requests.
  1794. * The scanner keeps repeating probe requests transmission with
  1795. * period specified by repeat_probe_time.
  1796. * The number of probe requests specified depends on the ssid_list
  1797. * and bssid_list
  1798. */
  1799. __le32 repeat_probe_time;
  1800. /* time in msec between 2 consequetive probe requests with in a set. */
  1801. __le32 probe_spacing_time;
  1802. /*
  1803. * data inactivity time in msec on bss channel that will be used by
  1804. * scanner for measuring the inactivity.
  1805. */
  1806. __le32 idle_time;
  1807. /* maximum time in msec allowed for scan */
  1808. __le32 max_scan_time;
  1809. /*
  1810. * delay in msec before sending first probe request after switching
  1811. * to a channel
  1812. */
  1813. __le32 probe_delay;
  1814. /* Scan control flags */
  1815. __le32 scan_ctrl_flags;
  1816. /* Burst duration time in msecs */
  1817. __le32 burst_duration;
  1818. /*
  1819. * TLV (tag length value ) paramerters follow the scan_cmd structure.
  1820. * TLV can contain channel list, bssid list, ssid list and
  1821. * ie. the TLV tags are defined above;
  1822. */
  1823. } __packed;
  1824. /* This is the definition from 10.X firmware branch */
  1825. struct wmi_start_scan_cmd_10x {
  1826. /* Scan ID */
  1827. __le32 scan_id;
  1828. /* Scan requestor ID */
  1829. __le32 scan_req_id;
  1830. /* VDEV id(interface) that is requesting scan */
  1831. __le32 vdev_id;
  1832. /* Scan Priority, input to scan scheduler */
  1833. __le32 scan_priority;
  1834. /* Scan events subscription */
  1835. __le32 notify_scan_events;
  1836. /* dwell time in msec on active channels */
  1837. __le32 dwell_time_active;
  1838. /* dwell time in msec on passive channels */
  1839. __le32 dwell_time_passive;
  1840. /*
  1841. * min time in msec on the BSS channel,only valid if atleast one
  1842. * VDEV is active
  1843. */
  1844. __le32 min_rest_time;
  1845. /*
  1846. * max rest time in msec on the BSS channel,only valid if at least
  1847. * one VDEV is active
  1848. */
  1849. /*
  1850. * the scanner will rest on the bss channel at least min_rest_time
  1851. * after min_rest_time the scanner will start checking for tx/rx
  1852. * activity on all VDEVs. if there is no activity the scanner will
  1853. * switch to off channel. if there is activity the scanner will let
  1854. * the radio on the bss channel until max_rest_time expires.at
  1855. * max_rest_time scanner will switch to off channel irrespective of
  1856. * activity. activity is determined by the idle_time parameter.
  1857. */
  1858. __le32 max_rest_time;
  1859. /*
  1860. * time before sending next set of probe requests.
  1861. * The scanner keeps repeating probe requests transmission with
  1862. * period specified by repeat_probe_time.
  1863. * The number of probe requests specified depends on the ssid_list
  1864. * and bssid_list
  1865. */
  1866. __le32 repeat_probe_time;
  1867. /* time in msec between 2 consequetive probe requests with in a set. */
  1868. __le32 probe_spacing_time;
  1869. /*
  1870. * data inactivity time in msec on bss channel that will be used by
  1871. * scanner for measuring the inactivity.
  1872. */
  1873. __le32 idle_time;
  1874. /* maximum time in msec allowed for scan */
  1875. __le32 max_scan_time;
  1876. /*
  1877. * delay in msec before sending first probe request after switching
  1878. * to a channel
  1879. */
  1880. __le32 probe_delay;
  1881. /* Scan control flags */
  1882. __le32 scan_ctrl_flags;
  1883. /*
  1884. * TLV (tag length value ) paramerters follow the scan_cmd structure.
  1885. * TLV can contain channel list, bssid list, ssid list and
  1886. * ie. the TLV tags are defined above;
  1887. */
  1888. } __packed;
  1889. struct wmi_ssid_arg {
  1890. int len;
  1891. const u8 *ssid;
  1892. };
  1893. struct wmi_bssid_arg {
  1894. const u8 *bssid;
  1895. };
  1896. struct wmi_start_scan_arg {
  1897. u32 scan_id;
  1898. u32 scan_req_id;
  1899. u32 vdev_id;
  1900. u32 scan_priority;
  1901. u32 notify_scan_events;
  1902. u32 dwell_time_active;
  1903. u32 dwell_time_passive;
  1904. u32 min_rest_time;
  1905. u32 max_rest_time;
  1906. u32 repeat_probe_time;
  1907. u32 probe_spacing_time;
  1908. u32 idle_time;
  1909. u32 max_scan_time;
  1910. u32 probe_delay;
  1911. u32 scan_ctrl_flags;
  1912. u32 ie_len;
  1913. u32 n_channels;
  1914. u32 n_ssids;
  1915. u32 n_bssids;
  1916. u8 ie[WLAN_SCAN_PARAMS_MAX_IE_LEN];
  1917. u16 channels[64];
  1918. struct wmi_ssid_arg ssids[WLAN_SCAN_PARAMS_MAX_SSID];
  1919. struct wmi_bssid_arg bssids[WLAN_SCAN_PARAMS_MAX_BSSID];
  1920. };
  1921. /* scan control flags */
  1922. /* passively scan all channels including active channels */
  1923. #define WMI_SCAN_FLAG_PASSIVE 0x1
  1924. /* add wild card ssid probe request even though ssid_list is specified. */
  1925. #define WMI_SCAN_ADD_BCAST_PROBE_REQ 0x2
  1926. /* add cck rates to rates/xrate ie for the generated probe request */
  1927. #define WMI_SCAN_ADD_CCK_RATES 0x4
  1928. /* add ofdm rates to rates/xrate ie for the generated probe request */
  1929. #define WMI_SCAN_ADD_OFDM_RATES 0x8
  1930. /* To enable indication of Chan load and Noise floor to host */
  1931. #define WMI_SCAN_CHAN_STAT_EVENT 0x10
  1932. /* Filter Probe request frames */
  1933. #define WMI_SCAN_FILTER_PROBE_REQ 0x20
  1934. /* When set, DFS channels will not be scanned */
  1935. #define WMI_SCAN_BYPASS_DFS_CHN 0x40
  1936. /* Different FW scan engine may choose to bail out on errors.
  1937. * Allow the driver to have influence over that. */
  1938. #define WMI_SCAN_CONTINUE_ON_ERROR 0x80
  1939. /* WMI_SCAN_CLASS_MASK must be the same value as IEEE80211_SCAN_CLASS_MASK */
  1940. #define WMI_SCAN_CLASS_MASK 0xFF000000
  1941. enum wmi_stop_scan_type {
  1942. WMI_SCAN_STOP_ONE = 0x00000000, /* stop by scan_id */
  1943. WMI_SCAN_STOP_VDEV_ALL = 0x01000000, /* stop by vdev_id */
  1944. WMI_SCAN_STOP_ALL = 0x04000000, /* stop all scans */
  1945. };
  1946. struct wmi_stop_scan_cmd {
  1947. __le32 scan_req_id;
  1948. __le32 scan_id;
  1949. __le32 req_type;
  1950. __le32 vdev_id;
  1951. } __packed;
  1952. struct wmi_stop_scan_arg {
  1953. u32 req_id;
  1954. enum wmi_stop_scan_type req_type;
  1955. union {
  1956. u32 scan_id;
  1957. u32 vdev_id;
  1958. } u;
  1959. };
  1960. struct wmi_scan_chan_list_cmd {
  1961. __le32 num_scan_chans;
  1962. struct wmi_channel chan_info[0];
  1963. } __packed;
  1964. struct wmi_scan_chan_list_arg {
  1965. u32 n_channels;
  1966. struct wmi_channel_arg *channels;
  1967. };
  1968. enum wmi_bss_filter {
  1969. WMI_BSS_FILTER_NONE = 0, /* no beacons forwarded */
  1970. WMI_BSS_FILTER_ALL, /* all beacons forwarded */
  1971. WMI_BSS_FILTER_PROFILE, /* only beacons matching profile */
  1972. WMI_BSS_FILTER_ALL_BUT_PROFILE, /* all but beacons matching profile */
  1973. WMI_BSS_FILTER_CURRENT_BSS, /* only beacons matching current BSS */
  1974. WMI_BSS_FILTER_ALL_BUT_BSS, /* all but beacons matching BSS */
  1975. WMI_BSS_FILTER_PROBED_SSID, /* beacons matching probed ssid */
  1976. WMI_BSS_FILTER_LAST_BSS, /* marker only */
  1977. };
  1978. enum wmi_scan_event_type {
  1979. WMI_SCAN_EVENT_STARTED = 0x1,
  1980. WMI_SCAN_EVENT_COMPLETED = 0x2,
  1981. WMI_SCAN_EVENT_BSS_CHANNEL = 0x4,
  1982. WMI_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
  1983. WMI_SCAN_EVENT_DEQUEUED = 0x10,
  1984. WMI_SCAN_EVENT_PREEMPTED = 0x20, /* possibly by high-prio scan */
  1985. WMI_SCAN_EVENT_START_FAILED = 0x40,
  1986. WMI_SCAN_EVENT_RESTARTED = 0x80,
  1987. WMI_SCAN_EVENT_MAX = 0x8000
  1988. };
  1989. enum wmi_scan_completion_reason {
  1990. WMI_SCAN_REASON_COMPLETED,
  1991. WMI_SCAN_REASON_CANCELLED,
  1992. WMI_SCAN_REASON_PREEMPTED,
  1993. WMI_SCAN_REASON_TIMEDOUT,
  1994. WMI_SCAN_REASON_MAX,
  1995. };
  1996. struct wmi_scan_event {
  1997. __le32 event_type; /* %WMI_SCAN_EVENT_ */
  1998. __le32 reason; /* %WMI_SCAN_REASON_ */
  1999. __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
  2000. __le32 scan_req_id;
  2001. __le32 scan_id;
  2002. __le32 vdev_id;
  2003. } __packed;
  2004. /*
  2005. * This defines how much headroom is kept in the
  2006. * receive frame between the descriptor and the
  2007. * payload, in order for the WMI PHY error and
  2008. * management handler to insert header contents.
  2009. *
  2010. * This is in bytes.
  2011. */
  2012. #define WMI_MGMT_RX_HDR_HEADROOM 52
  2013. /*
  2014. * This event will be used for sending scan results
  2015. * as well as rx mgmt frames to the host. The rx buffer
  2016. * will be sent as part of this WMI event. It would be a
  2017. * good idea to pass all the fields in the RX status
  2018. * descriptor up to the host.
  2019. */
  2020. struct wmi_mgmt_rx_hdr_v1 {
  2021. __le32 channel;
  2022. __le32 snr;
  2023. __le32 rate;
  2024. __le32 phy_mode;
  2025. __le32 buf_len;
  2026. __le32 status; /* %WMI_RX_STATUS_ */
  2027. } __packed;
  2028. struct wmi_mgmt_rx_hdr_v2 {
  2029. struct wmi_mgmt_rx_hdr_v1 v1;
  2030. __le32 rssi_ctl[4];
  2031. } __packed;
  2032. struct wmi_mgmt_rx_event_v1 {
  2033. struct wmi_mgmt_rx_hdr_v1 hdr;
  2034. u8 buf[0];
  2035. } __packed;
  2036. struct wmi_mgmt_rx_event_v2 {
  2037. struct wmi_mgmt_rx_hdr_v2 hdr;
  2038. u8 buf[0];
  2039. } __packed;
  2040. #define WMI_RX_STATUS_OK 0x00
  2041. #define WMI_RX_STATUS_ERR_CRC 0x01
  2042. #define WMI_RX_STATUS_ERR_DECRYPT 0x08
  2043. #define WMI_RX_STATUS_ERR_MIC 0x10
  2044. #define WMI_RX_STATUS_ERR_KEY_CACHE_MISS 0x20
  2045. #define PHY_ERROR_SPECTRAL_SCAN 0x26
  2046. #define PHY_ERROR_FALSE_RADAR_EXT 0x24
  2047. #define PHY_ERROR_RADAR 0x05
  2048. struct wmi_single_phyerr_rx_hdr {
  2049. /* TSF timestamp */
  2050. __le32 tsf_timestamp;
  2051. /*
  2052. * Current freq1, freq2
  2053. *
  2054. * [7:0]: freq1[lo]
  2055. * [15:8] : freq1[hi]
  2056. * [23:16]: freq2[lo]
  2057. * [31:24]: freq2[hi]
  2058. */
  2059. __le16 freq1;
  2060. __le16 freq2;
  2061. /*
  2062. * Combined RSSI over all chains and channel width for this PHY error
  2063. *
  2064. * [7:0]: RSSI combined
  2065. * [15:8]: Channel width (MHz)
  2066. * [23:16]: PHY error code
  2067. * [24:16]: reserved (future use)
  2068. */
  2069. u8 rssi_combined;
  2070. u8 chan_width_mhz;
  2071. u8 phy_err_code;
  2072. u8 rsvd0;
  2073. /*
  2074. * RSSI on chain 0 through 3
  2075. *
  2076. * This is formatted the same as the PPDU_START RX descriptor
  2077. * field:
  2078. *
  2079. * [7:0]: pri20
  2080. * [15:8]: sec20
  2081. * [23:16]: sec40
  2082. * [31:24]: sec80
  2083. */
  2084. __le32 rssi_chain0;
  2085. __le32 rssi_chain1;
  2086. __le32 rssi_chain2;
  2087. __le32 rssi_chain3;
  2088. /*
  2089. * Last calibrated NF value for chain 0 through 3
  2090. *
  2091. * nf_list_1:
  2092. *
  2093. * + [15:0] - chain 0
  2094. * + [31:16] - chain 1
  2095. *
  2096. * nf_list_2:
  2097. *
  2098. * + [15:0] - chain 2
  2099. * + [31:16] - chain 3
  2100. */
  2101. __le32 nf_list_1;
  2102. __le32 nf_list_2;
  2103. /* Length of the frame */
  2104. __le32 buf_len;
  2105. } __packed;
  2106. struct wmi_single_phyerr_rx_event {
  2107. /* Phy error event header */
  2108. struct wmi_single_phyerr_rx_hdr hdr;
  2109. /* frame buffer */
  2110. u8 bufp[0];
  2111. } __packed;
  2112. struct wmi_comb_phyerr_rx_hdr {
  2113. /* Phy error phy error count */
  2114. __le32 num_phyerr_events;
  2115. __le32 tsf_l32;
  2116. __le32 tsf_u32;
  2117. } __packed;
  2118. struct wmi_comb_phyerr_rx_event {
  2119. /* Phy error phy error count */
  2120. struct wmi_comb_phyerr_rx_hdr hdr;
  2121. /*
  2122. * frame buffer - contains multiple payloads in the order:
  2123. * header - payload, header - payload...
  2124. * (The header is of type: wmi_single_phyerr_rx_hdr)
  2125. */
  2126. u8 bufp[0];
  2127. } __packed;
  2128. #define PHYERR_TLV_SIG 0xBB
  2129. #define PHYERR_TLV_TAG_SEARCH_FFT_REPORT 0xFB
  2130. #define PHYERR_TLV_TAG_RADAR_PULSE_SUMMARY 0xF8
  2131. #define PHYERR_TLV_TAG_SPECTRAL_SUMMARY_REPORT 0xF9
  2132. struct phyerr_radar_report {
  2133. __le32 reg0; /* RADAR_REPORT_REG0_* */
  2134. __le32 reg1; /* REDAR_REPORT_REG1_* */
  2135. } __packed;
  2136. #define RADAR_REPORT_REG0_PULSE_IS_CHIRP_MASK 0x80000000
  2137. #define RADAR_REPORT_REG0_PULSE_IS_CHIRP_LSB 31
  2138. #define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_MASK 0x40000000
  2139. #define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_LSB 30
  2140. #define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_MASK 0x3FF00000
  2141. #define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_LSB 20
  2142. #define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_MASK 0x000F0000
  2143. #define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_LSB 16
  2144. #define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_MASK 0x0000FC00
  2145. #define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_LSB 10
  2146. #define RADAR_REPORT_REG0_PULSE_SIDX_MASK 0x000003FF
  2147. #define RADAR_REPORT_REG0_PULSE_SIDX_LSB 0
  2148. #define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_MASK 0x80000000
  2149. #define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_LSB 31
  2150. #define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_MASK 0x7F000000
  2151. #define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_LSB 24
  2152. #define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_MASK 0x00FF0000
  2153. #define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_LSB 16
  2154. #define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_MASK 0x0000FF00
  2155. #define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_LSB 8
  2156. #define RADAR_REPORT_REG1_PULSE_DUR_MASK 0x000000FF
  2157. #define RADAR_REPORT_REG1_PULSE_DUR_LSB 0
  2158. struct phyerr_fft_report {
  2159. __le32 reg0; /* SEARCH_FFT_REPORT_REG0_ * */
  2160. __le32 reg1; /* SEARCH_FFT_REPORT_REG1_ * */
  2161. } __packed;
  2162. #define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_MASK 0xFF800000
  2163. #define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_LSB 23
  2164. #define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_MASK 0x007FC000
  2165. #define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_LSB 14
  2166. #define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_MASK 0x00003000
  2167. #define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_LSB 12
  2168. #define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_MASK 0x00000FFF
  2169. #define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_LSB 0
  2170. #define SEARCH_FFT_REPORT_REG1_RELPWR_DB_MASK 0xFC000000
  2171. #define SEARCH_FFT_REPORT_REG1_RELPWR_DB_LSB 26
  2172. #define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_MASK 0x03FC0000
  2173. #define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_LSB 18
  2174. #define SEARCH_FFT_REPORT_REG1_PEAK_MAG_MASK 0x0003FF00
  2175. #define SEARCH_FFT_REPORT_REG1_PEAK_MAG_LSB 8
  2176. #define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_MASK 0x000000FF
  2177. #define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_LSB 0
  2178. struct phyerr_tlv {
  2179. __le16 len;
  2180. u8 tag;
  2181. u8 sig;
  2182. } __packed;
  2183. #define DFS_RSSI_POSSIBLY_FALSE 50
  2184. #define DFS_PEAK_MAG_THOLD_POSSIBLY_FALSE 40
  2185. struct wmi_mgmt_tx_hdr {
  2186. __le32 vdev_id;
  2187. struct wmi_mac_addr peer_macaddr;
  2188. __le32 tx_rate;
  2189. __le32 tx_power;
  2190. __le32 buf_len;
  2191. } __packed;
  2192. struct wmi_mgmt_tx_cmd {
  2193. struct wmi_mgmt_tx_hdr hdr;
  2194. u8 buf[0];
  2195. } __packed;
  2196. struct wmi_echo_event {
  2197. __le32 value;
  2198. } __packed;
  2199. struct wmi_echo_cmd {
  2200. __le32 value;
  2201. } __packed;
  2202. struct wmi_pdev_set_regdomain_cmd {
  2203. __le32 reg_domain;
  2204. __le32 reg_domain_2G;
  2205. __le32 reg_domain_5G;
  2206. __le32 conformance_test_limit_2G;
  2207. __le32 conformance_test_limit_5G;
  2208. } __packed;
  2209. enum wmi_dfs_region {
  2210. /* Uninitialized dfs domain */
  2211. WMI_UNINIT_DFS_DOMAIN = 0,
  2212. /* FCC3 dfs domain */
  2213. WMI_FCC_DFS_DOMAIN = 1,
  2214. /* ETSI dfs domain */
  2215. WMI_ETSI_DFS_DOMAIN = 2,
  2216. /*Japan dfs domain */
  2217. WMI_MKK4_DFS_DOMAIN = 3,
  2218. };
  2219. struct wmi_pdev_set_regdomain_cmd_10x {
  2220. __le32 reg_domain;
  2221. __le32 reg_domain_2G;
  2222. __le32 reg_domain_5G;
  2223. __le32 conformance_test_limit_2G;
  2224. __le32 conformance_test_limit_5G;
  2225. /* dfs domain from wmi_dfs_region */
  2226. __le32 dfs_domain;
  2227. } __packed;
  2228. /* Command to set/unset chip in quiet mode */
  2229. struct wmi_pdev_set_quiet_cmd {
  2230. /* period in TUs */
  2231. __le32 period;
  2232. /* duration in TUs */
  2233. __le32 duration;
  2234. /* offset in TUs */
  2235. __le32 next_start;
  2236. /* enable/disable */
  2237. __le32 enabled;
  2238. } __packed;
  2239. /*
  2240. * 802.11g protection mode.
  2241. */
  2242. enum ath10k_protmode {
  2243. ATH10K_PROT_NONE = 0, /* no protection */
  2244. ATH10K_PROT_CTSONLY = 1, /* CTS to self */
  2245. ATH10K_PROT_RTSCTS = 2, /* RTS-CTS */
  2246. };
  2247. enum wmi_rtscts_profile {
  2248. WMI_RTSCTS_FOR_NO_RATESERIES = 0,
  2249. WMI_RTSCTS_FOR_SECOND_RATESERIES,
  2250. WMI_RTSCTS_ACROSS_SW_RETRIES
  2251. };
  2252. #define WMI_RTSCTS_ENABLED 1
  2253. #define WMI_RTSCTS_SET_MASK 0x0f
  2254. #define WMI_RTSCTS_SET_LSB 0
  2255. #define WMI_RTSCTS_PROFILE_MASK 0xf0
  2256. #define WMI_RTSCTS_PROFILE_LSB 4
  2257. enum wmi_beacon_gen_mode {
  2258. WMI_BEACON_STAGGERED_MODE = 0,
  2259. WMI_BEACON_BURST_MODE = 1
  2260. };
  2261. enum wmi_csa_event_ies_present_flag {
  2262. WMI_CSA_IE_PRESENT = 0x00000001,
  2263. WMI_XCSA_IE_PRESENT = 0x00000002,
  2264. WMI_WBW_IE_PRESENT = 0x00000004,
  2265. WMI_CSWARP_IE_PRESENT = 0x00000008,
  2266. };
  2267. /* wmi CSA receive event from beacon frame */
  2268. struct wmi_csa_event {
  2269. __le32 i_fc_dur;
  2270. /* Bit 0-15: FC */
  2271. /* Bit 16-31: DUR */
  2272. struct wmi_mac_addr i_addr1;
  2273. struct wmi_mac_addr i_addr2;
  2274. __le32 csa_ie[2];
  2275. __le32 xcsa_ie[2];
  2276. __le32 wb_ie[2];
  2277. __le32 cswarp_ie;
  2278. __le32 ies_present_flag; /* wmi_csa_event_ies_present_flag */
  2279. } __packed;
  2280. /* the definition of different PDEV parameters */
  2281. #define PDEV_DEFAULT_STATS_UPDATE_PERIOD 500
  2282. #define VDEV_DEFAULT_STATS_UPDATE_PERIOD 500
  2283. #define PEER_DEFAULT_STATS_UPDATE_PERIOD 500
  2284. struct wmi_pdev_param_map {
  2285. u32 tx_chain_mask;
  2286. u32 rx_chain_mask;
  2287. u32 txpower_limit2g;
  2288. u32 txpower_limit5g;
  2289. u32 txpower_scale;
  2290. u32 beacon_gen_mode;
  2291. u32 beacon_tx_mode;
  2292. u32 resmgr_offchan_mode;
  2293. u32 protection_mode;
  2294. u32 dynamic_bw;
  2295. u32 non_agg_sw_retry_th;
  2296. u32 agg_sw_retry_th;
  2297. u32 sta_kickout_th;
  2298. u32 ac_aggrsize_scaling;
  2299. u32 ltr_enable;
  2300. u32 ltr_ac_latency_be;
  2301. u32 ltr_ac_latency_bk;
  2302. u32 ltr_ac_latency_vi;
  2303. u32 ltr_ac_latency_vo;
  2304. u32 ltr_ac_latency_timeout;
  2305. u32 ltr_sleep_override;
  2306. u32 ltr_rx_override;
  2307. u32 ltr_tx_activity_timeout;
  2308. u32 l1ss_enable;
  2309. u32 dsleep_enable;
  2310. u32 pcielp_txbuf_flush;
  2311. u32 pcielp_txbuf_watermark;
  2312. u32 pcielp_txbuf_tmo_en;
  2313. u32 pcielp_txbuf_tmo_value;
  2314. u32 pdev_stats_update_period;
  2315. u32 vdev_stats_update_period;
  2316. u32 peer_stats_update_period;
  2317. u32 bcnflt_stats_update_period;
  2318. u32 pmf_qos;
  2319. u32 arp_ac_override;
  2320. u32 dcs;
  2321. u32 ani_enable;
  2322. u32 ani_poll_period;
  2323. u32 ani_listen_period;
  2324. u32 ani_ofdm_level;
  2325. u32 ani_cck_level;
  2326. u32 dyntxchain;
  2327. u32 proxy_sta;
  2328. u32 idle_ps_config;
  2329. u32 power_gating_sleep;
  2330. u32 fast_channel_reset;
  2331. u32 burst_dur;
  2332. u32 burst_enable;
  2333. };
  2334. #define WMI_PDEV_PARAM_UNSUPPORTED 0
  2335. enum wmi_pdev_param {
  2336. /* TX chain mask */
  2337. WMI_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
  2338. /* RX chain mask */
  2339. WMI_PDEV_PARAM_RX_CHAIN_MASK,
  2340. /* TX power limit for 2G Radio */
  2341. WMI_PDEV_PARAM_TXPOWER_LIMIT2G,
  2342. /* TX power limit for 5G Radio */
  2343. WMI_PDEV_PARAM_TXPOWER_LIMIT5G,
  2344. /* TX power scale */
  2345. WMI_PDEV_PARAM_TXPOWER_SCALE,
  2346. /* Beacon generation mode . 0: host, 1: target */
  2347. WMI_PDEV_PARAM_BEACON_GEN_MODE,
  2348. /* Beacon generation mode . 0: staggered 1: bursted */
  2349. WMI_PDEV_PARAM_BEACON_TX_MODE,
  2350. /*
  2351. * Resource manager off chan mode .
  2352. * 0: turn off off chan mode. 1: turn on offchan mode
  2353. */
  2354. WMI_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
  2355. /*
  2356. * Protection mode:
  2357. * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
  2358. */
  2359. WMI_PDEV_PARAM_PROTECTION_MODE,
  2360. /*
  2361. * Dynamic bandwidth - 0: disable, 1: enable
  2362. *
  2363. * When enabled HW rate control tries different bandwidths when
  2364. * retransmitting frames.
  2365. */
  2366. WMI_PDEV_PARAM_DYNAMIC_BW,
  2367. /* Non aggregrate/ 11g sw retry threshold.0-disable */
  2368. WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
  2369. /* aggregrate sw retry threshold. 0-disable*/
  2370. WMI_PDEV_PARAM_AGG_SW_RETRY_TH,
  2371. /* Station kickout threshold (non of consecutive failures).0-disable */
  2372. WMI_PDEV_PARAM_STA_KICKOUT_TH,
  2373. /* Aggerate size scaling configuration per AC */
  2374. WMI_PDEV_PARAM_AC_AGGRSIZE_SCALING,
  2375. /* LTR enable */
  2376. WMI_PDEV_PARAM_LTR_ENABLE,
  2377. /* LTR latency for BE, in us */
  2378. WMI_PDEV_PARAM_LTR_AC_LATENCY_BE,
  2379. /* LTR latency for BK, in us */
  2380. WMI_PDEV_PARAM_LTR_AC_LATENCY_BK,
  2381. /* LTR latency for VI, in us */
  2382. WMI_PDEV_PARAM_LTR_AC_LATENCY_VI,
  2383. /* LTR latency for VO, in us */
  2384. WMI_PDEV_PARAM_LTR_AC_LATENCY_VO,
  2385. /* LTR AC latency timeout, in ms */
  2386. WMI_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
  2387. /* LTR platform latency override, in us */
  2388. WMI_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
  2389. /* LTR-RX override, in us */
  2390. WMI_PDEV_PARAM_LTR_RX_OVERRIDE,
  2391. /* Tx activity timeout for LTR, in us */
  2392. WMI_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
  2393. /* L1SS state machine enable */
  2394. WMI_PDEV_PARAM_L1SS_ENABLE,
  2395. /* Deep sleep state machine enable */
  2396. WMI_PDEV_PARAM_DSLEEP_ENABLE,
  2397. /* RX buffering flush enable */
  2398. WMI_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
  2399. /* RX buffering matermark */
  2400. WMI_PDEV_PARAM_PCIELP_TXBUF_WATERMARK,
  2401. /* RX buffering timeout enable */
  2402. WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
  2403. /* RX buffering timeout value */
  2404. WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
  2405. /* pdev level stats update period in ms */
  2406. WMI_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
  2407. /* vdev level stats update period in ms */
  2408. WMI_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
  2409. /* peer level stats update period in ms */
  2410. WMI_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
  2411. /* beacon filter status update period */
  2412. WMI_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
  2413. /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
  2414. WMI_PDEV_PARAM_PMF_QOS,
  2415. /* Access category on which ARP frames are sent */
  2416. WMI_PDEV_PARAM_ARP_AC_OVERRIDE,
  2417. /* DCS configuration */
  2418. WMI_PDEV_PARAM_DCS,
  2419. /* Enable/Disable ANI on target */
  2420. WMI_PDEV_PARAM_ANI_ENABLE,
  2421. /* configure the ANI polling period */
  2422. WMI_PDEV_PARAM_ANI_POLL_PERIOD,
  2423. /* configure the ANI listening period */
  2424. WMI_PDEV_PARAM_ANI_LISTEN_PERIOD,
  2425. /* configure OFDM immunity level */
  2426. WMI_PDEV_PARAM_ANI_OFDM_LEVEL,
  2427. /* configure CCK immunity level */
  2428. WMI_PDEV_PARAM_ANI_CCK_LEVEL,
  2429. /* Enable/Disable CDD for 1x1 STAs in rate control module */
  2430. WMI_PDEV_PARAM_DYNTXCHAIN,
  2431. /* Enable/Disable proxy STA */
  2432. WMI_PDEV_PARAM_PROXY_STA,
  2433. /* Enable/Disable low power state when all VDEVs are inactive/idle. */
  2434. WMI_PDEV_PARAM_IDLE_PS_CONFIG,
  2435. /* Enable/Disable power gating sleep */
  2436. WMI_PDEV_PARAM_POWER_GATING_SLEEP,
  2437. };
  2438. enum wmi_10x_pdev_param {
  2439. /* TX chian mask */
  2440. WMI_10X_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
  2441. /* RX chian mask */
  2442. WMI_10X_PDEV_PARAM_RX_CHAIN_MASK,
  2443. /* TX power limit for 2G Radio */
  2444. WMI_10X_PDEV_PARAM_TXPOWER_LIMIT2G,
  2445. /* TX power limit for 5G Radio */
  2446. WMI_10X_PDEV_PARAM_TXPOWER_LIMIT5G,
  2447. /* TX power scale */
  2448. WMI_10X_PDEV_PARAM_TXPOWER_SCALE,
  2449. /* Beacon generation mode . 0: host, 1: target */
  2450. WMI_10X_PDEV_PARAM_BEACON_GEN_MODE,
  2451. /* Beacon generation mode . 0: staggered 1: bursted */
  2452. WMI_10X_PDEV_PARAM_BEACON_TX_MODE,
  2453. /*
  2454. * Resource manager off chan mode .
  2455. * 0: turn off off chan mode. 1: turn on offchan mode
  2456. */
  2457. WMI_10X_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
  2458. /*
  2459. * Protection mode:
  2460. * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
  2461. */
  2462. WMI_10X_PDEV_PARAM_PROTECTION_MODE,
  2463. /* Dynamic bandwidth 0: disable 1: enable */
  2464. WMI_10X_PDEV_PARAM_DYNAMIC_BW,
  2465. /* Non aggregrate/ 11g sw retry threshold.0-disable */
  2466. WMI_10X_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
  2467. /* aggregrate sw retry threshold. 0-disable*/
  2468. WMI_10X_PDEV_PARAM_AGG_SW_RETRY_TH,
  2469. /* Station kickout threshold (non of consecutive failures).0-disable */
  2470. WMI_10X_PDEV_PARAM_STA_KICKOUT_TH,
  2471. /* Aggerate size scaling configuration per AC */
  2472. WMI_10X_PDEV_PARAM_AC_AGGRSIZE_SCALING,
  2473. /* LTR enable */
  2474. WMI_10X_PDEV_PARAM_LTR_ENABLE,
  2475. /* LTR latency for BE, in us */
  2476. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BE,
  2477. /* LTR latency for BK, in us */
  2478. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BK,
  2479. /* LTR latency for VI, in us */
  2480. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VI,
  2481. /* LTR latency for VO, in us */
  2482. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VO,
  2483. /* LTR AC latency timeout, in ms */
  2484. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
  2485. /* LTR platform latency override, in us */
  2486. WMI_10X_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
  2487. /* LTR-RX override, in us */
  2488. WMI_10X_PDEV_PARAM_LTR_RX_OVERRIDE,
  2489. /* Tx activity timeout for LTR, in us */
  2490. WMI_10X_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
  2491. /* L1SS state machine enable */
  2492. WMI_10X_PDEV_PARAM_L1SS_ENABLE,
  2493. /* Deep sleep state machine enable */
  2494. WMI_10X_PDEV_PARAM_DSLEEP_ENABLE,
  2495. /* pdev level stats update period in ms */
  2496. WMI_10X_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
  2497. /* vdev level stats update period in ms */
  2498. WMI_10X_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
  2499. /* peer level stats update period in ms */
  2500. WMI_10X_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
  2501. /* beacon filter status update period */
  2502. WMI_10X_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
  2503. /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
  2504. WMI_10X_PDEV_PARAM_PMF_QOS,
  2505. /* Access category on which ARP and DHCP frames are sent */
  2506. WMI_10X_PDEV_PARAM_ARPDHCP_AC_OVERRIDE,
  2507. /* DCS configuration */
  2508. WMI_10X_PDEV_PARAM_DCS,
  2509. /* Enable/Disable ANI on target */
  2510. WMI_10X_PDEV_PARAM_ANI_ENABLE,
  2511. /* configure the ANI polling period */
  2512. WMI_10X_PDEV_PARAM_ANI_POLL_PERIOD,
  2513. /* configure the ANI listening period */
  2514. WMI_10X_PDEV_PARAM_ANI_LISTEN_PERIOD,
  2515. /* configure OFDM immunity level */
  2516. WMI_10X_PDEV_PARAM_ANI_OFDM_LEVEL,
  2517. /* configure CCK immunity level */
  2518. WMI_10X_PDEV_PARAM_ANI_CCK_LEVEL,
  2519. /* Enable/Disable CDD for 1x1 STAs in rate control module */
  2520. WMI_10X_PDEV_PARAM_DYNTXCHAIN,
  2521. /* Enable/Disable Fast channel reset*/
  2522. WMI_10X_PDEV_PARAM_FAST_CHANNEL_RESET,
  2523. /* Set Bursting DUR */
  2524. WMI_10X_PDEV_PARAM_BURST_DUR,
  2525. /* Set Bursting Enable*/
  2526. WMI_10X_PDEV_PARAM_BURST_ENABLE,
  2527. /* following are available as of firmware 10.2 */
  2528. WMI_10X_PDEV_PARAM_SMART_ANTENNA_DEFAULT_ANTENNA,
  2529. WMI_10X_PDEV_PARAM_IGMPMLD_OVERRIDE,
  2530. WMI_10X_PDEV_PARAM_IGMPMLD_TID,
  2531. WMI_10X_PDEV_PARAM_ANTENNA_GAIN,
  2532. WMI_10X_PDEV_PARAM_RX_DECAP_MODE,
  2533. WMI_10X_PDEV_PARAM_RX_FILTER,
  2534. WMI_10X_PDEV_PARAM_SET_MCAST_TO_UCAST_TID,
  2535. WMI_10X_PDEV_PARAM_PROXY_STA_MODE,
  2536. WMI_10X_PDEV_PARAM_SET_MCAST2UCAST_MODE,
  2537. WMI_10X_PDEV_PARAM_SET_MCAST2UCAST_BUFFER,
  2538. WMI_10X_PDEV_PARAM_REMOVE_MCAST2UCAST_BUFFER,
  2539. };
  2540. struct wmi_pdev_set_param_cmd {
  2541. __le32 param_id;
  2542. __le32 param_value;
  2543. } __packed;
  2544. struct wmi_pdev_get_tpc_config_cmd {
  2545. /* parameter */
  2546. __le32 param;
  2547. } __packed;
  2548. #define WMI_TPC_RATE_MAX 160
  2549. #define WMI_TPC_TX_N_CHAIN 4
  2550. enum wmi_tpc_config_event_flag {
  2551. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_CDD = 0x1,
  2552. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_STBC = 0x2,
  2553. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF = 0x4,
  2554. };
  2555. struct wmi_pdev_tpc_config_event {
  2556. __le32 reg_domain;
  2557. __le32 chan_freq;
  2558. __le32 phy_mode;
  2559. __le32 twice_antenna_reduction;
  2560. __le32 twice_max_rd_power;
  2561. s32 twice_antenna_gain;
  2562. __le32 power_limit;
  2563. __le32 rate_max;
  2564. __le32 num_tx_chain;
  2565. __le32 ctl;
  2566. __le32 flags;
  2567. s8 max_reg_allow_pow[WMI_TPC_TX_N_CHAIN];
  2568. s8 max_reg_allow_pow_agcdd[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  2569. s8 max_reg_allow_pow_agstbc[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  2570. s8 max_reg_allow_pow_agtxbf[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  2571. u8 rates_array[WMI_TPC_RATE_MAX];
  2572. } __packed;
  2573. /* Transmit power scale factor. */
  2574. enum wmi_tp_scale {
  2575. WMI_TP_SCALE_MAX = 0, /* no scaling (default) */
  2576. WMI_TP_SCALE_50 = 1, /* 50% of max (-3 dBm) */
  2577. WMI_TP_SCALE_25 = 2, /* 25% of max (-6 dBm) */
  2578. WMI_TP_SCALE_12 = 3, /* 12% of max (-9 dBm) */
  2579. WMI_TP_SCALE_MIN = 4, /* min, but still on */
  2580. WMI_TP_SCALE_SIZE = 5, /* max num of enum */
  2581. };
  2582. struct wmi_set_channel_cmd {
  2583. /* channel (only frequency and mode info are used) */
  2584. struct wmi_channel chan;
  2585. } __packed;
  2586. struct wmi_pdev_chanlist_update_event {
  2587. /* number of channels */
  2588. __le32 num_chan;
  2589. /* array of channels */
  2590. struct wmi_channel channel_list[1];
  2591. } __packed;
  2592. #define WMI_MAX_DEBUG_MESG (sizeof(u32) * 32)
  2593. struct wmi_debug_mesg_event {
  2594. /* message buffer, NULL terminated */
  2595. char bufp[WMI_MAX_DEBUG_MESG];
  2596. } __packed;
  2597. enum {
  2598. /* P2P device */
  2599. VDEV_SUBTYPE_P2PDEV = 0,
  2600. /* P2P client */
  2601. VDEV_SUBTYPE_P2PCLI,
  2602. /* P2P GO */
  2603. VDEV_SUBTYPE_P2PGO,
  2604. /* BT3.0 HS */
  2605. VDEV_SUBTYPE_BT,
  2606. };
  2607. struct wmi_pdev_set_channel_cmd {
  2608. /* idnore power , only use flags , mode and freq */
  2609. struct wmi_channel chan;
  2610. } __packed;
  2611. /* Customize the DSCP (bit) to TID (0-7) mapping for QOS */
  2612. #define WMI_DSCP_MAP_MAX (64)
  2613. struct wmi_pdev_set_dscp_tid_map_cmd {
  2614. /* map indicating DSCP to TID conversion */
  2615. __le32 dscp_to_tid_map[WMI_DSCP_MAP_MAX];
  2616. } __packed;
  2617. enum mcast_bcast_rate_id {
  2618. WMI_SET_MCAST_RATE,
  2619. WMI_SET_BCAST_RATE
  2620. };
  2621. struct mcast_bcast_rate {
  2622. enum mcast_bcast_rate_id rate_id;
  2623. __le32 rate;
  2624. } __packed;
  2625. struct wmi_wmm_params {
  2626. __le32 cwmin;
  2627. __le32 cwmax;
  2628. __le32 aifs;
  2629. __le32 txop;
  2630. __le32 acm;
  2631. __le32 no_ack;
  2632. } __packed;
  2633. struct wmi_pdev_set_wmm_params {
  2634. struct wmi_wmm_params ac_be;
  2635. struct wmi_wmm_params ac_bk;
  2636. struct wmi_wmm_params ac_vi;
  2637. struct wmi_wmm_params ac_vo;
  2638. } __packed;
  2639. struct wmi_wmm_params_arg {
  2640. u32 cwmin;
  2641. u32 cwmax;
  2642. u32 aifs;
  2643. u32 txop;
  2644. u32 acm;
  2645. u32 no_ack;
  2646. };
  2647. struct wmi_pdev_set_wmm_params_arg {
  2648. struct wmi_wmm_params_arg ac_be;
  2649. struct wmi_wmm_params_arg ac_bk;
  2650. struct wmi_wmm_params_arg ac_vi;
  2651. struct wmi_wmm_params_arg ac_vo;
  2652. };
  2653. struct wal_dbg_tx_stats {
  2654. /* Num HTT cookies queued to dispatch list */
  2655. __le32 comp_queued;
  2656. /* Num HTT cookies dispatched */
  2657. __le32 comp_delivered;
  2658. /* Num MSDU queued to WAL */
  2659. __le32 msdu_enqued;
  2660. /* Num MPDU queue to WAL */
  2661. __le32 mpdu_enqued;
  2662. /* Num MSDUs dropped by WMM limit */
  2663. __le32 wmm_drop;
  2664. /* Num Local frames queued */
  2665. __le32 local_enqued;
  2666. /* Num Local frames done */
  2667. __le32 local_freed;
  2668. /* Num queued to HW */
  2669. __le32 hw_queued;
  2670. /* Num PPDU reaped from HW */
  2671. __le32 hw_reaped;
  2672. /* Num underruns */
  2673. __le32 underrun;
  2674. /* Num PPDUs cleaned up in TX abort */
  2675. __le32 tx_abort;
  2676. /* Num MPDUs requed by SW */
  2677. __le32 mpdus_requed;
  2678. /* excessive retries */
  2679. __le32 tx_ko;
  2680. /* data hw rate code */
  2681. __le32 data_rc;
  2682. /* Scheduler self triggers */
  2683. __le32 self_triggers;
  2684. /* frames dropped due to excessive sw retries */
  2685. __le32 sw_retry_failure;
  2686. /* illegal rate phy errors */
  2687. __le32 illgl_rate_phy_err;
  2688. /* wal pdev continous xretry */
  2689. __le32 pdev_cont_xretry;
  2690. /* wal pdev continous xretry */
  2691. __le32 pdev_tx_timeout;
  2692. /* wal pdev resets */
  2693. __le32 pdev_resets;
  2694. /* frames dropped due to non-availability of stateless TIDs */
  2695. __le32 stateless_tid_alloc_failure;
  2696. __le32 phy_underrun;
  2697. /* MPDU is more than txop limit */
  2698. __le32 txop_ovf;
  2699. } __packed;
  2700. struct wal_dbg_rx_stats {
  2701. /* Cnts any change in ring routing mid-ppdu */
  2702. __le32 mid_ppdu_route_change;
  2703. /* Total number of statuses processed */
  2704. __le32 status_rcvd;
  2705. /* Extra frags on rings 0-3 */
  2706. __le32 r0_frags;
  2707. __le32 r1_frags;
  2708. __le32 r2_frags;
  2709. __le32 r3_frags;
  2710. /* MSDUs / MPDUs delivered to HTT */
  2711. __le32 htt_msdus;
  2712. __le32 htt_mpdus;
  2713. /* MSDUs / MPDUs delivered to local stack */
  2714. __le32 loc_msdus;
  2715. __le32 loc_mpdus;
  2716. /* AMSDUs that have more MSDUs than the status ring size */
  2717. __le32 oversize_amsdu;
  2718. /* Number of PHY errors */
  2719. __le32 phy_errs;
  2720. /* Number of PHY errors drops */
  2721. __le32 phy_err_drop;
  2722. /* Number of mpdu errors - FCS, MIC, ENC etc. */
  2723. __le32 mpdu_errs;
  2724. } __packed;
  2725. struct wal_dbg_peer_stats {
  2726. /* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
  2727. __le32 dummy;
  2728. } __packed;
  2729. struct wal_dbg_stats {
  2730. struct wal_dbg_tx_stats tx;
  2731. struct wal_dbg_rx_stats rx;
  2732. struct wal_dbg_peer_stats peer;
  2733. } __packed;
  2734. enum wmi_stats_id {
  2735. WMI_REQUEST_PEER_STAT = 0x01,
  2736. WMI_REQUEST_AP_STAT = 0x02
  2737. };
  2738. struct wlan_inst_rssi_args {
  2739. __le16 cfg_retry_count;
  2740. __le16 retry_count;
  2741. };
  2742. struct wmi_request_stats_cmd {
  2743. __le32 stats_id;
  2744. __le32 vdev_id;
  2745. /* peer MAC address */
  2746. struct wmi_mac_addr peer_macaddr;
  2747. /* Instantaneous RSSI arguments */
  2748. struct wlan_inst_rssi_args inst_rssi_args;
  2749. } __packed;
  2750. /* Suspend option */
  2751. enum {
  2752. /* suspend */
  2753. WMI_PDEV_SUSPEND,
  2754. /* suspend and disable all interrupts */
  2755. WMI_PDEV_SUSPEND_AND_DISABLE_INTR,
  2756. };
  2757. struct wmi_pdev_suspend_cmd {
  2758. /* suspend option sent to target */
  2759. __le32 suspend_opt;
  2760. } __packed;
  2761. struct wmi_stats_event {
  2762. __le32 stats_id; /* %WMI_REQUEST_ */
  2763. /*
  2764. * number of pdev stats event structures
  2765. * (wmi_pdev_stats) 0 or 1
  2766. */
  2767. __le32 num_pdev_stats;
  2768. /*
  2769. * number of vdev stats event structures
  2770. * (wmi_vdev_stats) 0 or max vdevs
  2771. */
  2772. __le32 num_vdev_stats;
  2773. /*
  2774. * number of peer stats event structures
  2775. * (wmi_peer_stats) 0 or max peers
  2776. */
  2777. __le32 num_peer_stats;
  2778. __le32 num_bcnflt_stats;
  2779. /*
  2780. * followed by
  2781. * num_pdev_stats * size of(struct wmi_pdev_stats)
  2782. * num_vdev_stats * size of(struct wmi_vdev_stats)
  2783. * num_peer_stats * size of(struct wmi_peer_stats)
  2784. *
  2785. * By having a zero sized array, the pointer to data area
  2786. * becomes available without increasing the struct size
  2787. */
  2788. u8 data[0];
  2789. } __packed;
  2790. /*
  2791. * PDEV statistics
  2792. * TODO: add all PDEV stats here
  2793. */
  2794. struct wmi_pdev_stats_old {
  2795. __le32 chan_nf; /* Channel noise floor */
  2796. __le32 tx_frame_count; /* TX frame count */
  2797. __le32 rx_frame_count; /* RX frame count */
  2798. __le32 rx_clear_count; /* rx clear count */
  2799. __le32 cycle_count; /* cycle count */
  2800. __le32 phy_err_count; /* Phy error count */
  2801. __le32 chan_tx_pwr; /* channel tx power */
  2802. struct wal_dbg_stats wal; /* WAL dbg stats */
  2803. } __packed;
  2804. struct wmi_pdev_stats_10x {
  2805. __le32 chan_nf; /* Channel noise floor */
  2806. __le32 tx_frame_count; /* TX frame count */
  2807. __le32 rx_frame_count; /* RX frame count */
  2808. __le32 rx_clear_count; /* rx clear count */
  2809. __le32 cycle_count; /* cycle count */
  2810. __le32 phy_err_count; /* Phy error count */
  2811. __le32 chan_tx_pwr; /* channel tx power */
  2812. struct wal_dbg_stats wal; /* WAL dbg stats */
  2813. __le32 ack_rx_bad;
  2814. __le32 rts_bad;
  2815. __le32 rts_good;
  2816. __le32 fcs_bad;
  2817. __le32 no_beacons;
  2818. __le32 mib_int_count;
  2819. } __packed;
  2820. /*
  2821. * VDEV statistics
  2822. * TODO: add all VDEV stats here
  2823. */
  2824. struct wmi_vdev_stats {
  2825. __le32 vdev_id;
  2826. } __packed;
  2827. /*
  2828. * peer statistics.
  2829. * TODO: add more stats
  2830. */
  2831. struct wmi_peer_stats_old {
  2832. struct wmi_mac_addr peer_macaddr;
  2833. __le32 peer_rssi;
  2834. __le32 peer_tx_rate;
  2835. } __packed;
  2836. struct wmi_peer_stats_10x {
  2837. struct wmi_mac_addr peer_macaddr;
  2838. __le32 peer_rssi;
  2839. __le32 peer_tx_rate;
  2840. __le32 peer_rx_rate;
  2841. } __packed;
  2842. struct wmi_vdev_create_cmd {
  2843. __le32 vdev_id;
  2844. __le32 vdev_type;
  2845. __le32 vdev_subtype;
  2846. struct wmi_mac_addr vdev_macaddr;
  2847. } __packed;
  2848. enum wmi_vdev_type {
  2849. WMI_VDEV_TYPE_AP = 1,
  2850. WMI_VDEV_TYPE_STA = 2,
  2851. WMI_VDEV_TYPE_IBSS = 3,
  2852. WMI_VDEV_TYPE_MONITOR = 4,
  2853. };
  2854. enum wmi_vdev_subtype {
  2855. WMI_VDEV_SUBTYPE_NONE = 0,
  2856. WMI_VDEV_SUBTYPE_P2P_DEVICE = 1,
  2857. WMI_VDEV_SUBTYPE_P2P_CLIENT = 2,
  2858. WMI_VDEV_SUBTYPE_P2P_GO = 3,
  2859. };
  2860. /* values for vdev_subtype */
  2861. /* values for vdev_start_request flags */
  2862. /*
  2863. * Indicates that AP VDEV uses hidden ssid. only valid for
  2864. * AP/GO */
  2865. #define WMI_VDEV_START_HIDDEN_SSID (1<<0)
  2866. /*
  2867. * Indicates if robust management frame/management frame
  2868. * protection is enabled. For GO/AP vdevs, it indicates that
  2869. * it may support station/client associations with RMF enabled.
  2870. * For STA/client vdevs, it indicates that sta will
  2871. * associate with AP with RMF enabled. */
  2872. #define WMI_VDEV_START_PMF_ENABLED (1<<1)
  2873. struct wmi_p2p_noa_descriptor {
  2874. __le32 type_count; /* 255: continuous schedule, 0: reserved */
  2875. __le32 duration; /* Absent period duration in micro seconds */
  2876. __le32 interval; /* Absent period interval in micro seconds */
  2877. __le32 start_time; /* 32 bit tsf time when in starts */
  2878. } __packed;
  2879. struct wmi_vdev_start_request_cmd {
  2880. /* WMI channel */
  2881. struct wmi_channel chan;
  2882. /* unique id identifying the VDEV, generated by the caller */
  2883. __le32 vdev_id;
  2884. /* requestor id identifying the caller module */
  2885. __le32 requestor_id;
  2886. /* beacon interval from received beacon */
  2887. __le32 beacon_interval;
  2888. /* DTIM Period from the received beacon */
  2889. __le32 dtim_period;
  2890. /* Flags */
  2891. __le32 flags;
  2892. /* ssid field. Only valid for AP/GO/IBSS/BTAmp VDEV type. */
  2893. struct wmi_ssid ssid;
  2894. /* beacon/probe reponse xmit rate. Applicable for SoftAP. */
  2895. __le32 bcn_tx_rate;
  2896. /* beacon/probe reponse xmit power. Applicable for SoftAP. */
  2897. __le32 bcn_tx_power;
  2898. /* number of p2p NOA descriptor(s) from scan entry */
  2899. __le32 num_noa_descriptors;
  2900. /*
  2901. * Disable H/W ack. This used by WMI_VDEV_RESTART_REQUEST_CMDID.
  2902. * During CAC, Our HW shouldn't ack ditected frames
  2903. */
  2904. __le32 disable_hw_ack;
  2905. /* actual p2p NOA descriptor from scan entry */
  2906. struct wmi_p2p_noa_descriptor noa_descriptors[2];
  2907. } __packed;
  2908. struct wmi_vdev_restart_request_cmd {
  2909. struct wmi_vdev_start_request_cmd vdev_start_request_cmd;
  2910. } __packed;
  2911. struct wmi_vdev_start_request_arg {
  2912. u32 vdev_id;
  2913. struct wmi_channel_arg channel;
  2914. u32 bcn_intval;
  2915. u32 dtim_period;
  2916. u8 *ssid;
  2917. u32 ssid_len;
  2918. u32 bcn_tx_rate;
  2919. u32 bcn_tx_power;
  2920. bool disable_hw_ack;
  2921. bool hidden_ssid;
  2922. bool pmf_enabled;
  2923. };
  2924. struct wmi_vdev_delete_cmd {
  2925. /* unique id identifying the VDEV, generated by the caller */
  2926. __le32 vdev_id;
  2927. } __packed;
  2928. struct wmi_vdev_up_cmd {
  2929. __le32 vdev_id;
  2930. __le32 vdev_assoc_id;
  2931. struct wmi_mac_addr vdev_bssid;
  2932. } __packed;
  2933. struct wmi_vdev_stop_cmd {
  2934. __le32 vdev_id;
  2935. } __packed;
  2936. struct wmi_vdev_down_cmd {
  2937. __le32 vdev_id;
  2938. } __packed;
  2939. struct wmi_vdev_standby_response_cmd {
  2940. /* unique id identifying the VDEV, generated by the caller */
  2941. __le32 vdev_id;
  2942. } __packed;
  2943. struct wmi_vdev_resume_response_cmd {
  2944. /* unique id identifying the VDEV, generated by the caller */
  2945. __le32 vdev_id;
  2946. } __packed;
  2947. struct wmi_vdev_set_param_cmd {
  2948. __le32 vdev_id;
  2949. __le32 param_id;
  2950. __le32 param_value;
  2951. } __packed;
  2952. #define WMI_MAX_KEY_INDEX 3
  2953. #define WMI_MAX_KEY_LEN 32
  2954. #define WMI_KEY_PAIRWISE 0x00
  2955. #define WMI_KEY_GROUP 0x01
  2956. #define WMI_KEY_TX_USAGE 0x02 /* default tx key - static wep */
  2957. struct wmi_key_seq_counter {
  2958. __le32 key_seq_counter_l;
  2959. __le32 key_seq_counter_h;
  2960. } __packed;
  2961. #define WMI_CIPHER_NONE 0x0 /* clear key */
  2962. #define WMI_CIPHER_WEP 0x1
  2963. #define WMI_CIPHER_TKIP 0x2
  2964. #define WMI_CIPHER_AES_OCB 0x3
  2965. #define WMI_CIPHER_AES_CCM 0x4
  2966. #define WMI_CIPHER_WAPI 0x5
  2967. #define WMI_CIPHER_CKIP 0x6
  2968. #define WMI_CIPHER_AES_CMAC 0x7
  2969. struct wmi_vdev_install_key_cmd {
  2970. __le32 vdev_id;
  2971. struct wmi_mac_addr peer_macaddr;
  2972. __le32 key_idx;
  2973. __le32 key_flags;
  2974. __le32 key_cipher; /* %WMI_CIPHER_ */
  2975. struct wmi_key_seq_counter key_rsc_counter;
  2976. struct wmi_key_seq_counter key_global_rsc_counter;
  2977. struct wmi_key_seq_counter key_tsc_counter;
  2978. u8 wpi_key_rsc_counter[16];
  2979. u8 wpi_key_tsc_counter[16];
  2980. __le32 key_len;
  2981. __le32 key_txmic_len;
  2982. __le32 key_rxmic_len;
  2983. /* contains key followed by tx mic followed by rx mic */
  2984. u8 key_data[0];
  2985. } __packed;
  2986. struct wmi_vdev_install_key_arg {
  2987. u32 vdev_id;
  2988. const u8 *macaddr;
  2989. u32 key_idx;
  2990. u32 key_flags;
  2991. u32 key_cipher;
  2992. u32 key_len;
  2993. u32 key_txmic_len;
  2994. u32 key_rxmic_len;
  2995. const void *key_data;
  2996. };
  2997. /*
  2998. * vdev fixed rate format:
  2999. * - preamble - b7:b6 - see WMI_RATE_PREMABLE_
  3000. * - nss - b5:b4 - ss number (0 mean 1ss)
  3001. * - rate_mcs - b3:b0 - as below
  3002. * CCK: 0 - 11Mbps, 1 - 5,5Mbps, 2 - 2Mbps, 3 - 1Mbps,
  3003. * 4 - 11Mbps (s), 5 - 5,5Mbps (s), 6 - 2Mbps (s)
  3004. * OFDM: 0 - 48Mbps, 1 - 24Mbps, 2 - 12Mbps, 3 - 6Mbps,
  3005. * 4 - 54Mbps, 5 - 36Mbps, 6 - 18Mbps, 7 - 9Mbps
  3006. * HT/VHT: MCS index
  3007. */
  3008. /* Preamble types to be used with VDEV fixed rate configuration */
  3009. enum wmi_rate_preamble {
  3010. WMI_RATE_PREAMBLE_OFDM,
  3011. WMI_RATE_PREAMBLE_CCK,
  3012. WMI_RATE_PREAMBLE_HT,
  3013. WMI_RATE_PREAMBLE_VHT,
  3014. };
  3015. /* Value to disable fixed rate setting */
  3016. #define WMI_FIXED_RATE_NONE (0xff)
  3017. struct wmi_vdev_param_map {
  3018. u32 rts_threshold;
  3019. u32 fragmentation_threshold;
  3020. u32 beacon_interval;
  3021. u32 listen_interval;
  3022. u32 multicast_rate;
  3023. u32 mgmt_tx_rate;
  3024. u32 slot_time;
  3025. u32 preamble;
  3026. u32 swba_time;
  3027. u32 wmi_vdev_stats_update_period;
  3028. u32 wmi_vdev_pwrsave_ageout_time;
  3029. u32 wmi_vdev_host_swba_interval;
  3030. u32 dtim_period;
  3031. u32 wmi_vdev_oc_scheduler_air_time_limit;
  3032. u32 wds;
  3033. u32 atim_window;
  3034. u32 bmiss_count_max;
  3035. u32 bmiss_first_bcnt;
  3036. u32 bmiss_final_bcnt;
  3037. u32 feature_wmm;
  3038. u32 chwidth;
  3039. u32 chextoffset;
  3040. u32 disable_htprotection;
  3041. u32 sta_quickkickout;
  3042. u32 mgmt_rate;
  3043. u32 protection_mode;
  3044. u32 fixed_rate;
  3045. u32 sgi;
  3046. u32 ldpc;
  3047. u32 tx_stbc;
  3048. u32 rx_stbc;
  3049. u32 intra_bss_fwd;
  3050. u32 def_keyid;
  3051. u32 nss;
  3052. u32 bcast_data_rate;
  3053. u32 mcast_data_rate;
  3054. u32 mcast_indicate;
  3055. u32 dhcp_indicate;
  3056. u32 unknown_dest_indicate;
  3057. u32 ap_keepalive_min_idle_inactive_time_secs;
  3058. u32 ap_keepalive_max_idle_inactive_time_secs;
  3059. u32 ap_keepalive_max_unresponsive_time_secs;
  3060. u32 ap_enable_nawds;
  3061. u32 mcast2ucast_set;
  3062. u32 enable_rtscts;
  3063. u32 txbf;
  3064. u32 packet_powersave;
  3065. u32 drop_unencry;
  3066. u32 tx_encap_type;
  3067. u32 ap_detect_out_of_sync_sleeping_sta_time_secs;
  3068. };
  3069. #define WMI_VDEV_PARAM_UNSUPPORTED 0
  3070. /* the definition of different VDEV parameters */
  3071. enum wmi_vdev_param {
  3072. /* RTS Threshold */
  3073. WMI_VDEV_PARAM_RTS_THRESHOLD = 0x1,
  3074. /* Fragmentation threshold */
  3075. WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
  3076. /* beacon interval in TUs */
  3077. WMI_VDEV_PARAM_BEACON_INTERVAL,
  3078. /* Listen interval in TUs */
  3079. WMI_VDEV_PARAM_LISTEN_INTERVAL,
  3080. /* muticast rate in Mbps */
  3081. WMI_VDEV_PARAM_MULTICAST_RATE,
  3082. /* management frame rate in Mbps */
  3083. WMI_VDEV_PARAM_MGMT_TX_RATE,
  3084. /* slot time (long vs short) */
  3085. WMI_VDEV_PARAM_SLOT_TIME,
  3086. /* preamble (long vs short) */
  3087. WMI_VDEV_PARAM_PREAMBLE,
  3088. /* SWBA time (time before tbtt in msec) */
  3089. WMI_VDEV_PARAM_SWBA_TIME,
  3090. /* time period for updating VDEV stats */
  3091. WMI_VDEV_STATS_UPDATE_PERIOD,
  3092. /* age out time in msec for frames queued for station in power save */
  3093. WMI_VDEV_PWRSAVE_AGEOUT_TIME,
  3094. /*
  3095. * Host SWBA interval (time in msec before tbtt for SWBA event
  3096. * generation).
  3097. */
  3098. WMI_VDEV_HOST_SWBA_INTERVAL,
  3099. /* DTIM period (specified in units of num beacon intervals) */
  3100. WMI_VDEV_PARAM_DTIM_PERIOD,
  3101. /*
  3102. * scheduler air time limit for this VDEV. used by off chan
  3103. * scheduler.
  3104. */
  3105. WMI_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
  3106. /* enable/dsiable WDS for this VDEV */
  3107. WMI_VDEV_PARAM_WDS,
  3108. /* ATIM Window */
  3109. WMI_VDEV_PARAM_ATIM_WINDOW,
  3110. /* BMISS max */
  3111. WMI_VDEV_PARAM_BMISS_COUNT_MAX,
  3112. /* BMISS first time */
  3113. WMI_VDEV_PARAM_BMISS_FIRST_BCNT,
  3114. /* BMISS final time */
  3115. WMI_VDEV_PARAM_BMISS_FINAL_BCNT,
  3116. /* WMM enables/disabled */
  3117. WMI_VDEV_PARAM_FEATURE_WMM,
  3118. /* Channel width */
  3119. WMI_VDEV_PARAM_CHWIDTH,
  3120. /* Channel Offset */
  3121. WMI_VDEV_PARAM_CHEXTOFFSET,
  3122. /* Disable HT Protection */
  3123. WMI_VDEV_PARAM_DISABLE_HTPROTECTION,
  3124. /* Quick STA Kickout */
  3125. WMI_VDEV_PARAM_STA_QUICKKICKOUT,
  3126. /* Rate to be used with Management frames */
  3127. WMI_VDEV_PARAM_MGMT_RATE,
  3128. /* Protection Mode */
  3129. WMI_VDEV_PARAM_PROTECTION_MODE,
  3130. /* Fixed rate setting */
  3131. WMI_VDEV_PARAM_FIXED_RATE,
  3132. /* Short GI Enable/Disable */
  3133. WMI_VDEV_PARAM_SGI,
  3134. /* Enable LDPC */
  3135. WMI_VDEV_PARAM_LDPC,
  3136. /* Enable Tx STBC */
  3137. WMI_VDEV_PARAM_TX_STBC,
  3138. /* Enable Rx STBC */
  3139. WMI_VDEV_PARAM_RX_STBC,
  3140. /* Intra BSS forwarding */
  3141. WMI_VDEV_PARAM_INTRA_BSS_FWD,
  3142. /* Setting Default xmit key for Vdev */
  3143. WMI_VDEV_PARAM_DEF_KEYID,
  3144. /* NSS width */
  3145. WMI_VDEV_PARAM_NSS,
  3146. /* Set the custom rate for the broadcast data frames */
  3147. WMI_VDEV_PARAM_BCAST_DATA_RATE,
  3148. /* Set the custom rate (rate-code) for multicast data frames */
  3149. WMI_VDEV_PARAM_MCAST_DATA_RATE,
  3150. /* Tx multicast packet indicate Enable/Disable */
  3151. WMI_VDEV_PARAM_MCAST_INDICATE,
  3152. /* Tx DHCP packet indicate Enable/Disable */
  3153. WMI_VDEV_PARAM_DHCP_INDICATE,
  3154. /* Enable host inspection of Tx unicast packet to unknown destination */
  3155. WMI_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
  3156. /* The minimum amount of time AP begins to consider STA inactive */
  3157. WMI_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
  3158. /*
  3159. * An associated STA is considered inactive when there is no recent
  3160. * TX/RX activity and no downlink frames are buffered for it. Once a
  3161. * STA exceeds the maximum idle inactive time, the AP will send an
  3162. * 802.11 data-null as a keep alive to verify the STA is still
  3163. * associated. If the STA does ACK the data-null, or if the data-null
  3164. * is buffered and the STA does not retrieve it, the STA will be
  3165. * considered unresponsive
  3166. * (see WMI_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
  3167. */
  3168. WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
  3169. /*
  3170. * An associated STA is considered unresponsive if there is no recent
  3171. * TX/RX activity and downlink frames are buffered for it. Once a STA
  3172. * exceeds the maximum unresponsive time, the AP will send a
  3173. * WMI_STA_KICKOUT event to the host so the STA can be deleted. */
  3174. WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
  3175. /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
  3176. WMI_VDEV_PARAM_AP_ENABLE_NAWDS,
  3177. /* Enable/Disable RTS-CTS */
  3178. WMI_VDEV_PARAM_ENABLE_RTSCTS,
  3179. /* Enable TXBFee/er */
  3180. WMI_VDEV_PARAM_TXBF,
  3181. /* Set packet power save */
  3182. WMI_VDEV_PARAM_PACKET_POWERSAVE,
  3183. /*
  3184. * Drops un-encrypted packets if eceived in an encrypted connection
  3185. * otherwise forwards to host.
  3186. */
  3187. WMI_VDEV_PARAM_DROP_UNENCRY,
  3188. /*
  3189. * Set the encapsulation type for frames.
  3190. */
  3191. WMI_VDEV_PARAM_TX_ENCAP_TYPE,
  3192. };
  3193. /* the definition of different VDEV parameters */
  3194. enum wmi_10x_vdev_param {
  3195. /* RTS Threshold */
  3196. WMI_10X_VDEV_PARAM_RTS_THRESHOLD = 0x1,
  3197. /* Fragmentation threshold */
  3198. WMI_10X_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
  3199. /* beacon interval in TUs */
  3200. WMI_10X_VDEV_PARAM_BEACON_INTERVAL,
  3201. /* Listen interval in TUs */
  3202. WMI_10X_VDEV_PARAM_LISTEN_INTERVAL,
  3203. /* muticast rate in Mbps */
  3204. WMI_10X_VDEV_PARAM_MULTICAST_RATE,
  3205. /* management frame rate in Mbps */
  3206. WMI_10X_VDEV_PARAM_MGMT_TX_RATE,
  3207. /* slot time (long vs short) */
  3208. WMI_10X_VDEV_PARAM_SLOT_TIME,
  3209. /* preamble (long vs short) */
  3210. WMI_10X_VDEV_PARAM_PREAMBLE,
  3211. /* SWBA time (time before tbtt in msec) */
  3212. WMI_10X_VDEV_PARAM_SWBA_TIME,
  3213. /* time period for updating VDEV stats */
  3214. WMI_10X_VDEV_STATS_UPDATE_PERIOD,
  3215. /* age out time in msec for frames queued for station in power save */
  3216. WMI_10X_VDEV_PWRSAVE_AGEOUT_TIME,
  3217. /*
  3218. * Host SWBA interval (time in msec before tbtt for SWBA event
  3219. * generation).
  3220. */
  3221. WMI_10X_VDEV_HOST_SWBA_INTERVAL,
  3222. /* DTIM period (specified in units of num beacon intervals) */
  3223. WMI_10X_VDEV_PARAM_DTIM_PERIOD,
  3224. /*
  3225. * scheduler air time limit for this VDEV. used by off chan
  3226. * scheduler.
  3227. */
  3228. WMI_10X_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
  3229. /* enable/dsiable WDS for this VDEV */
  3230. WMI_10X_VDEV_PARAM_WDS,
  3231. /* ATIM Window */
  3232. WMI_10X_VDEV_PARAM_ATIM_WINDOW,
  3233. /* BMISS max */
  3234. WMI_10X_VDEV_PARAM_BMISS_COUNT_MAX,
  3235. /* WMM enables/disabled */
  3236. WMI_10X_VDEV_PARAM_FEATURE_WMM,
  3237. /* Channel width */
  3238. WMI_10X_VDEV_PARAM_CHWIDTH,
  3239. /* Channel Offset */
  3240. WMI_10X_VDEV_PARAM_CHEXTOFFSET,
  3241. /* Disable HT Protection */
  3242. WMI_10X_VDEV_PARAM_DISABLE_HTPROTECTION,
  3243. /* Quick STA Kickout */
  3244. WMI_10X_VDEV_PARAM_STA_QUICKKICKOUT,
  3245. /* Rate to be used with Management frames */
  3246. WMI_10X_VDEV_PARAM_MGMT_RATE,
  3247. /* Protection Mode */
  3248. WMI_10X_VDEV_PARAM_PROTECTION_MODE,
  3249. /* Fixed rate setting */
  3250. WMI_10X_VDEV_PARAM_FIXED_RATE,
  3251. /* Short GI Enable/Disable */
  3252. WMI_10X_VDEV_PARAM_SGI,
  3253. /* Enable LDPC */
  3254. WMI_10X_VDEV_PARAM_LDPC,
  3255. /* Enable Tx STBC */
  3256. WMI_10X_VDEV_PARAM_TX_STBC,
  3257. /* Enable Rx STBC */
  3258. WMI_10X_VDEV_PARAM_RX_STBC,
  3259. /* Intra BSS forwarding */
  3260. WMI_10X_VDEV_PARAM_INTRA_BSS_FWD,
  3261. /* Setting Default xmit key for Vdev */
  3262. WMI_10X_VDEV_PARAM_DEF_KEYID,
  3263. /* NSS width */
  3264. WMI_10X_VDEV_PARAM_NSS,
  3265. /* Set the custom rate for the broadcast data frames */
  3266. WMI_10X_VDEV_PARAM_BCAST_DATA_RATE,
  3267. /* Set the custom rate (rate-code) for multicast data frames */
  3268. WMI_10X_VDEV_PARAM_MCAST_DATA_RATE,
  3269. /* Tx multicast packet indicate Enable/Disable */
  3270. WMI_10X_VDEV_PARAM_MCAST_INDICATE,
  3271. /* Tx DHCP packet indicate Enable/Disable */
  3272. WMI_10X_VDEV_PARAM_DHCP_INDICATE,
  3273. /* Enable host inspection of Tx unicast packet to unknown destination */
  3274. WMI_10X_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
  3275. /* The minimum amount of time AP begins to consider STA inactive */
  3276. WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
  3277. /*
  3278. * An associated STA is considered inactive when there is no recent
  3279. * TX/RX activity and no downlink frames are buffered for it. Once a
  3280. * STA exceeds the maximum idle inactive time, the AP will send an
  3281. * 802.11 data-null as a keep alive to verify the STA is still
  3282. * associated. If the STA does ACK the data-null, or if the data-null
  3283. * is buffered and the STA does not retrieve it, the STA will be
  3284. * considered unresponsive
  3285. * (see WMI_10X_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
  3286. */
  3287. WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
  3288. /*
  3289. * An associated STA is considered unresponsive if there is no recent
  3290. * TX/RX activity and downlink frames are buffered for it. Once a STA
  3291. * exceeds the maximum unresponsive time, the AP will send a
  3292. * WMI_10X_STA_KICKOUT event to the host so the STA can be deleted. */
  3293. WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
  3294. /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
  3295. WMI_10X_VDEV_PARAM_AP_ENABLE_NAWDS,
  3296. WMI_10X_VDEV_PARAM_MCAST2UCAST_SET,
  3297. /* Enable/Disable RTS-CTS */
  3298. WMI_10X_VDEV_PARAM_ENABLE_RTSCTS,
  3299. WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,
  3300. /* following are available as of firmware 10.2 */
  3301. WMI_10X_VDEV_PARAM_TX_ENCAP_TYPE,
  3302. WMI_10X_VDEV_PARAM_CABQ_MAXDUR,
  3303. WMI_10X_VDEV_PARAM_MFPTEST_SET,
  3304. WMI_10X_VDEV_PARAM_RTS_FIXED_RATE,
  3305. WMI_10X_VDEV_PARAM_VHT_SGIMASK,
  3306. WMI_10X_VDEV_PARAM_VHT80_RATEMASK,
  3307. };
  3308. /* slot time long */
  3309. #define WMI_VDEV_SLOT_TIME_LONG 0x1
  3310. /* slot time short */
  3311. #define WMI_VDEV_SLOT_TIME_SHORT 0x2
  3312. /* preablbe long */
  3313. #define WMI_VDEV_PREAMBLE_LONG 0x1
  3314. /* preablbe short */
  3315. #define WMI_VDEV_PREAMBLE_SHORT 0x2
  3316. enum wmi_start_event_param {
  3317. WMI_VDEV_RESP_START_EVENT = 0,
  3318. WMI_VDEV_RESP_RESTART_EVENT,
  3319. };
  3320. struct wmi_vdev_start_response_event {
  3321. __le32 vdev_id;
  3322. __le32 req_id;
  3323. __le32 resp_type; /* %WMI_VDEV_RESP_ */
  3324. __le32 status;
  3325. } __packed;
  3326. struct wmi_vdev_standby_req_event {
  3327. /* unique id identifying the VDEV, generated by the caller */
  3328. __le32 vdev_id;
  3329. } __packed;
  3330. struct wmi_vdev_resume_req_event {
  3331. /* unique id identifying the VDEV, generated by the caller */
  3332. __le32 vdev_id;
  3333. } __packed;
  3334. struct wmi_vdev_stopped_event {
  3335. /* unique id identifying the VDEV, generated by the caller */
  3336. __le32 vdev_id;
  3337. } __packed;
  3338. /*
  3339. * common structure used for simple events
  3340. * (stopped, resume_req, standby response)
  3341. */
  3342. struct wmi_vdev_simple_event {
  3343. /* unique id identifying the VDEV, generated by the caller */
  3344. __le32 vdev_id;
  3345. } __packed;
  3346. /* VDEV start response status codes */
  3347. /* VDEV succesfully started */
  3348. #define WMI_INIFIED_VDEV_START_RESPONSE_STATUS_SUCCESS 0x0
  3349. /* requested VDEV not found */
  3350. #define WMI_INIFIED_VDEV_START_RESPONSE_INVALID_VDEVID 0x1
  3351. /* unsupported VDEV combination */
  3352. #define WMI_INIFIED_VDEV_START_RESPONSE_NOT_SUPPORTED 0x2
  3353. /* TODO: please add more comments if you have in-depth information */
  3354. struct wmi_vdev_spectral_conf_cmd {
  3355. __le32 vdev_id;
  3356. /* number of fft samples to send (0 for infinite) */
  3357. __le32 scan_count;
  3358. __le32 scan_period;
  3359. __le32 scan_priority;
  3360. /* number of bins in the FFT: 2^(fft_size - bin_scale) */
  3361. __le32 scan_fft_size;
  3362. __le32 scan_gc_ena;
  3363. __le32 scan_restart_ena;
  3364. __le32 scan_noise_floor_ref;
  3365. __le32 scan_init_delay;
  3366. __le32 scan_nb_tone_thr;
  3367. __le32 scan_str_bin_thr;
  3368. __le32 scan_wb_rpt_mode;
  3369. __le32 scan_rssi_rpt_mode;
  3370. __le32 scan_rssi_thr;
  3371. __le32 scan_pwr_format;
  3372. /* rpt_mode: Format of FFT report to software for spectral scan
  3373. * triggered FFTs:
  3374. * 0: No FFT report (only spectral scan summary report)
  3375. * 1: 2-dword summary of metrics for each completed FFT + spectral
  3376. * scan summary report
  3377. * 2: 2-dword summary of metrics for each completed FFT +
  3378. * 1x- oversampled bins(in-band) per FFT + spectral scan summary
  3379. * report
  3380. * 3: 2-dword summary of metrics for each completed FFT +
  3381. * 2x- oversampled bins (all) per FFT + spectral scan summary
  3382. */
  3383. __le32 scan_rpt_mode;
  3384. __le32 scan_bin_scale;
  3385. __le32 scan_dbm_adj;
  3386. __le32 scan_chn_mask;
  3387. } __packed;
  3388. struct wmi_vdev_spectral_conf_arg {
  3389. u32 vdev_id;
  3390. u32 scan_count;
  3391. u32 scan_period;
  3392. u32 scan_priority;
  3393. u32 scan_fft_size;
  3394. u32 scan_gc_ena;
  3395. u32 scan_restart_ena;
  3396. u32 scan_noise_floor_ref;
  3397. u32 scan_init_delay;
  3398. u32 scan_nb_tone_thr;
  3399. u32 scan_str_bin_thr;
  3400. u32 scan_wb_rpt_mode;
  3401. u32 scan_rssi_rpt_mode;
  3402. u32 scan_rssi_thr;
  3403. u32 scan_pwr_format;
  3404. u32 scan_rpt_mode;
  3405. u32 scan_bin_scale;
  3406. u32 scan_dbm_adj;
  3407. u32 scan_chn_mask;
  3408. };
  3409. #define WMI_SPECTRAL_ENABLE_DEFAULT 0
  3410. #define WMI_SPECTRAL_COUNT_DEFAULT 0
  3411. #define WMI_SPECTRAL_PERIOD_DEFAULT 35
  3412. #define WMI_SPECTRAL_PRIORITY_DEFAULT 1
  3413. #define WMI_SPECTRAL_FFT_SIZE_DEFAULT 7
  3414. #define WMI_SPECTRAL_GC_ENA_DEFAULT 1
  3415. #define WMI_SPECTRAL_RESTART_ENA_DEFAULT 0
  3416. #define WMI_SPECTRAL_NOISE_FLOOR_REF_DEFAULT -96
  3417. #define WMI_SPECTRAL_INIT_DELAY_DEFAULT 80
  3418. #define WMI_SPECTRAL_NB_TONE_THR_DEFAULT 12
  3419. #define WMI_SPECTRAL_STR_BIN_THR_DEFAULT 8
  3420. #define WMI_SPECTRAL_WB_RPT_MODE_DEFAULT 0
  3421. #define WMI_SPECTRAL_RSSI_RPT_MODE_DEFAULT 0
  3422. #define WMI_SPECTRAL_RSSI_THR_DEFAULT 0xf0
  3423. #define WMI_SPECTRAL_PWR_FORMAT_DEFAULT 0
  3424. #define WMI_SPECTRAL_RPT_MODE_DEFAULT 2
  3425. #define WMI_SPECTRAL_BIN_SCALE_DEFAULT 1
  3426. #define WMI_SPECTRAL_DBM_ADJ_DEFAULT 1
  3427. #define WMI_SPECTRAL_CHN_MASK_DEFAULT 1
  3428. struct wmi_vdev_spectral_enable_cmd {
  3429. __le32 vdev_id;
  3430. __le32 trigger_cmd;
  3431. __le32 enable_cmd;
  3432. } __packed;
  3433. #define WMI_SPECTRAL_TRIGGER_CMD_TRIGGER 1
  3434. #define WMI_SPECTRAL_TRIGGER_CMD_CLEAR 2
  3435. #define WMI_SPECTRAL_ENABLE_CMD_ENABLE 1
  3436. #define WMI_SPECTRAL_ENABLE_CMD_DISABLE 2
  3437. /* Beacon processing related command and event structures */
  3438. struct wmi_bcn_tx_hdr {
  3439. __le32 vdev_id;
  3440. __le32 tx_rate;
  3441. __le32 tx_power;
  3442. __le32 bcn_len;
  3443. } __packed;
  3444. struct wmi_bcn_tx_cmd {
  3445. struct wmi_bcn_tx_hdr hdr;
  3446. u8 *bcn[0];
  3447. } __packed;
  3448. struct wmi_bcn_tx_arg {
  3449. u32 vdev_id;
  3450. u32 tx_rate;
  3451. u32 tx_power;
  3452. u32 bcn_len;
  3453. const void *bcn;
  3454. };
  3455. enum wmi_bcn_tx_ref_flags {
  3456. WMI_BCN_TX_REF_FLAG_DTIM_ZERO = 0x1,
  3457. WMI_BCN_TX_REF_FLAG_DELIVER_CAB = 0x2,
  3458. };
  3459. /* TODO: It is unclear why "no antenna" works while any other seemingly valid
  3460. * chainmask yields no beacons on the air at all.
  3461. */
  3462. #define WMI_BCN_TX_REF_DEF_ANTENNA 0
  3463. struct wmi_bcn_tx_ref_cmd {
  3464. __le32 vdev_id;
  3465. __le32 data_len;
  3466. /* physical address of the frame - dma pointer */
  3467. __le32 data_ptr;
  3468. /* id for host to track */
  3469. __le32 msdu_id;
  3470. /* frame ctrl to setup PPDU desc */
  3471. __le32 frame_control;
  3472. /* to control CABQ traffic: WMI_BCN_TX_REF_FLAG_ */
  3473. __le32 flags;
  3474. /* introduced in 10.2 */
  3475. __le32 antenna_mask;
  3476. } __packed;
  3477. /* Beacon filter */
  3478. #define WMI_BCN_FILTER_ALL 0 /* Filter all beacons */
  3479. #define WMI_BCN_FILTER_NONE 1 /* Pass all beacons */
  3480. #define WMI_BCN_FILTER_RSSI 2 /* Pass Beacons RSSI >= RSSI threshold */
  3481. #define WMI_BCN_FILTER_BSSID 3 /* Pass Beacons with matching BSSID */
  3482. #define WMI_BCN_FILTER_SSID 4 /* Pass Beacons with matching SSID */
  3483. struct wmi_bcn_filter_rx_cmd {
  3484. /* Filter ID */
  3485. __le32 bcn_filter_id;
  3486. /* Filter type - wmi_bcn_filter */
  3487. __le32 bcn_filter;
  3488. /* Buffer len */
  3489. __le32 bcn_filter_len;
  3490. /* Filter info (threshold, BSSID, RSSI) */
  3491. u8 *bcn_filter_buf;
  3492. } __packed;
  3493. /* Capabilities and IEs to be passed to firmware */
  3494. struct wmi_bcn_prb_info {
  3495. /* Capabilities */
  3496. __le32 caps;
  3497. /* ERP info */
  3498. __le32 erp;
  3499. /* Advanced capabilities */
  3500. /* HT capabilities */
  3501. /* HT Info */
  3502. /* ibss_dfs */
  3503. /* wpa Info */
  3504. /* rsn Info */
  3505. /* rrm info */
  3506. /* ath_ext */
  3507. /* app IE */
  3508. } __packed;
  3509. struct wmi_bcn_tmpl_cmd {
  3510. /* unique id identifying the VDEV, generated by the caller */
  3511. __le32 vdev_id;
  3512. /* TIM IE offset from the beginning of the template. */
  3513. __le32 tim_ie_offset;
  3514. /* beacon probe capabilities and IEs */
  3515. struct wmi_bcn_prb_info bcn_prb_info;
  3516. /* beacon buffer length */
  3517. __le32 buf_len;
  3518. /* variable length data */
  3519. u8 data[1];
  3520. } __packed;
  3521. struct wmi_prb_tmpl_cmd {
  3522. /* unique id identifying the VDEV, generated by the caller */
  3523. __le32 vdev_id;
  3524. /* beacon probe capabilities and IEs */
  3525. struct wmi_bcn_prb_info bcn_prb_info;
  3526. /* beacon buffer length */
  3527. __le32 buf_len;
  3528. /* Variable length data */
  3529. u8 data[1];
  3530. } __packed;
  3531. enum wmi_sta_ps_mode {
  3532. /* enable power save for the given STA VDEV */
  3533. WMI_STA_PS_MODE_DISABLED = 0,
  3534. /* disable power save for a given STA VDEV */
  3535. WMI_STA_PS_MODE_ENABLED = 1,
  3536. };
  3537. struct wmi_sta_powersave_mode_cmd {
  3538. /* unique id identifying the VDEV, generated by the caller */
  3539. __le32 vdev_id;
  3540. /*
  3541. * Power save mode
  3542. * (see enum wmi_sta_ps_mode)
  3543. */
  3544. __le32 sta_ps_mode;
  3545. } __packed;
  3546. enum wmi_csa_offload_en {
  3547. WMI_CSA_OFFLOAD_DISABLE = 0,
  3548. WMI_CSA_OFFLOAD_ENABLE = 1,
  3549. };
  3550. struct wmi_csa_offload_enable_cmd {
  3551. __le32 vdev_id;
  3552. __le32 csa_offload_enable;
  3553. } __packed;
  3554. struct wmi_csa_offload_chanswitch_cmd {
  3555. __le32 vdev_id;
  3556. struct wmi_channel chan;
  3557. } __packed;
  3558. /*
  3559. * This parameter controls the policy for retrieving frames from AP while the
  3560. * STA is in sleep state.
  3561. *
  3562. * Only takes affect if the sta_ps_mode is enabled
  3563. */
  3564. enum wmi_sta_ps_param_rx_wake_policy {
  3565. /*
  3566. * Wake up when ever there is an RX activity on the VDEV. In this mode
  3567. * the Power save SM(state machine) will come out of sleep by either
  3568. * sending null frame (or) a data frame (with PS==0) in response to TIM
  3569. * bit set in the received beacon frame from AP.
  3570. */
  3571. WMI_STA_PS_RX_WAKE_POLICY_WAKE = 0,
  3572. /*
  3573. * Here the power save state machine will not wakeup in response to TIM
  3574. * bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD
  3575. * configuration setup by WMISET_PS_SET_UAPSD WMI command. When all
  3576. * access categories are delivery-enabled, the station will send a
  3577. * UAPSD trigger frame, otherwise it will send a PS-Poll.
  3578. */
  3579. WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1,
  3580. };
  3581. /*
  3582. * Number of tx frames/beacon that cause the power save SM to wake up.
  3583. *
  3584. * Value 1 causes the SM to wake up for every TX. Value 0 has a special
  3585. * meaning, It will cause the SM to never wake up. This is useful if you want
  3586. * to keep the system to sleep all the time for some kind of test mode . host
  3587. * can change this parameter any time. It will affect at the next tx frame.
  3588. */
  3589. enum wmi_sta_ps_param_tx_wake_threshold {
  3590. WMI_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0,
  3591. WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1,
  3592. /*
  3593. * Values greater than one indicate that many TX attempts per beacon
  3594. * interval before the STA will wake up
  3595. */
  3596. };
  3597. /*
  3598. * The maximum number of PS-Poll frames the FW will send in response to
  3599. * traffic advertised in TIM before waking up (by sending a null frame with PS
  3600. * = 0). Value 0 has a special meaning: there is no maximum count and the FW
  3601. * will send as many PS-Poll as are necessary to retrieve buffered BU. This
  3602. * parameter is used when the RX wake policy is
  3603. * WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD and ignored when the RX wake
  3604. * policy is WMI_STA_PS_RX_WAKE_POLICY_WAKE.
  3605. */
  3606. enum wmi_sta_ps_param_pspoll_count {
  3607. WMI_STA_PS_PSPOLL_COUNT_NO_MAX = 0,
  3608. /*
  3609. * Values greater than 0 indicate the maximum numer of PS-Poll frames
  3610. * FW will send before waking up.
  3611. */
  3612. };
  3613. /*
  3614. * This will include the delivery and trigger enabled state for every AC.
  3615. * This is the negotiated state with AP. The host MLME needs to set this based
  3616. * on AP capability and the state Set in the association request by the
  3617. * station MLME.Lower 8 bits of the value specify the UAPSD configuration.
  3618. */
  3619. #define WMI_UAPSD_AC_TYPE_DELI 0
  3620. #define WMI_UAPSD_AC_TYPE_TRIG 1
  3621. #define WMI_UAPSD_AC_BIT_MASK(ac, type) \
  3622. ((type == WMI_UAPSD_AC_TYPE_DELI) ? (1<<(ac<<1)) : (1<<((ac<<1)+1)))
  3623. enum wmi_sta_ps_param_uapsd {
  3624. WMI_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
  3625. WMI_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
  3626. WMI_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
  3627. WMI_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
  3628. WMI_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
  3629. WMI_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
  3630. WMI_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
  3631. WMI_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
  3632. };
  3633. enum wmi_sta_powersave_param {
  3634. /*
  3635. * Controls how frames are retrievd from AP while STA is sleeping
  3636. *
  3637. * (see enum wmi_sta_ps_param_rx_wake_policy)
  3638. */
  3639. WMI_STA_PS_PARAM_RX_WAKE_POLICY = 0,
  3640. /*
  3641. * The STA will go active after this many TX
  3642. *
  3643. * (see enum wmi_sta_ps_param_tx_wake_threshold)
  3644. */
  3645. WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
  3646. /*
  3647. * Number of PS-Poll to send before STA wakes up
  3648. *
  3649. * (see enum wmi_sta_ps_param_pspoll_count)
  3650. *
  3651. */
  3652. WMI_STA_PS_PARAM_PSPOLL_COUNT = 2,
  3653. /*
  3654. * TX/RX inactivity time in msec before going to sleep.
  3655. *
  3656. * The power save SM will monitor tx/rx activity on the VDEV, if no
  3657. * activity for the specified msec of the parameter the Power save
  3658. * SM will go to sleep.
  3659. */
  3660. WMI_STA_PS_PARAM_INACTIVITY_TIME = 3,
  3661. /*
  3662. * Set uapsd configuration.
  3663. *
  3664. * (see enum wmi_sta_ps_param_uapsd)
  3665. */
  3666. WMI_STA_PS_PARAM_UAPSD = 4,
  3667. };
  3668. struct wmi_sta_powersave_param_cmd {
  3669. __le32 vdev_id;
  3670. __le32 param_id; /* %WMI_STA_PS_PARAM_ */
  3671. __le32 param_value;
  3672. } __packed;
  3673. /* No MIMO power save */
  3674. #define WMI_STA_MIMO_PS_MODE_DISABLE
  3675. /* mimo powersave mode static*/
  3676. #define WMI_STA_MIMO_PS_MODE_STATIC
  3677. /* mimo powersave mode dynamic */
  3678. #define WMI_STA_MIMO_PS_MODE_DYNAMIC
  3679. struct wmi_sta_mimo_ps_mode_cmd {
  3680. /* unique id identifying the VDEV, generated by the caller */
  3681. __le32 vdev_id;
  3682. /* mimo powersave mode as defined above */
  3683. __le32 mimo_pwrsave_mode;
  3684. } __packed;
  3685. /* U-APSD configuration of peer station from (re)assoc request and TSPECs */
  3686. enum wmi_ap_ps_param_uapsd {
  3687. WMI_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
  3688. WMI_AP_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
  3689. WMI_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
  3690. WMI_AP_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
  3691. WMI_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
  3692. WMI_AP_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
  3693. WMI_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
  3694. WMI_AP_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
  3695. };
  3696. /* U-APSD maximum service period of peer station */
  3697. enum wmi_ap_ps_peer_param_max_sp {
  3698. WMI_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0,
  3699. WMI_AP_PS_PEER_PARAM_MAX_SP_2 = 1,
  3700. WMI_AP_PS_PEER_PARAM_MAX_SP_4 = 2,
  3701. WMI_AP_PS_PEER_PARAM_MAX_SP_6 = 3,
  3702. MAX_WMI_AP_PS_PEER_PARAM_MAX_SP,
  3703. };
  3704. /*
  3705. * AP power save parameter
  3706. * Set a power save specific parameter for a peer station
  3707. */
  3708. enum wmi_ap_ps_peer_param {
  3709. /* Set uapsd configuration for a given peer.
  3710. *
  3711. * Include the delivery and trigger enabled state for every AC.
  3712. * The host MLME needs to set this based on AP capability and stations
  3713. * request Set in the association request received from the station.
  3714. *
  3715. * Lower 8 bits of the value specify the UAPSD configuration.
  3716. *
  3717. * (see enum wmi_ap_ps_param_uapsd)
  3718. * The default value is 0.
  3719. */
  3720. WMI_AP_PS_PEER_PARAM_UAPSD = 0,
  3721. /*
  3722. * Set the service period for a UAPSD capable station
  3723. *
  3724. * The service period from wme ie in the (re)assoc request frame.
  3725. *
  3726. * (see enum wmi_ap_ps_peer_param_max_sp)
  3727. */
  3728. WMI_AP_PS_PEER_PARAM_MAX_SP = 1,
  3729. /* Time in seconds for aging out buffered frames for STA in PS */
  3730. WMI_AP_PS_PEER_PARAM_AGEOUT_TIME = 2,
  3731. };
  3732. struct wmi_ap_ps_peer_cmd {
  3733. /* unique id identifying the VDEV, generated by the caller */
  3734. __le32 vdev_id;
  3735. /* peer MAC address */
  3736. struct wmi_mac_addr peer_macaddr;
  3737. /* AP powersave param (see enum wmi_ap_ps_peer_param) */
  3738. __le32 param_id;
  3739. /* AP powersave param value */
  3740. __le32 param_value;
  3741. } __packed;
  3742. /* 128 clients = 4 words */
  3743. #define WMI_TIM_BITMAP_ARRAY_SIZE 4
  3744. struct wmi_tim_info {
  3745. __le32 tim_len;
  3746. __le32 tim_mcast;
  3747. __le32 tim_bitmap[WMI_TIM_BITMAP_ARRAY_SIZE];
  3748. __le32 tim_changed;
  3749. __le32 tim_num_ps_pending;
  3750. } __packed;
  3751. /* Maximum number of NOA Descriptors supported */
  3752. #define WMI_P2P_MAX_NOA_DESCRIPTORS 4
  3753. #define WMI_P2P_OPPPS_ENABLE_BIT BIT(0)
  3754. #define WMI_P2P_OPPPS_CTWINDOW_OFFSET 1
  3755. #define WMI_P2P_NOA_CHANGED_BIT BIT(0)
  3756. struct wmi_p2p_noa_info {
  3757. /* Bit 0 - Flag to indicate an update in NOA schedule
  3758. Bits 7-1 - Reserved */
  3759. u8 changed;
  3760. /* NOA index */
  3761. u8 index;
  3762. /* Bit 0 - Opp PS state of the AP
  3763. Bits 1-7 - Ctwindow in TUs */
  3764. u8 ctwindow_oppps;
  3765. /* Number of NOA descriptors */
  3766. u8 num_descriptors;
  3767. struct wmi_p2p_noa_descriptor descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS];
  3768. } __packed;
  3769. struct wmi_bcn_info {
  3770. struct wmi_tim_info tim_info;
  3771. struct wmi_p2p_noa_info p2p_noa_info;
  3772. } __packed;
  3773. struct wmi_host_swba_event {
  3774. __le32 vdev_map;
  3775. struct wmi_bcn_info bcn_info[1];
  3776. } __packed;
  3777. #define WMI_MAX_AP_VDEV 16
  3778. struct wmi_tbtt_offset_event {
  3779. __le32 vdev_map;
  3780. __le32 tbttoffset_list[WMI_MAX_AP_VDEV];
  3781. } __packed;
  3782. struct wmi_peer_create_cmd {
  3783. __le32 vdev_id;
  3784. struct wmi_mac_addr peer_macaddr;
  3785. } __packed;
  3786. struct wmi_peer_delete_cmd {
  3787. __le32 vdev_id;
  3788. struct wmi_mac_addr peer_macaddr;
  3789. } __packed;
  3790. struct wmi_peer_flush_tids_cmd {
  3791. __le32 vdev_id;
  3792. struct wmi_mac_addr peer_macaddr;
  3793. __le32 peer_tid_bitmap;
  3794. } __packed;
  3795. struct wmi_fixed_rate {
  3796. /*
  3797. * rate mode . 0: disable fixed rate (auto rate)
  3798. * 1: legacy (non 11n) rate specified as ieee rate 2*Mbps
  3799. * 2: ht20 11n rate specified as mcs index
  3800. * 3: ht40 11n rate specified as mcs index
  3801. */
  3802. __le32 rate_mode;
  3803. /*
  3804. * 4 rate values for 4 rate series. series 0 is stored in byte 0 (LSB)
  3805. * and series 3 is stored at byte 3 (MSB)
  3806. */
  3807. __le32 rate_series;
  3808. /*
  3809. * 4 retry counts for 4 rate series. retry count for rate 0 is stored
  3810. * in byte 0 (LSB) and retry count for rate 3 is stored at byte 3
  3811. * (MSB)
  3812. */
  3813. __le32 rate_retries;
  3814. } __packed;
  3815. struct wmi_peer_fixed_rate_cmd {
  3816. /* unique id identifying the VDEV, generated by the caller */
  3817. __le32 vdev_id;
  3818. /* peer MAC address */
  3819. struct wmi_mac_addr peer_macaddr;
  3820. /* fixed rate */
  3821. struct wmi_fixed_rate peer_fixed_rate;
  3822. } __packed;
  3823. #define WMI_MGMT_TID 17
  3824. struct wmi_addba_clear_resp_cmd {
  3825. /* unique id identifying the VDEV, generated by the caller */
  3826. __le32 vdev_id;
  3827. /* peer MAC address */
  3828. struct wmi_mac_addr peer_macaddr;
  3829. } __packed;
  3830. struct wmi_addba_send_cmd {
  3831. /* unique id identifying the VDEV, generated by the caller */
  3832. __le32 vdev_id;
  3833. /* peer MAC address */
  3834. struct wmi_mac_addr peer_macaddr;
  3835. /* Tid number */
  3836. __le32 tid;
  3837. /* Buffer/Window size*/
  3838. __le32 buffersize;
  3839. } __packed;
  3840. struct wmi_delba_send_cmd {
  3841. /* unique id identifying the VDEV, generated by the caller */
  3842. __le32 vdev_id;
  3843. /* peer MAC address */
  3844. struct wmi_mac_addr peer_macaddr;
  3845. /* Tid number */
  3846. __le32 tid;
  3847. /* Is Initiator */
  3848. __le32 initiator;
  3849. /* Reason code */
  3850. __le32 reasoncode;
  3851. } __packed;
  3852. struct wmi_addba_setresponse_cmd {
  3853. /* unique id identifying the vdev, generated by the caller */
  3854. __le32 vdev_id;
  3855. /* peer mac address */
  3856. struct wmi_mac_addr peer_macaddr;
  3857. /* Tid number */
  3858. __le32 tid;
  3859. /* status code */
  3860. __le32 statuscode;
  3861. } __packed;
  3862. struct wmi_send_singleamsdu_cmd {
  3863. /* unique id identifying the vdev, generated by the caller */
  3864. __le32 vdev_id;
  3865. /* peer mac address */
  3866. struct wmi_mac_addr peer_macaddr;
  3867. /* Tid number */
  3868. __le32 tid;
  3869. } __packed;
  3870. enum wmi_peer_smps_state {
  3871. WMI_PEER_SMPS_PS_NONE = 0x0,
  3872. WMI_PEER_SMPS_STATIC = 0x1,
  3873. WMI_PEER_SMPS_DYNAMIC = 0x2
  3874. };
  3875. enum wmi_peer_chwidth {
  3876. WMI_PEER_CHWIDTH_20MHZ = 0,
  3877. WMI_PEER_CHWIDTH_40MHZ = 1,
  3878. WMI_PEER_CHWIDTH_80MHZ = 2,
  3879. };
  3880. enum wmi_peer_param {
  3881. WMI_PEER_SMPS_STATE = 0x1, /* see %wmi_peer_smps_state */
  3882. WMI_PEER_AMPDU = 0x2,
  3883. WMI_PEER_AUTHORIZE = 0x3,
  3884. WMI_PEER_CHAN_WIDTH = 0x4,
  3885. WMI_PEER_NSS = 0x5,
  3886. WMI_PEER_USE_4ADDR = 0x6
  3887. };
  3888. struct wmi_peer_set_param_cmd {
  3889. __le32 vdev_id;
  3890. struct wmi_mac_addr peer_macaddr;
  3891. __le32 param_id;
  3892. __le32 param_value;
  3893. } __packed;
  3894. #define MAX_SUPPORTED_RATES 128
  3895. struct wmi_rate_set {
  3896. /* total number of rates */
  3897. __le32 num_rates;
  3898. /*
  3899. * rates (each 8bit value) packed into a 32 bit word.
  3900. * the rates are filled from least significant byte to most
  3901. * significant byte.
  3902. */
  3903. __le32 rates[(MAX_SUPPORTED_RATES/4)+1];
  3904. } __packed;
  3905. struct wmi_rate_set_arg {
  3906. unsigned int num_rates;
  3907. u8 rates[MAX_SUPPORTED_RATES];
  3908. };
  3909. /*
  3910. * NOTE: It would bea good idea to represent the Tx MCS
  3911. * info in one word and Rx in another word. This is split
  3912. * into multiple words for convenience
  3913. */
  3914. struct wmi_vht_rate_set {
  3915. __le32 rx_max_rate; /* Max Rx data rate */
  3916. __le32 rx_mcs_set; /* Negotiated RX VHT rates */
  3917. __le32 tx_max_rate; /* Max Tx data rate */
  3918. __le32 tx_mcs_set; /* Negotiated TX VHT rates */
  3919. } __packed;
  3920. struct wmi_vht_rate_set_arg {
  3921. u32 rx_max_rate;
  3922. u32 rx_mcs_set;
  3923. u32 tx_max_rate;
  3924. u32 tx_mcs_set;
  3925. };
  3926. struct wmi_peer_set_rates_cmd {
  3927. /* peer MAC address */
  3928. struct wmi_mac_addr peer_macaddr;
  3929. /* legacy rate set */
  3930. struct wmi_rate_set peer_legacy_rates;
  3931. /* ht rate set */
  3932. struct wmi_rate_set peer_ht_rates;
  3933. } __packed;
  3934. struct wmi_peer_set_q_empty_callback_cmd {
  3935. /* unique id identifying the VDEV, generated by the caller */
  3936. __le32 vdev_id;
  3937. /* peer MAC address */
  3938. struct wmi_mac_addr peer_macaddr;
  3939. __le32 callback_enable;
  3940. } __packed;
  3941. #define WMI_PEER_AUTH 0x00000001
  3942. #define WMI_PEER_QOS 0x00000002
  3943. #define WMI_PEER_NEED_PTK_4_WAY 0x00000004
  3944. #define WMI_PEER_NEED_GTK_2_WAY 0x00000010
  3945. #define WMI_PEER_APSD 0x00000800
  3946. #define WMI_PEER_HT 0x00001000
  3947. #define WMI_PEER_40MHZ 0x00002000
  3948. #define WMI_PEER_STBC 0x00008000
  3949. #define WMI_PEER_LDPC 0x00010000
  3950. #define WMI_PEER_DYN_MIMOPS 0x00020000
  3951. #define WMI_PEER_STATIC_MIMOPS 0x00040000
  3952. #define WMI_PEER_SPATIAL_MUX 0x00200000
  3953. #define WMI_PEER_VHT 0x02000000
  3954. #define WMI_PEER_80MHZ 0x04000000
  3955. #define WMI_PEER_PMF 0x08000000
  3956. /*
  3957. * Peer rate capabilities.
  3958. *
  3959. * This is of interest to the ratecontrol
  3960. * module which resides in the firmware. The bit definitions are
  3961. * consistent with that defined in if_athrate.c.
  3962. */
  3963. #define WMI_RC_DS_FLAG 0x01
  3964. #define WMI_RC_CW40_FLAG 0x02
  3965. #define WMI_RC_SGI_FLAG 0x04
  3966. #define WMI_RC_HT_FLAG 0x08
  3967. #define WMI_RC_RTSCTS_FLAG 0x10
  3968. #define WMI_RC_TX_STBC_FLAG 0x20
  3969. #define WMI_RC_RX_STBC_FLAG 0xC0
  3970. #define WMI_RC_RX_STBC_FLAG_S 6
  3971. #define WMI_RC_WEP_TKIP_FLAG 0x100
  3972. #define WMI_RC_TS_FLAG 0x200
  3973. #define WMI_RC_UAPSD_FLAG 0x400
  3974. /* Maximum listen interval supported by hw in units of beacon interval */
  3975. #define ATH10K_MAX_HW_LISTEN_INTERVAL 5
  3976. struct wmi_common_peer_assoc_complete_cmd {
  3977. struct wmi_mac_addr peer_macaddr;
  3978. __le32 vdev_id;
  3979. __le32 peer_new_assoc; /* 1=assoc, 0=reassoc */
  3980. __le32 peer_associd; /* 16 LSBs */
  3981. __le32 peer_flags;
  3982. __le32 peer_caps; /* 16 LSBs */
  3983. __le32 peer_listen_intval;
  3984. __le32 peer_ht_caps;
  3985. __le32 peer_max_mpdu;
  3986. __le32 peer_mpdu_density; /* 0..16 */
  3987. __le32 peer_rate_caps;
  3988. struct wmi_rate_set peer_legacy_rates;
  3989. struct wmi_rate_set peer_ht_rates;
  3990. __le32 peer_nss; /* num of spatial streams */
  3991. __le32 peer_vht_caps;
  3992. __le32 peer_phymode;
  3993. struct wmi_vht_rate_set peer_vht_rates;
  3994. };
  3995. struct wmi_main_peer_assoc_complete_cmd {
  3996. struct wmi_common_peer_assoc_complete_cmd cmd;
  3997. /* HT Operation Element of the peer. Five bytes packed in 2
  3998. * INT32 array and filled from lsb to msb. */
  3999. __le32 peer_ht_info[2];
  4000. } __packed;
  4001. struct wmi_10_1_peer_assoc_complete_cmd {
  4002. struct wmi_common_peer_assoc_complete_cmd cmd;
  4003. } __packed;
  4004. #define WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX_LSB 0
  4005. #define WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX_MASK 0x0f
  4006. #define WMI_PEER_ASSOC_INFO0_MAX_NSS_LSB 4
  4007. #define WMI_PEER_ASSOC_INFO0_MAX_NSS_MASK 0xf0
  4008. struct wmi_10_2_peer_assoc_complete_cmd {
  4009. struct wmi_common_peer_assoc_complete_cmd cmd;
  4010. __le32 info0; /* WMI_PEER_ASSOC_INFO0_ */
  4011. } __packed;
  4012. struct wmi_peer_assoc_complete_arg {
  4013. u8 addr[ETH_ALEN];
  4014. u32 vdev_id;
  4015. bool peer_reassoc;
  4016. u16 peer_aid;
  4017. u32 peer_flags; /* see %WMI_PEER_ */
  4018. u16 peer_caps;
  4019. u32 peer_listen_intval;
  4020. u32 peer_ht_caps;
  4021. u32 peer_max_mpdu;
  4022. u32 peer_mpdu_density; /* 0..16 */
  4023. u32 peer_rate_caps; /* see %WMI_RC_ */
  4024. struct wmi_rate_set_arg peer_legacy_rates;
  4025. struct wmi_rate_set_arg peer_ht_rates;
  4026. u32 peer_num_spatial_streams;
  4027. u32 peer_vht_caps;
  4028. enum wmi_phy_mode peer_phymode;
  4029. struct wmi_vht_rate_set_arg peer_vht_rates;
  4030. };
  4031. struct wmi_peer_add_wds_entry_cmd {
  4032. /* peer MAC address */
  4033. struct wmi_mac_addr peer_macaddr;
  4034. /* wds MAC addr */
  4035. struct wmi_mac_addr wds_macaddr;
  4036. } __packed;
  4037. struct wmi_peer_remove_wds_entry_cmd {
  4038. /* wds MAC addr */
  4039. struct wmi_mac_addr wds_macaddr;
  4040. } __packed;
  4041. struct wmi_peer_q_empty_callback_event {
  4042. /* peer MAC address */
  4043. struct wmi_mac_addr peer_macaddr;
  4044. } __packed;
  4045. /*
  4046. * Channel info WMI event
  4047. */
  4048. struct wmi_chan_info_event {
  4049. __le32 err_code;
  4050. __le32 freq;
  4051. __le32 cmd_flags;
  4052. __le32 noise_floor;
  4053. __le32 rx_clear_count;
  4054. __le32 cycle_count;
  4055. } __packed;
  4056. struct wmi_peer_sta_kickout_event {
  4057. struct wmi_mac_addr peer_macaddr;
  4058. } __packed;
  4059. #define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0)
  4060. /* FIXME: empirically extrapolated */
  4061. #define WMI_CHAN_INFO_MSEC(x) ((x) / 76595)
  4062. /* Beacon filter wmi command info */
  4063. #define BCN_FLT_MAX_SUPPORTED_IES 256
  4064. #define BCN_FLT_MAX_ELEMS_IE_LIST (BCN_FLT_MAX_SUPPORTED_IES / 32)
  4065. struct bss_bcn_stats {
  4066. __le32 vdev_id;
  4067. __le32 bss_bcnsdropped;
  4068. __le32 bss_bcnsdelivered;
  4069. } __packed;
  4070. struct bcn_filter_stats {
  4071. __le32 bcns_dropped;
  4072. __le32 bcns_delivered;
  4073. __le32 activefilters;
  4074. struct bss_bcn_stats bss_stats;
  4075. } __packed;
  4076. struct wmi_add_bcn_filter_cmd {
  4077. u32 vdev_id;
  4078. u32 ie_map[BCN_FLT_MAX_ELEMS_IE_LIST];
  4079. } __packed;
  4080. enum wmi_sta_keepalive_method {
  4081. WMI_STA_KEEPALIVE_METHOD_NULL_FRAME = 1,
  4082. WMI_STA_KEEPALIVE_METHOD_UNSOLICITATED_ARP_RESPONSE = 2,
  4083. };
  4084. /* note: ip4 addresses are in network byte order, i.e. big endian */
  4085. struct wmi_sta_keepalive_arp_resp {
  4086. __be32 src_ip4_addr;
  4087. __be32 dest_ip4_addr;
  4088. struct wmi_mac_addr dest_mac_addr;
  4089. } __packed;
  4090. struct wmi_sta_keepalive_cmd {
  4091. __le32 vdev_id;
  4092. __le32 enabled;
  4093. __le32 method; /* WMI_STA_KEEPALIVE_METHOD_ */
  4094. __le32 interval; /* in seconds */
  4095. struct wmi_sta_keepalive_arp_resp arp_resp;
  4096. } __packed;
  4097. enum wmi_force_fw_hang_type {
  4098. WMI_FORCE_FW_HANG_ASSERT = 1,
  4099. WMI_FORCE_FW_HANG_NO_DETECT,
  4100. WMI_FORCE_FW_HANG_CTRL_EP_FULL,
  4101. WMI_FORCE_FW_HANG_EMPTY_POINT,
  4102. WMI_FORCE_FW_HANG_STACK_OVERFLOW,
  4103. WMI_FORCE_FW_HANG_INFINITE_LOOP,
  4104. };
  4105. #define WMI_FORCE_FW_HANG_RANDOM_TIME 0xFFFFFFFF
  4106. struct wmi_force_fw_hang_cmd {
  4107. __le32 type;
  4108. __le32 delay_ms;
  4109. } __packed;
  4110. enum ath10k_dbglog_level {
  4111. ATH10K_DBGLOG_LEVEL_VERBOSE = 0,
  4112. ATH10K_DBGLOG_LEVEL_INFO = 1,
  4113. ATH10K_DBGLOG_LEVEL_WARN = 2,
  4114. ATH10K_DBGLOG_LEVEL_ERR = 3,
  4115. };
  4116. /* VAP ids to enable dbglog */
  4117. #define ATH10K_DBGLOG_CFG_VAP_LOG_LSB 0
  4118. #define ATH10K_DBGLOG_CFG_VAP_LOG_MASK 0x0000ffff
  4119. /* to enable dbglog in the firmware */
  4120. #define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_LSB 16
  4121. #define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_MASK 0x00010000
  4122. /* timestamp resolution */
  4123. #define ATH10K_DBGLOG_CFG_RESOLUTION_LSB 17
  4124. #define ATH10K_DBGLOG_CFG_RESOLUTION_MASK 0x000E0000
  4125. /* number of queued messages before sending them to the host */
  4126. #define ATH10K_DBGLOG_CFG_REPORT_SIZE_LSB 20
  4127. #define ATH10K_DBGLOG_CFG_REPORT_SIZE_MASK 0x0ff00000
  4128. /*
  4129. * Log levels to enable. This defines the minimum level to enable, this is
  4130. * not a bitmask. See enum ath10k_dbglog_level for the values.
  4131. */
  4132. #define ATH10K_DBGLOG_CFG_LOG_LVL_LSB 28
  4133. #define ATH10K_DBGLOG_CFG_LOG_LVL_MASK 0x70000000
  4134. /*
  4135. * Note: this is a cleaned up version of a struct firmware uses. For
  4136. * example, config_valid was hidden inside an array.
  4137. */
  4138. struct wmi_dbglog_cfg_cmd {
  4139. /* bitmask to hold mod id config*/
  4140. __le32 module_enable;
  4141. /* see ATH10K_DBGLOG_CFG_ */
  4142. __le32 config_enable;
  4143. /* mask of module id bits to be changed */
  4144. __le32 module_valid;
  4145. /* mask of config bits to be changed, see ATH10K_DBGLOG_CFG_ */
  4146. __le32 config_valid;
  4147. } __packed;
  4148. #define ATH10K_RTS_MAX 2347
  4149. #define ATH10K_FRAGMT_THRESHOLD_MIN 540
  4150. #define ATH10K_FRAGMT_THRESHOLD_MAX 2346
  4151. #define WMI_MAX_EVENT 0x1000
  4152. /* Maximum number of pending TXed WMI packets */
  4153. #define WMI_SKB_HEADROOM sizeof(struct wmi_cmd_hdr)
  4154. /* By default disable power save for IBSS */
  4155. #define ATH10K_DEFAULT_ATIM 0
  4156. struct ath10k;
  4157. struct ath10k_vif;
  4158. int ath10k_wmi_attach(struct ath10k *ar);
  4159. void ath10k_wmi_detach(struct ath10k *ar);
  4160. int ath10k_wmi_wait_for_service_ready(struct ath10k *ar);
  4161. int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar);
  4162. int ath10k_wmi_connect(struct ath10k *ar);
  4163. struct sk_buff *ath10k_wmi_alloc_skb(struct ath10k *ar, u32 len);
  4164. int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
  4165. int ath10k_wmi_pdev_set_channel(struct ath10k *ar,
  4166. const struct wmi_channel_arg *);
  4167. int ath10k_wmi_pdev_suspend_target(struct ath10k *ar, u32 suspend_opt);
  4168. int ath10k_wmi_pdev_resume_target(struct ath10k *ar);
  4169. int ath10k_wmi_pdev_set_regdomain(struct ath10k *ar, u16 rd, u16 rd2g,
  4170. u16 rd5g, u16 ctl2g, u16 ctl5g,
  4171. enum wmi_dfs_region dfs_reg);
  4172. int ath10k_wmi_pdev_set_param(struct ath10k *ar, u32 id, u32 value);
  4173. int ath10k_wmi_cmd_init(struct ath10k *ar);
  4174. int ath10k_wmi_start_scan(struct ath10k *ar, const struct wmi_start_scan_arg *);
  4175. void ath10k_wmi_start_scan_init(struct ath10k *ar, struct wmi_start_scan_arg *);
  4176. int ath10k_wmi_stop_scan(struct ath10k *ar,
  4177. const struct wmi_stop_scan_arg *arg);
  4178. int ath10k_wmi_vdev_create(struct ath10k *ar, u32 vdev_id,
  4179. enum wmi_vdev_type type,
  4180. enum wmi_vdev_subtype subtype,
  4181. const u8 macaddr[ETH_ALEN]);
  4182. int ath10k_wmi_vdev_delete(struct ath10k *ar, u32 vdev_id);
  4183. int ath10k_wmi_vdev_start(struct ath10k *ar,
  4184. const struct wmi_vdev_start_request_arg *);
  4185. int ath10k_wmi_vdev_restart(struct ath10k *ar,
  4186. const struct wmi_vdev_start_request_arg *);
  4187. int ath10k_wmi_vdev_stop(struct ath10k *ar, u32 vdev_id);
  4188. int ath10k_wmi_vdev_up(struct ath10k *ar, u32 vdev_id, u32 aid,
  4189. const u8 *bssid);
  4190. int ath10k_wmi_vdev_down(struct ath10k *ar, u32 vdev_id);
  4191. int ath10k_wmi_vdev_set_param(struct ath10k *ar, u32 vdev_id,
  4192. u32 param_id, u32 param_value);
  4193. int ath10k_wmi_vdev_install_key(struct ath10k *ar,
  4194. const struct wmi_vdev_install_key_arg *arg);
  4195. int ath10k_wmi_vdev_spectral_conf(struct ath10k *ar,
  4196. const struct wmi_vdev_spectral_conf_arg *arg);
  4197. int ath10k_wmi_vdev_spectral_enable(struct ath10k *ar, u32 vdev_id, u32 trigger,
  4198. u32 enable);
  4199. int ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id,
  4200. const u8 peer_addr[ETH_ALEN]);
  4201. int ath10k_wmi_peer_delete(struct ath10k *ar, u32 vdev_id,
  4202. const u8 peer_addr[ETH_ALEN]);
  4203. int ath10k_wmi_peer_flush(struct ath10k *ar, u32 vdev_id,
  4204. const u8 peer_addr[ETH_ALEN], u32 tid_bitmap);
  4205. int ath10k_wmi_peer_set_param(struct ath10k *ar, u32 vdev_id,
  4206. const u8 *peer_addr,
  4207. enum wmi_peer_param param_id, u32 param_value);
  4208. int ath10k_wmi_peer_assoc(struct ath10k *ar,
  4209. const struct wmi_peer_assoc_complete_arg *arg);
  4210. int ath10k_wmi_set_psmode(struct ath10k *ar, u32 vdev_id,
  4211. enum wmi_sta_ps_mode psmode);
  4212. int ath10k_wmi_set_sta_ps_param(struct ath10k *ar, u32 vdev_id,
  4213. enum wmi_sta_powersave_param param_id,
  4214. u32 value);
  4215. int ath10k_wmi_set_ap_ps_param(struct ath10k *ar, u32 vdev_id, const u8 *mac,
  4216. enum wmi_ap_ps_peer_param param_id, u32 value);
  4217. int ath10k_wmi_scan_chan_list(struct ath10k *ar,
  4218. const struct wmi_scan_chan_list_arg *arg);
  4219. int ath10k_wmi_beacon_send_ref_nowait(struct ath10k_vif *arvif);
  4220. int ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar,
  4221. const struct wmi_pdev_set_wmm_params_arg *arg);
  4222. int ath10k_wmi_request_stats(struct ath10k *ar, enum wmi_stats_id stats_id);
  4223. int ath10k_wmi_force_fw_hang(struct ath10k *ar,
  4224. enum wmi_force_fw_hang_type type, u32 delay_ms);
  4225. int ath10k_wmi_mgmt_tx(struct ath10k *ar, struct sk_buff *skb);
  4226. int ath10k_wmi_dbglog_cfg(struct ath10k *ar, u32 module_enable);
  4227. #endif /* _WMI_H_ */