wmi.h 86 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119
  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. /*
  198. * wmi command groups.
  199. */
  200. enum wmi_cmd_group {
  201. /* 0 to 2 are reserved */
  202. WMI_GRP_START = 0x3,
  203. WMI_GRP_SCAN = WMI_GRP_START,
  204. WMI_GRP_PDEV,
  205. WMI_GRP_VDEV,
  206. WMI_GRP_PEER,
  207. WMI_GRP_MGMT,
  208. WMI_GRP_BA_NEG,
  209. WMI_GRP_STA_PS,
  210. WMI_GRP_DFS,
  211. WMI_GRP_ROAM,
  212. WMI_GRP_OFL_SCAN,
  213. WMI_GRP_P2P,
  214. WMI_GRP_AP_PS,
  215. WMI_GRP_RATE_CTRL,
  216. WMI_GRP_PROFILE,
  217. WMI_GRP_SUSPEND,
  218. WMI_GRP_BCN_FILTER,
  219. WMI_GRP_WOW,
  220. WMI_GRP_RTT,
  221. WMI_GRP_SPECTRAL,
  222. WMI_GRP_STATS,
  223. WMI_GRP_ARP_NS_OFL,
  224. WMI_GRP_NLO_OFL,
  225. WMI_GRP_GTK_OFL,
  226. WMI_GRP_CSA_OFL,
  227. WMI_GRP_CHATTER,
  228. WMI_GRP_TID_ADDBA,
  229. WMI_GRP_MISC,
  230. WMI_GRP_GPIO,
  231. };
  232. #define WMI_CMD_GRP(grp_id) (((grp_id) << 12) | 0x1)
  233. #define WMI_EVT_GRP_START_ID(grp_id) (((grp_id) << 12) | 0x1)
  234. /* Command IDs and commande events. */
  235. enum wmi_cmd_id {
  236. WMI_INIT_CMDID = 0x1,
  237. /* Scan specific commands */
  238. WMI_START_SCAN_CMDID = WMI_CMD_GRP(WMI_GRP_SCAN),
  239. WMI_STOP_SCAN_CMDID,
  240. WMI_SCAN_CHAN_LIST_CMDID,
  241. WMI_SCAN_SCH_PRIO_TBL_CMDID,
  242. /* PDEV (physical device) specific commands */
  243. WMI_PDEV_SET_REGDOMAIN_CMDID = WMI_CMD_GRP(WMI_GRP_PDEV),
  244. WMI_PDEV_SET_CHANNEL_CMDID,
  245. WMI_PDEV_SET_PARAM_CMDID,
  246. WMI_PDEV_PKTLOG_ENABLE_CMDID,
  247. WMI_PDEV_PKTLOG_DISABLE_CMDID,
  248. WMI_PDEV_SET_WMM_PARAMS_CMDID,
  249. WMI_PDEV_SET_HT_CAP_IE_CMDID,
  250. WMI_PDEV_SET_VHT_CAP_IE_CMDID,
  251. WMI_PDEV_SET_DSCP_TID_MAP_CMDID,
  252. WMI_PDEV_SET_QUIET_MODE_CMDID,
  253. WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID,
  254. WMI_PDEV_GET_TPC_CONFIG_CMDID,
  255. WMI_PDEV_SET_BASE_MACADDR_CMDID,
  256. /* VDEV (virtual device) specific commands */
  257. WMI_VDEV_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_VDEV),
  258. WMI_VDEV_DELETE_CMDID,
  259. WMI_VDEV_START_REQUEST_CMDID,
  260. WMI_VDEV_RESTART_REQUEST_CMDID,
  261. WMI_VDEV_UP_CMDID,
  262. WMI_VDEV_STOP_CMDID,
  263. WMI_VDEV_DOWN_CMDID,
  264. WMI_VDEV_SET_PARAM_CMDID,
  265. WMI_VDEV_INSTALL_KEY_CMDID,
  266. /* peer specific commands */
  267. WMI_PEER_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_PEER),
  268. WMI_PEER_DELETE_CMDID,
  269. WMI_PEER_FLUSH_TIDS_CMDID,
  270. WMI_PEER_SET_PARAM_CMDID,
  271. WMI_PEER_ASSOC_CMDID,
  272. WMI_PEER_ADD_WDS_ENTRY_CMDID,
  273. WMI_PEER_REMOVE_WDS_ENTRY_CMDID,
  274. WMI_PEER_MCAST_GROUP_CMDID,
  275. /* beacon/management specific commands */
  276. WMI_BCN_TX_CMDID = WMI_CMD_GRP(WMI_GRP_MGMT),
  277. WMI_PDEV_SEND_BCN_CMDID,
  278. WMI_BCN_TMPL_CMDID,
  279. WMI_BCN_FILTER_RX_CMDID,
  280. WMI_PRB_REQ_FILTER_RX_CMDID,
  281. WMI_MGMT_TX_CMDID,
  282. WMI_PRB_TMPL_CMDID,
  283. /* commands to directly control BA negotiation directly from host. */
  284. WMI_ADDBA_CLEAR_RESP_CMDID = WMI_CMD_GRP(WMI_GRP_BA_NEG),
  285. WMI_ADDBA_SEND_CMDID,
  286. WMI_ADDBA_STATUS_CMDID,
  287. WMI_DELBA_SEND_CMDID,
  288. WMI_ADDBA_SET_RESP_CMDID,
  289. WMI_SEND_SINGLEAMSDU_CMDID,
  290. /* Station power save specific config */
  291. WMI_STA_POWERSAVE_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_STA_PS),
  292. WMI_STA_POWERSAVE_PARAM_CMDID,
  293. WMI_STA_MIMO_PS_MODE_CMDID,
  294. /** DFS-specific commands */
  295. WMI_PDEV_DFS_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_DFS),
  296. WMI_PDEV_DFS_DISABLE_CMDID,
  297. /* Roaming specific commands */
  298. WMI_ROAM_SCAN_MODE = WMI_CMD_GRP(WMI_GRP_ROAM),
  299. WMI_ROAM_SCAN_RSSI_THRESHOLD,
  300. WMI_ROAM_SCAN_PERIOD,
  301. WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
  302. WMI_ROAM_AP_PROFILE,
  303. /* offload scan specific commands */
  304. WMI_OFL_SCAN_ADD_AP_PROFILE = WMI_CMD_GRP(WMI_GRP_OFL_SCAN),
  305. WMI_OFL_SCAN_REMOVE_AP_PROFILE,
  306. WMI_OFL_SCAN_PERIOD,
  307. /* P2P specific commands */
  308. WMI_P2P_DEV_SET_DEVICE_INFO = WMI_CMD_GRP(WMI_GRP_P2P),
  309. WMI_P2P_DEV_SET_DISCOVERABILITY,
  310. WMI_P2P_GO_SET_BEACON_IE,
  311. WMI_P2P_GO_SET_PROBE_RESP_IE,
  312. WMI_P2P_SET_VENDOR_IE_DATA_CMDID,
  313. /* AP power save specific config */
  314. WMI_AP_PS_PEER_PARAM_CMDID = WMI_CMD_GRP(WMI_GRP_AP_PS),
  315. WMI_AP_PS_PEER_UAPSD_COEX_CMDID,
  316. /* Rate-control specific commands */
  317. WMI_PEER_RATE_RETRY_SCHED_CMDID =
  318. WMI_CMD_GRP(WMI_GRP_RATE_CTRL),
  319. /* WLAN Profiling commands. */
  320. WMI_WLAN_PROFILE_TRIGGER_CMDID = WMI_CMD_GRP(WMI_GRP_PROFILE),
  321. WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
  322. WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
  323. WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
  324. WMI_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
  325. /* Suspend resume command Ids */
  326. WMI_PDEV_SUSPEND_CMDID = WMI_CMD_GRP(WMI_GRP_SUSPEND),
  327. WMI_PDEV_RESUME_CMDID,
  328. /* Beacon filter commands */
  329. WMI_ADD_BCN_FILTER_CMDID = WMI_CMD_GRP(WMI_GRP_BCN_FILTER),
  330. WMI_RMV_BCN_FILTER_CMDID,
  331. /* WOW Specific WMI commands*/
  332. WMI_WOW_ADD_WAKE_PATTERN_CMDID = WMI_CMD_GRP(WMI_GRP_WOW),
  333. WMI_WOW_DEL_WAKE_PATTERN_CMDID,
  334. WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
  335. WMI_WOW_ENABLE_CMDID,
  336. WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
  337. /* RTT measurement related cmd */
  338. WMI_RTT_MEASREQ_CMDID = WMI_CMD_GRP(WMI_GRP_RTT),
  339. WMI_RTT_TSF_CMDID,
  340. /* spectral scan commands */
  341. WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID = WMI_CMD_GRP(WMI_GRP_SPECTRAL),
  342. WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
  343. /* F/W stats */
  344. WMI_REQUEST_STATS_CMDID = WMI_CMD_GRP(WMI_GRP_STATS),
  345. /* ARP OFFLOAD REQUEST*/
  346. WMI_SET_ARP_NS_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_ARP_NS_OFL),
  347. /* NS offload confid*/
  348. WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_NLO_OFL),
  349. /* GTK offload Specific WMI commands*/
  350. WMI_GTK_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_GTK_OFL),
  351. /* CSA offload Specific WMI commands*/
  352. WMI_CSA_OFFLOAD_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_CSA_OFL),
  353. WMI_CSA_OFFLOAD_CHANSWITCH_CMDID,
  354. /* Chatter commands*/
  355. WMI_CHATTER_SET_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_CHATTER),
  356. /* addba specific commands */
  357. WMI_PEER_TID_ADDBA_CMDID = WMI_CMD_GRP(WMI_GRP_TID_ADDBA),
  358. WMI_PEER_TID_DELBA_CMDID,
  359. /* set station mimo powersave method */
  360. WMI_STA_DTIM_PS_METHOD_CMDID,
  361. /* Configure the Station UAPSD AC Auto Trigger Parameters */
  362. WMI_STA_UAPSD_AUTO_TRIG_CMDID,
  363. /* STA Keep alive parameter configuration,
  364. Requires WMI_SERVICE_STA_KEEP_ALIVE */
  365. WMI_STA_KEEPALIVE_CMD,
  366. /* misc command group */
  367. WMI_ECHO_CMDID = WMI_CMD_GRP(WMI_GRP_MISC),
  368. WMI_PDEV_UTF_CMDID,
  369. WMI_DBGLOG_CFG_CMDID,
  370. WMI_PDEV_QVIT_CMDID,
  371. WMI_PDEV_FTM_INTG_CMDID,
  372. WMI_VDEV_SET_KEEPALIVE_CMDID,
  373. WMI_VDEV_GET_KEEPALIVE_CMDID,
  374. WMI_FORCE_FW_HANG_CMDID,
  375. /* GPIO Configuration */
  376. WMI_GPIO_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_GPIO),
  377. WMI_GPIO_OUTPUT_CMDID,
  378. };
  379. enum wmi_event_id {
  380. WMI_SERVICE_READY_EVENTID = 0x1,
  381. WMI_READY_EVENTID,
  382. /* Scan specific events */
  383. WMI_SCAN_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_SCAN),
  384. /* PDEV specific events */
  385. WMI_PDEV_TPC_CONFIG_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PDEV),
  386. WMI_CHAN_INFO_EVENTID,
  387. WMI_PHYERR_EVENTID,
  388. /* VDEV specific events */
  389. WMI_VDEV_START_RESP_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_VDEV),
  390. WMI_VDEV_STOPPED_EVENTID,
  391. WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID,
  392. /* peer specific events */
  393. WMI_PEER_STA_KICKOUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PEER),
  394. /* beacon/mgmt specific events */
  395. WMI_MGMT_RX_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MGMT),
  396. WMI_HOST_SWBA_EVENTID,
  397. WMI_TBTTOFFSET_UPDATE_EVENTID,
  398. /* ADDBA Related WMI Events*/
  399. WMI_TX_DELBA_COMPLETE_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_BA_NEG),
  400. WMI_TX_ADDBA_COMPLETE_EVENTID,
  401. /* Roam event to trigger roaming on host */
  402. WMI_ROAM_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_ROAM),
  403. WMI_PROFILE_MATCH,
  404. /* WoW */
  405. WMI_WOW_WAKEUP_HOST_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_WOW),
  406. /* RTT */
  407. WMI_RTT_MEASUREMENT_REPORT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_RTT),
  408. WMI_TSF_MEASUREMENT_REPORT_EVENTID,
  409. WMI_RTT_ERROR_REPORT_EVENTID,
  410. /* GTK offload */
  411. WMI_GTK_OFFLOAD_STATUS_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GTK_OFL),
  412. WMI_GTK_REKEY_FAIL_EVENTID,
  413. /* CSA IE received event */
  414. WMI_CSA_HANDLING_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_CSA_OFL),
  415. /* Misc events */
  416. WMI_ECHO_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MISC),
  417. WMI_PDEV_UTF_EVENTID,
  418. WMI_DEBUG_MESG_EVENTID,
  419. WMI_UPDATE_STATS_EVENTID,
  420. WMI_DEBUG_PRINT_EVENTID,
  421. WMI_DCS_INTERFERENCE_EVENTID,
  422. WMI_PDEV_QVIT_EVENTID,
  423. WMI_WLAN_PROFILE_DATA_EVENTID,
  424. WMI_PDEV_FTM_INTG_EVENTID,
  425. WMI_WLAN_FREQ_AVOID_EVENTID,
  426. WMI_VDEV_GET_KEEPALIVE_EVENTID,
  427. /* GPIO Event */
  428. WMI_GPIO_INPUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GPIO),
  429. };
  430. enum wmi_phy_mode {
  431. MODE_11A = 0, /* 11a Mode */
  432. MODE_11G = 1, /* 11b/g Mode */
  433. MODE_11B = 2, /* 11b Mode */
  434. MODE_11GONLY = 3, /* 11g only Mode */
  435. MODE_11NA_HT20 = 4, /* 11a HT20 mode */
  436. MODE_11NG_HT20 = 5, /* 11g HT20 mode */
  437. MODE_11NA_HT40 = 6, /* 11a HT40 mode */
  438. MODE_11NG_HT40 = 7, /* 11g HT40 mode */
  439. MODE_11AC_VHT20 = 8,
  440. MODE_11AC_VHT40 = 9,
  441. MODE_11AC_VHT80 = 10,
  442. /* MODE_11AC_VHT160 = 11, */
  443. MODE_11AC_VHT20_2G = 11,
  444. MODE_11AC_VHT40_2G = 12,
  445. MODE_11AC_VHT80_2G = 13,
  446. MODE_UNKNOWN = 14,
  447. MODE_MAX = 14
  448. };
  449. static inline const char *ath10k_wmi_phymode_str(enum wmi_phy_mode mode)
  450. {
  451. switch (mode) {
  452. case MODE_11A:
  453. return "11a";
  454. case MODE_11G:
  455. return "11g";
  456. case MODE_11B:
  457. return "11b";
  458. case MODE_11GONLY:
  459. return "11gonly";
  460. case MODE_11NA_HT20:
  461. return "11na-ht20";
  462. case MODE_11NG_HT20:
  463. return "11ng-ht20";
  464. case MODE_11NA_HT40:
  465. return "11na-ht40";
  466. case MODE_11NG_HT40:
  467. return "11ng-ht40";
  468. case MODE_11AC_VHT20:
  469. return "11ac-vht20";
  470. case MODE_11AC_VHT40:
  471. return "11ac-vht40";
  472. case MODE_11AC_VHT80:
  473. return "11ac-vht80";
  474. case MODE_11AC_VHT20_2G:
  475. return "11ac-vht20-2g";
  476. case MODE_11AC_VHT40_2G:
  477. return "11ac-vht40-2g";
  478. case MODE_11AC_VHT80_2G:
  479. return "11ac-vht80-2g";
  480. case MODE_UNKNOWN:
  481. /* skip */
  482. break;
  483. /* no default handler to allow compiler to check that the
  484. * enum is fully handled */
  485. };
  486. return "<unknown>";
  487. }
  488. #define WMI_CHAN_LIST_TAG 0x1
  489. #define WMI_SSID_LIST_TAG 0x2
  490. #define WMI_BSSID_LIST_TAG 0x3
  491. #define WMI_IE_TAG 0x4
  492. struct wmi_channel {
  493. __le32 mhz;
  494. __le32 band_center_freq1;
  495. __le32 band_center_freq2; /* valid for 11ac, 80plus80 */
  496. union {
  497. __le32 flags; /* WMI_CHAN_FLAG_ */
  498. struct {
  499. u8 mode; /* only 6 LSBs */
  500. } __packed;
  501. } __packed;
  502. union {
  503. __le32 reginfo0;
  504. struct {
  505. u8 min_power;
  506. u8 max_power;
  507. u8 reg_power;
  508. u8 reg_classid;
  509. } __packed;
  510. } __packed;
  511. union {
  512. __le32 reginfo1;
  513. struct {
  514. u8 antenna_max;
  515. } __packed;
  516. } __packed;
  517. } __packed;
  518. struct wmi_channel_arg {
  519. u32 freq;
  520. u32 band_center_freq1;
  521. bool passive;
  522. bool allow_ibss;
  523. bool allow_ht;
  524. bool allow_vht;
  525. bool ht40plus;
  526. /* note: power unit is 1/4th of dBm */
  527. u32 min_power;
  528. u32 max_power;
  529. u32 max_reg_power;
  530. u32 max_antenna_gain;
  531. u32 reg_class_id;
  532. enum wmi_phy_mode mode;
  533. };
  534. enum wmi_channel_change_cause {
  535. WMI_CHANNEL_CHANGE_CAUSE_NONE = 0,
  536. WMI_CHANNEL_CHANGE_CAUSE_CSA,
  537. };
  538. #define WMI_CHAN_FLAG_HT40_PLUS (1 << 6)
  539. #define WMI_CHAN_FLAG_PASSIVE (1 << 7)
  540. #define WMI_CHAN_FLAG_ADHOC_ALLOWED (1 << 8)
  541. #define WMI_CHAN_FLAG_AP_DISABLED (1 << 9)
  542. #define WMI_CHAN_FLAG_DFS (1 << 10)
  543. #define WMI_CHAN_FLAG_ALLOW_HT (1 << 11)
  544. #define WMI_CHAN_FLAG_ALLOW_VHT (1 << 12)
  545. /* Indicate reason for channel switch */
  546. #define WMI_CHANNEL_CHANGE_CAUSE_CSA (1 << 13)
  547. #define WMI_MAX_SPATIAL_STREAM 3
  548. /* HT Capabilities*/
  549. #define WMI_HT_CAP_ENABLED 0x0001 /* HT Enabled/ disabled */
  550. #define WMI_HT_CAP_HT20_SGI 0x0002 /* Short Guard Interval with HT20 */
  551. #define WMI_HT_CAP_DYNAMIC_SMPS 0x0004 /* Dynamic MIMO powersave */
  552. #define WMI_HT_CAP_TX_STBC 0x0008 /* B3 TX STBC */
  553. #define WMI_HT_CAP_TX_STBC_MASK_SHIFT 3
  554. #define WMI_HT_CAP_RX_STBC 0x0030 /* B4-B5 RX STBC */
  555. #define WMI_HT_CAP_RX_STBC_MASK_SHIFT 4
  556. #define WMI_HT_CAP_LDPC 0x0040 /* LDPC supported */
  557. #define WMI_HT_CAP_L_SIG_TXOP_PROT 0x0080 /* L-SIG TXOP Protection */
  558. #define WMI_HT_CAP_MPDU_DENSITY 0x0700 /* MPDU Density */
  559. #define WMI_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8
  560. #define WMI_HT_CAP_HT40_SGI 0x0800
  561. #define WMI_HT_CAP_DEFAULT_ALL (WMI_HT_CAP_ENABLED | \
  562. WMI_HT_CAP_HT20_SGI | \
  563. WMI_HT_CAP_HT40_SGI | \
  564. WMI_HT_CAP_TX_STBC | \
  565. WMI_HT_CAP_RX_STBC | \
  566. WMI_HT_CAP_LDPC)
  567. /*
  568. * WMI_VHT_CAP_* these maps to ieee 802.11ac vht capability information
  569. * field. The fields not defined here are not supported, or reserved.
  570. * Do not change these masks and if you have to add new one follow the
  571. * bitmask as specified by 802.11ac draft.
  572. */
  573. #define WMI_VHT_CAP_MAX_MPDU_LEN_MASK 0x00000003
  574. #define WMI_VHT_CAP_RX_LDPC 0x00000010
  575. #define WMI_VHT_CAP_SGI_80MHZ 0x00000020
  576. #define WMI_VHT_CAP_TX_STBC 0x00000080
  577. #define WMI_VHT_CAP_RX_STBC_MASK 0x00000300
  578. #define WMI_VHT_CAP_RX_STBC_MASK_SHIFT 8
  579. #define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP 0x03800000
  580. #define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP_SHIFT 23
  581. #define WMI_VHT_CAP_RX_FIXED_ANT 0x10000000
  582. #define WMI_VHT_CAP_TX_FIXED_ANT 0x20000000
  583. /* The following also refer for max HT AMSDU */
  584. #define WMI_VHT_CAP_MAX_MPDU_LEN_3839 0x00000000
  585. #define WMI_VHT_CAP_MAX_MPDU_LEN_7935 0x00000001
  586. #define WMI_VHT_CAP_MAX_MPDU_LEN_11454 0x00000002
  587. #define WMI_VHT_CAP_DEFAULT_ALL (WMI_VHT_CAP_MAX_MPDU_LEN_11454 | \
  588. WMI_VHT_CAP_RX_LDPC | \
  589. WMI_VHT_CAP_SGI_80MHZ | \
  590. WMI_VHT_CAP_TX_STBC | \
  591. WMI_VHT_CAP_RX_STBC_MASK | \
  592. WMI_VHT_CAP_MAX_AMPDU_LEN_EXP | \
  593. WMI_VHT_CAP_RX_FIXED_ANT | \
  594. WMI_VHT_CAP_TX_FIXED_ANT)
  595. /*
  596. * Interested readers refer to Rx/Tx MCS Map definition as defined in
  597. * 802.11ac
  598. */
  599. #define WMI_VHT_MAX_MCS_4_SS_MASK(r, ss) ((3 & (r)) << (((ss) - 1) << 1))
  600. #define WMI_VHT_MAX_SUPP_RATE_MASK 0x1fff0000
  601. #define WMI_VHT_MAX_SUPP_RATE_MASK_SHIFT 16
  602. enum {
  603. REGDMN_MODE_11A = 0x00001, /* 11a channels */
  604. REGDMN_MODE_TURBO = 0x00002, /* 11a turbo-only channels */
  605. REGDMN_MODE_11B = 0x00004, /* 11b channels */
  606. REGDMN_MODE_PUREG = 0x00008, /* 11g channels (OFDM only) */
  607. REGDMN_MODE_11G = 0x00008, /* XXX historical */
  608. REGDMN_MODE_108G = 0x00020, /* 11a+Turbo channels */
  609. REGDMN_MODE_108A = 0x00040, /* 11g+Turbo channels */
  610. REGDMN_MODE_XR = 0x00100, /* XR channels */
  611. REGDMN_MODE_11A_HALF_RATE = 0x00200, /* 11A half rate channels */
  612. REGDMN_MODE_11A_QUARTER_RATE = 0x00400, /* 11A quarter rate channels */
  613. REGDMN_MODE_11NG_HT20 = 0x00800, /* 11N-G HT20 channels */
  614. REGDMN_MODE_11NA_HT20 = 0x01000, /* 11N-A HT20 channels */
  615. REGDMN_MODE_11NG_HT40PLUS = 0x02000, /* 11N-G HT40 + channels */
  616. REGDMN_MODE_11NG_HT40MINUS = 0x04000, /* 11N-G HT40 - channels */
  617. REGDMN_MODE_11NA_HT40PLUS = 0x08000, /* 11N-A HT40 + channels */
  618. REGDMN_MODE_11NA_HT40MINUS = 0x10000, /* 11N-A HT40 - channels */
  619. REGDMN_MODE_11AC_VHT20 = 0x20000, /* 5Ghz, VHT20 */
  620. REGDMN_MODE_11AC_VHT40PLUS = 0x40000, /* 5Ghz, VHT40 + channels */
  621. REGDMN_MODE_11AC_VHT40MINUS = 0x80000, /* 5Ghz VHT40 - channels */
  622. REGDMN_MODE_11AC_VHT80 = 0x100000, /* 5Ghz, VHT80 channels */
  623. REGDMN_MODE_ALL = 0xffffffff
  624. };
  625. #define REGDMN_CAP1_CHAN_HALF_RATE 0x00000001
  626. #define REGDMN_CAP1_CHAN_QUARTER_RATE 0x00000002
  627. #define REGDMN_CAP1_CHAN_HAL49GHZ 0x00000004
  628. /* regulatory capabilities */
  629. #define REGDMN_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040
  630. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080
  631. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U2 0x0100
  632. #define REGDMN_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200
  633. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400
  634. #define REGDMN_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800
  635. struct hal_reg_capabilities {
  636. /* regdomain value specified in EEPROM */
  637. __le32 eeprom_rd;
  638. /*regdomain */
  639. __le32 eeprom_rd_ext;
  640. /* CAP1 capabilities bit map. */
  641. __le32 regcap1;
  642. /* REGDMN EEPROM CAP. */
  643. __le32 regcap2;
  644. /* REGDMN MODE */
  645. __le32 wireless_modes;
  646. __le32 low_2ghz_chan;
  647. __le32 high_2ghz_chan;
  648. __le32 low_5ghz_chan;
  649. __le32 high_5ghz_chan;
  650. } __packed;
  651. enum wlan_mode_capability {
  652. WHAL_WLAN_11A_CAPABILITY = 0x1,
  653. WHAL_WLAN_11G_CAPABILITY = 0x2,
  654. WHAL_WLAN_11AG_CAPABILITY = 0x3,
  655. };
  656. /* structure used by FW for requesting host memory */
  657. struct wlan_host_mem_req {
  658. /* ID of the request */
  659. __le32 req_id;
  660. /* size of the of each unit */
  661. __le32 unit_size;
  662. /* flags to indicate that
  663. * the number units is dependent
  664. * on number of resources(num vdevs num peers .. etc)
  665. */
  666. __le32 num_unit_info;
  667. /*
  668. * actual number of units to allocate . if flags in the num_unit_info
  669. * indicate that number of units is tied to number of a particular
  670. * resource to allocate then num_units filed is set to 0 and host
  671. * will derive the number units from number of the resources it is
  672. * requesting.
  673. */
  674. __le32 num_units;
  675. } __packed;
  676. #define WMI_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id) \
  677. ((((wmi_svc_bmap)[(svc_id)/(sizeof(u32))]) & \
  678. (1 << ((svc_id)%(sizeof(u32))))) != 0)
  679. /*
  680. * The following struct holds optional payload for
  681. * wmi_service_ready_event,e.g., 11ac pass some of the
  682. * device capability to the host.
  683. */
  684. struct wmi_service_ready_event {
  685. __le32 sw_version;
  686. __le32 sw_version_1;
  687. __le32 abi_version;
  688. /* WMI_PHY_CAPABILITY */
  689. __le32 phy_capability;
  690. /* Maximum number of frag table entries that SW will populate less 1 */
  691. __le32 max_frag_entry;
  692. __le32 wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
  693. __le32 num_rf_chains;
  694. /*
  695. * The following field is only valid for service type
  696. * WMI_SERVICE_11AC
  697. */
  698. __le32 ht_cap_info; /* WMI HT Capability */
  699. __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
  700. __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
  701. __le32 hw_min_tx_power;
  702. __le32 hw_max_tx_power;
  703. struct hal_reg_capabilities hal_reg_capabilities;
  704. __le32 sys_cap_info;
  705. __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
  706. /*
  707. * Max beacon and Probe Response IE offload size
  708. * (includes optional P2P IEs)
  709. */
  710. __le32 max_bcn_ie_size;
  711. /*
  712. * request to host to allocate a chuck of memory and pss it down to FW
  713. * via WM_INIT. FW uses this as FW extesnsion memory for saving its
  714. * data structures. Only valid for low latency interfaces like PCIE
  715. * where FW can access this memory directly (or) by DMA.
  716. */
  717. __le32 num_mem_reqs;
  718. struct wlan_host_mem_req mem_reqs[1];
  719. } __packed;
  720. #define WMI_SERVICE_READY_TIMEOUT_HZ (5*HZ)
  721. #define WMI_UNIFIED_READY_TIMEOUT_HZ (5*HZ)
  722. struct wmi_ready_event {
  723. __le32 sw_version;
  724. __le32 abi_version;
  725. struct wmi_mac_addr mac_addr;
  726. __le32 status;
  727. } __packed;
  728. struct wmi_resource_config {
  729. /* number of virtual devices (VAPs) to support */
  730. __le32 num_vdevs;
  731. /* number of peer nodes to support */
  732. __le32 num_peers;
  733. /*
  734. * In offload mode target supports features like WOW, chatter and
  735. * other protocol offloads. In order to support them some
  736. * functionalities like reorder buffering, PN checking need to be
  737. * done in target. This determines maximum number of peers suported
  738. * by target in offload mode
  739. */
  740. __le32 num_offload_peers;
  741. /* For target-based RX reordering */
  742. __le32 num_offload_reorder_bufs;
  743. /* number of keys per peer */
  744. __le32 num_peer_keys;
  745. /* total number of TX/RX data TIDs */
  746. __le32 num_tids;
  747. /*
  748. * max skid for resolving hash collisions
  749. *
  750. * The address search table is sparse, so that if two MAC addresses
  751. * result in the same hash value, the second of these conflicting
  752. * entries can slide to the next index in the address search table,
  753. * and use it, if it is unoccupied. This ast_skid_limit parameter
  754. * specifies the upper bound on how many subsequent indices to search
  755. * over to find an unoccupied space.
  756. */
  757. __le32 ast_skid_limit;
  758. /*
  759. * the nominal chain mask for transmit
  760. *
  761. * The chain mask may be modified dynamically, e.g. to operate AP
  762. * tx with a reduced number of chains if no clients are associated.
  763. * This configuration parameter specifies the nominal chain-mask that
  764. * should be used when not operating with a reduced set of tx chains.
  765. */
  766. __le32 tx_chain_mask;
  767. /*
  768. * the nominal chain mask for receive
  769. *
  770. * The chain mask may be modified dynamically, e.g. for a client
  771. * to use a reduced number of chains for receive if the traffic to
  772. * the client is low enough that it doesn't require downlink MIMO
  773. * or antenna diversity.
  774. * This configuration parameter specifies the nominal chain-mask that
  775. * should be used when not operating with a reduced set of rx chains.
  776. */
  777. __le32 rx_chain_mask;
  778. /*
  779. * what rx reorder timeout (ms) to use for the AC
  780. *
  781. * Each WMM access class (voice, video, best-effort, background) will
  782. * have its own timeout value to dictate how long to wait for missing
  783. * rx MPDUs to arrive before flushing subsequent MPDUs that have
  784. * already been received.
  785. * This parameter specifies the timeout in milliseconds for each
  786. * class.
  787. */
  788. __le32 rx_timeout_pri_vi;
  789. __le32 rx_timeout_pri_vo;
  790. __le32 rx_timeout_pri_be;
  791. __le32 rx_timeout_pri_bk;
  792. /*
  793. * what mode the rx should decap packets to
  794. *
  795. * MAC can decap to RAW (no decap), native wifi or Ethernet types
  796. * THis setting also determines the default TX behavior, however TX
  797. * behavior can be modified on a per VAP basis during VAP init
  798. */
  799. __le32 rx_decap_mode;
  800. /* what is the maximum scan requests than can be queued */
  801. __le32 scan_max_pending_reqs;
  802. /* maximum VDEV that could use BMISS offload */
  803. __le32 bmiss_offload_max_vdev;
  804. /* maximum VDEV that could use offload roaming */
  805. __le32 roam_offload_max_vdev;
  806. /* maximum AP profiles that would push to offload roaming */
  807. __le32 roam_offload_max_ap_profiles;
  808. /*
  809. * how many groups to use for mcast->ucast conversion
  810. *
  811. * The target's WAL maintains a table to hold information regarding
  812. * which peers belong to a given multicast group, so that if
  813. * multicast->unicast conversion is enabled, the target can convert
  814. * multicast tx frames to a series of unicast tx frames, to each
  815. * peer within the multicast group.
  816. This num_mcast_groups configuration parameter tells the target how
  817. * many multicast groups to provide storage for within its multicast
  818. * group membership table.
  819. */
  820. __le32 num_mcast_groups;
  821. /*
  822. * size to alloc for the mcast membership table
  823. *
  824. * This num_mcast_table_elems configuration parameter tells the
  825. * target how many peer elements it needs to provide storage for in
  826. * its multicast group membership table.
  827. * These multicast group membership table elements are shared by the
  828. * multicast groups stored within the table.
  829. */
  830. __le32 num_mcast_table_elems;
  831. /*
  832. * whether/how to do multicast->unicast conversion
  833. *
  834. * This configuration parameter specifies whether the target should
  835. * perform multicast --> unicast conversion on transmit, and if so,
  836. * what to do if it finds no entries in its multicast group
  837. * membership table for the multicast IP address in the tx frame.
  838. * Configuration value:
  839. * 0 -> Do not perform multicast to unicast conversion.
  840. * 1 -> Convert multicast frames to unicast, if the IP multicast
  841. * address from the tx frame is found in the multicast group
  842. * membership table. If the IP multicast address is not found,
  843. * drop the frame.
  844. * 2 -> Convert multicast frames to unicast, if the IP multicast
  845. * address from the tx frame is found in the multicast group
  846. * membership table. If the IP multicast address is not found,
  847. * transmit the frame as multicast.
  848. */
  849. __le32 mcast2ucast_mode;
  850. /*
  851. * how much memory to allocate for a tx PPDU dbg log
  852. *
  853. * This parameter controls how much memory the target will allocate
  854. * to store a log of tx PPDU meta-information (how large the PPDU
  855. * was, when it was sent, whether it was successful, etc.)
  856. */
  857. __le32 tx_dbg_log_size;
  858. /* how many AST entries to be allocated for WDS */
  859. __le32 num_wds_entries;
  860. /*
  861. * MAC DMA burst size, e.g., For target PCI limit can be
  862. * 0 -default, 1 256B
  863. */
  864. __le32 dma_burst_size;
  865. /*
  866. * Fixed delimiters to be inserted after every MPDU to
  867. * account for interface latency to avoid underrun.
  868. */
  869. __le32 mac_aggr_delim;
  870. /*
  871. * determine whether target is responsible for detecting duplicate
  872. * non-aggregate MPDU and timing out stale fragments.
  873. *
  874. * A-MPDU reordering is always performed on the target.
  875. *
  876. * 0: target responsible for frag timeout and dup checking
  877. * 1: host responsible for frag timeout and dup checking
  878. */
  879. __le32 rx_skip_defrag_timeout_dup_detection_check;
  880. /*
  881. * Configuration for VoW :
  882. * No of Video Nodes to be supported
  883. * and Max no of descriptors for each Video link (node).
  884. */
  885. __le32 vow_config;
  886. /* maximum VDEV that could use GTK offload */
  887. __le32 gtk_offload_max_vdev;
  888. /* Number of msdu descriptors target should use */
  889. __le32 num_msdu_desc;
  890. /*
  891. * Max. number of Tx fragments per MSDU
  892. * This parameter controls the max number of Tx fragments per MSDU.
  893. * This is sent by the target as part of the WMI_SERVICE_READY event
  894. * and is overriden by the OS shim as required.
  895. */
  896. __le32 max_frag_entries;
  897. } __packed;
  898. /* strucutre describing host memory chunk. */
  899. struct host_memory_chunk {
  900. /* id of the request that is passed up in service ready */
  901. __le32 req_id;
  902. /* the physical address the memory chunk */
  903. __le32 ptr;
  904. /* size of the chunk */
  905. __le32 size;
  906. } __packed;
  907. struct wmi_init_cmd {
  908. struct wmi_resource_config resource_config;
  909. __le32 num_host_mem_chunks;
  910. /*
  911. * variable number of host memory chunks.
  912. * This should be the last element in the structure
  913. */
  914. struct host_memory_chunk host_mem_chunks[1];
  915. } __packed;
  916. /* TLV for channel list */
  917. struct wmi_chan_list {
  918. __le32 tag; /* WMI_CHAN_LIST_TAG */
  919. __le32 num_chan;
  920. __le32 channel_list[0];
  921. } __packed;
  922. struct wmi_bssid_list {
  923. __le32 tag; /* WMI_BSSID_LIST_TAG */
  924. __le32 num_bssid;
  925. struct wmi_mac_addr bssid_list[0];
  926. } __packed;
  927. struct wmi_ie_data {
  928. __le32 tag; /* WMI_IE_TAG */
  929. __le32 ie_len;
  930. u8 ie_data[0];
  931. } __packed;
  932. struct wmi_ssid {
  933. __le32 ssid_len;
  934. u8 ssid[32];
  935. } __packed;
  936. struct wmi_ssid_list {
  937. __le32 tag; /* WMI_SSID_LIST_TAG */
  938. __le32 num_ssids;
  939. struct wmi_ssid ssids[0];
  940. } __packed;
  941. /* prefix used by scan requestor ids on the host */
  942. #define WMI_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
  943. /* prefix used by scan request ids generated on the host */
  944. /* host cycles through the lower 12 bits to generate ids */
  945. #define WMI_HOST_SCAN_REQ_ID_PREFIX 0xA000
  946. #define WLAN_SCAN_PARAMS_MAX_SSID 16
  947. #define WLAN_SCAN_PARAMS_MAX_BSSID 4
  948. #define WLAN_SCAN_PARAMS_MAX_IE_LEN 256
  949. /* Scan priority numbers must be sequential, starting with 0 */
  950. enum wmi_scan_priority {
  951. WMI_SCAN_PRIORITY_VERY_LOW = 0,
  952. WMI_SCAN_PRIORITY_LOW,
  953. WMI_SCAN_PRIORITY_MEDIUM,
  954. WMI_SCAN_PRIORITY_HIGH,
  955. WMI_SCAN_PRIORITY_VERY_HIGH,
  956. WMI_SCAN_PRIORITY_COUNT /* number of priorities supported */
  957. };
  958. struct wmi_start_scan_cmd {
  959. /* Scan ID */
  960. __le32 scan_id;
  961. /* Scan requestor ID */
  962. __le32 scan_req_id;
  963. /* VDEV id(interface) that is requesting scan */
  964. __le32 vdev_id;
  965. /* Scan Priority, input to scan scheduler */
  966. __le32 scan_priority;
  967. /* Scan events subscription */
  968. __le32 notify_scan_events;
  969. /* dwell time in msec on active channels */
  970. __le32 dwell_time_active;
  971. /* dwell time in msec on passive channels */
  972. __le32 dwell_time_passive;
  973. /*
  974. * min time in msec on the BSS channel,only valid if atleast one
  975. * VDEV is active
  976. */
  977. __le32 min_rest_time;
  978. /*
  979. * max rest time in msec on the BSS channel,only valid if at least
  980. * one VDEV is active
  981. */
  982. /*
  983. * the scanner will rest on the bss channel at least min_rest_time
  984. * after min_rest_time the scanner will start checking for tx/rx
  985. * activity on all VDEVs. if there is no activity the scanner will
  986. * switch to off channel. if there is activity the scanner will let
  987. * the radio on the bss channel until max_rest_time expires.at
  988. * max_rest_time scanner will switch to off channel irrespective of
  989. * activity. activity is determined by the idle_time parameter.
  990. */
  991. __le32 max_rest_time;
  992. /*
  993. * time before sending next set of probe requests.
  994. * The scanner keeps repeating probe requests transmission with
  995. * period specified by repeat_probe_time.
  996. * The number of probe requests specified depends on the ssid_list
  997. * and bssid_list
  998. */
  999. __le32 repeat_probe_time;
  1000. /* time in msec between 2 consequetive probe requests with in a set. */
  1001. __le32 probe_spacing_time;
  1002. /*
  1003. * data inactivity time in msec on bss channel that will be used by
  1004. * scanner for measuring the inactivity.
  1005. */
  1006. __le32 idle_time;
  1007. /* maximum time in msec allowed for scan */
  1008. __le32 max_scan_time;
  1009. /*
  1010. * delay in msec before sending first probe request after switching
  1011. * to a channel
  1012. */
  1013. __le32 probe_delay;
  1014. /* Scan control flags */
  1015. __le32 scan_ctrl_flags;
  1016. /* Burst duration time in msecs */
  1017. __le32 burst_duration;
  1018. /*
  1019. * TLV (tag length value ) paramerters follow the scan_cmd structure.
  1020. * TLV can contain channel list, bssid list, ssid list and
  1021. * ie. the TLV tags are defined above;
  1022. */
  1023. } __packed;
  1024. struct wmi_ssid_arg {
  1025. int len;
  1026. const u8 *ssid;
  1027. };
  1028. struct wmi_bssid_arg {
  1029. const u8 *bssid;
  1030. };
  1031. struct wmi_start_scan_arg {
  1032. u32 scan_id;
  1033. u32 scan_req_id;
  1034. u32 vdev_id;
  1035. u32 scan_priority;
  1036. u32 notify_scan_events;
  1037. u32 dwell_time_active;
  1038. u32 dwell_time_passive;
  1039. u32 min_rest_time;
  1040. u32 max_rest_time;
  1041. u32 repeat_probe_time;
  1042. u32 probe_spacing_time;
  1043. u32 idle_time;
  1044. u32 max_scan_time;
  1045. u32 probe_delay;
  1046. u32 scan_ctrl_flags;
  1047. u32 ie_len;
  1048. u32 n_channels;
  1049. u32 n_ssids;
  1050. u32 n_bssids;
  1051. u8 ie[WLAN_SCAN_PARAMS_MAX_IE_LEN];
  1052. u32 channels[64];
  1053. struct wmi_ssid_arg ssids[WLAN_SCAN_PARAMS_MAX_SSID];
  1054. struct wmi_bssid_arg bssids[WLAN_SCAN_PARAMS_MAX_BSSID];
  1055. };
  1056. /* scan control flags */
  1057. /* passively scan all channels including active channels */
  1058. #define WMI_SCAN_FLAG_PASSIVE 0x1
  1059. /* add wild card ssid probe request even though ssid_list is specified. */
  1060. #define WMI_SCAN_ADD_BCAST_PROBE_REQ 0x2
  1061. /* add cck rates to rates/xrate ie for the generated probe request */
  1062. #define WMI_SCAN_ADD_CCK_RATES 0x4
  1063. /* add ofdm rates to rates/xrate ie for the generated probe request */
  1064. #define WMI_SCAN_ADD_OFDM_RATES 0x8
  1065. /* To enable indication of Chan load and Noise floor to host */
  1066. #define WMI_SCAN_CHAN_STAT_EVENT 0x10
  1067. /* Filter Probe request frames */
  1068. #define WMI_SCAN_FILTER_PROBE_REQ 0x20
  1069. /* When set, DFS channels will not be scanned */
  1070. #define WMI_SCAN_BYPASS_DFS_CHN 0x40
  1071. /* Different FW scan engine may choose to bail out on errors.
  1072. * Allow the driver to have influence over that. */
  1073. #define WMI_SCAN_CONTINUE_ON_ERROR 0x80
  1074. /* WMI_SCAN_CLASS_MASK must be the same value as IEEE80211_SCAN_CLASS_MASK */
  1075. #define WMI_SCAN_CLASS_MASK 0xFF000000
  1076. enum wmi_stop_scan_type {
  1077. WMI_SCAN_STOP_ONE = 0x00000000, /* stop by scan_id */
  1078. WMI_SCAN_STOP_VDEV_ALL = 0x01000000, /* stop by vdev_id */
  1079. WMI_SCAN_STOP_ALL = 0x04000000, /* stop all scans */
  1080. };
  1081. struct wmi_stop_scan_cmd {
  1082. __le32 scan_req_id;
  1083. __le32 scan_id;
  1084. __le32 req_type;
  1085. __le32 vdev_id;
  1086. } __packed;
  1087. struct wmi_stop_scan_arg {
  1088. u32 req_id;
  1089. enum wmi_stop_scan_type req_type;
  1090. union {
  1091. u32 scan_id;
  1092. u32 vdev_id;
  1093. } u;
  1094. };
  1095. struct wmi_scan_chan_list_cmd {
  1096. __le32 num_scan_chans;
  1097. struct wmi_channel chan_info[0];
  1098. } __packed;
  1099. struct wmi_scan_chan_list_arg {
  1100. u32 n_channels;
  1101. struct wmi_channel_arg *channels;
  1102. };
  1103. enum wmi_bss_filter {
  1104. WMI_BSS_FILTER_NONE = 0, /* no beacons forwarded */
  1105. WMI_BSS_FILTER_ALL, /* all beacons forwarded */
  1106. WMI_BSS_FILTER_PROFILE, /* only beacons matching profile */
  1107. WMI_BSS_FILTER_ALL_BUT_PROFILE, /* all but beacons matching profile */
  1108. WMI_BSS_FILTER_CURRENT_BSS, /* only beacons matching current BSS */
  1109. WMI_BSS_FILTER_ALL_BUT_BSS, /* all but beacons matching BSS */
  1110. WMI_BSS_FILTER_PROBED_SSID, /* beacons matching probed ssid */
  1111. WMI_BSS_FILTER_LAST_BSS, /* marker only */
  1112. };
  1113. enum wmi_scan_event_type {
  1114. WMI_SCAN_EVENT_STARTED = 0x1,
  1115. WMI_SCAN_EVENT_COMPLETED = 0x2,
  1116. WMI_SCAN_EVENT_BSS_CHANNEL = 0x4,
  1117. WMI_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
  1118. WMI_SCAN_EVENT_DEQUEUED = 0x10,
  1119. WMI_SCAN_EVENT_PREEMPTED = 0x20, /* possibly by high-prio scan */
  1120. WMI_SCAN_EVENT_START_FAILED = 0x40,
  1121. WMI_SCAN_EVENT_RESTARTED = 0x80,
  1122. WMI_SCAN_EVENT_MAX = 0x8000
  1123. };
  1124. enum wmi_scan_completion_reason {
  1125. WMI_SCAN_REASON_COMPLETED,
  1126. WMI_SCAN_REASON_CANCELLED,
  1127. WMI_SCAN_REASON_PREEMPTED,
  1128. WMI_SCAN_REASON_TIMEDOUT,
  1129. WMI_SCAN_REASON_MAX,
  1130. };
  1131. struct wmi_scan_event {
  1132. __le32 event_type; /* %WMI_SCAN_EVENT_ */
  1133. __le32 reason; /* %WMI_SCAN_REASON_ */
  1134. __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
  1135. __le32 scan_req_id;
  1136. __le32 scan_id;
  1137. __le32 vdev_id;
  1138. } __packed;
  1139. /*
  1140. * This defines how much headroom is kept in the
  1141. * receive frame between the descriptor and the
  1142. * payload, in order for the WMI PHY error and
  1143. * management handler to insert header contents.
  1144. *
  1145. * This is in bytes.
  1146. */
  1147. #define WMI_MGMT_RX_HDR_HEADROOM 52
  1148. /*
  1149. * This event will be used for sending scan results
  1150. * as well as rx mgmt frames to the host. The rx buffer
  1151. * will be sent as part of this WMI event. It would be a
  1152. * good idea to pass all the fields in the RX status
  1153. * descriptor up to the host.
  1154. */
  1155. struct wmi_mgmt_rx_hdr_v1 {
  1156. __le32 channel;
  1157. __le32 snr;
  1158. __le32 rate;
  1159. __le32 phy_mode;
  1160. __le32 buf_len;
  1161. __le32 status; /* %WMI_RX_STATUS_ */
  1162. } __packed;
  1163. struct wmi_mgmt_rx_hdr_v2 {
  1164. struct wmi_mgmt_rx_hdr_v1 v1;
  1165. __le32 rssi_ctl[4];
  1166. } __packed;
  1167. struct wmi_mgmt_rx_event_v1 {
  1168. struct wmi_mgmt_rx_hdr_v1 hdr;
  1169. u8 buf[0];
  1170. } __packed;
  1171. struct wmi_mgmt_rx_event_v2 {
  1172. struct wmi_mgmt_rx_hdr_v2 hdr;
  1173. u8 buf[0];
  1174. } __packed;
  1175. #define WMI_RX_STATUS_OK 0x00
  1176. #define WMI_RX_STATUS_ERR_CRC 0x01
  1177. #define WMI_RX_STATUS_ERR_DECRYPT 0x08
  1178. #define WMI_RX_STATUS_ERR_MIC 0x10
  1179. #define WMI_RX_STATUS_ERR_KEY_CACHE_MISS 0x20
  1180. struct wmi_single_phyerr_rx_hdr {
  1181. /* TSF timestamp */
  1182. __le32 tsf_timestamp;
  1183. /*
  1184. * Current freq1, freq2
  1185. *
  1186. * [7:0]: freq1[lo]
  1187. * [15:8] : freq1[hi]
  1188. * [23:16]: freq2[lo]
  1189. * [31:24]: freq2[hi]
  1190. */
  1191. __le16 freq1;
  1192. __le16 freq2;
  1193. /*
  1194. * Combined RSSI over all chains and channel width for this PHY error
  1195. *
  1196. * [7:0]: RSSI combined
  1197. * [15:8]: Channel width (MHz)
  1198. * [23:16]: PHY error code
  1199. * [24:16]: reserved (future use)
  1200. */
  1201. u8 rssi_combined;
  1202. u8 chan_width_mhz;
  1203. u8 phy_err_code;
  1204. u8 rsvd0;
  1205. /*
  1206. * RSSI on chain 0 through 3
  1207. *
  1208. * This is formatted the same as the PPDU_START RX descriptor
  1209. * field:
  1210. *
  1211. * [7:0]: pri20
  1212. * [15:8]: sec20
  1213. * [23:16]: sec40
  1214. * [31:24]: sec80
  1215. */
  1216. __le32 rssi_chain0;
  1217. __le32 rssi_chain1;
  1218. __le32 rssi_chain2;
  1219. __le32 rssi_chain3;
  1220. /*
  1221. * Last calibrated NF value for chain 0 through 3
  1222. *
  1223. * nf_list_1:
  1224. *
  1225. * + [15:0] - chain 0
  1226. * + [31:16] - chain 1
  1227. *
  1228. * nf_list_2:
  1229. *
  1230. * + [15:0] - chain 2
  1231. * + [31:16] - chain 3
  1232. */
  1233. __le32 nf_list_1;
  1234. __le32 nf_list_2;
  1235. /* Length of the frame */
  1236. __le32 buf_len;
  1237. } __packed;
  1238. struct wmi_single_phyerr_rx_event {
  1239. /* Phy error event header */
  1240. struct wmi_single_phyerr_rx_hdr hdr;
  1241. /* frame buffer */
  1242. u8 bufp[0];
  1243. } __packed;
  1244. struct wmi_comb_phyerr_rx_hdr {
  1245. /* Phy error phy error count */
  1246. __le32 num_phyerr_events;
  1247. __le32 tsf_l32;
  1248. __le32 tsf_u32;
  1249. } __packed;
  1250. struct wmi_comb_phyerr_rx_event {
  1251. /* Phy error phy error count */
  1252. struct wmi_comb_phyerr_rx_hdr hdr;
  1253. /*
  1254. * frame buffer - contains multiple payloads in the order:
  1255. * header - payload, header - payload...
  1256. * (The header is of type: wmi_single_phyerr_rx_hdr)
  1257. */
  1258. u8 bufp[0];
  1259. } __packed;
  1260. struct wmi_mgmt_tx_hdr {
  1261. __le32 vdev_id;
  1262. struct wmi_mac_addr peer_macaddr;
  1263. __le32 tx_rate;
  1264. __le32 tx_power;
  1265. __le32 buf_len;
  1266. } __packed;
  1267. struct wmi_mgmt_tx_cmd {
  1268. struct wmi_mgmt_tx_hdr hdr;
  1269. u8 buf[0];
  1270. } __packed;
  1271. struct wmi_echo_event {
  1272. __le32 value;
  1273. } __packed;
  1274. struct wmi_echo_cmd {
  1275. __le32 value;
  1276. } __packed;
  1277. struct wmi_pdev_set_regdomain_cmd {
  1278. __le32 reg_domain;
  1279. __le32 reg_domain_2G;
  1280. __le32 reg_domain_5G;
  1281. __le32 conformance_test_limit_2G;
  1282. __le32 conformance_test_limit_5G;
  1283. } __packed;
  1284. /* Command to set/unset chip in quiet mode */
  1285. struct wmi_pdev_set_quiet_cmd {
  1286. /* period in TUs */
  1287. __le32 period;
  1288. /* duration in TUs */
  1289. __le32 duration;
  1290. /* offset in TUs */
  1291. __le32 next_start;
  1292. /* enable/disable */
  1293. __le32 enabled;
  1294. } __packed;
  1295. /*
  1296. * 802.11g protection mode.
  1297. */
  1298. enum ath10k_protmode {
  1299. ATH10K_PROT_NONE = 0, /* no protection */
  1300. ATH10K_PROT_CTSONLY = 1, /* CTS to self */
  1301. ATH10K_PROT_RTSCTS = 2, /* RTS-CTS */
  1302. };
  1303. enum wmi_beacon_gen_mode {
  1304. WMI_BEACON_STAGGERED_MODE = 0,
  1305. WMI_BEACON_BURST_MODE = 1
  1306. };
  1307. enum wmi_csa_event_ies_present_flag {
  1308. WMI_CSA_IE_PRESENT = 0x00000001,
  1309. WMI_XCSA_IE_PRESENT = 0x00000002,
  1310. WMI_WBW_IE_PRESENT = 0x00000004,
  1311. WMI_CSWARP_IE_PRESENT = 0x00000008,
  1312. };
  1313. /* wmi CSA receive event from beacon frame */
  1314. struct wmi_csa_event {
  1315. __le32 i_fc_dur;
  1316. /* Bit 0-15: FC */
  1317. /* Bit 16-31: DUR */
  1318. struct wmi_mac_addr i_addr1;
  1319. struct wmi_mac_addr i_addr2;
  1320. __le32 csa_ie[2];
  1321. __le32 xcsa_ie[2];
  1322. __le32 wb_ie[2];
  1323. __le32 cswarp_ie;
  1324. __le32 ies_present_flag; /* wmi_csa_event_ies_present_flag */
  1325. } __packed;
  1326. /* the definition of different PDEV parameters */
  1327. #define PDEV_DEFAULT_STATS_UPDATE_PERIOD 500
  1328. #define VDEV_DEFAULT_STATS_UPDATE_PERIOD 500
  1329. #define PEER_DEFAULT_STATS_UPDATE_PERIOD 500
  1330. enum wmi_pdev_param {
  1331. /* TX chian mask */
  1332. WMI_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
  1333. /* RX chian mask */
  1334. WMI_PDEV_PARAM_RX_CHAIN_MASK,
  1335. /* TX power limit for 2G Radio */
  1336. WMI_PDEV_PARAM_TXPOWER_LIMIT2G,
  1337. /* TX power limit for 5G Radio */
  1338. WMI_PDEV_PARAM_TXPOWER_LIMIT5G,
  1339. /* TX power scale */
  1340. WMI_PDEV_PARAM_TXPOWER_SCALE,
  1341. /* Beacon generation mode . 0: host, 1: target */
  1342. WMI_PDEV_PARAM_BEACON_GEN_MODE,
  1343. /* Beacon generation mode . 0: staggered 1: bursted */
  1344. WMI_PDEV_PARAM_BEACON_TX_MODE,
  1345. /*
  1346. * Resource manager off chan mode .
  1347. * 0: turn off off chan mode. 1: turn on offchan mode
  1348. */
  1349. WMI_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
  1350. /*
  1351. * Protection mode:
  1352. * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
  1353. */
  1354. WMI_PDEV_PARAM_PROTECTION_MODE,
  1355. /* Dynamic bandwidth 0: disable 1: enable */
  1356. WMI_PDEV_PARAM_DYNAMIC_BW,
  1357. /* Non aggregrate/ 11g sw retry threshold.0-disable */
  1358. WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
  1359. /* aggregrate sw retry threshold. 0-disable*/
  1360. WMI_PDEV_PARAM_AGG_SW_RETRY_TH,
  1361. /* Station kickout threshold (non of consecutive failures).0-disable */
  1362. WMI_PDEV_PARAM_STA_KICKOUT_TH,
  1363. /* Aggerate size scaling configuration per AC */
  1364. WMI_PDEV_PARAM_AC_AGGRSIZE_SCALING,
  1365. /* LTR enable */
  1366. WMI_PDEV_PARAM_LTR_ENABLE,
  1367. /* LTR latency for BE, in us */
  1368. WMI_PDEV_PARAM_LTR_AC_LATENCY_BE,
  1369. /* LTR latency for BK, in us */
  1370. WMI_PDEV_PARAM_LTR_AC_LATENCY_BK,
  1371. /* LTR latency for VI, in us */
  1372. WMI_PDEV_PARAM_LTR_AC_LATENCY_VI,
  1373. /* LTR latency for VO, in us */
  1374. WMI_PDEV_PARAM_LTR_AC_LATENCY_VO,
  1375. /* LTR AC latency timeout, in ms */
  1376. WMI_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
  1377. /* LTR platform latency override, in us */
  1378. WMI_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
  1379. /* LTR-RX override, in us */
  1380. WMI_PDEV_PARAM_LTR_RX_OVERRIDE,
  1381. /* Tx activity timeout for LTR, in us */
  1382. WMI_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
  1383. /* L1SS state machine enable */
  1384. WMI_PDEV_PARAM_L1SS_ENABLE,
  1385. /* Deep sleep state machine enable */
  1386. WMI_PDEV_PARAM_DSLEEP_ENABLE,
  1387. /* RX buffering flush enable */
  1388. WMI_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
  1389. /* RX buffering matermark */
  1390. WMI_PDEV_PARAM_PCIELP_TXBUF_WATERMARK,
  1391. /* RX buffering timeout enable */
  1392. WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
  1393. /* RX buffering timeout value */
  1394. WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
  1395. /* pdev level stats update period in ms */
  1396. WMI_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
  1397. /* vdev level stats update period in ms */
  1398. WMI_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
  1399. /* peer level stats update period in ms */
  1400. WMI_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
  1401. /* beacon filter status update period */
  1402. WMI_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
  1403. /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
  1404. WMI_PDEV_PARAM_PMF_QOS,
  1405. /* Access category on which ARP frames are sent */
  1406. WMI_PDEV_PARAM_ARP_AC_OVERRIDE,
  1407. /* DCS configuration */
  1408. WMI_PDEV_PARAM_DCS,
  1409. /* Enable/Disable ANI on target */
  1410. WMI_PDEV_PARAM_ANI_ENABLE,
  1411. /* configure the ANI polling period */
  1412. WMI_PDEV_PARAM_ANI_POLL_PERIOD,
  1413. /* configure the ANI listening period */
  1414. WMI_PDEV_PARAM_ANI_LISTEN_PERIOD,
  1415. /* configure OFDM immunity level */
  1416. WMI_PDEV_PARAM_ANI_OFDM_LEVEL,
  1417. /* configure CCK immunity level */
  1418. WMI_PDEV_PARAM_ANI_CCK_LEVEL,
  1419. /* Enable/Disable CDD for 1x1 STAs in rate control module */
  1420. WMI_PDEV_PARAM_DYNTXCHAIN,
  1421. /* Enable/Disable proxy STA */
  1422. WMI_PDEV_PARAM_PROXY_STA,
  1423. /* Enable/Disable low power state when all VDEVs are inactive/idle. */
  1424. WMI_PDEV_PARAM_IDLE_PS_CONFIG,
  1425. /* Enable/Disable power gating sleep */
  1426. WMI_PDEV_PARAM_POWER_GATING_SLEEP,
  1427. };
  1428. struct wmi_pdev_set_param_cmd {
  1429. __le32 param_id;
  1430. __le32 param_value;
  1431. } __packed;
  1432. struct wmi_pdev_get_tpc_config_cmd {
  1433. /* parameter */
  1434. __le32 param;
  1435. } __packed;
  1436. #define WMI_TPC_RATE_MAX 160
  1437. #define WMI_TPC_TX_N_CHAIN 4
  1438. enum wmi_tpc_config_event_flag {
  1439. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_CDD = 0x1,
  1440. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_STBC = 0x2,
  1441. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF = 0x4,
  1442. };
  1443. struct wmi_pdev_tpc_config_event {
  1444. __le32 reg_domain;
  1445. __le32 chan_freq;
  1446. __le32 phy_mode;
  1447. __le32 twice_antenna_reduction;
  1448. __le32 twice_max_rd_power;
  1449. s32 twice_antenna_gain;
  1450. __le32 power_limit;
  1451. __le32 rate_max;
  1452. __le32 num_tx_chain;
  1453. __le32 ctl;
  1454. __le32 flags;
  1455. s8 max_reg_allow_pow[WMI_TPC_TX_N_CHAIN];
  1456. s8 max_reg_allow_pow_agcdd[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  1457. s8 max_reg_allow_pow_agstbc[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  1458. s8 max_reg_allow_pow_agtxbf[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  1459. u8 rates_array[WMI_TPC_RATE_MAX];
  1460. } __packed;
  1461. /* Transmit power scale factor. */
  1462. enum wmi_tp_scale {
  1463. WMI_TP_SCALE_MAX = 0, /* no scaling (default) */
  1464. WMI_TP_SCALE_50 = 1, /* 50% of max (-3 dBm) */
  1465. WMI_TP_SCALE_25 = 2, /* 25% of max (-6 dBm) */
  1466. WMI_TP_SCALE_12 = 3, /* 12% of max (-9 dBm) */
  1467. WMI_TP_SCALE_MIN = 4, /* min, but still on */
  1468. WMI_TP_SCALE_SIZE = 5, /* max num of enum */
  1469. };
  1470. struct wmi_set_channel_cmd {
  1471. /* channel (only frequency and mode info are used) */
  1472. struct wmi_channel chan;
  1473. } __packed;
  1474. struct wmi_pdev_chanlist_update_event {
  1475. /* number of channels */
  1476. __le32 num_chan;
  1477. /* array of channels */
  1478. struct wmi_channel channel_list[1];
  1479. } __packed;
  1480. #define WMI_MAX_DEBUG_MESG (sizeof(u32) * 32)
  1481. struct wmi_debug_mesg_event {
  1482. /* message buffer, NULL terminated */
  1483. char bufp[WMI_MAX_DEBUG_MESG];
  1484. } __packed;
  1485. enum {
  1486. /* P2P device */
  1487. VDEV_SUBTYPE_P2PDEV = 0,
  1488. /* P2P client */
  1489. VDEV_SUBTYPE_P2PCLI,
  1490. /* P2P GO */
  1491. VDEV_SUBTYPE_P2PGO,
  1492. /* BT3.0 HS */
  1493. VDEV_SUBTYPE_BT,
  1494. };
  1495. struct wmi_pdev_set_channel_cmd {
  1496. /* idnore power , only use flags , mode and freq */
  1497. struct wmi_channel chan;
  1498. } __packed;
  1499. /* Customize the DSCP (bit) to TID (0-7) mapping for QOS */
  1500. #define WMI_DSCP_MAP_MAX (64)
  1501. struct wmi_pdev_set_dscp_tid_map_cmd {
  1502. /* map indicating DSCP to TID conversion */
  1503. __le32 dscp_to_tid_map[WMI_DSCP_MAP_MAX];
  1504. } __packed;
  1505. enum mcast_bcast_rate_id {
  1506. WMI_SET_MCAST_RATE,
  1507. WMI_SET_BCAST_RATE
  1508. };
  1509. struct mcast_bcast_rate {
  1510. enum mcast_bcast_rate_id rate_id;
  1511. __le32 rate;
  1512. } __packed;
  1513. struct wmi_wmm_params {
  1514. __le32 cwmin;
  1515. __le32 cwmax;
  1516. __le32 aifs;
  1517. __le32 txop;
  1518. __le32 acm;
  1519. __le32 no_ack;
  1520. } __packed;
  1521. struct wmi_pdev_set_wmm_params {
  1522. struct wmi_wmm_params ac_be;
  1523. struct wmi_wmm_params ac_bk;
  1524. struct wmi_wmm_params ac_vi;
  1525. struct wmi_wmm_params ac_vo;
  1526. } __packed;
  1527. struct wmi_wmm_params_arg {
  1528. u32 cwmin;
  1529. u32 cwmax;
  1530. u32 aifs;
  1531. u32 txop;
  1532. u32 acm;
  1533. u32 no_ack;
  1534. };
  1535. struct wmi_pdev_set_wmm_params_arg {
  1536. struct wmi_wmm_params_arg ac_be;
  1537. struct wmi_wmm_params_arg ac_bk;
  1538. struct wmi_wmm_params_arg ac_vi;
  1539. struct wmi_wmm_params_arg ac_vo;
  1540. };
  1541. struct wal_dbg_tx_stats {
  1542. /* Num HTT cookies queued to dispatch list */
  1543. __le32 comp_queued;
  1544. /* Num HTT cookies dispatched */
  1545. __le32 comp_delivered;
  1546. /* Num MSDU queued to WAL */
  1547. __le32 msdu_enqued;
  1548. /* Num MPDU queue to WAL */
  1549. __le32 mpdu_enqued;
  1550. /* Num MSDUs dropped by WMM limit */
  1551. __le32 wmm_drop;
  1552. /* Num Local frames queued */
  1553. __le32 local_enqued;
  1554. /* Num Local frames done */
  1555. __le32 local_freed;
  1556. /* Num queued to HW */
  1557. __le32 hw_queued;
  1558. /* Num PPDU reaped from HW */
  1559. __le32 hw_reaped;
  1560. /* Num underruns */
  1561. __le32 underrun;
  1562. /* Num PPDUs cleaned up in TX abort */
  1563. __le32 tx_abort;
  1564. /* Num MPDUs requed by SW */
  1565. __le32 mpdus_requed;
  1566. /* excessive retries */
  1567. __le32 tx_ko;
  1568. /* data hw rate code */
  1569. __le32 data_rc;
  1570. /* Scheduler self triggers */
  1571. __le32 self_triggers;
  1572. /* frames dropped due to excessive sw retries */
  1573. __le32 sw_retry_failure;
  1574. /* illegal rate phy errors */
  1575. __le32 illgl_rate_phy_err;
  1576. /* wal pdev continous xretry */
  1577. __le32 pdev_cont_xretry;
  1578. /* wal pdev continous xretry */
  1579. __le32 pdev_tx_timeout;
  1580. /* wal pdev resets */
  1581. __le32 pdev_resets;
  1582. __le32 phy_underrun;
  1583. /* MPDU is more than txop limit */
  1584. __le32 txop_ovf;
  1585. } __packed;
  1586. struct wal_dbg_rx_stats {
  1587. /* Cnts any change in ring routing mid-ppdu */
  1588. __le32 mid_ppdu_route_change;
  1589. /* Total number of statuses processed */
  1590. __le32 status_rcvd;
  1591. /* Extra frags on rings 0-3 */
  1592. __le32 r0_frags;
  1593. __le32 r1_frags;
  1594. __le32 r2_frags;
  1595. __le32 r3_frags;
  1596. /* MSDUs / MPDUs delivered to HTT */
  1597. __le32 htt_msdus;
  1598. __le32 htt_mpdus;
  1599. /* MSDUs / MPDUs delivered to local stack */
  1600. __le32 loc_msdus;
  1601. __le32 loc_mpdus;
  1602. /* AMSDUs that have more MSDUs than the status ring size */
  1603. __le32 oversize_amsdu;
  1604. /* Number of PHY errors */
  1605. __le32 phy_errs;
  1606. /* Number of PHY errors drops */
  1607. __le32 phy_err_drop;
  1608. /* Number of mpdu errors - FCS, MIC, ENC etc. */
  1609. __le32 mpdu_errs;
  1610. } __packed;
  1611. struct wal_dbg_peer_stats {
  1612. /* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
  1613. __le32 dummy;
  1614. } __packed;
  1615. struct wal_dbg_stats {
  1616. struct wal_dbg_tx_stats tx;
  1617. struct wal_dbg_rx_stats rx;
  1618. struct wal_dbg_peer_stats peer;
  1619. } __packed;
  1620. enum wmi_stats_id {
  1621. WMI_REQUEST_PEER_STAT = 0x01,
  1622. WMI_REQUEST_AP_STAT = 0x02
  1623. };
  1624. struct wmi_request_stats_cmd {
  1625. __le32 stats_id;
  1626. /*
  1627. * Space to add parameters like
  1628. * peer mac addr
  1629. */
  1630. } __packed;
  1631. /* Suspend option */
  1632. enum {
  1633. /* suspend */
  1634. WMI_PDEV_SUSPEND,
  1635. /* suspend and disable all interrupts */
  1636. WMI_PDEV_SUSPEND_AND_DISABLE_INTR,
  1637. };
  1638. struct wmi_pdev_suspend_cmd {
  1639. /* suspend option sent to target */
  1640. __le32 suspend_opt;
  1641. } __packed;
  1642. struct wmi_stats_event {
  1643. __le32 stats_id; /* %WMI_REQUEST_ */
  1644. /*
  1645. * number of pdev stats event structures
  1646. * (wmi_pdev_stats) 0 or 1
  1647. */
  1648. __le32 num_pdev_stats;
  1649. /*
  1650. * number of vdev stats event structures
  1651. * (wmi_vdev_stats) 0 or max vdevs
  1652. */
  1653. __le32 num_vdev_stats;
  1654. /*
  1655. * number of peer stats event structures
  1656. * (wmi_peer_stats) 0 or max peers
  1657. */
  1658. __le32 num_peer_stats;
  1659. __le32 num_bcnflt_stats;
  1660. /*
  1661. * followed by
  1662. * num_pdev_stats * size of(struct wmi_pdev_stats)
  1663. * num_vdev_stats * size of(struct wmi_vdev_stats)
  1664. * num_peer_stats * size of(struct wmi_peer_stats)
  1665. *
  1666. * By having a zero sized array, the pointer to data area
  1667. * becomes available without increasing the struct size
  1668. */
  1669. u8 data[0];
  1670. } __packed;
  1671. /*
  1672. * PDEV statistics
  1673. * TODO: add all PDEV stats here
  1674. */
  1675. struct wmi_pdev_stats {
  1676. __le32 chan_nf; /* Channel noise floor */
  1677. __le32 tx_frame_count; /* TX frame count */
  1678. __le32 rx_frame_count; /* RX frame count */
  1679. __le32 rx_clear_count; /* rx clear count */
  1680. __le32 cycle_count; /* cycle count */
  1681. __le32 phy_err_count; /* Phy error count */
  1682. __le32 chan_tx_pwr; /* channel tx power */
  1683. struct wal_dbg_stats wal; /* WAL dbg stats */
  1684. } __packed;
  1685. /*
  1686. * VDEV statistics
  1687. * TODO: add all VDEV stats here
  1688. */
  1689. struct wmi_vdev_stats {
  1690. __le32 vdev_id;
  1691. } __packed;
  1692. /*
  1693. * peer statistics.
  1694. * TODO: add more stats
  1695. */
  1696. struct wmi_peer_stats {
  1697. struct wmi_mac_addr peer_macaddr;
  1698. __le32 peer_rssi;
  1699. __le32 peer_tx_rate;
  1700. } __packed;
  1701. struct wmi_vdev_create_cmd {
  1702. __le32 vdev_id;
  1703. __le32 vdev_type;
  1704. __le32 vdev_subtype;
  1705. struct wmi_mac_addr vdev_macaddr;
  1706. } __packed;
  1707. enum wmi_vdev_type {
  1708. WMI_VDEV_TYPE_AP = 1,
  1709. WMI_VDEV_TYPE_STA = 2,
  1710. WMI_VDEV_TYPE_IBSS = 3,
  1711. WMI_VDEV_TYPE_MONITOR = 4,
  1712. };
  1713. enum wmi_vdev_subtype {
  1714. WMI_VDEV_SUBTYPE_NONE = 0,
  1715. WMI_VDEV_SUBTYPE_P2P_DEVICE = 1,
  1716. WMI_VDEV_SUBTYPE_P2P_CLIENT = 2,
  1717. WMI_VDEV_SUBTYPE_P2P_GO = 3,
  1718. };
  1719. /* values for vdev_subtype */
  1720. /* values for vdev_start_request flags */
  1721. /*
  1722. * Indicates that AP VDEV uses hidden ssid. only valid for
  1723. * AP/GO */
  1724. #define WMI_VDEV_START_HIDDEN_SSID (1<<0)
  1725. /*
  1726. * Indicates if robust management frame/management frame
  1727. * protection is enabled. For GO/AP vdevs, it indicates that
  1728. * it may support station/client associations with RMF enabled.
  1729. * For STA/client vdevs, it indicates that sta will
  1730. * associate with AP with RMF enabled. */
  1731. #define WMI_VDEV_START_PMF_ENABLED (1<<1)
  1732. struct wmi_p2p_noa_descriptor {
  1733. __le32 type_count; /* 255: continuous schedule, 0: reserved */
  1734. __le32 duration; /* Absent period duration in micro seconds */
  1735. __le32 interval; /* Absent period interval in micro seconds */
  1736. __le32 start_time; /* 32 bit tsf time when in starts */
  1737. } __packed;
  1738. struct wmi_vdev_start_request_cmd {
  1739. /* WMI channel */
  1740. struct wmi_channel chan;
  1741. /* unique id identifying the VDEV, generated by the caller */
  1742. __le32 vdev_id;
  1743. /* requestor id identifying the caller module */
  1744. __le32 requestor_id;
  1745. /* beacon interval from received beacon */
  1746. __le32 beacon_interval;
  1747. /* DTIM Period from the received beacon */
  1748. __le32 dtim_period;
  1749. /* Flags */
  1750. __le32 flags;
  1751. /* ssid field. Only valid for AP/GO/IBSS/BTAmp VDEV type. */
  1752. struct wmi_ssid ssid;
  1753. /* beacon/probe reponse xmit rate. Applicable for SoftAP. */
  1754. __le32 bcn_tx_rate;
  1755. /* beacon/probe reponse xmit power. Applicable for SoftAP. */
  1756. __le32 bcn_tx_power;
  1757. /* number of p2p NOA descriptor(s) from scan entry */
  1758. __le32 num_noa_descriptors;
  1759. /*
  1760. * Disable H/W ack. This used by WMI_VDEV_RESTART_REQUEST_CMDID.
  1761. * During CAC, Our HW shouldn't ack ditected frames
  1762. */
  1763. __le32 disable_hw_ack;
  1764. /* actual p2p NOA descriptor from scan entry */
  1765. struct wmi_p2p_noa_descriptor noa_descriptors[2];
  1766. } __packed;
  1767. struct wmi_vdev_restart_request_cmd {
  1768. struct wmi_vdev_start_request_cmd vdev_start_request_cmd;
  1769. } __packed;
  1770. struct wmi_vdev_start_request_arg {
  1771. u32 vdev_id;
  1772. struct wmi_channel_arg channel;
  1773. u32 bcn_intval;
  1774. u32 dtim_period;
  1775. u8 *ssid;
  1776. u32 ssid_len;
  1777. u32 bcn_tx_rate;
  1778. u32 bcn_tx_power;
  1779. bool disable_hw_ack;
  1780. bool hidden_ssid;
  1781. bool pmf_enabled;
  1782. };
  1783. struct wmi_vdev_delete_cmd {
  1784. /* unique id identifying the VDEV, generated by the caller */
  1785. __le32 vdev_id;
  1786. } __packed;
  1787. struct wmi_vdev_up_cmd {
  1788. __le32 vdev_id;
  1789. __le32 vdev_assoc_id;
  1790. struct wmi_mac_addr vdev_bssid;
  1791. } __packed;
  1792. struct wmi_vdev_stop_cmd {
  1793. __le32 vdev_id;
  1794. } __packed;
  1795. struct wmi_vdev_down_cmd {
  1796. __le32 vdev_id;
  1797. } __packed;
  1798. struct wmi_vdev_standby_response_cmd {
  1799. /* unique id identifying the VDEV, generated by the caller */
  1800. __le32 vdev_id;
  1801. } __packed;
  1802. struct wmi_vdev_resume_response_cmd {
  1803. /* unique id identifying the VDEV, generated by the caller */
  1804. __le32 vdev_id;
  1805. } __packed;
  1806. struct wmi_vdev_set_param_cmd {
  1807. __le32 vdev_id;
  1808. __le32 param_id;
  1809. __le32 param_value;
  1810. } __packed;
  1811. #define WMI_MAX_KEY_INDEX 3
  1812. #define WMI_MAX_KEY_LEN 32
  1813. #define WMI_KEY_PAIRWISE 0x00
  1814. #define WMI_KEY_GROUP 0x01
  1815. #define WMI_KEY_TX_USAGE 0x02 /* default tx key - static wep */
  1816. struct wmi_key_seq_counter {
  1817. __le32 key_seq_counter_l;
  1818. __le32 key_seq_counter_h;
  1819. } __packed;
  1820. #define WMI_CIPHER_NONE 0x0 /* clear key */
  1821. #define WMI_CIPHER_WEP 0x1
  1822. #define WMI_CIPHER_TKIP 0x2
  1823. #define WMI_CIPHER_AES_OCB 0x3
  1824. #define WMI_CIPHER_AES_CCM 0x4
  1825. #define WMI_CIPHER_WAPI 0x5
  1826. #define WMI_CIPHER_CKIP 0x6
  1827. #define WMI_CIPHER_AES_CMAC 0x7
  1828. struct wmi_vdev_install_key_cmd {
  1829. __le32 vdev_id;
  1830. struct wmi_mac_addr peer_macaddr;
  1831. __le32 key_idx;
  1832. __le32 key_flags;
  1833. __le32 key_cipher; /* %WMI_CIPHER_ */
  1834. struct wmi_key_seq_counter key_rsc_counter;
  1835. struct wmi_key_seq_counter key_global_rsc_counter;
  1836. struct wmi_key_seq_counter key_tsc_counter;
  1837. u8 wpi_key_rsc_counter[16];
  1838. u8 wpi_key_tsc_counter[16];
  1839. __le32 key_len;
  1840. __le32 key_txmic_len;
  1841. __le32 key_rxmic_len;
  1842. /* contains key followed by tx mic followed by rx mic */
  1843. u8 key_data[0];
  1844. } __packed;
  1845. struct wmi_vdev_install_key_arg {
  1846. u32 vdev_id;
  1847. const u8 *macaddr;
  1848. u32 key_idx;
  1849. u32 key_flags;
  1850. u32 key_cipher;
  1851. u32 key_len;
  1852. u32 key_txmic_len;
  1853. u32 key_rxmic_len;
  1854. const void *key_data;
  1855. };
  1856. /* Preamble types to be used with VDEV fixed rate configuration */
  1857. enum wmi_rate_preamble {
  1858. WMI_RATE_PREAMBLE_OFDM,
  1859. WMI_RATE_PREAMBLE_CCK,
  1860. WMI_RATE_PREAMBLE_HT,
  1861. WMI_RATE_PREAMBLE_VHT,
  1862. };
  1863. /* Value to disable fixed rate setting */
  1864. #define WMI_FIXED_RATE_NONE (0xff)
  1865. /* the definition of different VDEV parameters */
  1866. enum wmi_vdev_param {
  1867. /* RTS Threshold */
  1868. WMI_VDEV_PARAM_RTS_THRESHOLD = 0x1,
  1869. /* Fragmentation threshold */
  1870. WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
  1871. /* beacon interval in TUs */
  1872. WMI_VDEV_PARAM_BEACON_INTERVAL,
  1873. /* Listen interval in TUs */
  1874. WMI_VDEV_PARAM_LISTEN_INTERVAL,
  1875. /* muticast rate in Mbps */
  1876. WMI_VDEV_PARAM_MULTICAST_RATE,
  1877. /* management frame rate in Mbps */
  1878. WMI_VDEV_PARAM_MGMT_TX_RATE,
  1879. /* slot time (long vs short) */
  1880. WMI_VDEV_PARAM_SLOT_TIME,
  1881. /* preamble (long vs short) */
  1882. WMI_VDEV_PARAM_PREAMBLE,
  1883. /* SWBA time (time before tbtt in msec) */
  1884. WMI_VDEV_PARAM_SWBA_TIME,
  1885. /* time period for updating VDEV stats */
  1886. WMI_VDEV_STATS_UPDATE_PERIOD,
  1887. /* age out time in msec for frames queued for station in power save */
  1888. WMI_VDEV_PWRSAVE_AGEOUT_TIME,
  1889. /*
  1890. * Host SWBA interval (time in msec before tbtt for SWBA event
  1891. * generation).
  1892. */
  1893. WMI_VDEV_HOST_SWBA_INTERVAL,
  1894. /* DTIM period (specified in units of num beacon intervals) */
  1895. WMI_VDEV_PARAM_DTIM_PERIOD,
  1896. /*
  1897. * scheduler air time limit for this VDEV. used by off chan
  1898. * scheduler.
  1899. */
  1900. WMI_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
  1901. /* enable/dsiable WDS for this VDEV */
  1902. WMI_VDEV_PARAM_WDS,
  1903. /* ATIM Window */
  1904. WMI_VDEV_PARAM_ATIM_WINDOW,
  1905. /* BMISS max */
  1906. WMI_VDEV_PARAM_BMISS_COUNT_MAX,
  1907. /* BMISS first time */
  1908. WMI_VDEV_PARAM_BMISS_FIRST_BCNT,
  1909. /* BMISS final time */
  1910. WMI_VDEV_PARAM_BMISS_FINAL_BCNT,
  1911. /* WMM enables/disabled */
  1912. WMI_VDEV_PARAM_FEATURE_WMM,
  1913. /* Channel width */
  1914. WMI_VDEV_PARAM_CHWIDTH,
  1915. /* Channel Offset */
  1916. WMI_VDEV_PARAM_CHEXTOFFSET,
  1917. /* Disable HT Protection */
  1918. WMI_VDEV_PARAM_DISABLE_HTPROTECTION,
  1919. /* Quick STA Kickout */
  1920. WMI_VDEV_PARAM_STA_QUICKKICKOUT,
  1921. /* Rate to be used with Management frames */
  1922. WMI_VDEV_PARAM_MGMT_RATE,
  1923. /* Protection Mode */
  1924. WMI_VDEV_PARAM_PROTECTION_MODE,
  1925. /* Fixed rate setting */
  1926. WMI_VDEV_PARAM_FIXED_RATE,
  1927. /* Short GI Enable/Disable */
  1928. WMI_VDEV_PARAM_SGI,
  1929. /* Enable LDPC */
  1930. WMI_VDEV_PARAM_LDPC,
  1931. /* Enable Tx STBC */
  1932. WMI_VDEV_PARAM_TX_STBC,
  1933. /* Enable Rx STBC */
  1934. WMI_VDEV_PARAM_RX_STBC,
  1935. /* Intra BSS forwarding */
  1936. WMI_VDEV_PARAM_INTRA_BSS_FWD,
  1937. /* Setting Default xmit key for Vdev */
  1938. WMI_VDEV_PARAM_DEF_KEYID,
  1939. /* NSS width */
  1940. WMI_VDEV_PARAM_NSS,
  1941. /* Set the custom rate for the broadcast data frames */
  1942. WMI_VDEV_PARAM_BCAST_DATA_RATE,
  1943. /* Set the custom rate (rate-code) for multicast data frames */
  1944. WMI_VDEV_PARAM_MCAST_DATA_RATE,
  1945. /* Tx multicast packet indicate Enable/Disable */
  1946. WMI_VDEV_PARAM_MCAST_INDICATE,
  1947. /* Tx DHCP packet indicate Enable/Disable */
  1948. WMI_VDEV_PARAM_DHCP_INDICATE,
  1949. /* Enable host inspection of Tx unicast packet to unknown destination */
  1950. WMI_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
  1951. /* The minimum amount of time AP begins to consider STA inactive */
  1952. WMI_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
  1953. /*
  1954. * An associated STA is considered inactive when there is no recent
  1955. * TX/RX activity and no downlink frames are buffered for it. Once a
  1956. * STA exceeds the maximum idle inactive time, the AP will send an
  1957. * 802.11 data-null as a keep alive to verify the STA is still
  1958. * associated. If the STA does ACK the data-null, or if the data-null
  1959. * is buffered and the STA does not retrieve it, the STA will be
  1960. * considered unresponsive
  1961. * (see WMI_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
  1962. */
  1963. WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
  1964. /*
  1965. * An associated STA is considered unresponsive if there is no recent
  1966. * TX/RX activity and downlink frames are buffered for it. Once a STA
  1967. * exceeds the maximum unresponsive time, the AP will send a
  1968. * WMI_STA_KICKOUT event to the host so the STA can be deleted. */
  1969. WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
  1970. /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
  1971. WMI_VDEV_PARAM_AP_ENABLE_NAWDS,
  1972. /* Enable/Disable RTS-CTS */
  1973. WMI_VDEV_PARAM_ENABLE_RTSCTS,
  1974. /* Enable TXBFee/er */
  1975. WMI_VDEV_PARAM_TXBF,
  1976. /* Set packet power save */
  1977. WMI_VDEV_PARAM_PACKET_POWERSAVE,
  1978. /*
  1979. * Drops un-encrypted packets if eceived in an encrypted connection
  1980. * otherwise forwards to host.
  1981. */
  1982. WMI_VDEV_PARAM_DROP_UNENCRY,
  1983. /*
  1984. * Set the encapsulation type for frames.
  1985. */
  1986. WMI_VDEV_PARAM_TX_ENCAP_TYPE,
  1987. };
  1988. /* slot time long */
  1989. #define WMI_VDEV_SLOT_TIME_LONG 0x1
  1990. /* slot time short */
  1991. #define WMI_VDEV_SLOT_TIME_SHORT 0x2
  1992. /* preablbe long */
  1993. #define WMI_VDEV_PREAMBLE_LONG 0x1
  1994. /* preablbe short */
  1995. #define WMI_VDEV_PREAMBLE_SHORT 0x2
  1996. enum wmi_start_event_param {
  1997. WMI_VDEV_RESP_START_EVENT = 0,
  1998. WMI_VDEV_RESP_RESTART_EVENT,
  1999. };
  2000. struct wmi_vdev_start_response_event {
  2001. __le32 vdev_id;
  2002. __le32 req_id;
  2003. __le32 resp_type; /* %WMI_VDEV_RESP_ */
  2004. __le32 status;
  2005. } __packed;
  2006. struct wmi_vdev_standby_req_event {
  2007. /* unique id identifying the VDEV, generated by the caller */
  2008. __le32 vdev_id;
  2009. } __packed;
  2010. struct wmi_vdev_resume_req_event {
  2011. /* unique id identifying the VDEV, generated by the caller */
  2012. __le32 vdev_id;
  2013. } __packed;
  2014. struct wmi_vdev_stopped_event {
  2015. /* unique id identifying the VDEV, generated by the caller */
  2016. __le32 vdev_id;
  2017. } __packed;
  2018. /*
  2019. * common structure used for simple events
  2020. * (stopped, resume_req, standby response)
  2021. */
  2022. struct wmi_vdev_simple_event {
  2023. /* unique id identifying the VDEV, generated by the caller */
  2024. __le32 vdev_id;
  2025. } __packed;
  2026. /* VDEV start response status codes */
  2027. /* VDEV succesfully started */
  2028. #define WMI_INIFIED_VDEV_START_RESPONSE_STATUS_SUCCESS 0x0
  2029. /* requested VDEV not found */
  2030. #define WMI_INIFIED_VDEV_START_RESPONSE_INVALID_VDEVID 0x1
  2031. /* unsupported VDEV combination */
  2032. #define WMI_INIFIED_VDEV_START_RESPONSE_NOT_SUPPORTED 0x2
  2033. /* Beacon processing related command and event structures */
  2034. struct wmi_bcn_tx_hdr {
  2035. __le32 vdev_id;
  2036. __le32 tx_rate;
  2037. __le32 tx_power;
  2038. __le32 bcn_len;
  2039. } __packed;
  2040. struct wmi_bcn_tx_cmd {
  2041. struct wmi_bcn_tx_hdr hdr;
  2042. u8 *bcn[0];
  2043. } __packed;
  2044. struct wmi_bcn_tx_arg {
  2045. u32 vdev_id;
  2046. u32 tx_rate;
  2047. u32 tx_power;
  2048. u32 bcn_len;
  2049. const void *bcn;
  2050. };
  2051. /* Beacon filter */
  2052. #define WMI_BCN_FILTER_ALL 0 /* Filter all beacons */
  2053. #define WMI_BCN_FILTER_NONE 1 /* Pass all beacons */
  2054. #define WMI_BCN_FILTER_RSSI 2 /* Pass Beacons RSSI >= RSSI threshold */
  2055. #define WMI_BCN_FILTER_BSSID 3 /* Pass Beacons with matching BSSID */
  2056. #define WMI_BCN_FILTER_SSID 4 /* Pass Beacons with matching SSID */
  2057. struct wmi_bcn_filter_rx_cmd {
  2058. /* Filter ID */
  2059. __le32 bcn_filter_id;
  2060. /* Filter type - wmi_bcn_filter */
  2061. __le32 bcn_filter;
  2062. /* Buffer len */
  2063. __le32 bcn_filter_len;
  2064. /* Filter info (threshold, BSSID, RSSI) */
  2065. u8 *bcn_filter_buf;
  2066. } __packed;
  2067. /* Capabilities and IEs to be passed to firmware */
  2068. struct wmi_bcn_prb_info {
  2069. /* Capabilities */
  2070. __le32 caps;
  2071. /* ERP info */
  2072. __le32 erp;
  2073. /* Advanced capabilities */
  2074. /* HT capabilities */
  2075. /* HT Info */
  2076. /* ibss_dfs */
  2077. /* wpa Info */
  2078. /* rsn Info */
  2079. /* rrm info */
  2080. /* ath_ext */
  2081. /* app IE */
  2082. } __packed;
  2083. struct wmi_bcn_tmpl_cmd {
  2084. /* unique id identifying the VDEV, generated by the caller */
  2085. __le32 vdev_id;
  2086. /* TIM IE offset from the beginning of the template. */
  2087. __le32 tim_ie_offset;
  2088. /* beacon probe capabilities and IEs */
  2089. struct wmi_bcn_prb_info bcn_prb_info;
  2090. /* beacon buffer length */
  2091. __le32 buf_len;
  2092. /* variable length data */
  2093. u8 data[1];
  2094. } __packed;
  2095. struct wmi_prb_tmpl_cmd {
  2096. /* unique id identifying the VDEV, generated by the caller */
  2097. __le32 vdev_id;
  2098. /* beacon probe capabilities and IEs */
  2099. struct wmi_bcn_prb_info bcn_prb_info;
  2100. /* beacon buffer length */
  2101. __le32 buf_len;
  2102. /* Variable length data */
  2103. u8 data[1];
  2104. } __packed;
  2105. enum wmi_sta_ps_mode {
  2106. /* enable power save for the given STA VDEV */
  2107. WMI_STA_PS_MODE_DISABLED = 0,
  2108. /* disable power save for a given STA VDEV */
  2109. WMI_STA_PS_MODE_ENABLED = 1,
  2110. };
  2111. struct wmi_sta_powersave_mode_cmd {
  2112. /* unique id identifying the VDEV, generated by the caller */
  2113. __le32 vdev_id;
  2114. /*
  2115. * Power save mode
  2116. * (see enum wmi_sta_ps_mode)
  2117. */
  2118. __le32 sta_ps_mode;
  2119. } __packed;
  2120. enum wmi_csa_offload_en {
  2121. WMI_CSA_OFFLOAD_DISABLE = 0,
  2122. WMI_CSA_OFFLOAD_ENABLE = 1,
  2123. };
  2124. struct wmi_csa_offload_enable_cmd {
  2125. __le32 vdev_id;
  2126. __le32 csa_offload_enable;
  2127. } __packed;
  2128. struct wmi_csa_offload_chanswitch_cmd {
  2129. __le32 vdev_id;
  2130. struct wmi_channel chan;
  2131. } __packed;
  2132. /*
  2133. * This parameter controls the policy for retrieving frames from AP while the
  2134. * STA is in sleep state.
  2135. *
  2136. * Only takes affect if the sta_ps_mode is enabled
  2137. */
  2138. enum wmi_sta_ps_param_rx_wake_policy {
  2139. /*
  2140. * Wake up when ever there is an RX activity on the VDEV. In this mode
  2141. * the Power save SM(state machine) will come out of sleep by either
  2142. * sending null frame (or) a data frame (with PS==0) in response to TIM
  2143. * bit set in the received beacon frame from AP.
  2144. */
  2145. WMI_STA_PS_RX_WAKE_POLICY_WAKE = 0,
  2146. /*
  2147. * Here the power save state machine will not wakeup in response to TIM
  2148. * bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD
  2149. * configuration setup by WMISET_PS_SET_UAPSD WMI command. When all
  2150. * access categories are delivery-enabled, the station will send a
  2151. * UAPSD trigger frame, otherwise it will send a PS-Poll.
  2152. */
  2153. WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1,
  2154. };
  2155. /*
  2156. * Number of tx frames/beacon that cause the power save SM to wake up.
  2157. *
  2158. * Value 1 causes the SM to wake up for every TX. Value 0 has a special
  2159. * meaning, It will cause the SM to never wake up. This is useful if you want
  2160. * to keep the system to sleep all the time for some kind of test mode . host
  2161. * can change this parameter any time. It will affect at the next tx frame.
  2162. */
  2163. enum wmi_sta_ps_param_tx_wake_threshold {
  2164. WMI_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0,
  2165. WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1,
  2166. /*
  2167. * Values greater than one indicate that many TX attempts per beacon
  2168. * interval before the STA will wake up
  2169. */
  2170. };
  2171. /*
  2172. * The maximum number of PS-Poll frames the FW will send in response to
  2173. * traffic advertised in TIM before waking up (by sending a null frame with PS
  2174. * = 0). Value 0 has a special meaning: there is no maximum count and the FW
  2175. * will send as many PS-Poll as are necessary to retrieve buffered BU. This
  2176. * parameter is used when the RX wake policy is
  2177. * WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD and ignored when the RX wake
  2178. * policy is WMI_STA_PS_RX_WAKE_POLICY_WAKE.
  2179. */
  2180. enum wmi_sta_ps_param_pspoll_count {
  2181. WMI_STA_PS_PSPOLL_COUNT_NO_MAX = 0,
  2182. /*
  2183. * Values greater than 0 indicate the maximum numer of PS-Poll frames
  2184. * FW will send before waking up.
  2185. */
  2186. };
  2187. /*
  2188. * This will include the delivery and trigger enabled state for every AC.
  2189. * This is the negotiated state with AP. The host MLME needs to set this based
  2190. * on AP capability and the state Set in the association request by the
  2191. * station MLME.Lower 8 bits of the value specify the UAPSD configuration.
  2192. */
  2193. #define WMI_UAPSD_AC_TYPE_DELI 0
  2194. #define WMI_UAPSD_AC_TYPE_TRIG 1
  2195. #define WMI_UAPSD_AC_BIT_MASK(ac, type) \
  2196. ((type == WMI_UAPSD_AC_TYPE_DELI) ? (1<<(ac<<1)) : (1<<((ac<<1)+1)))
  2197. enum wmi_sta_ps_param_uapsd {
  2198. WMI_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
  2199. WMI_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
  2200. WMI_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
  2201. WMI_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
  2202. WMI_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
  2203. WMI_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
  2204. WMI_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
  2205. WMI_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
  2206. };
  2207. enum wmi_sta_powersave_param {
  2208. /*
  2209. * Controls how frames are retrievd from AP while STA is sleeping
  2210. *
  2211. * (see enum wmi_sta_ps_param_rx_wake_policy)
  2212. */
  2213. WMI_STA_PS_PARAM_RX_WAKE_POLICY = 0,
  2214. /*
  2215. * The STA will go active after this many TX
  2216. *
  2217. * (see enum wmi_sta_ps_param_tx_wake_threshold)
  2218. */
  2219. WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
  2220. /*
  2221. * Number of PS-Poll to send before STA wakes up
  2222. *
  2223. * (see enum wmi_sta_ps_param_pspoll_count)
  2224. *
  2225. */
  2226. WMI_STA_PS_PARAM_PSPOLL_COUNT = 2,
  2227. /*
  2228. * TX/RX inactivity time in msec before going to sleep.
  2229. *
  2230. * The power save SM will monitor tx/rx activity on the VDEV, if no
  2231. * activity for the specified msec of the parameter the Power save
  2232. * SM will go to sleep.
  2233. */
  2234. WMI_STA_PS_PARAM_INACTIVITY_TIME = 3,
  2235. /*
  2236. * Set uapsd configuration.
  2237. *
  2238. * (see enum wmi_sta_ps_param_uapsd)
  2239. */
  2240. WMI_STA_PS_PARAM_UAPSD = 4,
  2241. };
  2242. struct wmi_sta_powersave_param_cmd {
  2243. __le32 vdev_id;
  2244. __le32 param_id; /* %WMI_STA_PS_PARAM_ */
  2245. __le32 param_value;
  2246. } __packed;
  2247. /* No MIMO power save */
  2248. #define WMI_STA_MIMO_PS_MODE_DISABLE
  2249. /* mimo powersave mode static*/
  2250. #define WMI_STA_MIMO_PS_MODE_STATIC
  2251. /* mimo powersave mode dynamic */
  2252. #define WMI_STA_MIMO_PS_MODE_DYNAMIC
  2253. struct wmi_sta_mimo_ps_mode_cmd {
  2254. /* unique id identifying the VDEV, generated by the caller */
  2255. __le32 vdev_id;
  2256. /* mimo powersave mode as defined above */
  2257. __le32 mimo_pwrsave_mode;
  2258. } __packed;
  2259. /* U-APSD configuration of peer station from (re)assoc request and TSPECs */
  2260. enum wmi_ap_ps_param_uapsd {
  2261. WMI_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
  2262. WMI_AP_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
  2263. WMI_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
  2264. WMI_AP_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
  2265. WMI_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
  2266. WMI_AP_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
  2267. WMI_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
  2268. WMI_AP_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
  2269. };
  2270. /* U-APSD maximum service period of peer station */
  2271. enum wmi_ap_ps_peer_param_max_sp {
  2272. WMI_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0,
  2273. WMI_AP_PS_PEER_PARAM_MAX_SP_2 = 1,
  2274. WMI_AP_PS_PEER_PARAM_MAX_SP_4 = 2,
  2275. WMI_AP_PS_PEER_PARAM_MAX_SP_6 = 3,
  2276. MAX_WMI_AP_PS_PEER_PARAM_MAX_SP,
  2277. };
  2278. /*
  2279. * AP power save parameter
  2280. * Set a power save specific parameter for a peer station
  2281. */
  2282. enum wmi_ap_ps_peer_param {
  2283. /* Set uapsd configuration for a given peer.
  2284. *
  2285. * Include the delivery and trigger enabled state for every AC.
  2286. * The host MLME needs to set this based on AP capability and stations
  2287. * request Set in the association request received from the station.
  2288. *
  2289. * Lower 8 bits of the value specify the UAPSD configuration.
  2290. *
  2291. * (see enum wmi_ap_ps_param_uapsd)
  2292. * The default value is 0.
  2293. */
  2294. WMI_AP_PS_PEER_PARAM_UAPSD = 0,
  2295. /*
  2296. * Set the service period for a UAPSD capable station
  2297. *
  2298. * The service period from wme ie in the (re)assoc request frame.
  2299. *
  2300. * (see enum wmi_ap_ps_peer_param_max_sp)
  2301. */
  2302. WMI_AP_PS_PEER_PARAM_MAX_SP = 1,
  2303. /* Time in seconds for aging out buffered frames for STA in PS */
  2304. WMI_AP_PS_PEER_PARAM_AGEOUT_TIME = 2,
  2305. };
  2306. struct wmi_ap_ps_peer_cmd {
  2307. /* unique id identifying the VDEV, generated by the caller */
  2308. __le32 vdev_id;
  2309. /* peer MAC address */
  2310. struct wmi_mac_addr peer_macaddr;
  2311. /* AP powersave param (see enum wmi_ap_ps_peer_param) */
  2312. __le32 param_id;
  2313. /* AP powersave param value */
  2314. __le32 param_value;
  2315. } __packed;
  2316. /* 128 clients = 4 words */
  2317. #define WMI_TIM_BITMAP_ARRAY_SIZE 4
  2318. struct wmi_tim_info {
  2319. __le32 tim_len;
  2320. __le32 tim_mcast;
  2321. __le32 tim_bitmap[WMI_TIM_BITMAP_ARRAY_SIZE];
  2322. __le32 tim_changed;
  2323. __le32 tim_num_ps_pending;
  2324. } __packed;
  2325. /* Maximum number of NOA Descriptors supported */
  2326. #define WMI_P2P_MAX_NOA_DESCRIPTORS 4
  2327. #define WMI_P2P_OPPPS_ENABLE_BIT BIT(0)
  2328. #define WMI_P2P_OPPPS_CTWINDOW_OFFSET 1
  2329. #define WMI_P2P_NOA_CHANGED_BIT BIT(0)
  2330. struct wmi_p2p_noa_info {
  2331. /* Bit 0 - Flag to indicate an update in NOA schedule
  2332. Bits 7-1 - Reserved */
  2333. u8 changed;
  2334. /* NOA index */
  2335. u8 index;
  2336. /* Bit 0 - Opp PS state of the AP
  2337. Bits 1-7 - Ctwindow in TUs */
  2338. u8 ctwindow_oppps;
  2339. /* Number of NOA descriptors */
  2340. u8 num_descriptors;
  2341. struct wmi_p2p_noa_descriptor descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS];
  2342. } __packed;
  2343. struct wmi_bcn_info {
  2344. struct wmi_tim_info tim_info;
  2345. struct wmi_p2p_noa_info p2p_noa_info;
  2346. } __packed;
  2347. struct wmi_host_swba_event {
  2348. __le32 vdev_map;
  2349. struct wmi_bcn_info bcn_info[1];
  2350. } __packed;
  2351. #define WMI_MAX_AP_VDEV 16
  2352. struct wmi_tbtt_offset_event {
  2353. __le32 vdev_map;
  2354. __le32 tbttoffset_list[WMI_MAX_AP_VDEV];
  2355. } __packed;
  2356. struct wmi_peer_create_cmd {
  2357. __le32 vdev_id;
  2358. struct wmi_mac_addr peer_macaddr;
  2359. } __packed;
  2360. struct wmi_peer_delete_cmd {
  2361. __le32 vdev_id;
  2362. struct wmi_mac_addr peer_macaddr;
  2363. } __packed;
  2364. struct wmi_peer_flush_tids_cmd {
  2365. __le32 vdev_id;
  2366. struct wmi_mac_addr peer_macaddr;
  2367. __le32 peer_tid_bitmap;
  2368. } __packed;
  2369. struct wmi_fixed_rate {
  2370. /*
  2371. * rate mode . 0: disable fixed rate (auto rate)
  2372. * 1: legacy (non 11n) rate specified as ieee rate 2*Mbps
  2373. * 2: ht20 11n rate specified as mcs index
  2374. * 3: ht40 11n rate specified as mcs index
  2375. */
  2376. __le32 rate_mode;
  2377. /*
  2378. * 4 rate values for 4 rate series. series 0 is stored in byte 0 (LSB)
  2379. * and series 3 is stored at byte 3 (MSB)
  2380. */
  2381. __le32 rate_series;
  2382. /*
  2383. * 4 retry counts for 4 rate series. retry count for rate 0 is stored
  2384. * in byte 0 (LSB) and retry count for rate 3 is stored at byte 3
  2385. * (MSB)
  2386. */
  2387. __le32 rate_retries;
  2388. } __packed;
  2389. struct wmi_peer_fixed_rate_cmd {
  2390. /* unique id identifying the VDEV, generated by the caller */
  2391. __le32 vdev_id;
  2392. /* peer MAC address */
  2393. struct wmi_mac_addr peer_macaddr;
  2394. /* fixed rate */
  2395. struct wmi_fixed_rate peer_fixed_rate;
  2396. } __packed;
  2397. #define WMI_MGMT_TID 17
  2398. struct wmi_addba_clear_resp_cmd {
  2399. /* unique id identifying the VDEV, generated by the caller */
  2400. __le32 vdev_id;
  2401. /* peer MAC address */
  2402. struct wmi_mac_addr peer_macaddr;
  2403. } __packed;
  2404. struct wmi_addba_send_cmd {
  2405. /* unique id identifying the VDEV, generated by the caller */
  2406. __le32 vdev_id;
  2407. /* peer MAC address */
  2408. struct wmi_mac_addr peer_macaddr;
  2409. /* Tid number */
  2410. __le32 tid;
  2411. /* Buffer/Window size*/
  2412. __le32 buffersize;
  2413. } __packed;
  2414. struct wmi_delba_send_cmd {
  2415. /* unique id identifying the VDEV, generated by the caller */
  2416. __le32 vdev_id;
  2417. /* peer MAC address */
  2418. struct wmi_mac_addr peer_macaddr;
  2419. /* Tid number */
  2420. __le32 tid;
  2421. /* Is Initiator */
  2422. __le32 initiator;
  2423. /* Reason code */
  2424. __le32 reasoncode;
  2425. } __packed;
  2426. struct wmi_addba_setresponse_cmd {
  2427. /* unique id identifying the vdev, generated by the caller */
  2428. __le32 vdev_id;
  2429. /* peer mac address */
  2430. struct wmi_mac_addr peer_macaddr;
  2431. /* Tid number */
  2432. __le32 tid;
  2433. /* status code */
  2434. __le32 statuscode;
  2435. } __packed;
  2436. struct wmi_send_singleamsdu_cmd {
  2437. /* unique id identifying the vdev, generated by the caller */
  2438. __le32 vdev_id;
  2439. /* peer mac address */
  2440. struct wmi_mac_addr peer_macaddr;
  2441. /* Tid number */
  2442. __le32 tid;
  2443. } __packed;
  2444. enum wmi_peer_smps_state {
  2445. WMI_PEER_SMPS_PS_NONE = 0x0,
  2446. WMI_PEER_SMPS_STATIC = 0x1,
  2447. WMI_PEER_SMPS_DYNAMIC = 0x2
  2448. };
  2449. enum wmi_peer_param {
  2450. WMI_PEER_SMPS_STATE = 0x1, /* see %wmi_peer_smps_state */
  2451. WMI_PEER_AMPDU = 0x2,
  2452. WMI_PEER_AUTHORIZE = 0x3,
  2453. WMI_PEER_CHAN_WIDTH = 0x4,
  2454. WMI_PEER_NSS = 0x5,
  2455. WMI_PEER_USE_4ADDR = 0x6
  2456. };
  2457. struct wmi_peer_set_param_cmd {
  2458. __le32 vdev_id;
  2459. struct wmi_mac_addr peer_macaddr;
  2460. __le32 param_id;
  2461. __le32 param_value;
  2462. } __packed;
  2463. #define MAX_SUPPORTED_RATES 128
  2464. struct wmi_rate_set {
  2465. /* total number of rates */
  2466. __le32 num_rates;
  2467. /*
  2468. * rates (each 8bit value) packed into a 32 bit word.
  2469. * the rates are filled from least significant byte to most
  2470. * significant byte.
  2471. */
  2472. __le32 rates[(MAX_SUPPORTED_RATES/4)+1];
  2473. } __packed;
  2474. struct wmi_rate_set_arg {
  2475. unsigned int num_rates;
  2476. u8 rates[MAX_SUPPORTED_RATES];
  2477. };
  2478. /*
  2479. * NOTE: It would bea good idea to represent the Tx MCS
  2480. * info in one word and Rx in another word. This is split
  2481. * into multiple words for convenience
  2482. */
  2483. struct wmi_vht_rate_set {
  2484. __le32 rx_max_rate; /* Max Rx data rate */
  2485. __le32 rx_mcs_set; /* Negotiated RX VHT rates */
  2486. __le32 tx_max_rate; /* Max Tx data rate */
  2487. __le32 tx_mcs_set; /* Negotiated TX VHT rates */
  2488. } __packed;
  2489. struct wmi_vht_rate_set_arg {
  2490. u32 rx_max_rate;
  2491. u32 rx_mcs_set;
  2492. u32 tx_max_rate;
  2493. u32 tx_mcs_set;
  2494. };
  2495. struct wmi_peer_set_rates_cmd {
  2496. /* peer MAC address */
  2497. struct wmi_mac_addr peer_macaddr;
  2498. /* legacy rate set */
  2499. struct wmi_rate_set peer_legacy_rates;
  2500. /* ht rate set */
  2501. struct wmi_rate_set peer_ht_rates;
  2502. } __packed;
  2503. struct wmi_peer_set_q_empty_callback_cmd {
  2504. /* unique id identifying the VDEV, generated by the caller */
  2505. __le32 vdev_id;
  2506. /* peer MAC address */
  2507. struct wmi_mac_addr peer_macaddr;
  2508. __le32 callback_enable;
  2509. } __packed;
  2510. #define WMI_PEER_AUTH 0x00000001
  2511. #define WMI_PEER_QOS 0x00000002
  2512. #define WMI_PEER_NEED_PTK_4_WAY 0x00000004
  2513. #define WMI_PEER_NEED_GTK_2_WAY 0x00000010
  2514. #define WMI_PEER_APSD 0x00000800
  2515. #define WMI_PEER_HT 0x00001000
  2516. #define WMI_PEER_40MHZ 0x00002000
  2517. #define WMI_PEER_STBC 0x00008000
  2518. #define WMI_PEER_LDPC 0x00010000
  2519. #define WMI_PEER_DYN_MIMOPS 0x00020000
  2520. #define WMI_PEER_STATIC_MIMOPS 0x00040000
  2521. #define WMI_PEER_SPATIAL_MUX 0x00200000
  2522. #define WMI_PEER_VHT 0x02000000
  2523. #define WMI_PEER_80MHZ 0x04000000
  2524. #define WMI_PEER_PMF 0x08000000
  2525. /*
  2526. * Peer rate capabilities.
  2527. *
  2528. * This is of interest to the ratecontrol
  2529. * module which resides in the firmware. The bit definitions are
  2530. * consistent with that defined in if_athrate.c.
  2531. */
  2532. #define WMI_RC_DS_FLAG 0x01
  2533. #define WMI_RC_CW40_FLAG 0x02
  2534. #define WMI_RC_SGI_FLAG 0x04
  2535. #define WMI_RC_HT_FLAG 0x08
  2536. #define WMI_RC_RTSCTS_FLAG 0x10
  2537. #define WMI_RC_TX_STBC_FLAG 0x20
  2538. #define WMI_RC_RX_STBC_FLAG 0xC0
  2539. #define WMI_RC_RX_STBC_FLAG_S 6
  2540. #define WMI_RC_WEP_TKIP_FLAG 0x100
  2541. #define WMI_RC_TS_FLAG 0x200
  2542. #define WMI_RC_UAPSD_FLAG 0x400
  2543. /* Maximum listen interval supported by hw in units of beacon interval */
  2544. #define ATH10K_MAX_HW_LISTEN_INTERVAL 5
  2545. struct wmi_peer_assoc_complete_cmd {
  2546. struct wmi_mac_addr peer_macaddr;
  2547. __le32 vdev_id;
  2548. __le32 peer_new_assoc; /* 1=assoc, 0=reassoc */
  2549. __le32 peer_associd; /* 16 LSBs */
  2550. __le32 peer_flags;
  2551. __le32 peer_caps; /* 16 LSBs */
  2552. __le32 peer_listen_intval;
  2553. __le32 peer_ht_caps;
  2554. __le32 peer_max_mpdu;
  2555. __le32 peer_mpdu_density; /* 0..16 */
  2556. __le32 peer_rate_caps;
  2557. struct wmi_rate_set peer_legacy_rates;
  2558. struct wmi_rate_set peer_ht_rates;
  2559. __le32 peer_nss; /* num of spatial streams */
  2560. __le32 peer_vht_caps;
  2561. __le32 peer_phymode;
  2562. struct wmi_vht_rate_set peer_vht_rates;
  2563. /* HT Operation Element of the peer. Five bytes packed in 2
  2564. * INT32 array and filled from lsb to msb. */
  2565. __le32 peer_ht_info[2];
  2566. } __packed;
  2567. struct wmi_peer_assoc_complete_arg {
  2568. u8 addr[ETH_ALEN];
  2569. u32 vdev_id;
  2570. bool peer_reassoc;
  2571. u16 peer_aid;
  2572. u32 peer_flags; /* see %WMI_PEER_ */
  2573. u16 peer_caps;
  2574. u32 peer_listen_intval;
  2575. u32 peer_ht_caps;
  2576. u32 peer_max_mpdu;
  2577. u32 peer_mpdu_density; /* 0..16 */
  2578. u32 peer_rate_caps; /* see %WMI_RC_ */
  2579. struct wmi_rate_set_arg peer_legacy_rates;
  2580. struct wmi_rate_set_arg peer_ht_rates;
  2581. u32 peer_num_spatial_streams;
  2582. u32 peer_vht_caps;
  2583. enum wmi_phy_mode peer_phymode;
  2584. struct wmi_vht_rate_set_arg peer_vht_rates;
  2585. };
  2586. struct wmi_peer_add_wds_entry_cmd {
  2587. /* peer MAC address */
  2588. struct wmi_mac_addr peer_macaddr;
  2589. /* wds MAC addr */
  2590. struct wmi_mac_addr wds_macaddr;
  2591. } __packed;
  2592. struct wmi_peer_remove_wds_entry_cmd {
  2593. /* wds MAC addr */
  2594. struct wmi_mac_addr wds_macaddr;
  2595. } __packed;
  2596. struct wmi_peer_q_empty_callback_event {
  2597. /* peer MAC address */
  2598. struct wmi_mac_addr peer_macaddr;
  2599. } __packed;
  2600. /*
  2601. * Channel info WMI event
  2602. */
  2603. struct wmi_chan_info_event {
  2604. __le32 err_code;
  2605. __le32 freq;
  2606. __le32 cmd_flags;
  2607. __le32 noise_floor;
  2608. __le32 rx_clear_count;
  2609. __le32 cycle_count;
  2610. } __packed;
  2611. #define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0)
  2612. /* FIXME: empirically extrapolated */
  2613. #define WMI_CHAN_INFO_MSEC(x) ((x) / 76595)
  2614. /* Beacon filter wmi command info */
  2615. #define BCN_FLT_MAX_SUPPORTED_IES 256
  2616. #define BCN_FLT_MAX_ELEMS_IE_LIST (BCN_FLT_MAX_SUPPORTED_IES / 32)
  2617. struct bss_bcn_stats {
  2618. __le32 vdev_id;
  2619. __le32 bss_bcnsdropped;
  2620. __le32 bss_bcnsdelivered;
  2621. } __packed;
  2622. struct bcn_filter_stats {
  2623. __le32 bcns_dropped;
  2624. __le32 bcns_delivered;
  2625. __le32 activefilters;
  2626. struct bss_bcn_stats bss_stats;
  2627. } __packed;
  2628. struct wmi_add_bcn_filter_cmd {
  2629. u32 vdev_id;
  2630. u32 ie_map[BCN_FLT_MAX_ELEMS_IE_LIST];
  2631. } __packed;
  2632. enum wmi_sta_keepalive_method {
  2633. WMI_STA_KEEPALIVE_METHOD_NULL_FRAME = 1,
  2634. WMI_STA_KEEPALIVE_METHOD_UNSOLICITATED_ARP_RESPONSE = 2,
  2635. };
  2636. /* note: ip4 addresses are in network byte order, i.e. big endian */
  2637. struct wmi_sta_keepalive_arp_resp {
  2638. __be32 src_ip4_addr;
  2639. __be32 dest_ip4_addr;
  2640. struct wmi_mac_addr dest_mac_addr;
  2641. } __packed;
  2642. struct wmi_sta_keepalive_cmd {
  2643. __le32 vdev_id;
  2644. __le32 enabled;
  2645. __le32 method; /* WMI_STA_KEEPALIVE_METHOD_ */
  2646. __le32 interval; /* in seconds */
  2647. struct wmi_sta_keepalive_arp_resp arp_resp;
  2648. } __packed;
  2649. enum wmi_force_fw_hang_type {
  2650. WMI_FORCE_FW_HANG_ASSERT = 1,
  2651. WMI_FORCE_FW_HANG_NO_DETECT,
  2652. WMI_FORCE_FW_HANG_CTRL_EP_FULL,
  2653. WMI_FORCE_FW_HANG_EMPTY_POINT,
  2654. WMI_FORCE_FW_HANG_STACK_OVERFLOW,
  2655. WMI_FORCE_FW_HANG_INFINITE_LOOP,
  2656. };
  2657. #define WMI_FORCE_FW_HANG_RANDOM_TIME 0xFFFFFFFF
  2658. struct wmi_force_fw_hang_cmd {
  2659. __le32 type;
  2660. __le32 delay_ms;
  2661. } __packed;
  2662. #define ATH10K_RTS_MAX 2347
  2663. #define ATH10K_FRAGMT_THRESHOLD_MIN 540
  2664. #define ATH10K_FRAGMT_THRESHOLD_MAX 2346
  2665. #define WMI_MAX_EVENT 0x1000
  2666. /* Maximum number of pending TXed WMI packets */
  2667. #define WMI_SKB_HEADROOM sizeof(struct wmi_cmd_hdr)
  2668. /* By default disable power save for IBSS */
  2669. #define ATH10K_DEFAULT_ATIM 0
  2670. struct ath10k;
  2671. struct ath10k_vif;
  2672. int ath10k_wmi_attach(struct ath10k *ar);
  2673. void ath10k_wmi_detach(struct ath10k *ar);
  2674. int ath10k_wmi_wait_for_service_ready(struct ath10k *ar);
  2675. int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar);
  2676. int ath10k_wmi_connect_htc_service(struct ath10k *ar);
  2677. int ath10k_wmi_pdev_set_channel(struct ath10k *ar,
  2678. const struct wmi_channel_arg *);
  2679. int ath10k_wmi_pdev_suspend_target(struct ath10k *ar);
  2680. int ath10k_wmi_pdev_resume_target(struct ath10k *ar);
  2681. int ath10k_wmi_pdev_set_regdomain(struct ath10k *ar, u16 rd, u16 rd2g,
  2682. u16 rd5g, u16 ctl2g, u16 ctl5g);
  2683. int ath10k_wmi_pdev_set_param(struct ath10k *ar, enum wmi_pdev_param id,
  2684. u32 value);
  2685. int ath10k_wmi_cmd_init(struct ath10k *ar);
  2686. int ath10k_wmi_start_scan(struct ath10k *ar, const struct wmi_start_scan_arg *);
  2687. void ath10k_wmi_start_scan_init(struct ath10k *ar, struct wmi_start_scan_arg *);
  2688. int ath10k_wmi_stop_scan(struct ath10k *ar,
  2689. const struct wmi_stop_scan_arg *arg);
  2690. int ath10k_wmi_vdev_create(struct ath10k *ar, u32 vdev_id,
  2691. enum wmi_vdev_type type,
  2692. enum wmi_vdev_subtype subtype,
  2693. const u8 macaddr[ETH_ALEN]);
  2694. int ath10k_wmi_vdev_delete(struct ath10k *ar, u32 vdev_id);
  2695. int ath10k_wmi_vdev_start(struct ath10k *ar,
  2696. const struct wmi_vdev_start_request_arg *);
  2697. int ath10k_wmi_vdev_restart(struct ath10k *ar,
  2698. const struct wmi_vdev_start_request_arg *);
  2699. int ath10k_wmi_vdev_stop(struct ath10k *ar, u32 vdev_id);
  2700. int ath10k_wmi_vdev_up(struct ath10k *ar, u32 vdev_id, u32 aid,
  2701. const u8 *bssid);
  2702. int ath10k_wmi_vdev_down(struct ath10k *ar, u32 vdev_id);
  2703. int ath10k_wmi_vdev_set_param(struct ath10k *ar, u32 vdev_id,
  2704. enum wmi_vdev_param param_id, u32 param_value);
  2705. int ath10k_wmi_vdev_install_key(struct ath10k *ar,
  2706. const struct wmi_vdev_install_key_arg *arg);
  2707. int ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id,
  2708. const u8 peer_addr[ETH_ALEN]);
  2709. int ath10k_wmi_peer_delete(struct ath10k *ar, u32 vdev_id,
  2710. const u8 peer_addr[ETH_ALEN]);
  2711. int ath10k_wmi_peer_flush(struct ath10k *ar, u32 vdev_id,
  2712. const u8 peer_addr[ETH_ALEN], u32 tid_bitmap);
  2713. int ath10k_wmi_peer_set_param(struct ath10k *ar, u32 vdev_id,
  2714. const u8 *peer_addr,
  2715. enum wmi_peer_param param_id, u32 param_value);
  2716. int ath10k_wmi_peer_assoc(struct ath10k *ar,
  2717. const struct wmi_peer_assoc_complete_arg *arg);
  2718. int ath10k_wmi_set_psmode(struct ath10k *ar, u32 vdev_id,
  2719. enum wmi_sta_ps_mode psmode);
  2720. int ath10k_wmi_set_sta_ps_param(struct ath10k *ar, u32 vdev_id,
  2721. enum wmi_sta_powersave_param param_id,
  2722. u32 value);
  2723. int ath10k_wmi_set_ap_ps_param(struct ath10k *ar, u32 vdev_id, const u8 *mac,
  2724. enum wmi_ap_ps_peer_param param_id, u32 value);
  2725. int ath10k_wmi_scan_chan_list(struct ath10k *ar,
  2726. const struct wmi_scan_chan_list_arg *arg);
  2727. int ath10k_wmi_beacon_send_nowait(struct ath10k *ar,
  2728. const struct wmi_bcn_tx_arg *arg);
  2729. int ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar,
  2730. const struct wmi_pdev_set_wmm_params_arg *arg);
  2731. int ath10k_wmi_request_stats(struct ath10k *ar, enum wmi_stats_id stats_id);
  2732. int ath10k_wmi_force_fw_hang(struct ath10k *ar,
  2733. enum wmi_force_fw_hang_type type, u32 delay_ms);
  2734. #endif /* _WMI_H_ */