wmi.h 132 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657
  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[0];
  1294. } __packed;
  1295. /* This is the definition from 10.X firmware branch */
  1296. struct wmi_10x_service_ready_event {
  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[0];
  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_host_mem_chunks {
  1684. __le32 count;
  1685. /* some fw revisions require at least 1 chunk regardless of count */
  1686. struct host_memory_chunk items[1];
  1687. } __packed;
  1688. struct wmi_init_cmd {
  1689. struct wmi_resource_config resource_config;
  1690. struct wmi_host_mem_chunks mem_chunks;
  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. struct wmi_host_mem_chunks mem_chunks;
  1696. } __packed;
  1697. struct wmi_init_cmd_10_2 {
  1698. struct wmi_resource_config_10_2 resource_config;
  1699. struct wmi_host_mem_chunks mem_chunks;
  1700. } __packed;
  1701. struct wmi_chan_list_entry {
  1702. __le16 freq;
  1703. u8 phy_mode; /* valid for 10.2 only */
  1704. u8 reserved;
  1705. } __packed;
  1706. /* TLV for channel list */
  1707. struct wmi_chan_list {
  1708. __le32 tag; /* WMI_CHAN_LIST_TAG */
  1709. __le32 num_chan;
  1710. struct wmi_chan_list_entry channel_list[0];
  1711. } __packed;
  1712. struct wmi_bssid_list {
  1713. __le32 tag; /* WMI_BSSID_LIST_TAG */
  1714. __le32 num_bssid;
  1715. struct wmi_mac_addr bssid_list[0];
  1716. } __packed;
  1717. struct wmi_ie_data {
  1718. __le32 tag; /* WMI_IE_TAG */
  1719. __le32 ie_len;
  1720. u8 ie_data[0];
  1721. } __packed;
  1722. struct wmi_ssid {
  1723. __le32 ssid_len;
  1724. u8 ssid[32];
  1725. } __packed;
  1726. struct wmi_ssid_list {
  1727. __le32 tag; /* WMI_SSID_LIST_TAG */
  1728. __le32 num_ssids;
  1729. struct wmi_ssid ssids[0];
  1730. } __packed;
  1731. /* prefix used by scan requestor ids on the host */
  1732. #define WMI_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
  1733. /* prefix used by scan request ids generated on the host */
  1734. /* host cycles through the lower 12 bits to generate ids */
  1735. #define WMI_HOST_SCAN_REQ_ID_PREFIX 0xA000
  1736. #define WLAN_SCAN_PARAMS_MAX_SSID 16
  1737. #define WLAN_SCAN_PARAMS_MAX_BSSID 4
  1738. #define WLAN_SCAN_PARAMS_MAX_IE_LEN 256
  1739. /* Scan priority numbers must be sequential, starting with 0 */
  1740. enum wmi_scan_priority {
  1741. WMI_SCAN_PRIORITY_VERY_LOW = 0,
  1742. WMI_SCAN_PRIORITY_LOW,
  1743. WMI_SCAN_PRIORITY_MEDIUM,
  1744. WMI_SCAN_PRIORITY_HIGH,
  1745. WMI_SCAN_PRIORITY_VERY_HIGH,
  1746. WMI_SCAN_PRIORITY_COUNT /* number of priorities supported */
  1747. };
  1748. struct wmi_start_scan_common {
  1749. /* Scan ID */
  1750. __le32 scan_id;
  1751. /* Scan requestor ID */
  1752. __le32 scan_req_id;
  1753. /* VDEV id(interface) that is requesting scan */
  1754. __le32 vdev_id;
  1755. /* Scan Priority, input to scan scheduler */
  1756. __le32 scan_priority;
  1757. /* Scan events subscription */
  1758. __le32 notify_scan_events;
  1759. /* dwell time in msec on active channels */
  1760. __le32 dwell_time_active;
  1761. /* dwell time in msec on passive channels */
  1762. __le32 dwell_time_passive;
  1763. /*
  1764. * min time in msec on the BSS channel,only valid if atleast one
  1765. * VDEV is active
  1766. */
  1767. __le32 min_rest_time;
  1768. /*
  1769. * max rest time in msec on the BSS channel,only valid if at least
  1770. * one VDEV is active
  1771. */
  1772. /*
  1773. * the scanner will rest on the bss channel at least min_rest_time
  1774. * after min_rest_time the scanner will start checking for tx/rx
  1775. * activity on all VDEVs. if there is no activity the scanner will
  1776. * switch to off channel. if there is activity the scanner will let
  1777. * the radio on the bss channel until max_rest_time expires.at
  1778. * max_rest_time scanner will switch to off channel irrespective of
  1779. * activity. activity is determined by the idle_time parameter.
  1780. */
  1781. __le32 max_rest_time;
  1782. /*
  1783. * time before sending next set of probe requests.
  1784. * The scanner keeps repeating probe requests transmission with
  1785. * period specified by repeat_probe_time.
  1786. * The number of probe requests specified depends on the ssid_list
  1787. * and bssid_list
  1788. */
  1789. __le32 repeat_probe_time;
  1790. /* time in msec between 2 consequetive probe requests with in a set. */
  1791. __le32 probe_spacing_time;
  1792. /*
  1793. * data inactivity time in msec on bss channel that will be used by
  1794. * scanner for measuring the inactivity.
  1795. */
  1796. __le32 idle_time;
  1797. /* maximum time in msec allowed for scan */
  1798. __le32 max_scan_time;
  1799. /*
  1800. * delay in msec before sending first probe request after switching
  1801. * to a channel
  1802. */
  1803. __le32 probe_delay;
  1804. /* Scan control flags */
  1805. __le32 scan_ctrl_flags;
  1806. } __packed;
  1807. struct wmi_start_scan_tlvs {
  1808. /* TLV parameters. These includes channel list, ssid list, bssid list,
  1809. * extra ies.
  1810. */
  1811. u8 tlvs[0];
  1812. } __packed;
  1813. struct wmi_start_scan_cmd {
  1814. struct wmi_start_scan_common common;
  1815. __le32 burst_duration_ms;
  1816. struct wmi_start_scan_tlvs tlvs;
  1817. } __packed;
  1818. /* This is the definition from 10.X firmware branch */
  1819. struct wmi_10x_start_scan_cmd {
  1820. struct wmi_start_scan_common common;
  1821. struct wmi_start_scan_tlvs tlvs;
  1822. } __packed;
  1823. struct wmi_ssid_arg {
  1824. int len;
  1825. const u8 *ssid;
  1826. };
  1827. struct wmi_bssid_arg {
  1828. const u8 *bssid;
  1829. };
  1830. struct wmi_start_scan_arg {
  1831. u32 scan_id;
  1832. u32 scan_req_id;
  1833. u32 vdev_id;
  1834. u32 scan_priority;
  1835. u32 notify_scan_events;
  1836. u32 dwell_time_active;
  1837. u32 dwell_time_passive;
  1838. u32 min_rest_time;
  1839. u32 max_rest_time;
  1840. u32 repeat_probe_time;
  1841. u32 probe_spacing_time;
  1842. u32 idle_time;
  1843. u32 max_scan_time;
  1844. u32 probe_delay;
  1845. u32 scan_ctrl_flags;
  1846. u32 ie_len;
  1847. u32 n_channels;
  1848. u32 n_ssids;
  1849. u32 n_bssids;
  1850. u8 ie[WLAN_SCAN_PARAMS_MAX_IE_LEN];
  1851. u16 channels[64];
  1852. struct wmi_ssid_arg ssids[WLAN_SCAN_PARAMS_MAX_SSID];
  1853. struct wmi_bssid_arg bssids[WLAN_SCAN_PARAMS_MAX_BSSID];
  1854. };
  1855. /* scan control flags */
  1856. /* passively scan all channels including active channels */
  1857. #define WMI_SCAN_FLAG_PASSIVE 0x1
  1858. /* add wild card ssid probe request even though ssid_list is specified. */
  1859. #define WMI_SCAN_ADD_BCAST_PROBE_REQ 0x2
  1860. /* add cck rates to rates/xrate ie for the generated probe request */
  1861. #define WMI_SCAN_ADD_CCK_RATES 0x4
  1862. /* add ofdm rates to rates/xrate ie for the generated probe request */
  1863. #define WMI_SCAN_ADD_OFDM_RATES 0x8
  1864. /* To enable indication of Chan load and Noise floor to host */
  1865. #define WMI_SCAN_CHAN_STAT_EVENT 0x10
  1866. /* Filter Probe request frames */
  1867. #define WMI_SCAN_FILTER_PROBE_REQ 0x20
  1868. /* When set, DFS channels will not be scanned */
  1869. #define WMI_SCAN_BYPASS_DFS_CHN 0x40
  1870. /* Different FW scan engine may choose to bail out on errors.
  1871. * Allow the driver to have influence over that. */
  1872. #define WMI_SCAN_CONTINUE_ON_ERROR 0x80
  1873. /* WMI_SCAN_CLASS_MASK must be the same value as IEEE80211_SCAN_CLASS_MASK */
  1874. #define WMI_SCAN_CLASS_MASK 0xFF000000
  1875. enum wmi_stop_scan_type {
  1876. WMI_SCAN_STOP_ONE = 0x00000000, /* stop by scan_id */
  1877. WMI_SCAN_STOP_VDEV_ALL = 0x01000000, /* stop by vdev_id */
  1878. WMI_SCAN_STOP_ALL = 0x04000000, /* stop all scans */
  1879. };
  1880. struct wmi_stop_scan_cmd {
  1881. __le32 scan_req_id;
  1882. __le32 scan_id;
  1883. __le32 req_type;
  1884. __le32 vdev_id;
  1885. } __packed;
  1886. struct wmi_stop_scan_arg {
  1887. u32 req_id;
  1888. enum wmi_stop_scan_type req_type;
  1889. union {
  1890. u32 scan_id;
  1891. u32 vdev_id;
  1892. } u;
  1893. };
  1894. struct wmi_scan_chan_list_cmd {
  1895. __le32 num_scan_chans;
  1896. struct wmi_channel chan_info[0];
  1897. } __packed;
  1898. struct wmi_scan_chan_list_arg {
  1899. u32 n_channels;
  1900. struct wmi_channel_arg *channels;
  1901. };
  1902. enum wmi_bss_filter {
  1903. WMI_BSS_FILTER_NONE = 0, /* no beacons forwarded */
  1904. WMI_BSS_FILTER_ALL, /* all beacons forwarded */
  1905. WMI_BSS_FILTER_PROFILE, /* only beacons matching profile */
  1906. WMI_BSS_FILTER_ALL_BUT_PROFILE, /* all but beacons matching profile */
  1907. WMI_BSS_FILTER_CURRENT_BSS, /* only beacons matching current BSS */
  1908. WMI_BSS_FILTER_ALL_BUT_BSS, /* all but beacons matching BSS */
  1909. WMI_BSS_FILTER_PROBED_SSID, /* beacons matching probed ssid */
  1910. WMI_BSS_FILTER_LAST_BSS, /* marker only */
  1911. };
  1912. enum wmi_scan_event_type {
  1913. WMI_SCAN_EVENT_STARTED = 0x1,
  1914. WMI_SCAN_EVENT_COMPLETED = 0x2,
  1915. WMI_SCAN_EVENT_BSS_CHANNEL = 0x4,
  1916. WMI_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
  1917. WMI_SCAN_EVENT_DEQUEUED = 0x10,
  1918. WMI_SCAN_EVENT_PREEMPTED = 0x20, /* possibly by high-prio scan */
  1919. WMI_SCAN_EVENT_START_FAILED = 0x40,
  1920. WMI_SCAN_EVENT_RESTARTED = 0x80,
  1921. WMI_SCAN_EVENT_MAX = 0x8000
  1922. };
  1923. enum wmi_scan_completion_reason {
  1924. WMI_SCAN_REASON_COMPLETED,
  1925. WMI_SCAN_REASON_CANCELLED,
  1926. WMI_SCAN_REASON_PREEMPTED,
  1927. WMI_SCAN_REASON_TIMEDOUT,
  1928. WMI_SCAN_REASON_MAX,
  1929. };
  1930. struct wmi_scan_event {
  1931. __le32 event_type; /* %WMI_SCAN_EVENT_ */
  1932. __le32 reason; /* %WMI_SCAN_REASON_ */
  1933. __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
  1934. __le32 scan_req_id;
  1935. __le32 scan_id;
  1936. __le32 vdev_id;
  1937. } __packed;
  1938. /*
  1939. * This defines how much headroom is kept in the
  1940. * receive frame between the descriptor and the
  1941. * payload, in order for the WMI PHY error and
  1942. * management handler to insert header contents.
  1943. *
  1944. * This is in bytes.
  1945. */
  1946. #define WMI_MGMT_RX_HDR_HEADROOM 52
  1947. /*
  1948. * This event will be used for sending scan results
  1949. * as well as rx mgmt frames to the host. The rx buffer
  1950. * will be sent as part of this WMI event. It would be a
  1951. * good idea to pass all the fields in the RX status
  1952. * descriptor up to the host.
  1953. */
  1954. struct wmi_mgmt_rx_hdr_v1 {
  1955. __le32 channel;
  1956. __le32 snr;
  1957. __le32 rate;
  1958. __le32 phy_mode;
  1959. __le32 buf_len;
  1960. __le32 status; /* %WMI_RX_STATUS_ */
  1961. } __packed;
  1962. struct wmi_mgmt_rx_hdr_v2 {
  1963. struct wmi_mgmt_rx_hdr_v1 v1;
  1964. __le32 rssi_ctl[4];
  1965. } __packed;
  1966. struct wmi_mgmt_rx_event_v1 {
  1967. struct wmi_mgmt_rx_hdr_v1 hdr;
  1968. u8 buf[0];
  1969. } __packed;
  1970. struct wmi_mgmt_rx_event_v2 {
  1971. struct wmi_mgmt_rx_hdr_v2 hdr;
  1972. u8 buf[0];
  1973. } __packed;
  1974. #define WMI_RX_STATUS_OK 0x00
  1975. #define WMI_RX_STATUS_ERR_CRC 0x01
  1976. #define WMI_RX_STATUS_ERR_DECRYPT 0x08
  1977. #define WMI_RX_STATUS_ERR_MIC 0x10
  1978. #define WMI_RX_STATUS_ERR_KEY_CACHE_MISS 0x20
  1979. #define PHY_ERROR_SPECTRAL_SCAN 0x26
  1980. #define PHY_ERROR_FALSE_RADAR_EXT 0x24
  1981. #define PHY_ERROR_RADAR 0x05
  1982. struct wmi_phyerr {
  1983. __le32 tsf_timestamp;
  1984. __le16 freq1;
  1985. __le16 freq2;
  1986. u8 rssi_combined;
  1987. u8 chan_width_mhz;
  1988. u8 phy_err_code;
  1989. u8 rsvd0;
  1990. __le32 rssi_chains[4];
  1991. __le16 nf_chains[4];
  1992. __le32 buf_len;
  1993. u8 buf[0];
  1994. } __packed;
  1995. struct wmi_phyerr_event {
  1996. __le32 num_phyerrs;
  1997. __le32 tsf_l32;
  1998. __le32 tsf_u32;
  1999. struct wmi_phyerr phyerrs[0];
  2000. } __packed;
  2001. #define PHYERR_TLV_SIG 0xBB
  2002. #define PHYERR_TLV_TAG_SEARCH_FFT_REPORT 0xFB
  2003. #define PHYERR_TLV_TAG_RADAR_PULSE_SUMMARY 0xF8
  2004. #define PHYERR_TLV_TAG_SPECTRAL_SUMMARY_REPORT 0xF9
  2005. struct phyerr_radar_report {
  2006. __le32 reg0; /* RADAR_REPORT_REG0_* */
  2007. __le32 reg1; /* REDAR_REPORT_REG1_* */
  2008. } __packed;
  2009. #define RADAR_REPORT_REG0_PULSE_IS_CHIRP_MASK 0x80000000
  2010. #define RADAR_REPORT_REG0_PULSE_IS_CHIRP_LSB 31
  2011. #define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_MASK 0x40000000
  2012. #define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_LSB 30
  2013. #define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_MASK 0x3FF00000
  2014. #define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_LSB 20
  2015. #define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_MASK 0x000F0000
  2016. #define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_LSB 16
  2017. #define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_MASK 0x0000FC00
  2018. #define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_LSB 10
  2019. #define RADAR_REPORT_REG0_PULSE_SIDX_MASK 0x000003FF
  2020. #define RADAR_REPORT_REG0_PULSE_SIDX_LSB 0
  2021. #define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_MASK 0x80000000
  2022. #define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_LSB 31
  2023. #define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_MASK 0x7F000000
  2024. #define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_LSB 24
  2025. #define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_MASK 0x00FF0000
  2026. #define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_LSB 16
  2027. #define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_MASK 0x0000FF00
  2028. #define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_LSB 8
  2029. #define RADAR_REPORT_REG1_PULSE_DUR_MASK 0x000000FF
  2030. #define RADAR_REPORT_REG1_PULSE_DUR_LSB 0
  2031. struct phyerr_fft_report {
  2032. __le32 reg0; /* SEARCH_FFT_REPORT_REG0_ * */
  2033. __le32 reg1; /* SEARCH_FFT_REPORT_REG1_ * */
  2034. } __packed;
  2035. #define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_MASK 0xFF800000
  2036. #define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_LSB 23
  2037. #define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_MASK 0x007FC000
  2038. #define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_LSB 14
  2039. #define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_MASK 0x00003000
  2040. #define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_LSB 12
  2041. #define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_MASK 0x00000FFF
  2042. #define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_LSB 0
  2043. #define SEARCH_FFT_REPORT_REG1_RELPWR_DB_MASK 0xFC000000
  2044. #define SEARCH_FFT_REPORT_REG1_RELPWR_DB_LSB 26
  2045. #define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_MASK 0x03FC0000
  2046. #define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_LSB 18
  2047. #define SEARCH_FFT_REPORT_REG1_PEAK_MAG_MASK 0x0003FF00
  2048. #define SEARCH_FFT_REPORT_REG1_PEAK_MAG_LSB 8
  2049. #define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_MASK 0x000000FF
  2050. #define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_LSB 0
  2051. struct phyerr_tlv {
  2052. __le16 len;
  2053. u8 tag;
  2054. u8 sig;
  2055. } __packed;
  2056. #define DFS_RSSI_POSSIBLY_FALSE 50
  2057. #define DFS_PEAK_MAG_THOLD_POSSIBLY_FALSE 40
  2058. struct wmi_mgmt_tx_hdr {
  2059. __le32 vdev_id;
  2060. struct wmi_mac_addr peer_macaddr;
  2061. __le32 tx_rate;
  2062. __le32 tx_power;
  2063. __le32 buf_len;
  2064. } __packed;
  2065. struct wmi_mgmt_tx_cmd {
  2066. struct wmi_mgmt_tx_hdr hdr;
  2067. u8 buf[0];
  2068. } __packed;
  2069. struct wmi_echo_event {
  2070. __le32 value;
  2071. } __packed;
  2072. struct wmi_echo_cmd {
  2073. __le32 value;
  2074. } __packed;
  2075. struct wmi_pdev_set_regdomain_cmd {
  2076. __le32 reg_domain;
  2077. __le32 reg_domain_2G;
  2078. __le32 reg_domain_5G;
  2079. __le32 conformance_test_limit_2G;
  2080. __le32 conformance_test_limit_5G;
  2081. } __packed;
  2082. enum wmi_dfs_region {
  2083. /* Uninitialized dfs domain */
  2084. WMI_UNINIT_DFS_DOMAIN = 0,
  2085. /* FCC3 dfs domain */
  2086. WMI_FCC_DFS_DOMAIN = 1,
  2087. /* ETSI dfs domain */
  2088. WMI_ETSI_DFS_DOMAIN = 2,
  2089. /*Japan dfs domain */
  2090. WMI_MKK4_DFS_DOMAIN = 3,
  2091. };
  2092. struct wmi_pdev_set_regdomain_cmd_10x {
  2093. __le32 reg_domain;
  2094. __le32 reg_domain_2G;
  2095. __le32 reg_domain_5G;
  2096. __le32 conformance_test_limit_2G;
  2097. __le32 conformance_test_limit_5G;
  2098. /* dfs domain from wmi_dfs_region */
  2099. __le32 dfs_domain;
  2100. } __packed;
  2101. /* Command to set/unset chip in quiet mode */
  2102. struct wmi_pdev_set_quiet_cmd {
  2103. /* period in TUs */
  2104. __le32 period;
  2105. /* duration in TUs */
  2106. __le32 duration;
  2107. /* offset in TUs */
  2108. __le32 next_start;
  2109. /* enable/disable */
  2110. __le32 enabled;
  2111. } __packed;
  2112. /*
  2113. * 802.11g protection mode.
  2114. */
  2115. enum ath10k_protmode {
  2116. ATH10K_PROT_NONE = 0, /* no protection */
  2117. ATH10K_PROT_CTSONLY = 1, /* CTS to self */
  2118. ATH10K_PROT_RTSCTS = 2, /* RTS-CTS */
  2119. };
  2120. enum wmi_rtscts_profile {
  2121. WMI_RTSCTS_FOR_NO_RATESERIES = 0,
  2122. WMI_RTSCTS_FOR_SECOND_RATESERIES,
  2123. WMI_RTSCTS_ACROSS_SW_RETRIES
  2124. };
  2125. #define WMI_RTSCTS_ENABLED 1
  2126. #define WMI_RTSCTS_SET_MASK 0x0f
  2127. #define WMI_RTSCTS_SET_LSB 0
  2128. #define WMI_RTSCTS_PROFILE_MASK 0xf0
  2129. #define WMI_RTSCTS_PROFILE_LSB 4
  2130. enum wmi_beacon_gen_mode {
  2131. WMI_BEACON_STAGGERED_MODE = 0,
  2132. WMI_BEACON_BURST_MODE = 1
  2133. };
  2134. enum wmi_csa_event_ies_present_flag {
  2135. WMI_CSA_IE_PRESENT = 0x00000001,
  2136. WMI_XCSA_IE_PRESENT = 0x00000002,
  2137. WMI_WBW_IE_PRESENT = 0x00000004,
  2138. WMI_CSWARP_IE_PRESENT = 0x00000008,
  2139. };
  2140. /* wmi CSA receive event from beacon frame */
  2141. struct wmi_csa_event {
  2142. __le32 i_fc_dur;
  2143. /* Bit 0-15: FC */
  2144. /* Bit 16-31: DUR */
  2145. struct wmi_mac_addr i_addr1;
  2146. struct wmi_mac_addr i_addr2;
  2147. __le32 csa_ie[2];
  2148. __le32 xcsa_ie[2];
  2149. __le32 wb_ie[2];
  2150. __le32 cswarp_ie;
  2151. __le32 ies_present_flag; /* wmi_csa_event_ies_present_flag */
  2152. } __packed;
  2153. /* the definition of different PDEV parameters */
  2154. #define PDEV_DEFAULT_STATS_UPDATE_PERIOD 500
  2155. #define VDEV_DEFAULT_STATS_UPDATE_PERIOD 500
  2156. #define PEER_DEFAULT_STATS_UPDATE_PERIOD 500
  2157. struct wmi_pdev_param_map {
  2158. u32 tx_chain_mask;
  2159. u32 rx_chain_mask;
  2160. u32 txpower_limit2g;
  2161. u32 txpower_limit5g;
  2162. u32 txpower_scale;
  2163. u32 beacon_gen_mode;
  2164. u32 beacon_tx_mode;
  2165. u32 resmgr_offchan_mode;
  2166. u32 protection_mode;
  2167. u32 dynamic_bw;
  2168. u32 non_agg_sw_retry_th;
  2169. u32 agg_sw_retry_th;
  2170. u32 sta_kickout_th;
  2171. u32 ac_aggrsize_scaling;
  2172. u32 ltr_enable;
  2173. u32 ltr_ac_latency_be;
  2174. u32 ltr_ac_latency_bk;
  2175. u32 ltr_ac_latency_vi;
  2176. u32 ltr_ac_latency_vo;
  2177. u32 ltr_ac_latency_timeout;
  2178. u32 ltr_sleep_override;
  2179. u32 ltr_rx_override;
  2180. u32 ltr_tx_activity_timeout;
  2181. u32 l1ss_enable;
  2182. u32 dsleep_enable;
  2183. u32 pcielp_txbuf_flush;
  2184. u32 pcielp_txbuf_watermark;
  2185. u32 pcielp_txbuf_tmo_en;
  2186. u32 pcielp_txbuf_tmo_value;
  2187. u32 pdev_stats_update_period;
  2188. u32 vdev_stats_update_period;
  2189. u32 peer_stats_update_period;
  2190. u32 bcnflt_stats_update_period;
  2191. u32 pmf_qos;
  2192. u32 arp_ac_override;
  2193. u32 dcs;
  2194. u32 ani_enable;
  2195. u32 ani_poll_period;
  2196. u32 ani_listen_period;
  2197. u32 ani_ofdm_level;
  2198. u32 ani_cck_level;
  2199. u32 dyntxchain;
  2200. u32 proxy_sta;
  2201. u32 idle_ps_config;
  2202. u32 power_gating_sleep;
  2203. u32 fast_channel_reset;
  2204. u32 burst_dur;
  2205. u32 burst_enable;
  2206. };
  2207. #define WMI_PDEV_PARAM_UNSUPPORTED 0
  2208. enum wmi_pdev_param {
  2209. /* TX chain mask */
  2210. WMI_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
  2211. /* RX chain mask */
  2212. WMI_PDEV_PARAM_RX_CHAIN_MASK,
  2213. /* TX power limit for 2G Radio */
  2214. WMI_PDEV_PARAM_TXPOWER_LIMIT2G,
  2215. /* TX power limit for 5G Radio */
  2216. WMI_PDEV_PARAM_TXPOWER_LIMIT5G,
  2217. /* TX power scale */
  2218. WMI_PDEV_PARAM_TXPOWER_SCALE,
  2219. /* Beacon generation mode . 0: host, 1: target */
  2220. WMI_PDEV_PARAM_BEACON_GEN_MODE,
  2221. /* Beacon generation mode . 0: staggered 1: bursted */
  2222. WMI_PDEV_PARAM_BEACON_TX_MODE,
  2223. /*
  2224. * Resource manager off chan mode .
  2225. * 0: turn off off chan mode. 1: turn on offchan mode
  2226. */
  2227. WMI_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
  2228. /*
  2229. * Protection mode:
  2230. * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
  2231. */
  2232. WMI_PDEV_PARAM_PROTECTION_MODE,
  2233. /*
  2234. * Dynamic bandwidth - 0: disable, 1: enable
  2235. *
  2236. * When enabled HW rate control tries different bandwidths when
  2237. * retransmitting frames.
  2238. */
  2239. WMI_PDEV_PARAM_DYNAMIC_BW,
  2240. /* Non aggregrate/ 11g sw retry threshold.0-disable */
  2241. WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
  2242. /* aggregrate sw retry threshold. 0-disable*/
  2243. WMI_PDEV_PARAM_AGG_SW_RETRY_TH,
  2244. /* Station kickout threshold (non of consecutive failures).0-disable */
  2245. WMI_PDEV_PARAM_STA_KICKOUT_TH,
  2246. /* Aggerate size scaling configuration per AC */
  2247. WMI_PDEV_PARAM_AC_AGGRSIZE_SCALING,
  2248. /* LTR enable */
  2249. WMI_PDEV_PARAM_LTR_ENABLE,
  2250. /* LTR latency for BE, in us */
  2251. WMI_PDEV_PARAM_LTR_AC_LATENCY_BE,
  2252. /* LTR latency for BK, in us */
  2253. WMI_PDEV_PARAM_LTR_AC_LATENCY_BK,
  2254. /* LTR latency for VI, in us */
  2255. WMI_PDEV_PARAM_LTR_AC_LATENCY_VI,
  2256. /* LTR latency for VO, in us */
  2257. WMI_PDEV_PARAM_LTR_AC_LATENCY_VO,
  2258. /* LTR AC latency timeout, in ms */
  2259. WMI_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
  2260. /* LTR platform latency override, in us */
  2261. WMI_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
  2262. /* LTR-RX override, in us */
  2263. WMI_PDEV_PARAM_LTR_RX_OVERRIDE,
  2264. /* Tx activity timeout for LTR, in us */
  2265. WMI_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
  2266. /* L1SS state machine enable */
  2267. WMI_PDEV_PARAM_L1SS_ENABLE,
  2268. /* Deep sleep state machine enable */
  2269. WMI_PDEV_PARAM_DSLEEP_ENABLE,
  2270. /* RX buffering flush enable */
  2271. WMI_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
  2272. /* RX buffering matermark */
  2273. WMI_PDEV_PARAM_PCIELP_TXBUF_WATERMARK,
  2274. /* RX buffering timeout enable */
  2275. WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
  2276. /* RX buffering timeout value */
  2277. WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
  2278. /* pdev level stats update period in ms */
  2279. WMI_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
  2280. /* vdev level stats update period in ms */
  2281. WMI_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
  2282. /* peer level stats update period in ms */
  2283. WMI_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
  2284. /* beacon filter status update period */
  2285. WMI_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
  2286. /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
  2287. WMI_PDEV_PARAM_PMF_QOS,
  2288. /* Access category on which ARP frames are sent */
  2289. WMI_PDEV_PARAM_ARP_AC_OVERRIDE,
  2290. /* DCS configuration */
  2291. WMI_PDEV_PARAM_DCS,
  2292. /* Enable/Disable ANI on target */
  2293. WMI_PDEV_PARAM_ANI_ENABLE,
  2294. /* configure the ANI polling period */
  2295. WMI_PDEV_PARAM_ANI_POLL_PERIOD,
  2296. /* configure the ANI listening period */
  2297. WMI_PDEV_PARAM_ANI_LISTEN_PERIOD,
  2298. /* configure OFDM immunity level */
  2299. WMI_PDEV_PARAM_ANI_OFDM_LEVEL,
  2300. /* configure CCK immunity level */
  2301. WMI_PDEV_PARAM_ANI_CCK_LEVEL,
  2302. /* Enable/Disable CDD for 1x1 STAs in rate control module */
  2303. WMI_PDEV_PARAM_DYNTXCHAIN,
  2304. /* Enable/Disable proxy STA */
  2305. WMI_PDEV_PARAM_PROXY_STA,
  2306. /* Enable/Disable low power state when all VDEVs are inactive/idle. */
  2307. WMI_PDEV_PARAM_IDLE_PS_CONFIG,
  2308. /* Enable/Disable power gating sleep */
  2309. WMI_PDEV_PARAM_POWER_GATING_SLEEP,
  2310. };
  2311. enum wmi_10x_pdev_param {
  2312. /* TX chian mask */
  2313. WMI_10X_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
  2314. /* RX chian mask */
  2315. WMI_10X_PDEV_PARAM_RX_CHAIN_MASK,
  2316. /* TX power limit for 2G Radio */
  2317. WMI_10X_PDEV_PARAM_TXPOWER_LIMIT2G,
  2318. /* TX power limit for 5G Radio */
  2319. WMI_10X_PDEV_PARAM_TXPOWER_LIMIT5G,
  2320. /* TX power scale */
  2321. WMI_10X_PDEV_PARAM_TXPOWER_SCALE,
  2322. /* Beacon generation mode . 0: host, 1: target */
  2323. WMI_10X_PDEV_PARAM_BEACON_GEN_MODE,
  2324. /* Beacon generation mode . 0: staggered 1: bursted */
  2325. WMI_10X_PDEV_PARAM_BEACON_TX_MODE,
  2326. /*
  2327. * Resource manager off chan mode .
  2328. * 0: turn off off chan mode. 1: turn on offchan mode
  2329. */
  2330. WMI_10X_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
  2331. /*
  2332. * Protection mode:
  2333. * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
  2334. */
  2335. WMI_10X_PDEV_PARAM_PROTECTION_MODE,
  2336. /* Dynamic bandwidth 0: disable 1: enable */
  2337. WMI_10X_PDEV_PARAM_DYNAMIC_BW,
  2338. /* Non aggregrate/ 11g sw retry threshold.0-disable */
  2339. WMI_10X_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
  2340. /* aggregrate sw retry threshold. 0-disable*/
  2341. WMI_10X_PDEV_PARAM_AGG_SW_RETRY_TH,
  2342. /* Station kickout threshold (non of consecutive failures).0-disable */
  2343. WMI_10X_PDEV_PARAM_STA_KICKOUT_TH,
  2344. /* Aggerate size scaling configuration per AC */
  2345. WMI_10X_PDEV_PARAM_AC_AGGRSIZE_SCALING,
  2346. /* LTR enable */
  2347. WMI_10X_PDEV_PARAM_LTR_ENABLE,
  2348. /* LTR latency for BE, in us */
  2349. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BE,
  2350. /* LTR latency for BK, in us */
  2351. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BK,
  2352. /* LTR latency for VI, in us */
  2353. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VI,
  2354. /* LTR latency for VO, in us */
  2355. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VO,
  2356. /* LTR AC latency timeout, in ms */
  2357. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
  2358. /* LTR platform latency override, in us */
  2359. WMI_10X_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
  2360. /* LTR-RX override, in us */
  2361. WMI_10X_PDEV_PARAM_LTR_RX_OVERRIDE,
  2362. /* Tx activity timeout for LTR, in us */
  2363. WMI_10X_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
  2364. /* L1SS state machine enable */
  2365. WMI_10X_PDEV_PARAM_L1SS_ENABLE,
  2366. /* Deep sleep state machine enable */
  2367. WMI_10X_PDEV_PARAM_DSLEEP_ENABLE,
  2368. /* pdev level stats update period in ms */
  2369. WMI_10X_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
  2370. /* vdev level stats update period in ms */
  2371. WMI_10X_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
  2372. /* peer level stats update period in ms */
  2373. WMI_10X_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
  2374. /* beacon filter status update period */
  2375. WMI_10X_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
  2376. /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
  2377. WMI_10X_PDEV_PARAM_PMF_QOS,
  2378. /* Access category on which ARP and DHCP frames are sent */
  2379. WMI_10X_PDEV_PARAM_ARPDHCP_AC_OVERRIDE,
  2380. /* DCS configuration */
  2381. WMI_10X_PDEV_PARAM_DCS,
  2382. /* Enable/Disable ANI on target */
  2383. WMI_10X_PDEV_PARAM_ANI_ENABLE,
  2384. /* configure the ANI polling period */
  2385. WMI_10X_PDEV_PARAM_ANI_POLL_PERIOD,
  2386. /* configure the ANI listening period */
  2387. WMI_10X_PDEV_PARAM_ANI_LISTEN_PERIOD,
  2388. /* configure OFDM immunity level */
  2389. WMI_10X_PDEV_PARAM_ANI_OFDM_LEVEL,
  2390. /* configure CCK immunity level */
  2391. WMI_10X_PDEV_PARAM_ANI_CCK_LEVEL,
  2392. /* Enable/Disable CDD for 1x1 STAs in rate control module */
  2393. WMI_10X_PDEV_PARAM_DYNTXCHAIN,
  2394. /* Enable/Disable Fast channel reset*/
  2395. WMI_10X_PDEV_PARAM_FAST_CHANNEL_RESET,
  2396. /* Set Bursting DUR */
  2397. WMI_10X_PDEV_PARAM_BURST_DUR,
  2398. /* Set Bursting Enable*/
  2399. WMI_10X_PDEV_PARAM_BURST_ENABLE,
  2400. /* following are available as of firmware 10.2 */
  2401. WMI_10X_PDEV_PARAM_SMART_ANTENNA_DEFAULT_ANTENNA,
  2402. WMI_10X_PDEV_PARAM_IGMPMLD_OVERRIDE,
  2403. WMI_10X_PDEV_PARAM_IGMPMLD_TID,
  2404. WMI_10X_PDEV_PARAM_ANTENNA_GAIN,
  2405. WMI_10X_PDEV_PARAM_RX_DECAP_MODE,
  2406. WMI_10X_PDEV_PARAM_RX_FILTER,
  2407. WMI_10X_PDEV_PARAM_SET_MCAST_TO_UCAST_TID,
  2408. WMI_10X_PDEV_PARAM_PROXY_STA_MODE,
  2409. WMI_10X_PDEV_PARAM_SET_MCAST2UCAST_MODE,
  2410. WMI_10X_PDEV_PARAM_SET_MCAST2UCAST_BUFFER,
  2411. WMI_10X_PDEV_PARAM_REMOVE_MCAST2UCAST_BUFFER,
  2412. };
  2413. struct wmi_pdev_set_param_cmd {
  2414. __le32 param_id;
  2415. __le32 param_value;
  2416. } __packed;
  2417. struct wmi_pdev_get_tpc_config_cmd {
  2418. /* parameter */
  2419. __le32 param;
  2420. } __packed;
  2421. #define WMI_TPC_RATE_MAX 160
  2422. #define WMI_TPC_TX_N_CHAIN 4
  2423. enum wmi_tpc_config_event_flag {
  2424. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_CDD = 0x1,
  2425. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_STBC = 0x2,
  2426. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF = 0x4,
  2427. };
  2428. struct wmi_pdev_tpc_config_event {
  2429. __le32 reg_domain;
  2430. __le32 chan_freq;
  2431. __le32 phy_mode;
  2432. __le32 twice_antenna_reduction;
  2433. __le32 twice_max_rd_power;
  2434. s32 twice_antenna_gain;
  2435. __le32 power_limit;
  2436. __le32 rate_max;
  2437. __le32 num_tx_chain;
  2438. __le32 ctl;
  2439. __le32 flags;
  2440. s8 max_reg_allow_pow[WMI_TPC_TX_N_CHAIN];
  2441. s8 max_reg_allow_pow_agcdd[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  2442. s8 max_reg_allow_pow_agstbc[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  2443. s8 max_reg_allow_pow_agtxbf[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  2444. u8 rates_array[WMI_TPC_RATE_MAX];
  2445. } __packed;
  2446. /* Transmit power scale factor. */
  2447. enum wmi_tp_scale {
  2448. WMI_TP_SCALE_MAX = 0, /* no scaling (default) */
  2449. WMI_TP_SCALE_50 = 1, /* 50% of max (-3 dBm) */
  2450. WMI_TP_SCALE_25 = 2, /* 25% of max (-6 dBm) */
  2451. WMI_TP_SCALE_12 = 3, /* 12% of max (-9 dBm) */
  2452. WMI_TP_SCALE_MIN = 4, /* min, but still on */
  2453. WMI_TP_SCALE_SIZE = 5, /* max num of enum */
  2454. };
  2455. struct wmi_pdev_chanlist_update_event {
  2456. /* number of channels */
  2457. __le32 num_chan;
  2458. /* array of channels */
  2459. struct wmi_channel channel_list[1];
  2460. } __packed;
  2461. #define WMI_MAX_DEBUG_MESG (sizeof(u32) * 32)
  2462. struct wmi_debug_mesg_event {
  2463. /* message buffer, NULL terminated */
  2464. char bufp[WMI_MAX_DEBUG_MESG];
  2465. } __packed;
  2466. enum {
  2467. /* P2P device */
  2468. VDEV_SUBTYPE_P2PDEV = 0,
  2469. /* P2P client */
  2470. VDEV_SUBTYPE_P2PCLI,
  2471. /* P2P GO */
  2472. VDEV_SUBTYPE_P2PGO,
  2473. /* BT3.0 HS */
  2474. VDEV_SUBTYPE_BT,
  2475. };
  2476. struct wmi_pdev_set_channel_cmd {
  2477. /* idnore power , only use flags , mode and freq */
  2478. struct wmi_channel chan;
  2479. } __packed;
  2480. struct wmi_pdev_pktlog_enable_cmd {
  2481. __le32 ev_bitmap;
  2482. } __packed;
  2483. /* Customize the DSCP (bit) to TID (0-7) mapping for QOS */
  2484. #define WMI_DSCP_MAP_MAX (64)
  2485. struct wmi_pdev_set_dscp_tid_map_cmd {
  2486. /* map indicating DSCP to TID conversion */
  2487. __le32 dscp_to_tid_map[WMI_DSCP_MAP_MAX];
  2488. } __packed;
  2489. enum mcast_bcast_rate_id {
  2490. WMI_SET_MCAST_RATE,
  2491. WMI_SET_BCAST_RATE
  2492. };
  2493. struct mcast_bcast_rate {
  2494. enum mcast_bcast_rate_id rate_id;
  2495. __le32 rate;
  2496. } __packed;
  2497. struct wmi_wmm_params {
  2498. __le32 cwmin;
  2499. __le32 cwmax;
  2500. __le32 aifs;
  2501. __le32 txop;
  2502. __le32 acm;
  2503. __le32 no_ack;
  2504. } __packed;
  2505. struct wmi_pdev_set_wmm_params {
  2506. struct wmi_wmm_params ac_be;
  2507. struct wmi_wmm_params ac_bk;
  2508. struct wmi_wmm_params ac_vi;
  2509. struct wmi_wmm_params ac_vo;
  2510. } __packed;
  2511. struct wmi_wmm_params_arg {
  2512. u32 cwmin;
  2513. u32 cwmax;
  2514. u32 aifs;
  2515. u32 txop;
  2516. u32 acm;
  2517. u32 no_ack;
  2518. };
  2519. struct wmi_pdev_set_wmm_params_arg {
  2520. struct wmi_wmm_params_arg ac_be;
  2521. struct wmi_wmm_params_arg ac_bk;
  2522. struct wmi_wmm_params_arg ac_vi;
  2523. struct wmi_wmm_params_arg ac_vo;
  2524. };
  2525. struct wal_dbg_tx_stats {
  2526. /* Num HTT cookies queued to dispatch list */
  2527. __le32 comp_queued;
  2528. /* Num HTT cookies dispatched */
  2529. __le32 comp_delivered;
  2530. /* Num MSDU queued to WAL */
  2531. __le32 msdu_enqued;
  2532. /* Num MPDU queue to WAL */
  2533. __le32 mpdu_enqued;
  2534. /* Num MSDUs dropped by WMM limit */
  2535. __le32 wmm_drop;
  2536. /* Num Local frames queued */
  2537. __le32 local_enqued;
  2538. /* Num Local frames done */
  2539. __le32 local_freed;
  2540. /* Num queued to HW */
  2541. __le32 hw_queued;
  2542. /* Num PPDU reaped from HW */
  2543. __le32 hw_reaped;
  2544. /* Num underruns */
  2545. __le32 underrun;
  2546. /* Num PPDUs cleaned up in TX abort */
  2547. __le32 tx_abort;
  2548. /* Num MPDUs requed by SW */
  2549. __le32 mpdus_requed;
  2550. /* excessive retries */
  2551. __le32 tx_ko;
  2552. /* data hw rate code */
  2553. __le32 data_rc;
  2554. /* Scheduler self triggers */
  2555. __le32 self_triggers;
  2556. /* frames dropped due to excessive sw retries */
  2557. __le32 sw_retry_failure;
  2558. /* illegal rate phy errors */
  2559. __le32 illgl_rate_phy_err;
  2560. /* wal pdev continous xretry */
  2561. __le32 pdev_cont_xretry;
  2562. /* wal pdev continous xretry */
  2563. __le32 pdev_tx_timeout;
  2564. /* wal pdev resets */
  2565. __le32 pdev_resets;
  2566. /* frames dropped due to non-availability of stateless TIDs */
  2567. __le32 stateless_tid_alloc_failure;
  2568. __le32 phy_underrun;
  2569. /* MPDU is more than txop limit */
  2570. __le32 txop_ovf;
  2571. } __packed;
  2572. struct wal_dbg_rx_stats {
  2573. /* Cnts any change in ring routing mid-ppdu */
  2574. __le32 mid_ppdu_route_change;
  2575. /* Total number of statuses processed */
  2576. __le32 status_rcvd;
  2577. /* Extra frags on rings 0-3 */
  2578. __le32 r0_frags;
  2579. __le32 r1_frags;
  2580. __le32 r2_frags;
  2581. __le32 r3_frags;
  2582. /* MSDUs / MPDUs delivered to HTT */
  2583. __le32 htt_msdus;
  2584. __le32 htt_mpdus;
  2585. /* MSDUs / MPDUs delivered to local stack */
  2586. __le32 loc_msdus;
  2587. __le32 loc_mpdus;
  2588. /* AMSDUs that have more MSDUs than the status ring size */
  2589. __le32 oversize_amsdu;
  2590. /* Number of PHY errors */
  2591. __le32 phy_errs;
  2592. /* Number of PHY errors drops */
  2593. __le32 phy_err_drop;
  2594. /* Number of mpdu errors - FCS, MIC, ENC etc. */
  2595. __le32 mpdu_errs;
  2596. } __packed;
  2597. struct wal_dbg_peer_stats {
  2598. /* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
  2599. __le32 dummy;
  2600. } __packed;
  2601. struct wal_dbg_stats {
  2602. struct wal_dbg_tx_stats tx;
  2603. struct wal_dbg_rx_stats rx;
  2604. struct wal_dbg_peer_stats peer;
  2605. } __packed;
  2606. enum wmi_stats_id {
  2607. WMI_REQUEST_PEER_STAT = 0x01,
  2608. WMI_REQUEST_AP_STAT = 0x02
  2609. };
  2610. struct wlan_inst_rssi_args {
  2611. __le16 cfg_retry_count;
  2612. __le16 retry_count;
  2613. };
  2614. struct wmi_request_stats_cmd {
  2615. __le32 stats_id;
  2616. __le32 vdev_id;
  2617. /* peer MAC address */
  2618. struct wmi_mac_addr peer_macaddr;
  2619. /* Instantaneous RSSI arguments */
  2620. struct wlan_inst_rssi_args inst_rssi_args;
  2621. } __packed;
  2622. /* Suspend option */
  2623. enum {
  2624. /* suspend */
  2625. WMI_PDEV_SUSPEND,
  2626. /* suspend and disable all interrupts */
  2627. WMI_PDEV_SUSPEND_AND_DISABLE_INTR,
  2628. };
  2629. struct wmi_pdev_suspend_cmd {
  2630. /* suspend option sent to target */
  2631. __le32 suspend_opt;
  2632. } __packed;
  2633. struct wmi_stats_event {
  2634. __le32 stats_id; /* %WMI_REQUEST_ */
  2635. /*
  2636. * number of pdev stats event structures
  2637. * (wmi_pdev_stats) 0 or 1
  2638. */
  2639. __le32 num_pdev_stats;
  2640. /*
  2641. * number of vdev stats event structures
  2642. * (wmi_vdev_stats) 0 or max vdevs
  2643. */
  2644. __le32 num_vdev_stats;
  2645. /*
  2646. * number of peer stats event structures
  2647. * (wmi_peer_stats) 0 or max peers
  2648. */
  2649. __le32 num_peer_stats;
  2650. __le32 num_bcnflt_stats;
  2651. /*
  2652. * followed by
  2653. * num_pdev_stats * size of(struct wmi_pdev_stats)
  2654. * num_vdev_stats * size of(struct wmi_vdev_stats)
  2655. * num_peer_stats * size of(struct wmi_peer_stats)
  2656. *
  2657. * By having a zero sized array, the pointer to data area
  2658. * becomes available without increasing the struct size
  2659. */
  2660. u8 data[0];
  2661. } __packed;
  2662. /*
  2663. * PDEV statistics
  2664. * TODO: add all PDEV stats here
  2665. */
  2666. struct wmi_pdev_stats {
  2667. __le32 chan_nf; /* Channel noise floor */
  2668. __le32 tx_frame_count; /* TX frame count */
  2669. __le32 rx_frame_count; /* RX frame count */
  2670. __le32 rx_clear_count; /* rx clear count */
  2671. __le32 cycle_count; /* cycle count */
  2672. __le32 phy_err_count; /* Phy error count */
  2673. __le32 chan_tx_pwr; /* channel tx power */
  2674. struct wal_dbg_stats wal; /* WAL dbg stats */
  2675. } __packed;
  2676. struct wmi_10x_pdev_stats {
  2677. struct wmi_pdev_stats old;
  2678. __le32 ack_rx_bad;
  2679. __le32 rts_bad;
  2680. __le32 rts_good;
  2681. __le32 fcs_bad;
  2682. __le32 no_beacons;
  2683. __le32 mib_int_count;
  2684. } __packed;
  2685. /*
  2686. * VDEV statistics
  2687. * TODO: add all VDEV stats here
  2688. */
  2689. struct wmi_vdev_stats {
  2690. __le32 vdev_id;
  2691. } __packed;
  2692. /*
  2693. * peer statistics.
  2694. * TODO: add more stats
  2695. */
  2696. struct wmi_peer_stats {
  2697. struct wmi_mac_addr peer_macaddr;
  2698. __le32 peer_rssi;
  2699. __le32 peer_tx_rate;
  2700. } __packed;
  2701. struct wmi_10x_peer_stats {
  2702. struct wmi_peer_stats old;
  2703. __le32 peer_rx_rate;
  2704. } __packed;
  2705. struct wmi_vdev_create_cmd {
  2706. __le32 vdev_id;
  2707. __le32 vdev_type;
  2708. __le32 vdev_subtype;
  2709. struct wmi_mac_addr vdev_macaddr;
  2710. } __packed;
  2711. enum wmi_vdev_type {
  2712. WMI_VDEV_TYPE_AP = 1,
  2713. WMI_VDEV_TYPE_STA = 2,
  2714. WMI_VDEV_TYPE_IBSS = 3,
  2715. WMI_VDEV_TYPE_MONITOR = 4,
  2716. };
  2717. enum wmi_vdev_subtype {
  2718. WMI_VDEV_SUBTYPE_NONE = 0,
  2719. WMI_VDEV_SUBTYPE_P2P_DEVICE = 1,
  2720. WMI_VDEV_SUBTYPE_P2P_CLIENT = 2,
  2721. WMI_VDEV_SUBTYPE_P2P_GO = 3,
  2722. };
  2723. /* values for vdev_subtype */
  2724. /* values for vdev_start_request flags */
  2725. /*
  2726. * Indicates that AP VDEV uses hidden ssid. only valid for
  2727. * AP/GO */
  2728. #define WMI_VDEV_START_HIDDEN_SSID (1<<0)
  2729. /*
  2730. * Indicates if robust management frame/management frame
  2731. * protection is enabled. For GO/AP vdevs, it indicates that
  2732. * it may support station/client associations with RMF enabled.
  2733. * For STA/client vdevs, it indicates that sta will
  2734. * associate with AP with RMF enabled. */
  2735. #define WMI_VDEV_START_PMF_ENABLED (1<<1)
  2736. struct wmi_p2p_noa_descriptor {
  2737. __le32 type_count; /* 255: continuous schedule, 0: reserved */
  2738. __le32 duration; /* Absent period duration in micro seconds */
  2739. __le32 interval; /* Absent period interval in micro seconds */
  2740. __le32 start_time; /* 32 bit tsf time when in starts */
  2741. } __packed;
  2742. struct wmi_vdev_start_request_cmd {
  2743. /* WMI channel */
  2744. struct wmi_channel chan;
  2745. /* unique id identifying the VDEV, generated by the caller */
  2746. __le32 vdev_id;
  2747. /* requestor id identifying the caller module */
  2748. __le32 requestor_id;
  2749. /* beacon interval from received beacon */
  2750. __le32 beacon_interval;
  2751. /* DTIM Period from the received beacon */
  2752. __le32 dtim_period;
  2753. /* Flags */
  2754. __le32 flags;
  2755. /* ssid field. Only valid for AP/GO/IBSS/BTAmp VDEV type. */
  2756. struct wmi_ssid ssid;
  2757. /* beacon/probe reponse xmit rate. Applicable for SoftAP. */
  2758. __le32 bcn_tx_rate;
  2759. /* beacon/probe reponse xmit power. Applicable for SoftAP. */
  2760. __le32 bcn_tx_power;
  2761. /* number of p2p NOA descriptor(s) from scan entry */
  2762. __le32 num_noa_descriptors;
  2763. /*
  2764. * Disable H/W ack. This used by WMI_VDEV_RESTART_REQUEST_CMDID.
  2765. * During CAC, Our HW shouldn't ack ditected frames
  2766. */
  2767. __le32 disable_hw_ack;
  2768. /* actual p2p NOA descriptor from scan entry */
  2769. struct wmi_p2p_noa_descriptor noa_descriptors[2];
  2770. } __packed;
  2771. struct wmi_vdev_restart_request_cmd {
  2772. struct wmi_vdev_start_request_cmd vdev_start_request_cmd;
  2773. } __packed;
  2774. struct wmi_vdev_start_request_arg {
  2775. u32 vdev_id;
  2776. struct wmi_channel_arg channel;
  2777. u32 bcn_intval;
  2778. u32 dtim_period;
  2779. u8 *ssid;
  2780. u32 ssid_len;
  2781. u32 bcn_tx_rate;
  2782. u32 bcn_tx_power;
  2783. bool disable_hw_ack;
  2784. bool hidden_ssid;
  2785. bool pmf_enabled;
  2786. };
  2787. struct wmi_vdev_delete_cmd {
  2788. /* unique id identifying the VDEV, generated by the caller */
  2789. __le32 vdev_id;
  2790. } __packed;
  2791. struct wmi_vdev_up_cmd {
  2792. __le32 vdev_id;
  2793. __le32 vdev_assoc_id;
  2794. struct wmi_mac_addr vdev_bssid;
  2795. } __packed;
  2796. struct wmi_vdev_stop_cmd {
  2797. __le32 vdev_id;
  2798. } __packed;
  2799. struct wmi_vdev_down_cmd {
  2800. __le32 vdev_id;
  2801. } __packed;
  2802. struct wmi_vdev_standby_response_cmd {
  2803. /* unique id identifying the VDEV, generated by the caller */
  2804. __le32 vdev_id;
  2805. } __packed;
  2806. struct wmi_vdev_resume_response_cmd {
  2807. /* unique id identifying the VDEV, generated by the caller */
  2808. __le32 vdev_id;
  2809. } __packed;
  2810. struct wmi_vdev_set_param_cmd {
  2811. __le32 vdev_id;
  2812. __le32 param_id;
  2813. __le32 param_value;
  2814. } __packed;
  2815. #define WMI_MAX_KEY_INDEX 3
  2816. #define WMI_MAX_KEY_LEN 32
  2817. #define WMI_KEY_PAIRWISE 0x00
  2818. #define WMI_KEY_GROUP 0x01
  2819. #define WMI_KEY_TX_USAGE 0x02 /* default tx key - static wep */
  2820. struct wmi_key_seq_counter {
  2821. __le32 key_seq_counter_l;
  2822. __le32 key_seq_counter_h;
  2823. } __packed;
  2824. #define WMI_CIPHER_NONE 0x0 /* clear key */
  2825. #define WMI_CIPHER_WEP 0x1
  2826. #define WMI_CIPHER_TKIP 0x2
  2827. #define WMI_CIPHER_AES_OCB 0x3
  2828. #define WMI_CIPHER_AES_CCM 0x4
  2829. #define WMI_CIPHER_WAPI 0x5
  2830. #define WMI_CIPHER_CKIP 0x6
  2831. #define WMI_CIPHER_AES_CMAC 0x7
  2832. struct wmi_vdev_install_key_cmd {
  2833. __le32 vdev_id;
  2834. struct wmi_mac_addr peer_macaddr;
  2835. __le32 key_idx;
  2836. __le32 key_flags;
  2837. __le32 key_cipher; /* %WMI_CIPHER_ */
  2838. struct wmi_key_seq_counter key_rsc_counter;
  2839. struct wmi_key_seq_counter key_global_rsc_counter;
  2840. struct wmi_key_seq_counter key_tsc_counter;
  2841. u8 wpi_key_rsc_counter[16];
  2842. u8 wpi_key_tsc_counter[16];
  2843. __le32 key_len;
  2844. __le32 key_txmic_len;
  2845. __le32 key_rxmic_len;
  2846. /* contains key followed by tx mic followed by rx mic */
  2847. u8 key_data[0];
  2848. } __packed;
  2849. struct wmi_vdev_install_key_arg {
  2850. u32 vdev_id;
  2851. const u8 *macaddr;
  2852. u32 key_idx;
  2853. u32 key_flags;
  2854. u32 key_cipher;
  2855. u32 key_len;
  2856. u32 key_txmic_len;
  2857. u32 key_rxmic_len;
  2858. const void *key_data;
  2859. };
  2860. /*
  2861. * vdev fixed rate format:
  2862. * - preamble - b7:b6 - see WMI_RATE_PREMABLE_
  2863. * - nss - b5:b4 - ss number (0 mean 1ss)
  2864. * - rate_mcs - b3:b0 - as below
  2865. * CCK: 0 - 11Mbps, 1 - 5,5Mbps, 2 - 2Mbps, 3 - 1Mbps,
  2866. * 4 - 11Mbps (s), 5 - 5,5Mbps (s), 6 - 2Mbps (s)
  2867. * OFDM: 0 - 48Mbps, 1 - 24Mbps, 2 - 12Mbps, 3 - 6Mbps,
  2868. * 4 - 54Mbps, 5 - 36Mbps, 6 - 18Mbps, 7 - 9Mbps
  2869. * HT/VHT: MCS index
  2870. */
  2871. /* Preamble types to be used with VDEV fixed rate configuration */
  2872. enum wmi_rate_preamble {
  2873. WMI_RATE_PREAMBLE_OFDM,
  2874. WMI_RATE_PREAMBLE_CCK,
  2875. WMI_RATE_PREAMBLE_HT,
  2876. WMI_RATE_PREAMBLE_VHT,
  2877. };
  2878. /* Value to disable fixed rate setting */
  2879. #define WMI_FIXED_RATE_NONE (0xff)
  2880. struct wmi_vdev_param_map {
  2881. u32 rts_threshold;
  2882. u32 fragmentation_threshold;
  2883. u32 beacon_interval;
  2884. u32 listen_interval;
  2885. u32 multicast_rate;
  2886. u32 mgmt_tx_rate;
  2887. u32 slot_time;
  2888. u32 preamble;
  2889. u32 swba_time;
  2890. u32 wmi_vdev_stats_update_period;
  2891. u32 wmi_vdev_pwrsave_ageout_time;
  2892. u32 wmi_vdev_host_swba_interval;
  2893. u32 dtim_period;
  2894. u32 wmi_vdev_oc_scheduler_air_time_limit;
  2895. u32 wds;
  2896. u32 atim_window;
  2897. u32 bmiss_count_max;
  2898. u32 bmiss_first_bcnt;
  2899. u32 bmiss_final_bcnt;
  2900. u32 feature_wmm;
  2901. u32 chwidth;
  2902. u32 chextoffset;
  2903. u32 disable_htprotection;
  2904. u32 sta_quickkickout;
  2905. u32 mgmt_rate;
  2906. u32 protection_mode;
  2907. u32 fixed_rate;
  2908. u32 sgi;
  2909. u32 ldpc;
  2910. u32 tx_stbc;
  2911. u32 rx_stbc;
  2912. u32 intra_bss_fwd;
  2913. u32 def_keyid;
  2914. u32 nss;
  2915. u32 bcast_data_rate;
  2916. u32 mcast_data_rate;
  2917. u32 mcast_indicate;
  2918. u32 dhcp_indicate;
  2919. u32 unknown_dest_indicate;
  2920. u32 ap_keepalive_min_idle_inactive_time_secs;
  2921. u32 ap_keepalive_max_idle_inactive_time_secs;
  2922. u32 ap_keepalive_max_unresponsive_time_secs;
  2923. u32 ap_enable_nawds;
  2924. u32 mcast2ucast_set;
  2925. u32 enable_rtscts;
  2926. u32 txbf;
  2927. u32 packet_powersave;
  2928. u32 drop_unencry;
  2929. u32 tx_encap_type;
  2930. u32 ap_detect_out_of_sync_sleeping_sta_time_secs;
  2931. };
  2932. #define WMI_VDEV_PARAM_UNSUPPORTED 0
  2933. /* the definition of different VDEV parameters */
  2934. enum wmi_vdev_param {
  2935. /* RTS Threshold */
  2936. WMI_VDEV_PARAM_RTS_THRESHOLD = 0x1,
  2937. /* Fragmentation threshold */
  2938. WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
  2939. /* beacon interval in TUs */
  2940. WMI_VDEV_PARAM_BEACON_INTERVAL,
  2941. /* Listen interval in TUs */
  2942. WMI_VDEV_PARAM_LISTEN_INTERVAL,
  2943. /* muticast rate in Mbps */
  2944. WMI_VDEV_PARAM_MULTICAST_RATE,
  2945. /* management frame rate in Mbps */
  2946. WMI_VDEV_PARAM_MGMT_TX_RATE,
  2947. /* slot time (long vs short) */
  2948. WMI_VDEV_PARAM_SLOT_TIME,
  2949. /* preamble (long vs short) */
  2950. WMI_VDEV_PARAM_PREAMBLE,
  2951. /* SWBA time (time before tbtt in msec) */
  2952. WMI_VDEV_PARAM_SWBA_TIME,
  2953. /* time period for updating VDEV stats */
  2954. WMI_VDEV_STATS_UPDATE_PERIOD,
  2955. /* age out time in msec for frames queued for station in power save */
  2956. WMI_VDEV_PWRSAVE_AGEOUT_TIME,
  2957. /*
  2958. * Host SWBA interval (time in msec before tbtt for SWBA event
  2959. * generation).
  2960. */
  2961. WMI_VDEV_HOST_SWBA_INTERVAL,
  2962. /* DTIM period (specified in units of num beacon intervals) */
  2963. WMI_VDEV_PARAM_DTIM_PERIOD,
  2964. /*
  2965. * scheduler air time limit for this VDEV. used by off chan
  2966. * scheduler.
  2967. */
  2968. WMI_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
  2969. /* enable/dsiable WDS for this VDEV */
  2970. WMI_VDEV_PARAM_WDS,
  2971. /* ATIM Window */
  2972. WMI_VDEV_PARAM_ATIM_WINDOW,
  2973. /* BMISS max */
  2974. WMI_VDEV_PARAM_BMISS_COUNT_MAX,
  2975. /* BMISS first time */
  2976. WMI_VDEV_PARAM_BMISS_FIRST_BCNT,
  2977. /* BMISS final time */
  2978. WMI_VDEV_PARAM_BMISS_FINAL_BCNT,
  2979. /* WMM enables/disabled */
  2980. WMI_VDEV_PARAM_FEATURE_WMM,
  2981. /* Channel width */
  2982. WMI_VDEV_PARAM_CHWIDTH,
  2983. /* Channel Offset */
  2984. WMI_VDEV_PARAM_CHEXTOFFSET,
  2985. /* Disable HT Protection */
  2986. WMI_VDEV_PARAM_DISABLE_HTPROTECTION,
  2987. /* Quick STA Kickout */
  2988. WMI_VDEV_PARAM_STA_QUICKKICKOUT,
  2989. /* Rate to be used with Management frames */
  2990. WMI_VDEV_PARAM_MGMT_RATE,
  2991. /* Protection Mode */
  2992. WMI_VDEV_PARAM_PROTECTION_MODE,
  2993. /* Fixed rate setting */
  2994. WMI_VDEV_PARAM_FIXED_RATE,
  2995. /* Short GI Enable/Disable */
  2996. WMI_VDEV_PARAM_SGI,
  2997. /* Enable LDPC */
  2998. WMI_VDEV_PARAM_LDPC,
  2999. /* Enable Tx STBC */
  3000. WMI_VDEV_PARAM_TX_STBC,
  3001. /* Enable Rx STBC */
  3002. WMI_VDEV_PARAM_RX_STBC,
  3003. /* Intra BSS forwarding */
  3004. WMI_VDEV_PARAM_INTRA_BSS_FWD,
  3005. /* Setting Default xmit key for Vdev */
  3006. WMI_VDEV_PARAM_DEF_KEYID,
  3007. /* NSS width */
  3008. WMI_VDEV_PARAM_NSS,
  3009. /* Set the custom rate for the broadcast data frames */
  3010. WMI_VDEV_PARAM_BCAST_DATA_RATE,
  3011. /* Set the custom rate (rate-code) for multicast data frames */
  3012. WMI_VDEV_PARAM_MCAST_DATA_RATE,
  3013. /* Tx multicast packet indicate Enable/Disable */
  3014. WMI_VDEV_PARAM_MCAST_INDICATE,
  3015. /* Tx DHCP packet indicate Enable/Disable */
  3016. WMI_VDEV_PARAM_DHCP_INDICATE,
  3017. /* Enable host inspection of Tx unicast packet to unknown destination */
  3018. WMI_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
  3019. /* The minimum amount of time AP begins to consider STA inactive */
  3020. WMI_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
  3021. /*
  3022. * An associated STA is considered inactive when there is no recent
  3023. * TX/RX activity and no downlink frames are buffered for it. Once a
  3024. * STA exceeds the maximum idle inactive time, the AP will send an
  3025. * 802.11 data-null as a keep alive to verify the STA is still
  3026. * associated. If the STA does ACK the data-null, or if the data-null
  3027. * is buffered and the STA does not retrieve it, the STA will be
  3028. * considered unresponsive
  3029. * (see WMI_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
  3030. */
  3031. WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
  3032. /*
  3033. * An associated STA is considered unresponsive if there is no recent
  3034. * TX/RX activity and downlink frames are buffered for it. Once a STA
  3035. * exceeds the maximum unresponsive time, the AP will send a
  3036. * WMI_STA_KICKOUT event to the host so the STA can be deleted. */
  3037. WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
  3038. /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
  3039. WMI_VDEV_PARAM_AP_ENABLE_NAWDS,
  3040. /* Enable/Disable RTS-CTS */
  3041. WMI_VDEV_PARAM_ENABLE_RTSCTS,
  3042. /* Enable TXBFee/er */
  3043. WMI_VDEV_PARAM_TXBF,
  3044. /* Set packet power save */
  3045. WMI_VDEV_PARAM_PACKET_POWERSAVE,
  3046. /*
  3047. * Drops un-encrypted packets if eceived in an encrypted connection
  3048. * otherwise forwards to host.
  3049. */
  3050. WMI_VDEV_PARAM_DROP_UNENCRY,
  3051. /*
  3052. * Set the encapsulation type for frames.
  3053. */
  3054. WMI_VDEV_PARAM_TX_ENCAP_TYPE,
  3055. };
  3056. /* the definition of different VDEV parameters */
  3057. enum wmi_10x_vdev_param {
  3058. /* RTS Threshold */
  3059. WMI_10X_VDEV_PARAM_RTS_THRESHOLD = 0x1,
  3060. /* Fragmentation threshold */
  3061. WMI_10X_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
  3062. /* beacon interval in TUs */
  3063. WMI_10X_VDEV_PARAM_BEACON_INTERVAL,
  3064. /* Listen interval in TUs */
  3065. WMI_10X_VDEV_PARAM_LISTEN_INTERVAL,
  3066. /* muticast rate in Mbps */
  3067. WMI_10X_VDEV_PARAM_MULTICAST_RATE,
  3068. /* management frame rate in Mbps */
  3069. WMI_10X_VDEV_PARAM_MGMT_TX_RATE,
  3070. /* slot time (long vs short) */
  3071. WMI_10X_VDEV_PARAM_SLOT_TIME,
  3072. /* preamble (long vs short) */
  3073. WMI_10X_VDEV_PARAM_PREAMBLE,
  3074. /* SWBA time (time before tbtt in msec) */
  3075. WMI_10X_VDEV_PARAM_SWBA_TIME,
  3076. /* time period for updating VDEV stats */
  3077. WMI_10X_VDEV_STATS_UPDATE_PERIOD,
  3078. /* age out time in msec for frames queued for station in power save */
  3079. WMI_10X_VDEV_PWRSAVE_AGEOUT_TIME,
  3080. /*
  3081. * Host SWBA interval (time in msec before tbtt for SWBA event
  3082. * generation).
  3083. */
  3084. WMI_10X_VDEV_HOST_SWBA_INTERVAL,
  3085. /* DTIM period (specified in units of num beacon intervals) */
  3086. WMI_10X_VDEV_PARAM_DTIM_PERIOD,
  3087. /*
  3088. * scheduler air time limit for this VDEV. used by off chan
  3089. * scheduler.
  3090. */
  3091. WMI_10X_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
  3092. /* enable/dsiable WDS for this VDEV */
  3093. WMI_10X_VDEV_PARAM_WDS,
  3094. /* ATIM Window */
  3095. WMI_10X_VDEV_PARAM_ATIM_WINDOW,
  3096. /* BMISS max */
  3097. WMI_10X_VDEV_PARAM_BMISS_COUNT_MAX,
  3098. /* WMM enables/disabled */
  3099. WMI_10X_VDEV_PARAM_FEATURE_WMM,
  3100. /* Channel width */
  3101. WMI_10X_VDEV_PARAM_CHWIDTH,
  3102. /* Channel Offset */
  3103. WMI_10X_VDEV_PARAM_CHEXTOFFSET,
  3104. /* Disable HT Protection */
  3105. WMI_10X_VDEV_PARAM_DISABLE_HTPROTECTION,
  3106. /* Quick STA Kickout */
  3107. WMI_10X_VDEV_PARAM_STA_QUICKKICKOUT,
  3108. /* Rate to be used with Management frames */
  3109. WMI_10X_VDEV_PARAM_MGMT_RATE,
  3110. /* Protection Mode */
  3111. WMI_10X_VDEV_PARAM_PROTECTION_MODE,
  3112. /* Fixed rate setting */
  3113. WMI_10X_VDEV_PARAM_FIXED_RATE,
  3114. /* Short GI Enable/Disable */
  3115. WMI_10X_VDEV_PARAM_SGI,
  3116. /* Enable LDPC */
  3117. WMI_10X_VDEV_PARAM_LDPC,
  3118. /* Enable Tx STBC */
  3119. WMI_10X_VDEV_PARAM_TX_STBC,
  3120. /* Enable Rx STBC */
  3121. WMI_10X_VDEV_PARAM_RX_STBC,
  3122. /* Intra BSS forwarding */
  3123. WMI_10X_VDEV_PARAM_INTRA_BSS_FWD,
  3124. /* Setting Default xmit key for Vdev */
  3125. WMI_10X_VDEV_PARAM_DEF_KEYID,
  3126. /* NSS width */
  3127. WMI_10X_VDEV_PARAM_NSS,
  3128. /* Set the custom rate for the broadcast data frames */
  3129. WMI_10X_VDEV_PARAM_BCAST_DATA_RATE,
  3130. /* Set the custom rate (rate-code) for multicast data frames */
  3131. WMI_10X_VDEV_PARAM_MCAST_DATA_RATE,
  3132. /* Tx multicast packet indicate Enable/Disable */
  3133. WMI_10X_VDEV_PARAM_MCAST_INDICATE,
  3134. /* Tx DHCP packet indicate Enable/Disable */
  3135. WMI_10X_VDEV_PARAM_DHCP_INDICATE,
  3136. /* Enable host inspection of Tx unicast packet to unknown destination */
  3137. WMI_10X_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
  3138. /* The minimum amount of time AP begins to consider STA inactive */
  3139. WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
  3140. /*
  3141. * An associated STA is considered inactive when there is no recent
  3142. * TX/RX activity and no downlink frames are buffered for it. Once a
  3143. * STA exceeds the maximum idle inactive time, the AP will send an
  3144. * 802.11 data-null as a keep alive to verify the STA is still
  3145. * associated. If the STA does ACK the data-null, or if the data-null
  3146. * is buffered and the STA does not retrieve it, the STA will be
  3147. * considered unresponsive
  3148. * (see WMI_10X_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
  3149. */
  3150. WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
  3151. /*
  3152. * An associated STA is considered unresponsive if there is no recent
  3153. * TX/RX activity and downlink frames are buffered for it. Once a STA
  3154. * exceeds the maximum unresponsive time, the AP will send a
  3155. * WMI_10X_STA_KICKOUT event to the host so the STA can be deleted. */
  3156. WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
  3157. /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
  3158. WMI_10X_VDEV_PARAM_AP_ENABLE_NAWDS,
  3159. WMI_10X_VDEV_PARAM_MCAST2UCAST_SET,
  3160. /* Enable/Disable RTS-CTS */
  3161. WMI_10X_VDEV_PARAM_ENABLE_RTSCTS,
  3162. WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,
  3163. /* following are available as of firmware 10.2 */
  3164. WMI_10X_VDEV_PARAM_TX_ENCAP_TYPE,
  3165. WMI_10X_VDEV_PARAM_CABQ_MAXDUR,
  3166. WMI_10X_VDEV_PARAM_MFPTEST_SET,
  3167. WMI_10X_VDEV_PARAM_RTS_FIXED_RATE,
  3168. WMI_10X_VDEV_PARAM_VHT_SGIMASK,
  3169. WMI_10X_VDEV_PARAM_VHT80_RATEMASK,
  3170. };
  3171. /* slot time long */
  3172. #define WMI_VDEV_SLOT_TIME_LONG 0x1
  3173. /* slot time short */
  3174. #define WMI_VDEV_SLOT_TIME_SHORT 0x2
  3175. /* preablbe long */
  3176. #define WMI_VDEV_PREAMBLE_LONG 0x1
  3177. /* preablbe short */
  3178. #define WMI_VDEV_PREAMBLE_SHORT 0x2
  3179. enum wmi_start_event_param {
  3180. WMI_VDEV_RESP_START_EVENT = 0,
  3181. WMI_VDEV_RESP_RESTART_EVENT,
  3182. };
  3183. struct wmi_vdev_start_response_event {
  3184. __le32 vdev_id;
  3185. __le32 req_id;
  3186. __le32 resp_type; /* %WMI_VDEV_RESP_ */
  3187. __le32 status;
  3188. } __packed;
  3189. struct wmi_vdev_standby_req_event {
  3190. /* unique id identifying the VDEV, generated by the caller */
  3191. __le32 vdev_id;
  3192. } __packed;
  3193. struct wmi_vdev_resume_req_event {
  3194. /* unique id identifying the VDEV, generated by the caller */
  3195. __le32 vdev_id;
  3196. } __packed;
  3197. struct wmi_vdev_stopped_event {
  3198. /* unique id identifying the VDEV, generated by the caller */
  3199. __le32 vdev_id;
  3200. } __packed;
  3201. /*
  3202. * common structure used for simple events
  3203. * (stopped, resume_req, standby response)
  3204. */
  3205. struct wmi_vdev_simple_event {
  3206. /* unique id identifying the VDEV, generated by the caller */
  3207. __le32 vdev_id;
  3208. } __packed;
  3209. /* VDEV start response status codes */
  3210. /* VDEV succesfully started */
  3211. #define WMI_INIFIED_VDEV_START_RESPONSE_STATUS_SUCCESS 0x0
  3212. /* requested VDEV not found */
  3213. #define WMI_INIFIED_VDEV_START_RESPONSE_INVALID_VDEVID 0x1
  3214. /* unsupported VDEV combination */
  3215. #define WMI_INIFIED_VDEV_START_RESPONSE_NOT_SUPPORTED 0x2
  3216. /* TODO: please add more comments if you have in-depth information */
  3217. struct wmi_vdev_spectral_conf_cmd {
  3218. __le32 vdev_id;
  3219. /* number of fft samples to send (0 for infinite) */
  3220. __le32 scan_count;
  3221. __le32 scan_period;
  3222. __le32 scan_priority;
  3223. /* number of bins in the FFT: 2^(fft_size - bin_scale) */
  3224. __le32 scan_fft_size;
  3225. __le32 scan_gc_ena;
  3226. __le32 scan_restart_ena;
  3227. __le32 scan_noise_floor_ref;
  3228. __le32 scan_init_delay;
  3229. __le32 scan_nb_tone_thr;
  3230. __le32 scan_str_bin_thr;
  3231. __le32 scan_wb_rpt_mode;
  3232. __le32 scan_rssi_rpt_mode;
  3233. __le32 scan_rssi_thr;
  3234. __le32 scan_pwr_format;
  3235. /* rpt_mode: Format of FFT report to software for spectral scan
  3236. * triggered FFTs:
  3237. * 0: No FFT report (only spectral scan summary report)
  3238. * 1: 2-dword summary of metrics for each completed FFT + spectral
  3239. * scan summary report
  3240. * 2: 2-dword summary of metrics for each completed FFT +
  3241. * 1x- oversampled bins(in-band) per FFT + spectral scan summary
  3242. * report
  3243. * 3: 2-dword summary of metrics for each completed FFT +
  3244. * 2x- oversampled bins (all) per FFT + spectral scan summary
  3245. */
  3246. __le32 scan_rpt_mode;
  3247. __le32 scan_bin_scale;
  3248. __le32 scan_dbm_adj;
  3249. __le32 scan_chn_mask;
  3250. } __packed;
  3251. struct wmi_vdev_spectral_conf_arg {
  3252. u32 vdev_id;
  3253. u32 scan_count;
  3254. u32 scan_period;
  3255. u32 scan_priority;
  3256. u32 scan_fft_size;
  3257. u32 scan_gc_ena;
  3258. u32 scan_restart_ena;
  3259. u32 scan_noise_floor_ref;
  3260. u32 scan_init_delay;
  3261. u32 scan_nb_tone_thr;
  3262. u32 scan_str_bin_thr;
  3263. u32 scan_wb_rpt_mode;
  3264. u32 scan_rssi_rpt_mode;
  3265. u32 scan_rssi_thr;
  3266. u32 scan_pwr_format;
  3267. u32 scan_rpt_mode;
  3268. u32 scan_bin_scale;
  3269. u32 scan_dbm_adj;
  3270. u32 scan_chn_mask;
  3271. };
  3272. #define WMI_SPECTRAL_ENABLE_DEFAULT 0
  3273. #define WMI_SPECTRAL_COUNT_DEFAULT 0
  3274. #define WMI_SPECTRAL_PERIOD_DEFAULT 35
  3275. #define WMI_SPECTRAL_PRIORITY_DEFAULT 1
  3276. #define WMI_SPECTRAL_FFT_SIZE_DEFAULT 7
  3277. #define WMI_SPECTRAL_GC_ENA_DEFAULT 1
  3278. #define WMI_SPECTRAL_RESTART_ENA_DEFAULT 0
  3279. #define WMI_SPECTRAL_NOISE_FLOOR_REF_DEFAULT -96
  3280. #define WMI_SPECTRAL_INIT_DELAY_DEFAULT 80
  3281. #define WMI_SPECTRAL_NB_TONE_THR_DEFAULT 12
  3282. #define WMI_SPECTRAL_STR_BIN_THR_DEFAULT 8
  3283. #define WMI_SPECTRAL_WB_RPT_MODE_DEFAULT 0
  3284. #define WMI_SPECTRAL_RSSI_RPT_MODE_DEFAULT 0
  3285. #define WMI_SPECTRAL_RSSI_THR_DEFAULT 0xf0
  3286. #define WMI_SPECTRAL_PWR_FORMAT_DEFAULT 0
  3287. #define WMI_SPECTRAL_RPT_MODE_DEFAULT 2
  3288. #define WMI_SPECTRAL_BIN_SCALE_DEFAULT 1
  3289. #define WMI_SPECTRAL_DBM_ADJ_DEFAULT 1
  3290. #define WMI_SPECTRAL_CHN_MASK_DEFAULT 1
  3291. struct wmi_vdev_spectral_enable_cmd {
  3292. __le32 vdev_id;
  3293. __le32 trigger_cmd;
  3294. __le32 enable_cmd;
  3295. } __packed;
  3296. #define WMI_SPECTRAL_TRIGGER_CMD_TRIGGER 1
  3297. #define WMI_SPECTRAL_TRIGGER_CMD_CLEAR 2
  3298. #define WMI_SPECTRAL_ENABLE_CMD_ENABLE 1
  3299. #define WMI_SPECTRAL_ENABLE_CMD_DISABLE 2
  3300. /* Beacon processing related command and event structures */
  3301. struct wmi_bcn_tx_hdr {
  3302. __le32 vdev_id;
  3303. __le32 tx_rate;
  3304. __le32 tx_power;
  3305. __le32 bcn_len;
  3306. } __packed;
  3307. struct wmi_bcn_tx_cmd {
  3308. struct wmi_bcn_tx_hdr hdr;
  3309. u8 *bcn[0];
  3310. } __packed;
  3311. struct wmi_bcn_tx_arg {
  3312. u32 vdev_id;
  3313. u32 tx_rate;
  3314. u32 tx_power;
  3315. u32 bcn_len;
  3316. const void *bcn;
  3317. };
  3318. enum wmi_bcn_tx_ref_flags {
  3319. WMI_BCN_TX_REF_FLAG_DTIM_ZERO = 0x1,
  3320. WMI_BCN_TX_REF_FLAG_DELIVER_CAB = 0x2,
  3321. };
  3322. /* TODO: It is unclear why "no antenna" works while any other seemingly valid
  3323. * chainmask yields no beacons on the air at all.
  3324. */
  3325. #define WMI_BCN_TX_REF_DEF_ANTENNA 0
  3326. struct wmi_bcn_tx_ref_cmd {
  3327. __le32 vdev_id;
  3328. __le32 data_len;
  3329. /* physical address of the frame - dma pointer */
  3330. __le32 data_ptr;
  3331. /* id for host to track */
  3332. __le32 msdu_id;
  3333. /* frame ctrl to setup PPDU desc */
  3334. __le32 frame_control;
  3335. /* to control CABQ traffic: WMI_BCN_TX_REF_FLAG_ */
  3336. __le32 flags;
  3337. /* introduced in 10.2 */
  3338. __le32 antenna_mask;
  3339. } __packed;
  3340. /* Beacon filter */
  3341. #define WMI_BCN_FILTER_ALL 0 /* Filter all beacons */
  3342. #define WMI_BCN_FILTER_NONE 1 /* Pass all beacons */
  3343. #define WMI_BCN_FILTER_RSSI 2 /* Pass Beacons RSSI >= RSSI threshold */
  3344. #define WMI_BCN_FILTER_BSSID 3 /* Pass Beacons with matching BSSID */
  3345. #define WMI_BCN_FILTER_SSID 4 /* Pass Beacons with matching SSID */
  3346. struct wmi_bcn_filter_rx_cmd {
  3347. /* Filter ID */
  3348. __le32 bcn_filter_id;
  3349. /* Filter type - wmi_bcn_filter */
  3350. __le32 bcn_filter;
  3351. /* Buffer len */
  3352. __le32 bcn_filter_len;
  3353. /* Filter info (threshold, BSSID, RSSI) */
  3354. u8 *bcn_filter_buf;
  3355. } __packed;
  3356. /* Capabilities and IEs to be passed to firmware */
  3357. struct wmi_bcn_prb_info {
  3358. /* Capabilities */
  3359. __le32 caps;
  3360. /* ERP info */
  3361. __le32 erp;
  3362. /* Advanced capabilities */
  3363. /* HT capabilities */
  3364. /* HT Info */
  3365. /* ibss_dfs */
  3366. /* wpa Info */
  3367. /* rsn Info */
  3368. /* rrm info */
  3369. /* ath_ext */
  3370. /* app IE */
  3371. } __packed;
  3372. struct wmi_bcn_tmpl_cmd {
  3373. /* unique id identifying the VDEV, generated by the caller */
  3374. __le32 vdev_id;
  3375. /* TIM IE offset from the beginning of the template. */
  3376. __le32 tim_ie_offset;
  3377. /* beacon probe capabilities and IEs */
  3378. struct wmi_bcn_prb_info bcn_prb_info;
  3379. /* beacon buffer length */
  3380. __le32 buf_len;
  3381. /* variable length data */
  3382. u8 data[1];
  3383. } __packed;
  3384. struct wmi_prb_tmpl_cmd {
  3385. /* unique id identifying the VDEV, generated by the caller */
  3386. __le32 vdev_id;
  3387. /* beacon probe capabilities and IEs */
  3388. struct wmi_bcn_prb_info bcn_prb_info;
  3389. /* beacon buffer length */
  3390. __le32 buf_len;
  3391. /* Variable length data */
  3392. u8 data[1];
  3393. } __packed;
  3394. enum wmi_sta_ps_mode {
  3395. /* enable power save for the given STA VDEV */
  3396. WMI_STA_PS_MODE_DISABLED = 0,
  3397. /* disable power save for a given STA VDEV */
  3398. WMI_STA_PS_MODE_ENABLED = 1,
  3399. };
  3400. struct wmi_sta_powersave_mode_cmd {
  3401. /* unique id identifying the VDEV, generated by the caller */
  3402. __le32 vdev_id;
  3403. /*
  3404. * Power save mode
  3405. * (see enum wmi_sta_ps_mode)
  3406. */
  3407. __le32 sta_ps_mode;
  3408. } __packed;
  3409. enum wmi_csa_offload_en {
  3410. WMI_CSA_OFFLOAD_DISABLE = 0,
  3411. WMI_CSA_OFFLOAD_ENABLE = 1,
  3412. };
  3413. struct wmi_csa_offload_enable_cmd {
  3414. __le32 vdev_id;
  3415. __le32 csa_offload_enable;
  3416. } __packed;
  3417. struct wmi_csa_offload_chanswitch_cmd {
  3418. __le32 vdev_id;
  3419. struct wmi_channel chan;
  3420. } __packed;
  3421. /*
  3422. * This parameter controls the policy for retrieving frames from AP while the
  3423. * STA is in sleep state.
  3424. *
  3425. * Only takes affect if the sta_ps_mode is enabled
  3426. */
  3427. enum wmi_sta_ps_param_rx_wake_policy {
  3428. /*
  3429. * Wake up when ever there is an RX activity on the VDEV. In this mode
  3430. * the Power save SM(state machine) will come out of sleep by either
  3431. * sending null frame (or) a data frame (with PS==0) in response to TIM
  3432. * bit set in the received beacon frame from AP.
  3433. */
  3434. WMI_STA_PS_RX_WAKE_POLICY_WAKE = 0,
  3435. /*
  3436. * Here the power save state machine will not wakeup in response to TIM
  3437. * bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD
  3438. * configuration setup by WMISET_PS_SET_UAPSD WMI command. When all
  3439. * access categories are delivery-enabled, the station will send a
  3440. * UAPSD trigger frame, otherwise it will send a PS-Poll.
  3441. */
  3442. WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1,
  3443. };
  3444. /*
  3445. * Number of tx frames/beacon that cause the power save SM to wake up.
  3446. *
  3447. * Value 1 causes the SM to wake up for every TX. Value 0 has a special
  3448. * meaning, It will cause the SM to never wake up. This is useful if you want
  3449. * to keep the system to sleep all the time for some kind of test mode . host
  3450. * can change this parameter any time. It will affect at the next tx frame.
  3451. */
  3452. enum wmi_sta_ps_param_tx_wake_threshold {
  3453. WMI_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0,
  3454. WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1,
  3455. /*
  3456. * Values greater than one indicate that many TX attempts per beacon
  3457. * interval before the STA will wake up
  3458. */
  3459. };
  3460. /*
  3461. * The maximum number of PS-Poll frames the FW will send in response to
  3462. * traffic advertised in TIM before waking up (by sending a null frame with PS
  3463. * = 0). Value 0 has a special meaning: there is no maximum count and the FW
  3464. * will send as many PS-Poll as are necessary to retrieve buffered BU. This
  3465. * parameter is used when the RX wake policy is
  3466. * WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD and ignored when the RX wake
  3467. * policy is WMI_STA_PS_RX_WAKE_POLICY_WAKE.
  3468. */
  3469. enum wmi_sta_ps_param_pspoll_count {
  3470. WMI_STA_PS_PSPOLL_COUNT_NO_MAX = 0,
  3471. /*
  3472. * Values greater than 0 indicate the maximum numer of PS-Poll frames
  3473. * FW will send before waking up.
  3474. */
  3475. };
  3476. /*
  3477. * This will include the delivery and trigger enabled state for every AC.
  3478. * This is the negotiated state with AP. The host MLME needs to set this based
  3479. * on AP capability and the state Set in the association request by the
  3480. * station MLME.Lower 8 bits of the value specify the UAPSD configuration.
  3481. */
  3482. #define WMI_UAPSD_AC_TYPE_DELI 0
  3483. #define WMI_UAPSD_AC_TYPE_TRIG 1
  3484. #define WMI_UAPSD_AC_BIT_MASK(ac, type) \
  3485. ((type == WMI_UAPSD_AC_TYPE_DELI) ? (1<<(ac<<1)) : (1<<((ac<<1)+1)))
  3486. enum wmi_sta_ps_param_uapsd {
  3487. WMI_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
  3488. WMI_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
  3489. WMI_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
  3490. WMI_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
  3491. WMI_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
  3492. WMI_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
  3493. WMI_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
  3494. WMI_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
  3495. };
  3496. enum wmi_sta_powersave_param {
  3497. /*
  3498. * Controls how frames are retrievd from AP while STA is sleeping
  3499. *
  3500. * (see enum wmi_sta_ps_param_rx_wake_policy)
  3501. */
  3502. WMI_STA_PS_PARAM_RX_WAKE_POLICY = 0,
  3503. /*
  3504. * The STA will go active after this many TX
  3505. *
  3506. * (see enum wmi_sta_ps_param_tx_wake_threshold)
  3507. */
  3508. WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
  3509. /*
  3510. * Number of PS-Poll to send before STA wakes up
  3511. *
  3512. * (see enum wmi_sta_ps_param_pspoll_count)
  3513. *
  3514. */
  3515. WMI_STA_PS_PARAM_PSPOLL_COUNT = 2,
  3516. /*
  3517. * TX/RX inactivity time in msec before going to sleep.
  3518. *
  3519. * The power save SM will monitor tx/rx activity on the VDEV, if no
  3520. * activity for the specified msec of the parameter the Power save
  3521. * SM will go to sleep.
  3522. */
  3523. WMI_STA_PS_PARAM_INACTIVITY_TIME = 3,
  3524. /*
  3525. * Set uapsd configuration.
  3526. *
  3527. * (see enum wmi_sta_ps_param_uapsd)
  3528. */
  3529. WMI_STA_PS_PARAM_UAPSD = 4,
  3530. };
  3531. struct wmi_sta_powersave_param_cmd {
  3532. __le32 vdev_id;
  3533. __le32 param_id; /* %WMI_STA_PS_PARAM_ */
  3534. __le32 param_value;
  3535. } __packed;
  3536. /* No MIMO power save */
  3537. #define WMI_STA_MIMO_PS_MODE_DISABLE
  3538. /* mimo powersave mode static*/
  3539. #define WMI_STA_MIMO_PS_MODE_STATIC
  3540. /* mimo powersave mode dynamic */
  3541. #define WMI_STA_MIMO_PS_MODE_DYNAMIC
  3542. struct wmi_sta_mimo_ps_mode_cmd {
  3543. /* unique id identifying the VDEV, generated by the caller */
  3544. __le32 vdev_id;
  3545. /* mimo powersave mode as defined above */
  3546. __le32 mimo_pwrsave_mode;
  3547. } __packed;
  3548. /* U-APSD configuration of peer station from (re)assoc request and TSPECs */
  3549. enum wmi_ap_ps_param_uapsd {
  3550. WMI_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
  3551. WMI_AP_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
  3552. WMI_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
  3553. WMI_AP_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
  3554. WMI_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
  3555. WMI_AP_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
  3556. WMI_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
  3557. WMI_AP_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
  3558. };
  3559. /* U-APSD maximum service period of peer station */
  3560. enum wmi_ap_ps_peer_param_max_sp {
  3561. WMI_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0,
  3562. WMI_AP_PS_PEER_PARAM_MAX_SP_2 = 1,
  3563. WMI_AP_PS_PEER_PARAM_MAX_SP_4 = 2,
  3564. WMI_AP_PS_PEER_PARAM_MAX_SP_6 = 3,
  3565. MAX_WMI_AP_PS_PEER_PARAM_MAX_SP,
  3566. };
  3567. /*
  3568. * AP power save parameter
  3569. * Set a power save specific parameter for a peer station
  3570. */
  3571. enum wmi_ap_ps_peer_param {
  3572. /* Set uapsd configuration for a given peer.
  3573. *
  3574. * Include the delivery and trigger enabled state for every AC.
  3575. * The host MLME needs to set this based on AP capability and stations
  3576. * request Set in the association request received from the station.
  3577. *
  3578. * Lower 8 bits of the value specify the UAPSD configuration.
  3579. *
  3580. * (see enum wmi_ap_ps_param_uapsd)
  3581. * The default value is 0.
  3582. */
  3583. WMI_AP_PS_PEER_PARAM_UAPSD = 0,
  3584. /*
  3585. * Set the service period for a UAPSD capable station
  3586. *
  3587. * The service period from wme ie in the (re)assoc request frame.
  3588. *
  3589. * (see enum wmi_ap_ps_peer_param_max_sp)
  3590. */
  3591. WMI_AP_PS_PEER_PARAM_MAX_SP = 1,
  3592. /* Time in seconds for aging out buffered frames for STA in PS */
  3593. WMI_AP_PS_PEER_PARAM_AGEOUT_TIME = 2,
  3594. };
  3595. struct wmi_ap_ps_peer_cmd {
  3596. /* unique id identifying the VDEV, generated by the caller */
  3597. __le32 vdev_id;
  3598. /* peer MAC address */
  3599. struct wmi_mac_addr peer_macaddr;
  3600. /* AP powersave param (see enum wmi_ap_ps_peer_param) */
  3601. __le32 param_id;
  3602. /* AP powersave param value */
  3603. __le32 param_value;
  3604. } __packed;
  3605. /* 128 clients = 4 words */
  3606. #define WMI_TIM_BITMAP_ARRAY_SIZE 4
  3607. struct wmi_tim_info {
  3608. __le32 tim_len;
  3609. __le32 tim_mcast;
  3610. __le32 tim_bitmap[WMI_TIM_BITMAP_ARRAY_SIZE];
  3611. __le32 tim_changed;
  3612. __le32 tim_num_ps_pending;
  3613. } __packed;
  3614. /* Maximum number of NOA Descriptors supported */
  3615. #define WMI_P2P_MAX_NOA_DESCRIPTORS 4
  3616. #define WMI_P2P_OPPPS_ENABLE_BIT BIT(0)
  3617. #define WMI_P2P_OPPPS_CTWINDOW_OFFSET 1
  3618. #define WMI_P2P_NOA_CHANGED_BIT BIT(0)
  3619. struct wmi_p2p_noa_info {
  3620. /* Bit 0 - Flag to indicate an update in NOA schedule
  3621. Bits 7-1 - Reserved */
  3622. u8 changed;
  3623. /* NOA index */
  3624. u8 index;
  3625. /* Bit 0 - Opp PS state of the AP
  3626. Bits 1-7 - Ctwindow in TUs */
  3627. u8 ctwindow_oppps;
  3628. /* Number of NOA descriptors */
  3629. u8 num_descriptors;
  3630. struct wmi_p2p_noa_descriptor descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS];
  3631. } __packed;
  3632. struct wmi_bcn_info {
  3633. struct wmi_tim_info tim_info;
  3634. struct wmi_p2p_noa_info p2p_noa_info;
  3635. } __packed;
  3636. struct wmi_host_swba_event {
  3637. __le32 vdev_map;
  3638. struct wmi_bcn_info bcn_info[1];
  3639. } __packed;
  3640. #define WMI_MAX_AP_VDEV 16
  3641. struct wmi_tbtt_offset_event {
  3642. __le32 vdev_map;
  3643. __le32 tbttoffset_list[WMI_MAX_AP_VDEV];
  3644. } __packed;
  3645. struct wmi_peer_create_cmd {
  3646. __le32 vdev_id;
  3647. struct wmi_mac_addr peer_macaddr;
  3648. } __packed;
  3649. struct wmi_peer_delete_cmd {
  3650. __le32 vdev_id;
  3651. struct wmi_mac_addr peer_macaddr;
  3652. } __packed;
  3653. struct wmi_peer_flush_tids_cmd {
  3654. __le32 vdev_id;
  3655. struct wmi_mac_addr peer_macaddr;
  3656. __le32 peer_tid_bitmap;
  3657. } __packed;
  3658. struct wmi_fixed_rate {
  3659. /*
  3660. * rate mode . 0: disable fixed rate (auto rate)
  3661. * 1: legacy (non 11n) rate specified as ieee rate 2*Mbps
  3662. * 2: ht20 11n rate specified as mcs index
  3663. * 3: ht40 11n rate specified as mcs index
  3664. */
  3665. __le32 rate_mode;
  3666. /*
  3667. * 4 rate values for 4 rate series. series 0 is stored in byte 0 (LSB)
  3668. * and series 3 is stored at byte 3 (MSB)
  3669. */
  3670. __le32 rate_series;
  3671. /*
  3672. * 4 retry counts for 4 rate series. retry count for rate 0 is stored
  3673. * in byte 0 (LSB) and retry count for rate 3 is stored at byte 3
  3674. * (MSB)
  3675. */
  3676. __le32 rate_retries;
  3677. } __packed;
  3678. struct wmi_peer_fixed_rate_cmd {
  3679. /* unique id identifying the VDEV, generated by the caller */
  3680. __le32 vdev_id;
  3681. /* peer MAC address */
  3682. struct wmi_mac_addr peer_macaddr;
  3683. /* fixed rate */
  3684. struct wmi_fixed_rate peer_fixed_rate;
  3685. } __packed;
  3686. #define WMI_MGMT_TID 17
  3687. struct wmi_addba_clear_resp_cmd {
  3688. /* unique id identifying the VDEV, generated by the caller */
  3689. __le32 vdev_id;
  3690. /* peer MAC address */
  3691. struct wmi_mac_addr peer_macaddr;
  3692. } __packed;
  3693. struct wmi_addba_send_cmd {
  3694. /* unique id identifying the VDEV, generated by the caller */
  3695. __le32 vdev_id;
  3696. /* peer MAC address */
  3697. struct wmi_mac_addr peer_macaddr;
  3698. /* Tid number */
  3699. __le32 tid;
  3700. /* Buffer/Window size*/
  3701. __le32 buffersize;
  3702. } __packed;
  3703. struct wmi_delba_send_cmd {
  3704. /* unique id identifying the VDEV, generated by the caller */
  3705. __le32 vdev_id;
  3706. /* peer MAC address */
  3707. struct wmi_mac_addr peer_macaddr;
  3708. /* Tid number */
  3709. __le32 tid;
  3710. /* Is Initiator */
  3711. __le32 initiator;
  3712. /* Reason code */
  3713. __le32 reasoncode;
  3714. } __packed;
  3715. struct wmi_addba_setresponse_cmd {
  3716. /* unique id identifying the vdev, generated by the caller */
  3717. __le32 vdev_id;
  3718. /* peer mac address */
  3719. struct wmi_mac_addr peer_macaddr;
  3720. /* Tid number */
  3721. __le32 tid;
  3722. /* status code */
  3723. __le32 statuscode;
  3724. } __packed;
  3725. struct wmi_send_singleamsdu_cmd {
  3726. /* unique id identifying the vdev, generated by the caller */
  3727. __le32 vdev_id;
  3728. /* peer mac address */
  3729. struct wmi_mac_addr peer_macaddr;
  3730. /* Tid number */
  3731. __le32 tid;
  3732. } __packed;
  3733. enum wmi_peer_smps_state {
  3734. WMI_PEER_SMPS_PS_NONE = 0x0,
  3735. WMI_PEER_SMPS_STATIC = 0x1,
  3736. WMI_PEER_SMPS_DYNAMIC = 0x2
  3737. };
  3738. enum wmi_peer_chwidth {
  3739. WMI_PEER_CHWIDTH_20MHZ = 0,
  3740. WMI_PEER_CHWIDTH_40MHZ = 1,
  3741. WMI_PEER_CHWIDTH_80MHZ = 2,
  3742. };
  3743. enum wmi_peer_param {
  3744. WMI_PEER_SMPS_STATE = 0x1, /* see %wmi_peer_smps_state */
  3745. WMI_PEER_AMPDU = 0x2,
  3746. WMI_PEER_AUTHORIZE = 0x3,
  3747. WMI_PEER_CHAN_WIDTH = 0x4,
  3748. WMI_PEER_NSS = 0x5,
  3749. WMI_PEER_USE_4ADDR = 0x6
  3750. };
  3751. struct wmi_peer_set_param_cmd {
  3752. __le32 vdev_id;
  3753. struct wmi_mac_addr peer_macaddr;
  3754. __le32 param_id;
  3755. __le32 param_value;
  3756. } __packed;
  3757. #define MAX_SUPPORTED_RATES 128
  3758. struct wmi_rate_set {
  3759. /* total number of rates */
  3760. __le32 num_rates;
  3761. /*
  3762. * rates (each 8bit value) packed into a 32 bit word.
  3763. * the rates are filled from least significant byte to most
  3764. * significant byte.
  3765. */
  3766. __le32 rates[(MAX_SUPPORTED_RATES/4)+1];
  3767. } __packed;
  3768. struct wmi_rate_set_arg {
  3769. unsigned int num_rates;
  3770. u8 rates[MAX_SUPPORTED_RATES];
  3771. };
  3772. /*
  3773. * NOTE: It would bea good idea to represent the Tx MCS
  3774. * info in one word and Rx in another word. This is split
  3775. * into multiple words for convenience
  3776. */
  3777. struct wmi_vht_rate_set {
  3778. __le32 rx_max_rate; /* Max Rx data rate */
  3779. __le32 rx_mcs_set; /* Negotiated RX VHT rates */
  3780. __le32 tx_max_rate; /* Max Tx data rate */
  3781. __le32 tx_mcs_set; /* Negotiated TX VHT rates */
  3782. } __packed;
  3783. struct wmi_vht_rate_set_arg {
  3784. u32 rx_max_rate;
  3785. u32 rx_mcs_set;
  3786. u32 tx_max_rate;
  3787. u32 tx_mcs_set;
  3788. };
  3789. struct wmi_peer_set_rates_cmd {
  3790. /* peer MAC address */
  3791. struct wmi_mac_addr peer_macaddr;
  3792. /* legacy rate set */
  3793. struct wmi_rate_set peer_legacy_rates;
  3794. /* ht rate set */
  3795. struct wmi_rate_set peer_ht_rates;
  3796. } __packed;
  3797. struct wmi_peer_set_q_empty_callback_cmd {
  3798. /* unique id identifying the VDEV, generated by the caller */
  3799. __le32 vdev_id;
  3800. /* peer MAC address */
  3801. struct wmi_mac_addr peer_macaddr;
  3802. __le32 callback_enable;
  3803. } __packed;
  3804. #define WMI_PEER_AUTH 0x00000001
  3805. #define WMI_PEER_QOS 0x00000002
  3806. #define WMI_PEER_NEED_PTK_4_WAY 0x00000004
  3807. #define WMI_PEER_NEED_GTK_2_WAY 0x00000010
  3808. #define WMI_PEER_APSD 0x00000800
  3809. #define WMI_PEER_HT 0x00001000
  3810. #define WMI_PEER_40MHZ 0x00002000
  3811. #define WMI_PEER_STBC 0x00008000
  3812. #define WMI_PEER_LDPC 0x00010000
  3813. #define WMI_PEER_DYN_MIMOPS 0x00020000
  3814. #define WMI_PEER_STATIC_MIMOPS 0x00040000
  3815. #define WMI_PEER_SPATIAL_MUX 0x00200000
  3816. #define WMI_PEER_VHT 0x02000000
  3817. #define WMI_PEER_80MHZ 0x04000000
  3818. #define WMI_PEER_PMF 0x08000000
  3819. /*
  3820. * Peer rate capabilities.
  3821. *
  3822. * This is of interest to the ratecontrol
  3823. * module which resides in the firmware. The bit definitions are
  3824. * consistent with that defined in if_athrate.c.
  3825. */
  3826. #define WMI_RC_DS_FLAG 0x01
  3827. #define WMI_RC_CW40_FLAG 0x02
  3828. #define WMI_RC_SGI_FLAG 0x04
  3829. #define WMI_RC_HT_FLAG 0x08
  3830. #define WMI_RC_RTSCTS_FLAG 0x10
  3831. #define WMI_RC_TX_STBC_FLAG 0x20
  3832. #define WMI_RC_RX_STBC_FLAG 0xC0
  3833. #define WMI_RC_RX_STBC_FLAG_S 6
  3834. #define WMI_RC_WEP_TKIP_FLAG 0x100
  3835. #define WMI_RC_TS_FLAG 0x200
  3836. #define WMI_RC_UAPSD_FLAG 0x400
  3837. /* Maximum listen interval supported by hw in units of beacon interval */
  3838. #define ATH10K_MAX_HW_LISTEN_INTERVAL 5
  3839. struct wmi_common_peer_assoc_complete_cmd {
  3840. struct wmi_mac_addr peer_macaddr;
  3841. __le32 vdev_id;
  3842. __le32 peer_new_assoc; /* 1=assoc, 0=reassoc */
  3843. __le32 peer_associd; /* 16 LSBs */
  3844. __le32 peer_flags;
  3845. __le32 peer_caps; /* 16 LSBs */
  3846. __le32 peer_listen_intval;
  3847. __le32 peer_ht_caps;
  3848. __le32 peer_max_mpdu;
  3849. __le32 peer_mpdu_density; /* 0..16 */
  3850. __le32 peer_rate_caps;
  3851. struct wmi_rate_set peer_legacy_rates;
  3852. struct wmi_rate_set peer_ht_rates;
  3853. __le32 peer_nss; /* num of spatial streams */
  3854. __le32 peer_vht_caps;
  3855. __le32 peer_phymode;
  3856. struct wmi_vht_rate_set peer_vht_rates;
  3857. };
  3858. struct wmi_main_peer_assoc_complete_cmd {
  3859. struct wmi_common_peer_assoc_complete_cmd cmd;
  3860. /* HT Operation Element of the peer. Five bytes packed in 2
  3861. * INT32 array and filled from lsb to msb. */
  3862. __le32 peer_ht_info[2];
  3863. } __packed;
  3864. struct wmi_10_1_peer_assoc_complete_cmd {
  3865. struct wmi_common_peer_assoc_complete_cmd cmd;
  3866. } __packed;
  3867. #define WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX_LSB 0
  3868. #define WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX_MASK 0x0f
  3869. #define WMI_PEER_ASSOC_INFO0_MAX_NSS_LSB 4
  3870. #define WMI_PEER_ASSOC_INFO0_MAX_NSS_MASK 0xf0
  3871. struct wmi_10_2_peer_assoc_complete_cmd {
  3872. struct wmi_common_peer_assoc_complete_cmd cmd;
  3873. __le32 info0; /* WMI_PEER_ASSOC_INFO0_ */
  3874. } __packed;
  3875. struct wmi_peer_assoc_complete_arg {
  3876. u8 addr[ETH_ALEN];
  3877. u32 vdev_id;
  3878. bool peer_reassoc;
  3879. u16 peer_aid;
  3880. u32 peer_flags; /* see %WMI_PEER_ */
  3881. u16 peer_caps;
  3882. u32 peer_listen_intval;
  3883. u32 peer_ht_caps;
  3884. u32 peer_max_mpdu;
  3885. u32 peer_mpdu_density; /* 0..16 */
  3886. u32 peer_rate_caps; /* see %WMI_RC_ */
  3887. struct wmi_rate_set_arg peer_legacy_rates;
  3888. struct wmi_rate_set_arg peer_ht_rates;
  3889. u32 peer_num_spatial_streams;
  3890. u32 peer_vht_caps;
  3891. enum wmi_phy_mode peer_phymode;
  3892. struct wmi_vht_rate_set_arg peer_vht_rates;
  3893. };
  3894. struct wmi_peer_add_wds_entry_cmd {
  3895. /* peer MAC address */
  3896. struct wmi_mac_addr peer_macaddr;
  3897. /* wds MAC addr */
  3898. struct wmi_mac_addr wds_macaddr;
  3899. } __packed;
  3900. struct wmi_peer_remove_wds_entry_cmd {
  3901. /* wds MAC addr */
  3902. struct wmi_mac_addr wds_macaddr;
  3903. } __packed;
  3904. struct wmi_peer_q_empty_callback_event {
  3905. /* peer MAC address */
  3906. struct wmi_mac_addr peer_macaddr;
  3907. } __packed;
  3908. /*
  3909. * Channel info WMI event
  3910. */
  3911. struct wmi_chan_info_event {
  3912. __le32 err_code;
  3913. __le32 freq;
  3914. __le32 cmd_flags;
  3915. __le32 noise_floor;
  3916. __le32 rx_clear_count;
  3917. __le32 cycle_count;
  3918. } __packed;
  3919. struct wmi_peer_sta_kickout_event {
  3920. struct wmi_mac_addr peer_macaddr;
  3921. } __packed;
  3922. #define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0)
  3923. /* FIXME: empirically extrapolated */
  3924. #define WMI_CHAN_INFO_MSEC(x) ((x) / 76595)
  3925. /* Beacon filter wmi command info */
  3926. #define BCN_FLT_MAX_SUPPORTED_IES 256
  3927. #define BCN_FLT_MAX_ELEMS_IE_LIST (BCN_FLT_MAX_SUPPORTED_IES / 32)
  3928. struct bss_bcn_stats {
  3929. __le32 vdev_id;
  3930. __le32 bss_bcnsdropped;
  3931. __le32 bss_bcnsdelivered;
  3932. } __packed;
  3933. struct bcn_filter_stats {
  3934. __le32 bcns_dropped;
  3935. __le32 bcns_delivered;
  3936. __le32 activefilters;
  3937. struct bss_bcn_stats bss_stats;
  3938. } __packed;
  3939. struct wmi_add_bcn_filter_cmd {
  3940. u32 vdev_id;
  3941. u32 ie_map[BCN_FLT_MAX_ELEMS_IE_LIST];
  3942. } __packed;
  3943. enum wmi_sta_keepalive_method {
  3944. WMI_STA_KEEPALIVE_METHOD_NULL_FRAME = 1,
  3945. WMI_STA_KEEPALIVE_METHOD_UNSOLICITATED_ARP_RESPONSE = 2,
  3946. };
  3947. /* note: ip4 addresses are in network byte order, i.e. big endian */
  3948. struct wmi_sta_keepalive_arp_resp {
  3949. __be32 src_ip4_addr;
  3950. __be32 dest_ip4_addr;
  3951. struct wmi_mac_addr dest_mac_addr;
  3952. } __packed;
  3953. struct wmi_sta_keepalive_cmd {
  3954. __le32 vdev_id;
  3955. __le32 enabled;
  3956. __le32 method; /* WMI_STA_KEEPALIVE_METHOD_ */
  3957. __le32 interval; /* in seconds */
  3958. struct wmi_sta_keepalive_arp_resp arp_resp;
  3959. } __packed;
  3960. enum wmi_force_fw_hang_type {
  3961. WMI_FORCE_FW_HANG_ASSERT = 1,
  3962. WMI_FORCE_FW_HANG_NO_DETECT,
  3963. WMI_FORCE_FW_HANG_CTRL_EP_FULL,
  3964. WMI_FORCE_FW_HANG_EMPTY_POINT,
  3965. WMI_FORCE_FW_HANG_STACK_OVERFLOW,
  3966. WMI_FORCE_FW_HANG_INFINITE_LOOP,
  3967. };
  3968. #define WMI_FORCE_FW_HANG_RANDOM_TIME 0xFFFFFFFF
  3969. struct wmi_force_fw_hang_cmd {
  3970. __le32 type;
  3971. __le32 delay_ms;
  3972. } __packed;
  3973. enum ath10k_dbglog_level {
  3974. ATH10K_DBGLOG_LEVEL_VERBOSE = 0,
  3975. ATH10K_DBGLOG_LEVEL_INFO = 1,
  3976. ATH10K_DBGLOG_LEVEL_WARN = 2,
  3977. ATH10K_DBGLOG_LEVEL_ERR = 3,
  3978. };
  3979. /* VAP ids to enable dbglog */
  3980. #define ATH10K_DBGLOG_CFG_VAP_LOG_LSB 0
  3981. #define ATH10K_DBGLOG_CFG_VAP_LOG_MASK 0x0000ffff
  3982. /* to enable dbglog in the firmware */
  3983. #define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_LSB 16
  3984. #define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_MASK 0x00010000
  3985. /* timestamp resolution */
  3986. #define ATH10K_DBGLOG_CFG_RESOLUTION_LSB 17
  3987. #define ATH10K_DBGLOG_CFG_RESOLUTION_MASK 0x000E0000
  3988. /* number of queued messages before sending them to the host */
  3989. #define ATH10K_DBGLOG_CFG_REPORT_SIZE_LSB 20
  3990. #define ATH10K_DBGLOG_CFG_REPORT_SIZE_MASK 0x0ff00000
  3991. /*
  3992. * Log levels to enable. This defines the minimum level to enable, this is
  3993. * not a bitmask. See enum ath10k_dbglog_level for the values.
  3994. */
  3995. #define ATH10K_DBGLOG_CFG_LOG_LVL_LSB 28
  3996. #define ATH10K_DBGLOG_CFG_LOG_LVL_MASK 0x70000000
  3997. /*
  3998. * Note: this is a cleaned up version of a struct firmware uses. For
  3999. * example, config_valid was hidden inside an array.
  4000. */
  4001. struct wmi_dbglog_cfg_cmd {
  4002. /* bitmask to hold mod id config*/
  4003. __le32 module_enable;
  4004. /* see ATH10K_DBGLOG_CFG_ */
  4005. __le32 config_enable;
  4006. /* mask of module id bits to be changed */
  4007. __le32 module_valid;
  4008. /* mask of config bits to be changed, see ATH10K_DBGLOG_CFG_ */
  4009. __le32 config_valid;
  4010. } __packed;
  4011. #define ATH10K_RTS_MAX 2347
  4012. #define ATH10K_FRAGMT_THRESHOLD_MIN 540
  4013. #define ATH10K_FRAGMT_THRESHOLD_MAX 2346
  4014. #define WMI_MAX_EVENT 0x1000
  4015. /* Maximum number of pending TXed WMI packets */
  4016. #define WMI_SKB_HEADROOM sizeof(struct wmi_cmd_hdr)
  4017. /* By default disable power save for IBSS */
  4018. #define ATH10K_DEFAULT_ATIM 0
  4019. #define WMI_MAX_MEM_REQS 16
  4020. struct wmi_svc_rdy_ev_arg {
  4021. __le32 min_tx_power;
  4022. __le32 max_tx_power;
  4023. __le32 ht_cap;
  4024. __le32 vht_cap;
  4025. __le32 sw_ver0;
  4026. __le32 sw_ver1;
  4027. __le32 phy_capab;
  4028. __le32 num_rf_chains;
  4029. __le32 eeprom_rd;
  4030. __le32 num_mem_reqs;
  4031. const __le32 *service_map;
  4032. const struct wlan_host_mem_req *mem_reqs[WMI_MAX_MEM_REQS];
  4033. };
  4034. struct ath10k;
  4035. struct ath10k_vif;
  4036. struct ath10k_fw_stats;
  4037. int ath10k_wmi_attach(struct ath10k *ar);
  4038. void ath10k_wmi_detach(struct ath10k *ar);
  4039. int ath10k_wmi_wait_for_service_ready(struct ath10k *ar);
  4040. int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar);
  4041. int ath10k_wmi_connect(struct ath10k *ar);
  4042. struct sk_buff *ath10k_wmi_alloc_skb(struct ath10k *ar, u32 len);
  4043. int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
  4044. int ath10k_wmi_pdev_suspend_target(struct ath10k *ar, u32 suspend_opt);
  4045. int ath10k_wmi_pdev_resume_target(struct ath10k *ar);
  4046. int ath10k_wmi_pdev_set_regdomain(struct ath10k *ar, u16 rd, u16 rd2g,
  4047. u16 rd5g, u16 ctl2g, u16 ctl5g,
  4048. enum wmi_dfs_region dfs_reg);
  4049. int ath10k_wmi_pdev_set_param(struct ath10k *ar, u32 id, u32 value);
  4050. int ath10k_wmi_cmd_init(struct ath10k *ar);
  4051. int ath10k_wmi_start_scan(struct ath10k *ar, const struct wmi_start_scan_arg *);
  4052. void ath10k_wmi_start_scan_init(struct ath10k *ar, struct wmi_start_scan_arg *);
  4053. int ath10k_wmi_stop_scan(struct ath10k *ar,
  4054. const struct wmi_stop_scan_arg *arg);
  4055. int ath10k_wmi_vdev_create(struct ath10k *ar, u32 vdev_id,
  4056. enum wmi_vdev_type type,
  4057. enum wmi_vdev_subtype subtype,
  4058. const u8 macaddr[ETH_ALEN]);
  4059. int ath10k_wmi_vdev_delete(struct ath10k *ar, u32 vdev_id);
  4060. int ath10k_wmi_vdev_start(struct ath10k *ar,
  4061. const struct wmi_vdev_start_request_arg *);
  4062. int ath10k_wmi_vdev_restart(struct ath10k *ar,
  4063. const struct wmi_vdev_start_request_arg *);
  4064. int ath10k_wmi_vdev_stop(struct ath10k *ar, u32 vdev_id);
  4065. int ath10k_wmi_vdev_up(struct ath10k *ar, u32 vdev_id, u32 aid,
  4066. const u8 *bssid);
  4067. int ath10k_wmi_vdev_down(struct ath10k *ar, u32 vdev_id);
  4068. int ath10k_wmi_vdev_set_param(struct ath10k *ar, u32 vdev_id,
  4069. u32 param_id, u32 param_value);
  4070. int ath10k_wmi_vdev_install_key(struct ath10k *ar,
  4071. const struct wmi_vdev_install_key_arg *arg);
  4072. int ath10k_wmi_vdev_spectral_conf(struct ath10k *ar,
  4073. const struct wmi_vdev_spectral_conf_arg *arg);
  4074. int ath10k_wmi_vdev_spectral_enable(struct ath10k *ar, u32 vdev_id, u32 trigger,
  4075. u32 enable);
  4076. int ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id,
  4077. const u8 peer_addr[ETH_ALEN]);
  4078. int ath10k_wmi_peer_delete(struct ath10k *ar, u32 vdev_id,
  4079. const u8 peer_addr[ETH_ALEN]);
  4080. int ath10k_wmi_peer_flush(struct ath10k *ar, u32 vdev_id,
  4081. const u8 peer_addr[ETH_ALEN], u32 tid_bitmap);
  4082. int ath10k_wmi_peer_set_param(struct ath10k *ar, u32 vdev_id,
  4083. const u8 *peer_addr,
  4084. enum wmi_peer_param param_id, u32 param_value);
  4085. int ath10k_wmi_peer_assoc(struct ath10k *ar,
  4086. const struct wmi_peer_assoc_complete_arg *arg);
  4087. int ath10k_wmi_set_psmode(struct ath10k *ar, u32 vdev_id,
  4088. enum wmi_sta_ps_mode psmode);
  4089. int ath10k_wmi_set_sta_ps_param(struct ath10k *ar, u32 vdev_id,
  4090. enum wmi_sta_powersave_param param_id,
  4091. u32 value);
  4092. int ath10k_wmi_set_ap_ps_param(struct ath10k *ar, u32 vdev_id, const u8 *mac,
  4093. enum wmi_ap_ps_peer_param param_id, u32 value);
  4094. int ath10k_wmi_scan_chan_list(struct ath10k *ar,
  4095. const struct wmi_scan_chan_list_arg *arg);
  4096. int ath10k_wmi_beacon_send_ref_nowait(struct ath10k_vif *arvif);
  4097. int ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar,
  4098. const struct wmi_pdev_set_wmm_params_arg *arg);
  4099. int ath10k_wmi_request_stats(struct ath10k *ar, enum wmi_stats_id stats_id);
  4100. int ath10k_wmi_force_fw_hang(struct ath10k *ar,
  4101. enum wmi_force_fw_hang_type type, u32 delay_ms);
  4102. int ath10k_wmi_mgmt_tx(struct ath10k *ar, struct sk_buff *skb);
  4103. int ath10k_wmi_dbglog_cfg(struct ath10k *ar, u32 module_enable);
  4104. int ath10k_wmi_pull_fw_stats(struct ath10k *ar, struct sk_buff *skb,
  4105. struct ath10k_fw_stats *stats);
  4106. int ath10k_wmi_pdev_pktlog_enable(struct ath10k *ar, u32 ev_list);
  4107. int ath10k_wmi_pdev_pktlog_disable(struct ath10k *ar);
  4108. #endif /* _WMI_H_ */