wmi.h 117 KB

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