wmi.h 96 KB

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