wmi.h 95 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444
  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. #define WMI_SERVICE_READY_TIMEOUT_HZ (5*HZ)
  1002. #define WMI_UNIFIED_READY_TIMEOUT_HZ (5*HZ)
  1003. struct wmi_ready_event {
  1004. __le32 sw_version;
  1005. __le32 abi_version;
  1006. struct wmi_mac_addr mac_addr;
  1007. __le32 status;
  1008. } __packed;
  1009. struct wmi_resource_config {
  1010. /* number of virtual devices (VAPs) to support */
  1011. __le32 num_vdevs;
  1012. /* number of peer nodes to support */
  1013. __le32 num_peers;
  1014. /*
  1015. * In offload mode target supports features like WOW, chatter and
  1016. * other protocol offloads. In order to support them some
  1017. * functionalities like reorder buffering, PN checking need to be
  1018. * done in target. This determines maximum number of peers suported
  1019. * by target in offload mode
  1020. */
  1021. __le32 num_offload_peers;
  1022. /* For target-based RX reordering */
  1023. __le32 num_offload_reorder_bufs;
  1024. /* number of keys per peer */
  1025. __le32 num_peer_keys;
  1026. /* total number of TX/RX data TIDs */
  1027. __le32 num_tids;
  1028. /*
  1029. * max skid for resolving hash collisions
  1030. *
  1031. * The address search table is sparse, so that if two MAC addresses
  1032. * result in the same hash value, the second of these conflicting
  1033. * entries can slide to the next index in the address search table,
  1034. * and use it, if it is unoccupied. This ast_skid_limit parameter
  1035. * specifies the upper bound on how many subsequent indices to search
  1036. * over to find an unoccupied space.
  1037. */
  1038. __le32 ast_skid_limit;
  1039. /*
  1040. * the nominal chain mask for transmit
  1041. *
  1042. * The chain mask may be modified dynamically, e.g. to operate AP
  1043. * tx with a reduced number of chains if no clients are associated.
  1044. * This configuration parameter specifies the nominal chain-mask that
  1045. * should be used when not operating with a reduced set of tx chains.
  1046. */
  1047. __le32 tx_chain_mask;
  1048. /*
  1049. * the nominal chain mask for receive
  1050. *
  1051. * The chain mask may be modified dynamically, e.g. for a client
  1052. * to use a reduced number of chains for receive if the traffic to
  1053. * the client is low enough that it doesn't require downlink MIMO
  1054. * or antenna diversity.
  1055. * This configuration parameter specifies the nominal chain-mask that
  1056. * should be used when not operating with a reduced set of rx chains.
  1057. */
  1058. __le32 rx_chain_mask;
  1059. /*
  1060. * what rx reorder timeout (ms) to use for the AC
  1061. *
  1062. * Each WMM access class (voice, video, best-effort, background) will
  1063. * have its own timeout value to dictate how long to wait for missing
  1064. * rx MPDUs to arrive before flushing subsequent MPDUs that have
  1065. * already been received.
  1066. * This parameter specifies the timeout in milliseconds for each
  1067. * class.
  1068. */
  1069. __le32 rx_timeout_pri_vi;
  1070. __le32 rx_timeout_pri_vo;
  1071. __le32 rx_timeout_pri_be;
  1072. __le32 rx_timeout_pri_bk;
  1073. /*
  1074. * what mode the rx should decap packets to
  1075. *
  1076. * MAC can decap to RAW (no decap), native wifi or Ethernet types
  1077. * THis setting also determines the default TX behavior, however TX
  1078. * behavior can be modified on a per VAP basis during VAP init
  1079. */
  1080. __le32 rx_decap_mode;
  1081. /* what is the maximum scan requests than can be queued */
  1082. __le32 scan_max_pending_reqs;
  1083. /* maximum VDEV that could use BMISS offload */
  1084. __le32 bmiss_offload_max_vdev;
  1085. /* maximum VDEV that could use offload roaming */
  1086. __le32 roam_offload_max_vdev;
  1087. /* maximum AP profiles that would push to offload roaming */
  1088. __le32 roam_offload_max_ap_profiles;
  1089. /*
  1090. * how many groups to use for mcast->ucast conversion
  1091. *
  1092. * The target's WAL maintains a table to hold information regarding
  1093. * which peers belong to a given multicast group, so that if
  1094. * multicast->unicast conversion is enabled, the target can convert
  1095. * multicast tx frames to a series of unicast tx frames, to each
  1096. * peer within the multicast group.
  1097. This num_mcast_groups configuration parameter tells the target how
  1098. * many multicast groups to provide storage for within its multicast
  1099. * group membership table.
  1100. */
  1101. __le32 num_mcast_groups;
  1102. /*
  1103. * size to alloc for the mcast membership table
  1104. *
  1105. * This num_mcast_table_elems configuration parameter tells the
  1106. * target how many peer elements it needs to provide storage for in
  1107. * its multicast group membership table.
  1108. * These multicast group membership table elements are shared by the
  1109. * multicast groups stored within the table.
  1110. */
  1111. __le32 num_mcast_table_elems;
  1112. /*
  1113. * whether/how to do multicast->unicast conversion
  1114. *
  1115. * This configuration parameter specifies whether the target should
  1116. * perform multicast --> unicast conversion on transmit, and if so,
  1117. * what to do if it finds no entries in its multicast group
  1118. * membership table for the multicast IP address in the tx frame.
  1119. * Configuration value:
  1120. * 0 -> Do not perform multicast to unicast conversion.
  1121. * 1 -> Convert multicast frames to unicast, if the IP multicast
  1122. * address from the tx frame is found in the multicast group
  1123. * membership table. If the IP multicast address is not found,
  1124. * drop the frame.
  1125. * 2 -> Convert multicast frames to unicast, if the IP multicast
  1126. * address from the tx frame is found in the multicast group
  1127. * membership table. If the IP multicast address is not found,
  1128. * transmit the frame as multicast.
  1129. */
  1130. __le32 mcast2ucast_mode;
  1131. /*
  1132. * how much memory to allocate for a tx PPDU dbg log
  1133. *
  1134. * This parameter controls how much memory the target will allocate
  1135. * to store a log of tx PPDU meta-information (how large the PPDU
  1136. * was, when it was sent, whether it was successful, etc.)
  1137. */
  1138. __le32 tx_dbg_log_size;
  1139. /* how many AST entries to be allocated for WDS */
  1140. __le32 num_wds_entries;
  1141. /*
  1142. * MAC DMA burst size, e.g., For target PCI limit can be
  1143. * 0 -default, 1 256B
  1144. */
  1145. __le32 dma_burst_size;
  1146. /*
  1147. * Fixed delimiters to be inserted after every MPDU to
  1148. * account for interface latency to avoid underrun.
  1149. */
  1150. __le32 mac_aggr_delim;
  1151. /*
  1152. * determine whether target is responsible for detecting duplicate
  1153. * non-aggregate MPDU and timing out stale fragments.
  1154. *
  1155. * A-MPDU reordering is always performed on the target.
  1156. *
  1157. * 0: target responsible for frag timeout and dup checking
  1158. * 1: host responsible for frag timeout and dup checking
  1159. */
  1160. __le32 rx_skip_defrag_timeout_dup_detection_check;
  1161. /*
  1162. * Configuration for VoW :
  1163. * No of Video Nodes to be supported
  1164. * and Max no of descriptors for each Video link (node).
  1165. */
  1166. __le32 vow_config;
  1167. /* maximum VDEV that could use GTK offload */
  1168. __le32 gtk_offload_max_vdev;
  1169. /* Number of msdu descriptors target should use */
  1170. __le32 num_msdu_desc;
  1171. /*
  1172. * Max. number of Tx fragments per MSDU
  1173. * This parameter controls the max number of Tx fragments per MSDU.
  1174. * This is sent by the target as part of the WMI_SERVICE_READY event
  1175. * and is overriden by the OS shim as required.
  1176. */
  1177. __le32 max_frag_entries;
  1178. } __packed;
  1179. /* strucutre describing host memory chunk. */
  1180. struct host_memory_chunk {
  1181. /* id of the request that is passed up in service ready */
  1182. __le32 req_id;
  1183. /* the physical address the memory chunk */
  1184. __le32 ptr;
  1185. /* size of the chunk */
  1186. __le32 size;
  1187. } __packed;
  1188. struct wmi_init_cmd {
  1189. struct wmi_resource_config resource_config;
  1190. __le32 num_host_mem_chunks;
  1191. /*
  1192. * variable number of host memory chunks.
  1193. * This should be the last element in the structure
  1194. */
  1195. struct host_memory_chunk host_mem_chunks[1];
  1196. } __packed;
  1197. /* TLV for channel list */
  1198. struct wmi_chan_list {
  1199. __le32 tag; /* WMI_CHAN_LIST_TAG */
  1200. __le32 num_chan;
  1201. __le32 channel_list[0];
  1202. } __packed;
  1203. struct wmi_bssid_list {
  1204. __le32 tag; /* WMI_BSSID_LIST_TAG */
  1205. __le32 num_bssid;
  1206. struct wmi_mac_addr bssid_list[0];
  1207. } __packed;
  1208. struct wmi_ie_data {
  1209. __le32 tag; /* WMI_IE_TAG */
  1210. __le32 ie_len;
  1211. u8 ie_data[0];
  1212. } __packed;
  1213. struct wmi_ssid {
  1214. __le32 ssid_len;
  1215. u8 ssid[32];
  1216. } __packed;
  1217. struct wmi_ssid_list {
  1218. __le32 tag; /* WMI_SSID_LIST_TAG */
  1219. __le32 num_ssids;
  1220. struct wmi_ssid ssids[0];
  1221. } __packed;
  1222. /* prefix used by scan requestor ids on the host */
  1223. #define WMI_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
  1224. /* prefix used by scan request ids generated on the host */
  1225. /* host cycles through the lower 12 bits to generate ids */
  1226. #define WMI_HOST_SCAN_REQ_ID_PREFIX 0xA000
  1227. #define WLAN_SCAN_PARAMS_MAX_SSID 16
  1228. #define WLAN_SCAN_PARAMS_MAX_BSSID 4
  1229. #define WLAN_SCAN_PARAMS_MAX_IE_LEN 256
  1230. /* Scan priority numbers must be sequential, starting with 0 */
  1231. enum wmi_scan_priority {
  1232. WMI_SCAN_PRIORITY_VERY_LOW = 0,
  1233. WMI_SCAN_PRIORITY_LOW,
  1234. WMI_SCAN_PRIORITY_MEDIUM,
  1235. WMI_SCAN_PRIORITY_HIGH,
  1236. WMI_SCAN_PRIORITY_VERY_HIGH,
  1237. WMI_SCAN_PRIORITY_COUNT /* number of priorities supported */
  1238. };
  1239. struct wmi_start_scan_cmd {
  1240. /* Scan ID */
  1241. __le32 scan_id;
  1242. /* Scan requestor ID */
  1243. __le32 scan_req_id;
  1244. /* VDEV id(interface) that is requesting scan */
  1245. __le32 vdev_id;
  1246. /* Scan Priority, input to scan scheduler */
  1247. __le32 scan_priority;
  1248. /* Scan events subscription */
  1249. __le32 notify_scan_events;
  1250. /* dwell time in msec on active channels */
  1251. __le32 dwell_time_active;
  1252. /* dwell time in msec on passive channels */
  1253. __le32 dwell_time_passive;
  1254. /*
  1255. * min time in msec on the BSS channel,only valid if atleast one
  1256. * VDEV is active
  1257. */
  1258. __le32 min_rest_time;
  1259. /*
  1260. * max rest time in msec on the BSS channel,only valid if at least
  1261. * one VDEV is active
  1262. */
  1263. /*
  1264. * the scanner will rest on the bss channel at least min_rest_time
  1265. * after min_rest_time the scanner will start checking for tx/rx
  1266. * activity on all VDEVs. if there is no activity the scanner will
  1267. * switch to off channel. if there is activity the scanner will let
  1268. * the radio on the bss channel until max_rest_time expires.at
  1269. * max_rest_time scanner will switch to off channel irrespective of
  1270. * activity. activity is determined by the idle_time parameter.
  1271. */
  1272. __le32 max_rest_time;
  1273. /*
  1274. * time before sending next set of probe requests.
  1275. * The scanner keeps repeating probe requests transmission with
  1276. * period specified by repeat_probe_time.
  1277. * The number of probe requests specified depends on the ssid_list
  1278. * and bssid_list
  1279. */
  1280. __le32 repeat_probe_time;
  1281. /* time in msec between 2 consequetive probe requests with in a set. */
  1282. __le32 probe_spacing_time;
  1283. /*
  1284. * data inactivity time in msec on bss channel that will be used by
  1285. * scanner for measuring the inactivity.
  1286. */
  1287. __le32 idle_time;
  1288. /* maximum time in msec allowed for scan */
  1289. __le32 max_scan_time;
  1290. /*
  1291. * delay in msec before sending first probe request after switching
  1292. * to a channel
  1293. */
  1294. __le32 probe_delay;
  1295. /* Scan control flags */
  1296. __le32 scan_ctrl_flags;
  1297. /* Burst duration time in msecs */
  1298. __le32 burst_duration;
  1299. /*
  1300. * TLV (tag length value ) paramerters follow the scan_cmd structure.
  1301. * TLV can contain channel list, bssid list, ssid list and
  1302. * ie. the TLV tags are defined above;
  1303. */
  1304. } __packed;
  1305. struct wmi_ssid_arg {
  1306. int len;
  1307. const u8 *ssid;
  1308. };
  1309. struct wmi_bssid_arg {
  1310. const u8 *bssid;
  1311. };
  1312. struct wmi_start_scan_arg {
  1313. u32 scan_id;
  1314. u32 scan_req_id;
  1315. u32 vdev_id;
  1316. u32 scan_priority;
  1317. u32 notify_scan_events;
  1318. u32 dwell_time_active;
  1319. u32 dwell_time_passive;
  1320. u32 min_rest_time;
  1321. u32 max_rest_time;
  1322. u32 repeat_probe_time;
  1323. u32 probe_spacing_time;
  1324. u32 idle_time;
  1325. u32 max_scan_time;
  1326. u32 probe_delay;
  1327. u32 scan_ctrl_flags;
  1328. u32 ie_len;
  1329. u32 n_channels;
  1330. u32 n_ssids;
  1331. u32 n_bssids;
  1332. u8 ie[WLAN_SCAN_PARAMS_MAX_IE_LEN];
  1333. u32 channels[64];
  1334. struct wmi_ssid_arg ssids[WLAN_SCAN_PARAMS_MAX_SSID];
  1335. struct wmi_bssid_arg bssids[WLAN_SCAN_PARAMS_MAX_BSSID];
  1336. };
  1337. /* scan control flags */
  1338. /* passively scan all channels including active channels */
  1339. #define WMI_SCAN_FLAG_PASSIVE 0x1
  1340. /* add wild card ssid probe request even though ssid_list is specified. */
  1341. #define WMI_SCAN_ADD_BCAST_PROBE_REQ 0x2
  1342. /* add cck rates to rates/xrate ie for the generated probe request */
  1343. #define WMI_SCAN_ADD_CCK_RATES 0x4
  1344. /* add ofdm rates to rates/xrate ie for the generated probe request */
  1345. #define WMI_SCAN_ADD_OFDM_RATES 0x8
  1346. /* To enable indication of Chan load and Noise floor to host */
  1347. #define WMI_SCAN_CHAN_STAT_EVENT 0x10
  1348. /* Filter Probe request frames */
  1349. #define WMI_SCAN_FILTER_PROBE_REQ 0x20
  1350. /* When set, DFS channels will not be scanned */
  1351. #define WMI_SCAN_BYPASS_DFS_CHN 0x40
  1352. /* Different FW scan engine may choose to bail out on errors.
  1353. * Allow the driver to have influence over that. */
  1354. #define WMI_SCAN_CONTINUE_ON_ERROR 0x80
  1355. /* WMI_SCAN_CLASS_MASK must be the same value as IEEE80211_SCAN_CLASS_MASK */
  1356. #define WMI_SCAN_CLASS_MASK 0xFF000000
  1357. enum wmi_stop_scan_type {
  1358. WMI_SCAN_STOP_ONE = 0x00000000, /* stop by scan_id */
  1359. WMI_SCAN_STOP_VDEV_ALL = 0x01000000, /* stop by vdev_id */
  1360. WMI_SCAN_STOP_ALL = 0x04000000, /* stop all scans */
  1361. };
  1362. struct wmi_stop_scan_cmd {
  1363. __le32 scan_req_id;
  1364. __le32 scan_id;
  1365. __le32 req_type;
  1366. __le32 vdev_id;
  1367. } __packed;
  1368. struct wmi_stop_scan_arg {
  1369. u32 req_id;
  1370. enum wmi_stop_scan_type req_type;
  1371. union {
  1372. u32 scan_id;
  1373. u32 vdev_id;
  1374. } u;
  1375. };
  1376. struct wmi_scan_chan_list_cmd {
  1377. __le32 num_scan_chans;
  1378. struct wmi_channel chan_info[0];
  1379. } __packed;
  1380. struct wmi_scan_chan_list_arg {
  1381. u32 n_channels;
  1382. struct wmi_channel_arg *channels;
  1383. };
  1384. enum wmi_bss_filter {
  1385. WMI_BSS_FILTER_NONE = 0, /* no beacons forwarded */
  1386. WMI_BSS_FILTER_ALL, /* all beacons forwarded */
  1387. WMI_BSS_FILTER_PROFILE, /* only beacons matching profile */
  1388. WMI_BSS_FILTER_ALL_BUT_PROFILE, /* all but beacons matching profile */
  1389. WMI_BSS_FILTER_CURRENT_BSS, /* only beacons matching current BSS */
  1390. WMI_BSS_FILTER_ALL_BUT_BSS, /* all but beacons matching BSS */
  1391. WMI_BSS_FILTER_PROBED_SSID, /* beacons matching probed ssid */
  1392. WMI_BSS_FILTER_LAST_BSS, /* marker only */
  1393. };
  1394. enum wmi_scan_event_type {
  1395. WMI_SCAN_EVENT_STARTED = 0x1,
  1396. WMI_SCAN_EVENT_COMPLETED = 0x2,
  1397. WMI_SCAN_EVENT_BSS_CHANNEL = 0x4,
  1398. WMI_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
  1399. WMI_SCAN_EVENT_DEQUEUED = 0x10,
  1400. WMI_SCAN_EVENT_PREEMPTED = 0x20, /* possibly by high-prio scan */
  1401. WMI_SCAN_EVENT_START_FAILED = 0x40,
  1402. WMI_SCAN_EVENT_RESTARTED = 0x80,
  1403. WMI_SCAN_EVENT_MAX = 0x8000
  1404. };
  1405. enum wmi_scan_completion_reason {
  1406. WMI_SCAN_REASON_COMPLETED,
  1407. WMI_SCAN_REASON_CANCELLED,
  1408. WMI_SCAN_REASON_PREEMPTED,
  1409. WMI_SCAN_REASON_TIMEDOUT,
  1410. WMI_SCAN_REASON_MAX,
  1411. };
  1412. struct wmi_scan_event {
  1413. __le32 event_type; /* %WMI_SCAN_EVENT_ */
  1414. __le32 reason; /* %WMI_SCAN_REASON_ */
  1415. __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
  1416. __le32 scan_req_id;
  1417. __le32 scan_id;
  1418. __le32 vdev_id;
  1419. } __packed;
  1420. /*
  1421. * This defines how much headroom is kept in the
  1422. * receive frame between the descriptor and the
  1423. * payload, in order for the WMI PHY error and
  1424. * management handler to insert header contents.
  1425. *
  1426. * This is in bytes.
  1427. */
  1428. #define WMI_MGMT_RX_HDR_HEADROOM 52
  1429. /*
  1430. * This event will be used for sending scan results
  1431. * as well as rx mgmt frames to the host. The rx buffer
  1432. * will be sent as part of this WMI event. It would be a
  1433. * good idea to pass all the fields in the RX status
  1434. * descriptor up to the host.
  1435. */
  1436. struct wmi_mgmt_rx_hdr_v1 {
  1437. __le32 channel;
  1438. __le32 snr;
  1439. __le32 rate;
  1440. __le32 phy_mode;
  1441. __le32 buf_len;
  1442. __le32 status; /* %WMI_RX_STATUS_ */
  1443. } __packed;
  1444. struct wmi_mgmt_rx_hdr_v2 {
  1445. struct wmi_mgmt_rx_hdr_v1 v1;
  1446. __le32 rssi_ctl[4];
  1447. } __packed;
  1448. struct wmi_mgmt_rx_event_v1 {
  1449. struct wmi_mgmt_rx_hdr_v1 hdr;
  1450. u8 buf[0];
  1451. } __packed;
  1452. struct wmi_mgmt_rx_event_v2 {
  1453. struct wmi_mgmt_rx_hdr_v2 hdr;
  1454. u8 buf[0];
  1455. } __packed;
  1456. #define WMI_RX_STATUS_OK 0x00
  1457. #define WMI_RX_STATUS_ERR_CRC 0x01
  1458. #define WMI_RX_STATUS_ERR_DECRYPT 0x08
  1459. #define WMI_RX_STATUS_ERR_MIC 0x10
  1460. #define WMI_RX_STATUS_ERR_KEY_CACHE_MISS 0x20
  1461. struct wmi_single_phyerr_rx_hdr {
  1462. /* TSF timestamp */
  1463. __le32 tsf_timestamp;
  1464. /*
  1465. * Current freq1, freq2
  1466. *
  1467. * [7:0]: freq1[lo]
  1468. * [15:8] : freq1[hi]
  1469. * [23:16]: freq2[lo]
  1470. * [31:24]: freq2[hi]
  1471. */
  1472. __le16 freq1;
  1473. __le16 freq2;
  1474. /*
  1475. * Combined RSSI over all chains and channel width for this PHY error
  1476. *
  1477. * [7:0]: RSSI combined
  1478. * [15:8]: Channel width (MHz)
  1479. * [23:16]: PHY error code
  1480. * [24:16]: reserved (future use)
  1481. */
  1482. u8 rssi_combined;
  1483. u8 chan_width_mhz;
  1484. u8 phy_err_code;
  1485. u8 rsvd0;
  1486. /*
  1487. * RSSI on chain 0 through 3
  1488. *
  1489. * This is formatted the same as the PPDU_START RX descriptor
  1490. * field:
  1491. *
  1492. * [7:0]: pri20
  1493. * [15:8]: sec20
  1494. * [23:16]: sec40
  1495. * [31:24]: sec80
  1496. */
  1497. __le32 rssi_chain0;
  1498. __le32 rssi_chain1;
  1499. __le32 rssi_chain2;
  1500. __le32 rssi_chain3;
  1501. /*
  1502. * Last calibrated NF value for chain 0 through 3
  1503. *
  1504. * nf_list_1:
  1505. *
  1506. * + [15:0] - chain 0
  1507. * + [31:16] - chain 1
  1508. *
  1509. * nf_list_2:
  1510. *
  1511. * + [15:0] - chain 2
  1512. * + [31:16] - chain 3
  1513. */
  1514. __le32 nf_list_1;
  1515. __le32 nf_list_2;
  1516. /* Length of the frame */
  1517. __le32 buf_len;
  1518. } __packed;
  1519. struct wmi_single_phyerr_rx_event {
  1520. /* Phy error event header */
  1521. struct wmi_single_phyerr_rx_hdr hdr;
  1522. /* frame buffer */
  1523. u8 bufp[0];
  1524. } __packed;
  1525. struct wmi_comb_phyerr_rx_hdr {
  1526. /* Phy error phy error count */
  1527. __le32 num_phyerr_events;
  1528. __le32 tsf_l32;
  1529. __le32 tsf_u32;
  1530. } __packed;
  1531. struct wmi_comb_phyerr_rx_event {
  1532. /* Phy error phy error count */
  1533. struct wmi_comb_phyerr_rx_hdr hdr;
  1534. /*
  1535. * frame buffer - contains multiple payloads in the order:
  1536. * header - payload, header - payload...
  1537. * (The header is of type: wmi_single_phyerr_rx_hdr)
  1538. */
  1539. u8 bufp[0];
  1540. } __packed;
  1541. struct wmi_mgmt_tx_hdr {
  1542. __le32 vdev_id;
  1543. struct wmi_mac_addr peer_macaddr;
  1544. __le32 tx_rate;
  1545. __le32 tx_power;
  1546. __le32 buf_len;
  1547. } __packed;
  1548. struct wmi_mgmt_tx_cmd {
  1549. struct wmi_mgmt_tx_hdr hdr;
  1550. u8 buf[0];
  1551. } __packed;
  1552. struct wmi_echo_event {
  1553. __le32 value;
  1554. } __packed;
  1555. struct wmi_echo_cmd {
  1556. __le32 value;
  1557. } __packed;
  1558. struct wmi_pdev_set_regdomain_cmd {
  1559. __le32 reg_domain;
  1560. __le32 reg_domain_2G;
  1561. __le32 reg_domain_5G;
  1562. __le32 conformance_test_limit_2G;
  1563. __le32 conformance_test_limit_5G;
  1564. } __packed;
  1565. /* Command to set/unset chip in quiet mode */
  1566. struct wmi_pdev_set_quiet_cmd {
  1567. /* period in TUs */
  1568. __le32 period;
  1569. /* duration in TUs */
  1570. __le32 duration;
  1571. /* offset in TUs */
  1572. __le32 next_start;
  1573. /* enable/disable */
  1574. __le32 enabled;
  1575. } __packed;
  1576. /*
  1577. * 802.11g protection mode.
  1578. */
  1579. enum ath10k_protmode {
  1580. ATH10K_PROT_NONE = 0, /* no protection */
  1581. ATH10K_PROT_CTSONLY = 1, /* CTS to self */
  1582. ATH10K_PROT_RTSCTS = 2, /* RTS-CTS */
  1583. };
  1584. enum wmi_beacon_gen_mode {
  1585. WMI_BEACON_STAGGERED_MODE = 0,
  1586. WMI_BEACON_BURST_MODE = 1
  1587. };
  1588. enum wmi_csa_event_ies_present_flag {
  1589. WMI_CSA_IE_PRESENT = 0x00000001,
  1590. WMI_XCSA_IE_PRESENT = 0x00000002,
  1591. WMI_WBW_IE_PRESENT = 0x00000004,
  1592. WMI_CSWARP_IE_PRESENT = 0x00000008,
  1593. };
  1594. /* wmi CSA receive event from beacon frame */
  1595. struct wmi_csa_event {
  1596. __le32 i_fc_dur;
  1597. /* Bit 0-15: FC */
  1598. /* Bit 16-31: DUR */
  1599. struct wmi_mac_addr i_addr1;
  1600. struct wmi_mac_addr i_addr2;
  1601. __le32 csa_ie[2];
  1602. __le32 xcsa_ie[2];
  1603. __le32 wb_ie[2];
  1604. __le32 cswarp_ie;
  1605. __le32 ies_present_flag; /* wmi_csa_event_ies_present_flag */
  1606. } __packed;
  1607. /* the definition of different PDEV parameters */
  1608. #define PDEV_DEFAULT_STATS_UPDATE_PERIOD 500
  1609. #define VDEV_DEFAULT_STATS_UPDATE_PERIOD 500
  1610. #define PEER_DEFAULT_STATS_UPDATE_PERIOD 500
  1611. enum wmi_pdev_param {
  1612. /* TX chian mask */
  1613. WMI_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
  1614. /* RX chian mask */
  1615. WMI_PDEV_PARAM_RX_CHAIN_MASK,
  1616. /* TX power limit for 2G Radio */
  1617. WMI_PDEV_PARAM_TXPOWER_LIMIT2G,
  1618. /* TX power limit for 5G Radio */
  1619. WMI_PDEV_PARAM_TXPOWER_LIMIT5G,
  1620. /* TX power scale */
  1621. WMI_PDEV_PARAM_TXPOWER_SCALE,
  1622. /* Beacon generation mode . 0: host, 1: target */
  1623. WMI_PDEV_PARAM_BEACON_GEN_MODE,
  1624. /* Beacon generation mode . 0: staggered 1: bursted */
  1625. WMI_PDEV_PARAM_BEACON_TX_MODE,
  1626. /*
  1627. * Resource manager off chan mode .
  1628. * 0: turn off off chan mode. 1: turn on offchan mode
  1629. */
  1630. WMI_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
  1631. /*
  1632. * Protection mode:
  1633. * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
  1634. */
  1635. WMI_PDEV_PARAM_PROTECTION_MODE,
  1636. /* Dynamic bandwidth 0: disable 1: enable */
  1637. WMI_PDEV_PARAM_DYNAMIC_BW,
  1638. /* Non aggregrate/ 11g sw retry threshold.0-disable */
  1639. WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
  1640. /* aggregrate sw retry threshold. 0-disable*/
  1641. WMI_PDEV_PARAM_AGG_SW_RETRY_TH,
  1642. /* Station kickout threshold (non of consecutive failures).0-disable */
  1643. WMI_PDEV_PARAM_STA_KICKOUT_TH,
  1644. /* Aggerate size scaling configuration per AC */
  1645. WMI_PDEV_PARAM_AC_AGGRSIZE_SCALING,
  1646. /* LTR enable */
  1647. WMI_PDEV_PARAM_LTR_ENABLE,
  1648. /* LTR latency for BE, in us */
  1649. WMI_PDEV_PARAM_LTR_AC_LATENCY_BE,
  1650. /* LTR latency for BK, in us */
  1651. WMI_PDEV_PARAM_LTR_AC_LATENCY_BK,
  1652. /* LTR latency for VI, in us */
  1653. WMI_PDEV_PARAM_LTR_AC_LATENCY_VI,
  1654. /* LTR latency for VO, in us */
  1655. WMI_PDEV_PARAM_LTR_AC_LATENCY_VO,
  1656. /* LTR AC latency timeout, in ms */
  1657. WMI_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
  1658. /* LTR platform latency override, in us */
  1659. WMI_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
  1660. /* LTR-RX override, in us */
  1661. WMI_PDEV_PARAM_LTR_RX_OVERRIDE,
  1662. /* Tx activity timeout for LTR, in us */
  1663. WMI_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
  1664. /* L1SS state machine enable */
  1665. WMI_PDEV_PARAM_L1SS_ENABLE,
  1666. /* Deep sleep state machine enable */
  1667. WMI_PDEV_PARAM_DSLEEP_ENABLE,
  1668. /* RX buffering flush enable */
  1669. WMI_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
  1670. /* RX buffering matermark */
  1671. WMI_PDEV_PARAM_PCIELP_TXBUF_WATERMARK,
  1672. /* RX buffering timeout enable */
  1673. WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
  1674. /* RX buffering timeout value */
  1675. WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
  1676. /* pdev level stats update period in ms */
  1677. WMI_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
  1678. /* vdev level stats update period in ms */
  1679. WMI_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
  1680. /* peer level stats update period in ms */
  1681. WMI_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
  1682. /* beacon filter status update period */
  1683. WMI_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
  1684. /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
  1685. WMI_PDEV_PARAM_PMF_QOS,
  1686. /* Access category on which ARP frames are sent */
  1687. WMI_PDEV_PARAM_ARP_AC_OVERRIDE,
  1688. /* DCS configuration */
  1689. WMI_PDEV_PARAM_DCS,
  1690. /* Enable/Disable ANI on target */
  1691. WMI_PDEV_PARAM_ANI_ENABLE,
  1692. /* configure the ANI polling period */
  1693. WMI_PDEV_PARAM_ANI_POLL_PERIOD,
  1694. /* configure the ANI listening period */
  1695. WMI_PDEV_PARAM_ANI_LISTEN_PERIOD,
  1696. /* configure OFDM immunity level */
  1697. WMI_PDEV_PARAM_ANI_OFDM_LEVEL,
  1698. /* configure CCK immunity level */
  1699. WMI_PDEV_PARAM_ANI_CCK_LEVEL,
  1700. /* Enable/Disable CDD for 1x1 STAs in rate control module */
  1701. WMI_PDEV_PARAM_DYNTXCHAIN,
  1702. /* Enable/Disable proxy STA */
  1703. WMI_PDEV_PARAM_PROXY_STA,
  1704. /* Enable/Disable low power state when all VDEVs are inactive/idle. */
  1705. WMI_PDEV_PARAM_IDLE_PS_CONFIG,
  1706. /* Enable/Disable power gating sleep */
  1707. WMI_PDEV_PARAM_POWER_GATING_SLEEP,
  1708. };
  1709. struct wmi_pdev_set_param_cmd {
  1710. __le32 param_id;
  1711. __le32 param_value;
  1712. } __packed;
  1713. struct wmi_pdev_get_tpc_config_cmd {
  1714. /* parameter */
  1715. __le32 param;
  1716. } __packed;
  1717. #define WMI_TPC_RATE_MAX 160
  1718. #define WMI_TPC_TX_N_CHAIN 4
  1719. enum wmi_tpc_config_event_flag {
  1720. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_CDD = 0x1,
  1721. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_STBC = 0x2,
  1722. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF = 0x4,
  1723. };
  1724. struct wmi_pdev_tpc_config_event {
  1725. __le32 reg_domain;
  1726. __le32 chan_freq;
  1727. __le32 phy_mode;
  1728. __le32 twice_antenna_reduction;
  1729. __le32 twice_max_rd_power;
  1730. s32 twice_antenna_gain;
  1731. __le32 power_limit;
  1732. __le32 rate_max;
  1733. __le32 num_tx_chain;
  1734. __le32 ctl;
  1735. __le32 flags;
  1736. s8 max_reg_allow_pow[WMI_TPC_TX_N_CHAIN];
  1737. s8 max_reg_allow_pow_agcdd[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  1738. s8 max_reg_allow_pow_agstbc[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  1739. s8 max_reg_allow_pow_agtxbf[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  1740. u8 rates_array[WMI_TPC_RATE_MAX];
  1741. } __packed;
  1742. /* Transmit power scale factor. */
  1743. enum wmi_tp_scale {
  1744. WMI_TP_SCALE_MAX = 0, /* no scaling (default) */
  1745. WMI_TP_SCALE_50 = 1, /* 50% of max (-3 dBm) */
  1746. WMI_TP_SCALE_25 = 2, /* 25% of max (-6 dBm) */
  1747. WMI_TP_SCALE_12 = 3, /* 12% of max (-9 dBm) */
  1748. WMI_TP_SCALE_MIN = 4, /* min, but still on */
  1749. WMI_TP_SCALE_SIZE = 5, /* max num of enum */
  1750. };
  1751. struct wmi_set_channel_cmd {
  1752. /* channel (only frequency and mode info are used) */
  1753. struct wmi_channel chan;
  1754. } __packed;
  1755. struct wmi_pdev_chanlist_update_event {
  1756. /* number of channels */
  1757. __le32 num_chan;
  1758. /* array of channels */
  1759. struct wmi_channel channel_list[1];
  1760. } __packed;
  1761. #define WMI_MAX_DEBUG_MESG (sizeof(u32) * 32)
  1762. struct wmi_debug_mesg_event {
  1763. /* message buffer, NULL terminated */
  1764. char bufp[WMI_MAX_DEBUG_MESG];
  1765. } __packed;
  1766. enum {
  1767. /* P2P device */
  1768. VDEV_SUBTYPE_P2PDEV = 0,
  1769. /* P2P client */
  1770. VDEV_SUBTYPE_P2PCLI,
  1771. /* P2P GO */
  1772. VDEV_SUBTYPE_P2PGO,
  1773. /* BT3.0 HS */
  1774. VDEV_SUBTYPE_BT,
  1775. };
  1776. struct wmi_pdev_set_channel_cmd {
  1777. /* idnore power , only use flags , mode and freq */
  1778. struct wmi_channel chan;
  1779. } __packed;
  1780. /* Customize the DSCP (bit) to TID (0-7) mapping for QOS */
  1781. #define WMI_DSCP_MAP_MAX (64)
  1782. struct wmi_pdev_set_dscp_tid_map_cmd {
  1783. /* map indicating DSCP to TID conversion */
  1784. __le32 dscp_to_tid_map[WMI_DSCP_MAP_MAX];
  1785. } __packed;
  1786. enum mcast_bcast_rate_id {
  1787. WMI_SET_MCAST_RATE,
  1788. WMI_SET_BCAST_RATE
  1789. };
  1790. struct mcast_bcast_rate {
  1791. enum mcast_bcast_rate_id rate_id;
  1792. __le32 rate;
  1793. } __packed;
  1794. struct wmi_wmm_params {
  1795. __le32 cwmin;
  1796. __le32 cwmax;
  1797. __le32 aifs;
  1798. __le32 txop;
  1799. __le32 acm;
  1800. __le32 no_ack;
  1801. } __packed;
  1802. struct wmi_pdev_set_wmm_params {
  1803. struct wmi_wmm_params ac_be;
  1804. struct wmi_wmm_params ac_bk;
  1805. struct wmi_wmm_params ac_vi;
  1806. struct wmi_wmm_params ac_vo;
  1807. } __packed;
  1808. struct wmi_wmm_params_arg {
  1809. u32 cwmin;
  1810. u32 cwmax;
  1811. u32 aifs;
  1812. u32 txop;
  1813. u32 acm;
  1814. u32 no_ack;
  1815. };
  1816. struct wmi_pdev_set_wmm_params_arg {
  1817. struct wmi_wmm_params_arg ac_be;
  1818. struct wmi_wmm_params_arg ac_bk;
  1819. struct wmi_wmm_params_arg ac_vi;
  1820. struct wmi_wmm_params_arg ac_vo;
  1821. };
  1822. struct wal_dbg_tx_stats {
  1823. /* Num HTT cookies queued to dispatch list */
  1824. __le32 comp_queued;
  1825. /* Num HTT cookies dispatched */
  1826. __le32 comp_delivered;
  1827. /* Num MSDU queued to WAL */
  1828. __le32 msdu_enqued;
  1829. /* Num MPDU queue to WAL */
  1830. __le32 mpdu_enqued;
  1831. /* Num MSDUs dropped by WMM limit */
  1832. __le32 wmm_drop;
  1833. /* Num Local frames queued */
  1834. __le32 local_enqued;
  1835. /* Num Local frames done */
  1836. __le32 local_freed;
  1837. /* Num queued to HW */
  1838. __le32 hw_queued;
  1839. /* Num PPDU reaped from HW */
  1840. __le32 hw_reaped;
  1841. /* Num underruns */
  1842. __le32 underrun;
  1843. /* Num PPDUs cleaned up in TX abort */
  1844. __le32 tx_abort;
  1845. /* Num MPDUs requed by SW */
  1846. __le32 mpdus_requed;
  1847. /* excessive retries */
  1848. __le32 tx_ko;
  1849. /* data hw rate code */
  1850. __le32 data_rc;
  1851. /* Scheduler self triggers */
  1852. __le32 self_triggers;
  1853. /* frames dropped due to excessive sw retries */
  1854. __le32 sw_retry_failure;
  1855. /* illegal rate phy errors */
  1856. __le32 illgl_rate_phy_err;
  1857. /* wal pdev continous xretry */
  1858. __le32 pdev_cont_xretry;
  1859. /* wal pdev continous xretry */
  1860. __le32 pdev_tx_timeout;
  1861. /* wal pdev resets */
  1862. __le32 pdev_resets;
  1863. __le32 phy_underrun;
  1864. /* MPDU is more than txop limit */
  1865. __le32 txop_ovf;
  1866. } __packed;
  1867. struct wal_dbg_rx_stats {
  1868. /* Cnts any change in ring routing mid-ppdu */
  1869. __le32 mid_ppdu_route_change;
  1870. /* Total number of statuses processed */
  1871. __le32 status_rcvd;
  1872. /* Extra frags on rings 0-3 */
  1873. __le32 r0_frags;
  1874. __le32 r1_frags;
  1875. __le32 r2_frags;
  1876. __le32 r3_frags;
  1877. /* MSDUs / MPDUs delivered to HTT */
  1878. __le32 htt_msdus;
  1879. __le32 htt_mpdus;
  1880. /* MSDUs / MPDUs delivered to local stack */
  1881. __le32 loc_msdus;
  1882. __le32 loc_mpdus;
  1883. /* AMSDUs that have more MSDUs than the status ring size */
  1884. __le32 oversize_amsdu;
  1885. /* Number of PHY errors */
  1886. __le32 phy_errs;
  1887. /* Number of PHY errors drops */
  1888. __le32 phy_err_drop;
  1889. /* Number of mpdu errors - FCS, MIC, ENC etc. */
  1890. __le32 mpdu_errs;
  1891. } __packed;
  1892. struct wal_dbg_peer_stats {
  1893. /* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
  1894. __le32 dummy;
  1895. } __packed;
  1896. struct wal_dbg_stats {
  1897. struct wal_dbg_tx_stats tx;
  1898. struct wal_dbg_rx_stats rx;
  1899. struct wal_dbg_peer_stats peer;
  1900. } __packed;
  1901. enum wmi_stats_id {
  1902. WMI_REQUEST_PEER_STAT = 0x01,
  1903. WMI_REQUEST_AP_STAT = 0x02
  1904. };
  1905. struct wmi_request_stats_cmd {
  1906. __le32 stats_id;
  1907. /*
  1908. * Space to add parameters like
  1909. * peer mac addr
  1910. */
  1911. } __packed;
  1912. /* Suspend option */
  1913. enum {
  1914. /* suspend */
  1915. WMI_PDEV_SUSPEND,
  1916. /* suspend and disable all interrupts */
  1917. WMI_PDEV_SUSPEND_AND_DISABLE_INTR,
  1918. };
  1919. struct wmi_pdev_suspend_cmd {
  1920. /* suspend option sent to target */
  1921. __le32 suspend_opt;
  1922. } __packed;
  1923. struct wmi_stats_event {
  1924. __le32 stats_id; /* %WMI_REQUEST_ */
  1925. /*
  1926. * number of pdev stats event structures
  1927. * (wmi_pdev_stats) 0 or 1
  1928. */
  1929. __le32 num_pdev_stats;
  1930. /*
  1931. * number of vdev stats event structures
  1932. * (wmi_vdev_stats) 0 or max vdevs
  1933. */
  1934. __le32 num_vdev_stats;
  1935. /*
  1936. * number of peer stats event structures
  1937. * (wmi_peer_stats) 0 or max peers
  1938. */
  1939. __le32 num_peer_stats;
  1940. __le32 num_bcnflt_stats;
  1941. /*
  1942. * followed by
  1943. * num_pdev_stats * size of(struct wmi_pdev_stats)
  1944. * num_vdev_stats * size of(struct wmi_vdev_stats)
  1945. * num_peer_stats * size of(struct wmi_peer_stats)
  1946. *
  1947. * By having a zero sized array, the pointer to data area
  1948. * becomes available without increasing the struct size
  1949. */
  1950. u8 data[0];
  1951. } __packed;
  1952. /*
  1953. * PDEV statistics
  1954. * TODO: add all PDEV stats here
  1955. */
  1956. struct wmi_pdev_stats {
  1957. __le32 chan_nf; /* Channel noise floor */
  1958. __le32 tx_frame_count; /* TX frame count */
  1959. __le32 rx_frame_count; /* RX frame count */
  1960. __le32 rx_clear_count; /* rx clear count */
  1961. __le32 cycle_count; /* cycle count */
  1962. __le32 phy_err_count; /* Phy error count */
  1963. __le32 chan_tx_pwr; /* channel tx power */
  1964. struct wal_dbg_stats wal; /* WAL dbg stats */
  1965. } __packed;
  1966. /*
  1967. * VDEV statistics
  1968. * TODO: add all VDEV stats here
  1969. */
  1970. struct wmi_vdev_stats {
  1971. __le32 vdev_id;
  1972. } __packed;
  1973. /*
  1974. * peer statistics.
  1975. * TODO: add more stats
  1976. */
  1977. struct wmi_peer_stats {
  1978. struct wmi_mac_addr peer_macaddr;
  1979. __le32 peer_rssi;
  1980. __le32 peer_tx_rate;
  1981. } __packed;
  1982. struct wmi_vdev_create_cmd {
  1983. __le32 vdev_id;
  1984. __le32 vdev_type;
  1985. __le32 vdev_subtype;
  1986. struct wmi_mac_addr vdev_macaddr;
  1987. } __packed;
  1988. enum wmi_vdev_type {
  1989. WMI_VDEV_TYPE_AP = 1,
  1990. WMI_VDEV_TYPE_STA = 2,
  1991. WMI_VDEV_TYPE_IBSS = 3,
  1992. WMI_VDEV_TYPE_MONITOR = 4,
  1993. };
  1994. enum wmi_vdev_subtype {
  1995. WMI_VDEV_SUBTYPE_NONE = 0,
  1996. WMI_VDEV_SUBTYPE_P2P_DEVICE = 1,
  1997. WMI_VDEV_SUBTYPE_P2P_CLIENT = 2,
  1998. WMI_VDEV_SUBTYPE_P2P_GO = 3,
  1999. };
  2000. /* values for vdev_subtype */
  2001. /* values for vdev_start_request flags */
  2002. /*
  2003. * Indicates that AP VDEV uses hidden ssid. only valid for
  2004. * AP/GO */
  2005. #define WMI_VDEV_START_HIDDEN_SSID (1<<0)
  2006. /*
  2007. * Indicates if robust management frame/management frame
  2008. * protection is enabled. For GO/AP vdevs, it indicates that
  2009. * it may support station/client associations with RMF enabled.
  2010. * For STA/client vdevs, it indicates that sta will
  2011. * associate with AP with RMF enabled. */
  2012. #define WMI_VDEV_START_PMF_ENABLED (1<<1)
  2013. struct wmi_p2p_noa_descriptor {
  2014. __le32 type_count; /* 255: continuous schedule, 0: reserved */
  2015. __le32 duration; /* Absent period duration in micro seconds */
  2016. __le32 interval; /* Absent period interval in micro seconds */
  2017. __le32 start_time; /* 32 bit tsf time when in starts */
  2018. } __packed;
  2019. struct wmi_vdev_start_request_cmd {
  2020. /* WMI channel */
  2021. struct wmi_channel chan;
  2022. /* unique id identifying the VDEV, generated by the caller */
  2023. __le32 vdev_id;
  2024. /* requestor id identifying the caller module */
  2025. __le32 requestor_id;
  2026. /* beacon interval from received beacon */
  2027. __le32 beacon_interval;
  2028. /* DTIM Period from the received beacon */
  2029. __le32 dtim_period;
  2030. /* Flags */
  2031. __le32 flags;
  2032. /* ssid field. Only valid for AP/GO/IBSS/BTAmp VDEV type. */
  2033. struct wmi_ssid ssid;
  2034. /* beacon/probe reponse xmit rate. Applicable for SoftAP. */
  2035. __le32 bcn_tx_rate;
  2036. /* beacon/probe reponse xmit power. Applicable for SoftAP. */
  2037. __le32 bcn_tx_power;
  2038. /* number of p2p NOA descriptor(s) from scan entry */
  2039. __le32 num_noa_descriptors;
  2040. /*
  2041. * Disable H/W ack. This used by WMI_VDEV_RESTART_REQUEST_CMDID.
  2042. * During CAC, Our HW shouldn't ack ditected frames
  2043. */
  2044. __le32 disable_hw_ack;
  2045. /* actual p2p NOA descriptor from scan entry */
  2046. struct wmi_p2p_noa_descriptor noa_descriptors[2];
  2047. } __packed;
  2048. struct wmi_vdev_restart_request_cmd {
  2049. struct wmi_vdev_start_request_cmd vdev_start_request_cmd;
  2050. } __packed;
  2051. struct wmi_vdev_start_request_arg {
  2052. u32 vdev_id;
  2053. struct wmi_channel_arg channel;
  2054. u32 bcn_intval;
  2055. u32 dtim_period;
  2056. u8 *ssid;
  2057. u32 ssid_len;
  2058. u32 bcn_tx_rate;
  2059. u32 bcn_tx_power;
  2060. bool disable_hw_ack;
  2061. bool hidden_ssid;
  2062. bool pmf_enabled;
  2063. };
  2064. struct wmi_vdev_delete_cmd {
  2065. /* unique id identifying the VDEV, generated by the caller */
  2066. __le32 vdev_id;
  2067. } __packed;
  2068. struct wmi_vdev_up_cmd {
  2069. __le32 vdev_id;
  2070. __le32 vdev_assoc_id;
  2071. struct wmi_mac_addr vdev_bssid;
  2072. } __packed;
  2073. struct wmi_vdev_stop_cmd {
  2074. __le32 vdev_id;
  2075. } __packed;
  2076. struct wmi_vdev_down_cmd {
  2077. __le32 vdev_id;
  2078. } __packed;
  2079. struct wmi_vdev_standby_response_cmd {
  2080. /* unique id identifying the VDEV, generated by the caller */
  2081. __le32 vdev_id;
  2082. } __packed;
  2083. struct wmi_vdev_resume_response_cmd {
  2084. /* unique id identifying the VDEV, generated by the caller */
  2085. __le32 vdev_id;
  2086. } __packed;
  2087. struct wmi_vdev_set_param_cmd {
  2088. __le32 vdev_id;
  2089. __le32 param_id;
  2090. __le32 param_value;
  2091. } __packed;
  2092. #define WMI_MAX_KEY_INDEX 3
  2093. #define WMI_MAX_KEY_LEN 32
  2094. #define WMI_KEY_PAIRWISE 0x00
  2095. #define WMI_KEY_GROUP 0x01
  2096. #define WMI_KEY_TX_USAGE 0x02 /* default tx key - static wep */
  2097. struct wmi_key_seq_counter {
  2098. __le32 key_seq_counter_l;
  2099. __le32 key_seq_counter_h;
  2100. } __packed;
  2101. #define WMI_CIPHER_NONE 0x0 /* clear key */
  2102. #define WMI_CIPHER_WEP 0x1
  2103. #define WMI_CIPHER_TKIP 0x2
  2104. #define WMI_CIPHER_AES_OCB 0x3
  2105. #define WMI_CIPHER_AES_CCM 0x4
  2106. #define WMI_CIPHER_WAPI 0x5
  2107. #define WMI_CIPHER_CKIP 0x6
  2108. #define WMI_CIPHER_AES_CMAC 0x7
  2109. struct wmi_vdev_install_key_cmd {
  2110. __le32 vdev_id;
  2111. struct wmi_mac_addr peer_macaddr;
  2112. __le32 key_idx;
  2113. __le32 key_flags;
  2114. __le32 key_cipher; /* %WMI_CIPHER_ */
  2115. struct wmi_key_seq_counter key_rsc_counter;
  2116. struct wmi_key_seq_counter key_global_rsc_counter;
  2117. struct wmi_key_seq_counter key_tsc_counter;
  2118. u8 wpi_key_rsc_counter[16];
  2119. u8 wpi_key_tsc_counter[16];
  2120. __le32 key_len;
  2121. __le32 key_txmic_len;
  2122. __le32 key_rxmic_len;
  2123. /* contains key followed by tx mic followed by rx mic */
  2124. u8 key_data[0];
  2125. } __packed;
  2126. struct wmi_vdev_install_key_arg {
  2127. u32 vdev_id;
  2128. const u8 *macaddr;
  2129. u32 key_idx;
  2130. u32 key_flags;
  2131. u32 key_cipher;
  2132. u32 key_len;
  2133. u32 key_txmic_len;
  2134. u32 key_rxmic_len;
  2135. const void *key_data;
  2136. };
  2137. /* Preamble types to be used with VDEV fixed rate configuration */
  2138. enum wmi_rate_preamble {
  2139. WMI_RATE_PREAMBLE_OFDM,
  2140. WMI_RATE_PREAMBLE_CCK,
  2141. WMI_RATE_PREAMBLE_HT,
  2142. WMI_RATE_PREAMBLE_VHT,
  2143. };
  2144. /* Value to disable fixed rate setting */
  2145. #define WMI_FIXED_RATE_NONE (0xff)
  2146. /* the definition of different VDEV parameters */
  2147. enum wmi_vdev_param {
  2148. /* RTS Threshold */
  2149. WMI_VDEV_PARAM_RTS_THRESHOLD = 0x1,
  2150. /* Fragmentation threshold */
  2151. WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
  2152. /* beacon interval in TUs */
  2153. WMI_VDEV_PARAM_BEACON_INTERVAL,
  2154. /* Listen interval in TUs */
  2155. WMI_VDEV_PARAM_LISTEN_INTERVAL,
  2156. /* muticast rate in Mbps */
  2157. WMI_VDEV_PARAM_MULTICAST_RATE,
  2158. /* management frame rate in Mbps */
  2159. WMI_VDEV_PARAM_MGMT_TX_RATE,
  2160. /* slot time (long vs short) */
  2161. WMI_VDEV_PARAM_SLOT_TIME,
  2162. /* preamble (long vs short) */
  2163. WMI_VDEV_PARAM_PREAMBLE,
  2164. /* SWBA time (time before tbtt in msec) */
  2165. WMI_VDEV_PARAM_SWBA_TIME,
  2166. /* time period for updating VDEV stats */
  2167. WMI_VDEV_STATS_UPDATE_PERIOD,
  2168. /* age out time in msec for frames queued for station in power save */
  2169. WMI_VDEV_PWRSAVE_AGEOUT_TIME,
  2170. /*
  2171. * Host SWBA interval (time in msec before tbtt for SWBA event
  2172. * generation).
  2173. */
  2174. WMI_VDEV_HOST_SWBA_INTERVAL,
  2175. /* DTIM period (specified in units of num beacon intervals) */
  2176. WMI_VDEV_PARAM_DTIM_PERIOD,
  2177. /*
  2178. * scheduler air time limit for this VDEV. used by off chan
  2179. * scheduler.
  2180. */
  2181. WMI_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
  2182. /* enable/dsiable WDS for this VDEV */
  2183. WMI_VDEV_PARAM_WDS,
  2184. /* ATIM Window */
  2185. WMI_VDEV_PARAM_ATIM_WINDOW,
  2186. /* BMISS max */
  2187. WMI_VDEV_PARAM_BMISS_COUNT_MAX,
  2188. /* BMISS first time */
  2189. WMI_VDEV_PARAM_BMISS_FIRST_BCNT,
  2190. /* BMISS final time */
  2191. WMI_VDEV_PARAM_BMISS_FINAL_BCNT,
  2192. /* WMM enables/disabled */
  2193. WMI_VDEV_PARAM_FEATURE_WMM,
  2194. /* Channel width */
  2195. WMI_VDEV_PARAM_CHWIDTH,
  2196. /* Channel Offset */
  2197. WMI_VDEV_PARAM_CHEXTOFFSET,
  2198. /* Disable HT Protection */
  2199. WMI_VDEV_PARAM_DISABLE_HTPROTECTION,
  2200. /* Quick STA Kickout */
  2201. WMI_VDEV_PARAM_STA_QUICKKICKOUT,
  2202. /* Rate to be used with Management frames */
  2203. WMI_VDEV_PARAM_MGMT_RATE,
  2204. /* Protection Mode */
  2205. WMI_VDEV_PARAM_PROTECTION_MODE,
  2206. /* Fixed rate setting */
  2207. WMI_VDEV_PARAM_FIXED_RATE,
  2208. /* Short GI Enable/Disable */
  2209. WMI_VDEV_PARAM_SGI,
  2210. /* Enable LDPC */
  2211. WMI_VDEV_PARAM_LDPC,
  2212. /* Enable Tx STBC */
  2213. WMI_VDEV_PARAM_TX_STBC,
  2214. /* Enable Rx STBC */
  2215. WMI_VDEV_PARAM_RX_STBC,
  2216. /* Intra BSS forwarding */
  2217. WMI_VDEV_PARAM_INTRA_BSS_FWD,
  2218. /* Setting Default xmit key for Vdev */
  2219. WMI_VDEV_PARAM_DEF_KEYID,
  2220. /* NSS width */
  2221. WMI_VDEV_PARAM_NSS,
  2222. /* Set the custom rate for the broadcast data frames */
  2223. WMI_VDEV_PARAM_BCAST_DATA_RATE,
  2224. /* Set the custom rate (rate-code) for multicast data frames */
  2225. WMI_VDEV_PARAM_MCAST_DATA_RATE,
  2226. /* Tx multicast packet indicate Enable/Disable */
  2227. WMI_VDEV_PARAM_MCAST_INDICATE,
  2228. /* Tx DHCP packet indicate Enable/Disable */
  2229. WMI_VDEV_PARAM_DHCP_INDICATE,
  2230. /* Enable host inspection of Tx unicast packet to unknown destination */
  2231. WMI_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
  2232. /* The minimum amount of time AP begins to consider STA inactive */
  2233. WMI_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
  2234. /*
  2235. * An associated STA is considered inactive when there is no recent
  2236. * TX/RX activity and no downlink frames are buffered for it. Once a
  2237. * STA exceeds the maximum idle inactive time, the AP will send an
  2238. * 802.11 data-null as a keep alive to verify the STA is still
  2239. * associated. If the STA does ACK the data-null, or if the data-null
  2240. * is buffered and the STA does not retrieve it, the STA will be
  2241. * considered unresponsive
  2242. * (see WMI_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
  2243. */
  2244. WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
  2245. /*
  2246. * An associated STA is considered unresponsive if there is no recent
  2247. * TX/RX activity and downlink frames are buffered for it. Once a STA
  2248. * exceeds the maximum unresponsive time, the AP will send a
  2249. * WMI_STA_KICKOUT event to the host so the STA can be deleted. */
  2250. WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
  2251. /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
  2252. WMI_VDEV_PARAM_AP_ENABLE_NAWDS,
  2253. /* Enable/Disable RTS-CTS */
  2254. WMI_VDEV_PARAM_ENABLE_RTSCTS,
  2255. /* Enable TXBFee/er */
  2256. WMI_VDEV_PARAM_TXBF,
  2257. /* Set packet power save */
  2258. WMI_VDEV_PARAM_PACKET_POWERSAVE,
  2259. /*
  2260. * Drops un-encrypted packets if eceived in an encrypted connection
  2261. * otherwise forwards to host.
  2262. */
  2263. WMI_VDEV_PARAM_DROP_UNENCRY,
  2264. /*
  2265. * Set the encapsulation type for frames.
  2266. */
  2267. WMI_VDEV_PARAM_TX_ENCAP_TYPE,
  2268. };
  2269. /* slot time long */
  2270. #define WMI_VDEV_SLOT_TIME_LONG 0x1
  2271. /* slot time short */
  2272. #define WMI_VDEV_SLOT_TIME_SHORT 0x2
  2273. /* preablbe long */
  2274. #define WMI_VDEV_PREAMBLE_LONG 0x1
  2275. /* preablbe short */
  2276. #define WMI_VDEV_PREAMBLE_SHORT 0x2
  2277. enum wmi_start_event_param {
  2278. WMI_VDEV_RESP_START_EVENT = 0,
  2279. WMI_VDEV_RESP_RESTART_EVENT,
  2280. };
  2281. struct wmi_vdev_start_response_event {
  2282. __le32 vdev_id;
  2283. __le32 req_id;
  2284. __le32 resp_type; /* %WMI_VDEV_RESP_ */
  2285. __le32 status;
  2286. } __packed;
  2287. struct wmi_vdev_standby_req_event {
  2288. /* unique id identifying the VDEV, generated by the caller */
  2289. __le32 vdev_id;
  2290. } __packed;
  2291. struct wmi_vdev_resume_req_event {
  2292. /* unique id identifying the VDEV, generated by the caller */
  2293. __le32 vdev_id;
  2294. } __packed;
  2295. struct wmi_vdev_stopped_event {
  2296. /* unique id identifying the VDEV, generated by the caller */
  2297. __le32 vdev_id;
  2298. } __packed;
  2299. /*
  2300. * common structure used for simple events
  2301. * (stopped, resume_req, standby response)
  2302. */
  2303. struct wmi_vdev_simple_event {
  2304. /* unique id identifying the VDEV, generated by the caller */
  2305. __le32 vdev_id;
  2306. } __packed;
  2307. /* VDEV start response status codes */
  2308. /* VDEV succesfully started */
  2309. #define WMI_INIFIED_VDEV_START_RESPONSE_STATUS_SUCCESS 0x0
  2310. /* requested VDEV not found */
  2311. #define WMI_INIFIED_VDEV_START_RESPONSE_INVALID_VDEVID 0x1
  2312. /* unsupported VDEV combination */
  2313. #define WMI_INIFIED_VDEV_START_RESPONSE_NOT_SUPPORTED 0x2
  2314. /* Beacon processing related command and event structures */
  2315. struct wmi_bcn_tx_hdr {
  2316. __le32 vdev_id;
  2317. __le32 tx_rate;
  2318. __le32 tx_power;
  2319. __le32 bcn_len;
  2320. } __packed;
  2321. struct wmi_bcn_tx_cmd {
  2322. struct wmi_bcn_tx_hdr hdr;
  2323. u8 *bcn[0];
  2324. } __packed;
  2325. struct wmi_bcn_tx_arg {
  2326. u32 vdev_id;
  2327. u32 tx_rate;
  2328. u32 tx_power;
  2329. u32 bcn_len;
  2330. const void *bcn;
  2331. };
  2332. /* Beacon filter */
  2333. #define WMI_BCN_FILTER_ALL 0 /* Filter all beacons */
  2334. #define WMI_BCN_FILTER_NONE 1 /* Pass all beacons */
  2335. #define WMI_BCN_FILTER_RSSI 2 /* Pass Beacons RSSI >= RSSI threshold */
  2336. #define WMI_BCN_FILTER_BSSID 3 /* Pass Beacons with matching BSSID */
  2337. #define WMI_BCN_FILTER_SSID 4 /* Pass Beacons with matching SSID */
  2338. struct wmi_bcn_filter_rx_cmd {
  2339. /* Filter ID */
  2340. __le32 bcn_filter_id;
  2341. /* Filter type - wmi_bcn_filter */
  2342. __le32 bcn_filter;
  2343. /* Buffer len */
  2344. __le32 bcn_filter_len;
  2345. /* Filter info (threshold, BSSID, RSSI) */
  2346. u8 *bcn_filter_buf;
  2347. } __packed;
  2348. /* Capabilities and IEs to be passed to firmware */
  2349. struct wmi_bcn_prb_info {
  2350. /* Capabilities */
  2351. __le32 caps;
  2352. /* ERP info */
  2353. __le32 erp;
  2354. /* Advanced capabilities */
  2355. /* HT capabilities */
  2356. /* HT Info */
  2357. /* ibss_dfs */
  2358. /* wpa Info */
  2359. /* rsn Info */
  2360. /* rrm info */
  2361. /* ath_ext */
  2362. /* app IE */
  2363. } __packed;
  2364. struct wmi_bcn_tmpl_cmd {
  2365. /* unique id identifying the VDEV, generated by the caller */
  2366. __le32 vdev_id;
  2367. /* TIM IE offset from the beginning of the template. */
  2368. __le32 tim_ie_offset;
  2369. /* beacon probe capabilities and IEs */
  2370. struct wmi_bcn_prb_info bcn_prb_info;
  2371. /* beacon buffer length */
  2372. __le32 buf_len;
  2373. /* variable length data */
  2374. u8 data[1];
  2375. } __packed;
  2376. struct wmi_prb_tmpl_cmd {
  2377. /* unique id identifying the VDEV, generated by the caller */
  2378. __le32 vdev_id;
  2379. /* beacon probe capabilities and IEs */
  2380. struct wmi_bcn_prb_info bcn_prb_info;
  2381. /* beacon buffer length */
  2382. __le32 buf_len;
  2383. /* Variable length data */
  2384. u8 data[1];
  2385. } __packed;
  2386. enum wmi_sta_ps_mode {
  2387. /* enable power save for the given STA VDEV */
  2388. WMI_STA_PS_MODE_DISABLED = 0,
  2389. /* disable power save for a given STA VDEV */
  2390. WMI_STA_PS_MODE_ENABLED = 1,
  2391. };
  2392. struct wmi_sta_powersave_mode_cmd {
  2393. /* unique id identifying the VDEV, generated by the caller */
  2394. __le32 vdev_id;
  2395. /*
  2396. * Power save mode
  2397. * (see enum wmi_sta_ps_mode)
  2398. */
  2399. __le32 sta_ps_mode;
  2400. } __packed;
  2401. enum wmi_csa_offload_en {
  2402. WMI_CSA_OFFLOAD_DISABLE = 0,
  2403. WMI_CSA_OFFLOAD_ENABLE = 1,
  2404. };
  2405. struct wmi_csa_offload_enable_cmd {
  2406. __le32 vdev_id;
  2407. __le32 csa_offload_enable;
  2408. } __packed;
  2409. struct wmi_csa_offload_chanswitch_cmd {
  2410. __le32 vdev_id;
  2411. struct wmi_channel chan;
  2412. } __packed;
  2413. /*
  2414. * This parameter controls the policy for retrieving frames from AP while the
  2415. * STA is in sleep state.
  2416. *
  2417. * Only takes affect if the sta_ps_mode is enabled
  2418. */
  2419. enum wmi_sta_ps_param_rx_wake_policy {
  2420. /*
  2421. * Wake up when ever there is an RX activity on the VDEV. In this mode
  2422. * the Power save SM(state machine) will come out of sleep by either
  2423. * sending null frame (or) a data frame (with PS==0) in response to TIM
  2424. * bit set in the received beacon frame from AP.
  2425. */
  2426. WMI_STA_PS_RX_WAKE_POLICY_WAKE = 0,
  2427. /*
  2428. * Here the power save state machine will not wakeup in response to TIM
  2429. * bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD
  2430. * configuration setup by WMISET_PS_SET_UAPSD WMI command. When all
  2431. * access categories are delivery-enabled, the station will send a
  2432. * UAPSD trigger frame, otherwise it will send a PS-Poll.
  2433. */
  2434. WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1,
  2435. };
  2436. /*
  2437. * Number of tx frames/beacon that cause the power save SM to wake up.
  2438. *
  2439. * Value 1 causes the SM to wake up for every TX. Value 0 has a special
  2440. * meaning, It will cause the SM to never wake up. This is useful if you want
  2441. * to keep the system to sleep all the time for some kind of test mode . host
  2442. * can change this parameter any time. It will affect at the next tx frame.
  2443. */
  2444. enum wmi_sta_ps_param_tx_wake_threshold {
  2445. WMI_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0,
  2446. WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1,
  2447. /*
  2448. * Values greater than one indicate that many TX attempts per beacon
  2449. * interval before the STA will wake up
  2450. */
  2451. };
  2452. /*
  2453. * The maximum number of PS-Poll frames the FW will send in response to
  2454. * traffic advertised in TIM before waking up (by sending a null frame with PS
  2455. * = 0). Value 0 has a special meaning: there is no maximum count and the FW
  2456. * will send as many PS-Poll as are necessary to retrieve buffered BU. This
  2457. * parameter is used when the RX wake policy is
  2458. * WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD and ignored when the RX wake
  2459. * policy is WMI_STA_PS_RX_WAKE_POLICY_WAKE.
  2460. */
  2461. enum wmi_sta_ps_param_pspoll_count {
  2462. WMI_STA_PS_PSPOLL_COUNT_NO_MAX = 0,
  2463. /*
  2464. * Values greater than 0 indicate the maximum numer of PS-Poll frames
  2465. * FW will send before waking up.
  2466. */
  2467. };
  2468. /*
  2469. * This will include the delivery and trigger enabled state for every AC.
  2470. * This is the negotiated state with AP. The host MLME needs to set this based
  2471. * on AP capability and the state Set in the association request by the
  2472. * station MLME.Lower 8 bits of the value specify the UAPSD configuration.
  2473. */
  2474. #define WMI_UAPSD_AC_TYPE_DELI 0
  2475. #define WMI_UAPSD_AC_TYPE_TRIG 1
  2476. #define WMI_UAPSD_AC_BIT_MASK(ac, type) \
  2477. ((type == WMI_UAPSD_AC_TYPE_DELI) ? (1<<(ac<<1)) : (1<<((ac<<1)+1)))
  2478. enum wmi_sta_ps_param_uapsd {
  2479. WMI_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
  2480. WMI_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
  2481. WMI_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
  2482. WMI_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
  2483. WMI_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
  2484. WMI_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
  2485. WMI_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
  2486. WMI_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
  2487. };
  2488. enum wmi_sta_powersave_param {
  2489. /*
  2490. * Controls how frames are retrievd from AP while STA is sleeping
  2491. *
  2492. * (see enum wmi_sta_ps_param_rx_wake_policy)
  2493. */
  2494. WMI_STA_PS_PARAM_RX_WAKE_POLICY = 0,
  2495. /*
  2496. * The STA will go active after this many TX
  2497. *
  2498. * (see enum wmi_sta_ps_param_tx_wake_threshold)
  2499. */
  2500. WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
  2501. /*
  2502. * Number of PS-Poll to send before STA wakes up
  2503. *
  2504. * (see enum wmi_sta_ps_param_pspoll_count)
  2505. *
  2506. */
  2507. WMI_STA_PS_PARAM_PSPOLL_COUNT = 2,
  2508. /*
  2509. * TX/RX inactivity time in msec before going to sleep.
  2510. *
  2511. * The power save SM will monitor tx/rx activity on the VDEV, if no
  2512. * activity for the specified msec of the parameter the Power save
  2513. * SM will go to sleep.
  2514. */
  2515. WMI_STA_PS_PARAM_INACTIVITY_TIME = 3,
  2516. /*
  2517. * Set uapsd configuration.
  2518. *
  2519. * (see enum wmi_sta_ps_param_uapsd)
  2520. */
  2521. WMI_STA_PS_PARAM_UAPSD = 4,
  2522. };
  2523. struct wmi_sta_powersave_param_cmd {
  2524. __le32 vdev_id;
  2525. __le32 param_id; /* %WMI_STA_PS_PARAM_ */
  2526. __le32 param_value;
  2527. } __packed;
  2528. /* No MIMO power save */
  2529. #define WMI_STA_MIMO_PS_MODE_DISABLE
  2530. /* mimo powersave mode static*/
  2531. #define WMI_STA_MIMO_PS_MODE_STATIC
  2532. /* mimo powersave mode dynamic */
  2533. #define WMI_STA_MIMO_PS_MODE_DYNAMIC
  2534. struct wmi_sta_mimo_ps_mode_cmd {
  2535. /* unique id identifying the VDEV, generated by the caller */
  2536. __le32 vdev_id;
  2537. /* mimo powersave mode as defined above */
  2538. __le32 mimo_pwrsave_mode;
  2539. } __packed;
  2540. /* U-APSD configuration of peer station from (re)assoc request and TSPECs */
  2541. enum wmi_ap_ps_param_uapsd {
  2542. WMI_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
  2543. WMI_AP_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
  2544. WMI_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
  2545. WMI_AP_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
  2546. WMI_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
  2547. WMI_AP_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
  2548. WMI_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
  2549. WMI_AP_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
  2550. };
  2551. /* U-APSD maximum service period of peer station */
  2552. enum wmi_ap_ps_peer_param_max_sp {
  2553. WMI_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0,
  2554. WMI_AP_PS_PEER_PARAM_MAX_SP_2 = 1,
  2555. WMI_AP_PS_PEER_PARAM_MAX_SP_4 = 2,
  2556. WMI_AP_PS_PEER_PARAM_MAX_SP_6 = 3,
  2557. MAX_WMI_AP_PS_PEER_PARAM_MAX_SP,
  2558. };
  2559. /*
  2560. * AP power save parameter
  2561. * Set a power save specific parameter for a peer station
  2562. */
  2563. enum wmi_ap_ps_peer_param {
  2564. /* Set uapsd configuration for a given peer.
  2565. *
  2566. * Include the delivery and trigger enabled state for every AC.
  2567. * The host MLME needs to set this based on AP capability and stations
  2568. * request Set in the association request received from the station.
  2569. *
  2570. * Lower 8 bits of the value specify the UAPSD configuration.
  2571. *
  2572. * (see enum wmi_ap_ps_param_uapsd)
  2573. * The default value is 0.
  2574. */
  2575. WMI_AP_PS_PEER_PARAM_UAPSD = 0,
  2576. /*
  2577. * Set the service period for a UAPSD capable station
  2578. *
  2579. * The service period from wme ie in the (re)assoc request frame.
  2580. *
  2581. * (see enum wmi_ap_ps_peer_param_max_sp)
  2582. */
  2583. WMI_AP_PS_PEER_PARAM_MAX_SP = 1,
  2584. /* Time in seconds for aging out buffered frames for STA in PS */
  2585. WMI_AP_PS_PEER_PARAM_AGEOUT_TIME = 2,
  2586. };
  2587. struct wmi_ap_ps_peer_cmd {
  2588. /* unique id identifying the VDEV, generated by the caller */
  2589. __le32 vdev_id;
  2590. /* peer MAC address */
  2591. struct wmi_mac_addr peer_macaddr;
  2592. /* AP powersave param (see enum wmi_ap_ps_peer_param) */
  2593. __le32 param_id;
  2594. /* AP powersave param value */
  2595. __le32 param_value;
  2596. } __packed;
  2597. /* 128 clients = 4 words */
  2598. #define WMI_TIM_BITMAP_ARRAY_SIZE 4
  2599. struct wmi_tim_info {
  2600. __le32 tim_len;
  2601. __le32 tim_mcast;
  2602. __le32 tim_bitmap[WMI_TIM_BITMAP_ARRAY_SIZE];
  2603. __le32 tim_changed;
  2604. __le32 tim_num_ps_pending;
  2605. } __packed;
  2606. /* Maximum number of NOA Descriptors supported */
  2607. #define WMI_P2P_MAX_NOA_DESCRIPTORS 4
  2608. #define WMI_P2P_OPPPS_ENABLE_BIT BIT(0)
  2609. #define WMI_P2P_OPPPS_CTWINDOW_OFFSET 1
  2610. #define WMI_P2P_NOA_CHANGED_BIT BIT(0)
  2611. struct wmi_p2p_noa_info {
  2612. /* Bit 0 - Flag to indicate an update in NOA schedule
  2613. Bits 7-1 - Reserved */
  2614. u8 changed;
  2615. /* NOA index */
  2616. u8 index;
  2617. /* Bit 0 - Opp PS state of the AP
  2618. Bits 1-7 - Ctwindow in TUs */
  2619. u8 ctwindow_oppps;
  2620. /* Number of NOA descriptors */
  2621. u8 num_descriptors;
  2622. struct wmi_p2p_noa_descriptor descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS];
  2623. } __packed;
  2624. struct wmi_bcn_info {
  2625. struct wmi_tim_info tim_info;
  2626. struct wmi_p2p_noa_info p2p_noa_info;
  2627. } __packed;
  2628. struct wmi_host_swba_event {
  2629. __le32 vdev_map;
  2630. struct wmi_bcn_info bcn_info[1];
  2631. } __packed;
  2632. #define WMI_MAX_AP_VDEV 16
  2633. struct wmi_tbtt_offset_event {
  2634. __le32 vdev_map;
  2635. __le32 tbttoffset_list[WMI_MAX_AP_VDEV];
  2636. } __packed;
  2637. struct wmi_peer_create_cmd {
  2638. __le32 vdev_id;
  2639. struct wmi_mac_addr peer_macaddr;
  2640. } __packed;
  2641. struct wmi_peer_delete_cmd {
  2642. __le32 vdev_id;
  2643. struct wmi_mac_addr peer_macaddr;
  2644. } __packed;
  2645. struct wmi_peer_flush_tids_cmd {
  2646. __le32 vdev_id;
  2647. struct wmi_mac_addr peer_macaddr;
  2648. __le32 peer_tid_bitmap;
  2649. } __packed;
  2650. struct wmi_fixed_rate {
  2651. /*
  2652. * rate mode . 0: disable fixed rate (auto rate)
  2653. * 1: legacy (non 11n) rate specified as ieee rate 2*Mbps
  2654. * 2: ht20 11n rate specified as mcs index
  2655. * 3: ht40 11n rate specified as mcs index
  2656. */
  2657. __le32 rate_mode;
  2658. /*
  2659. * 4 rate values for 4 rate series. series 0 is stored in byte 0 (LSB)
  2660. * and series 3 is stored at byte 3 (MSB)
  2661. */
  2662. __le32 rate_series;
  2663. /*
  2664. * 4 retry counts for 4 rate series. retry count for rate 0 is stored
  2665. * in byte 0 (LSB) and retry count for rate 3 is stored at byte 3
  2666. * (MSB)
  2667. */
  2668. __le32 rate_retries;
  2669. } __packed;
  2670. struct wmi_peer_fixed_rate_cmd {
  2671. /* unique id identifying the VDEV, generated by the caller */
  2672. __le32 vdev_id;
  2673. /* peer MAC address */
  2674. struct wmi_mac_addr peer_macaddr;
  2675. /* fixed rate */
  2676. struct wmi_fixed_rate peer_fixed_rate;
  2677. } __packed;
  2678. #define WMI_MGMT_TID 17
  2679. struct wmi_addba_clear_resp_cmd {
  2680. /* unique id identifying the VDEV, generated by the caller */
  2681. __le32 vdev_id;
  2682. /* peer MAC address */
  2683. struct wmi_mac_addr peer_macaddr;
  2684. } __packed;
  2685. struct wmi_addba_send_cmd {
  2686. /* unique id identifying the VDEV, generated by the caller */
  2687. __le32 vdev_id;
  2688. /* peer MAC address */
  2689. struct wmi_mac_addr peer_macaddr;
  2690. /* Tid number */
  2691. __le32 tid;
  2692. /* Buffer/Window size*/
  2693. __le32 buffersize;
  2694. } __packed;
  2695. struct wmi_delba_send_cmd {
  2696. /* unique id identifying the VDEV, generated by the caller */
  2697. __le32 vdev_id;
  2698. /* peer MAC address */
  2699. struct wmi_mac_addr peer_macaddr;
  2700. /* Tid number */
  2701. __le32 tid;
  2702. /* Is Initiator */
  2703. __le32 initiator;
  2704. /* Reason code */
  2705. __le32 reasoncode;
  2706. } __packed;
  2707. struct wmi_addba_setresponse_cmd {
  2708. /* unique id identifying the vdev, generated by the caller */
  2709. __le32 vdev_id;
  2710. /* peer mac address */
  2711. struct wmi_mac_addr peer_macaddr;
  2712. /* Tid number */
  2713. __le32 tid;
  2714. /* status code */
  2715. __le32 statuscode;
  2716. } __packed;
  2717. struct wmi_send_singleamsdu_cmd {
  2718. /* unique id identifying the vdev, generated by the caller */
  2719. __le32 vdev_id;
  2720. /* peer mac address */
  2721. struct wmi_mac_addr peer_macaddr;
  2722. /* Tid number */
  2723. __le32 tid;
  2724. } __packed;
  2725. enum wmi_peer_smps_state {
  2726. WMI_PEER_SMPS_PS_NONE = 0x0,
  2727. WMI_PEER_SMPS_STATIC = 0x1,
  2728. WMI_PEER_SMPS_DYNAMIC = 0x2
  2729. };
  2730. enum wmi_peer_param {
  2731. WMI_PEER_SMPS_STATE = 0x1, /* see %wmi_peer_smps_state */
  2732. WMI_PEER_AMPDU = 0x2,
  2733. WMI_PEER_AUTHORIZE = 0x3,
  2734. WMI_PEER_CHAN_WIDTH = 0x4,
  2735. WMI_PEER_NSS = 0x5,
  2736. WMI_PEER_USE_4ADDR = 0x6
  2737. };
  2738. struct wmi_peer_set_param_cmd {
  2739. __le32 vdev_id;
  2740. struct wmi_mac_addr peer_macaddr;
  2741. __le32 param_id;
  2742. __le32 param_value;
  2743. } __packed;
  2744. #define MAX_SUPPORTED_RATES 128
  2745. struct wmi_rate_set {
  2746. /* total number of rates */
  2747. __le32 num_rates;
  2748. /*
  2749. * rates (each 8bit value) packed into a 32 bit word.
  2750. * the rates are filled from least significant byte to most
  2751. * significant byte.
  2752. */
  2753. __le32 rates[(MAX_SUPPORTED_RATES/4)+1];
  2754. } __packed;
  2755. struct wmi_rate_set_arg {
  2756. unsigned int num_rates;
  2757. u8 rates[MAX_SUPPORTED_RATES];
  2758. };
  2759. /*
  2760. * NOTE: It would bea good idea to represent the Tx MCS
  2761. * info in one word and Rx in another word. This is split
  2762. * into multiple words for convenience
  2763. */
  2764. struct wmi_vht_rate_set {
  2765. __le32 rx_max_rate; /* Max Rx data rate */
  2766. __le32 rx_mcs_set; /* Negotiated RX VHT rates */
  2767. __le32 tx_max_rate; /* Max Tx data rate */
  2768. __le32 tx_mcs_set; /* Negotiated TX VHT rates */
  2769. } __packed;
  2770. struct wmi_vht_rate_set_arg {
  2771. u32 rx_max_rate;
  2772. u32 rx_mcs_set;
  2773. u32 tx_max_rate;
  2774. u32 tx_mcs_set;
  2775. };
  2776. struct wmi_peer_set_rates_cmd {
  2777. /* peer MAC address */
  2778. struct wmi_mac_addr peer_macaddr;
  2779. /* legacy rate set */
  2780. struct wmi_rate_set peer_legacy_rates;
  2781. /* ht rate set */
  2782. struct wmi_rate_set peer_ht_rates;
  2783. } __packed;
  2784. struct wmi_peer_set_q_empty_callback_cmd {
  2785. /* unique id identifying the VDEV, generated by the caller */
  2786. __le32 vdev_id;
  2787. /* peer MAC address */
  2788. struct wmi_mac_addr peer_macaddr;
  2789. __le32 callback_enable;
  2790. } __packed;
  2791. #define WMI_PEER_AUTH 0x00000001
  2792. #define WMI_PEER_QOS 0x00000002
  2793. #define WMI_PEER_NEED_PTK_4_WAY 0x00000004
  2794. #define WMI_PEER_NEED_GTK_2_WAY 0x00000010
  2795. #define WMI_PEER_APSD 0x00000800
  2796. #define WMI_PEER_HT 0x00001000
  2797. #define WMI_PEER_40MHZ 0x00002000
  2798. #define WMI_PEER_STBC 0x00008000
  2799. #define WMI_PEER_LDPC 0x00010000
  2800. #define WMI_PEER_DYN_MIMOPS 0x00020000
  2801. #define WMI_PEER_STATIC_MIMOPS 0x00040000
  2802. #define WMI_PEER_SPATIAL_MUX 0x00200000
  2803. #define WMI_PEER_VHT 0x02000000
  2804. #define WMI_PEER_80MHZ 0x04000000
  2805. #define WMI_PEER_PMF 0x08000000
  2806. /*
  2807. * Peer rate capabilities.
  2808. *
  2809. * This is of interest to the ratecontrol
  2810. * module which resides in the firmware. The bit definitions are
  2811. * consistent with that defined in if_athrate.c.
  2812. */
  2813. #define WMI_RC_DS_FLAG 0x01
  2814. #define WMI_RC_CW40_FLAG 0x02
  2815. #define WMI_RC_SGI_FLAG 0x04
  2816. #define WMI_RC_HT_FLAG 0x08
  2817. #define WMI_RC_RTSCTS_FLAG 0x10
  2818. #define WMI_RC_TX_STBC_FLAG 0x20
  2819. #define WMI_RC_RX_STBC_FLAG 0xC0
  2820. #define WMI_RC_RX_STBC_FLAG_S 6
  2821. #define WMI_RC_WEP_TKIP_FLAG 0x100
  2822. #define WMI_RC_TS_FLAG 0x200
  2823. #define WMI_RC_UAPSD_FLAG 0x400
  2824. /* Maximum listen interval supported by hw in units of beacon interval */
  2825. #define ATH10K_MAX_HW_LISTEN_INTERVAL 5
  2826. struct wmi_peer_assoc_complete_cmd {
  2827. struct wmi_mac_addr peer_macaddr;
  2828. __le32 vdev_id;
  2829. __le32 peer_new_assoc; /* 1=assoc, 0=reassoc */
  2830. __le32 peer_associd; /* 16 LSBs */
  2831. __le32 peer_flags;
  2832. __le32 peer_caps; /* 16 LSBs */
  2833. __le32 peer_listen_intval;
  2834. __le32 peer_ht_caps;
  2835. __le32 peer_max_mpdu;
  2836. __le32 peer_mpdu_density; /* 0..16 */
  2837. __le32 peer_rate_caps;
  2838. struct wmi_rate_set peer_legacy_rates;
  2839. struct wmi_rate_set peer_ht_rates;
  2840. __le32 peer_nss; /* num of spatial streams */
  2841. __le32 peer_vht_caps;
  2842. __le32 peer_phymode;
  2843. struct wmi_vht_rate_set peer_vht_rates;
  2844. /* HT Operation Element of the peer. Five bytes packed in 2
  2845. * INT32 array and filled from lsb to msb. */
  2846. __le32 peer_ht_info[2];
  2847. } __packed;
  2848. struct wmi_peer_assoc_complete_arg {
  2849. u8 addr[ETH_ALEN];
  2850. u32 vdev_id;
  2851. bool peer_reassoc;
  2852. u16 peer_aid;
  2853. u32 peer_flags; /* see %WMI_PEER_ */
  2854. u16 peer_caps;
  2855. u32 peer_listen_intval;
  2856. u32 peer_ht_caps;
  2857. u32 peer_max_mpdu;
  2858. u32 peer_mpdu_density; /* 0..16 */
  2859. u32 peer_rate_caps; /* see %WMI_RC_ */
  2860. struct wmi_rate_set_arg peer_legacy_rates;
  2861. struct wmi_rate_set_arg peer_ht_rates;
  2862. u32 peer_num_spatial_streams;
  2863. u32 peer_vht_caps;
  2864. enum wmi_phy_mode peer_phymode;
  2865. struct wmi_vht_rate_set_arg peer_vht_rates;
  2866. };
  2867. struct wmi_peer_add_wds_entry_cmd {
  2868. /* peer MAC address */
  2869. struct wmi_mac_addr peer_macaddr;
  2870. /* wds MAC addr */
  2871. struct wmi_mac_addr wds_macaddr;
  2872. } __packed;
  2873. struct wmi_peer_remove_wds_entry_cmd {
  2874. /* wds MAC addr */
  2875. struct wmi_mac_addr wds_macaddr;
  2876. } __packed;
  2877. struct wmi_peer_q_empty_callback_event {
  2878. /* peer MAC address */
  2879. struct wmi_mac_addr peer_macaddr;
  2880. } __packed;
  2881. /*
  2882. * Channel info WMI event
  2883. */
  2884. struct wmi_chan_info_event {
  2885. __le32 err_code;
  2886. __le32 freq;
  2887. __le32 cmd_flags;
  2888. __le32 noise_floor;
  2889. __le32 rx_clear_count;
  2890. __le32 cycle_count;
  2891. } __packed;
  2892. #define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0)
  2893. /* FIXME: empirically extrapolated */
  2894. #define WMI_CHAN_INFO_MSEC(x) ((x) / 76595)
  2895. /* Beacon filter wmi command info */
  2896. #define BCN_FLT_MAX_SUPPORTED_IES 256
  2897. #define BCN_FLT_MAX_ELEMS_IE_LIST (BCN_FLT_MAX_SUPPORTED_IES / 32)
  2898. struct bss_bcn_stats {
  2899. __le32 vdev_id;
  2900. __le32 bss_bcnsdropped;
  2901. __le32 bss_bcnsdelivered;
  2902. } __packed;
  2903. struct bcn_filter_stats {
  2904. __le32 bcns_dropped;
  2905. __le32 bcns_delivered;
  2906. __le32 activefilters;
  2907. struct bss_bcn_stats bss_stats;
  2908. } __packed;
  2909. struct wmi_add_bcn_filter_cmd {
  2910. u32 vdev_id;
  2911. u32 ie_map[BCN_FLT_MAX_ELEMS_IE_LIST];
  2912. } __packed;
  2913. enum wmi_sta_keepalive_method {
  2914. WMI_STA_KEEPALIVE_METHOD_NULL_FRAME = 1,
  2915. WMI_STA_KEEPALIVE_METHOD_UNSOLICITATED_ARP_RESPONSE = 2,
  2916. };
  2917. /* note: ip4 addresses are in network byte order, i.e. big endian */
  2918. struct wmi_sta_keepalive_arp_resp {
  2919. __be32 src_ip4_addr;
  2920. __be32 dest_ip4_addr;
  2921. struct wmi_mac_addr dest_mac_addr;
  2922. } __packed;
  2923. struct wmi_sta_keepalive_cmd {
  2924. __le32 vdev_id;
  2925. __le32 enabled;
  2926. __le32 method; /* WMI_STA_KEEPALIVE_METHOD_ */
  2927. __le32 interval; /* in seconds */
  2928. struct wmi_sta_keepalive_arp_resp arp_resp;
  2929. } __packed;
  2930. enum wmi_force_fw_hang_type {
  2931. WMI_FORCE_FW_HANG_ASSERT = 1,
  2932. WMI_FORCE_FW_HANG_NO_DETECT,
  2933. WMI_FORCE_FW_HANG_CTRL_EP_FULL,
  2934. WMI_FORCE_FW_HANG_EMPTY_POINT,
  2935. WMI_FORCE_FW_HANG_STACK_OVERFLOW,
  2936. WMI_FORCE_FW_HANG_INFINITE_LOOP,
  2937. };
  2938. #define WMI_FORCE_FW_HANG_RANDOM_TIME 0xFFFFFFFF
  2939. struct wmi_force_fw_hang_cmd {
  2940. __le32 type;
  2941. __le32 delay_ms;
  2942. } __packed;
  2943. #define ATH10K_RTS_MAX 2347
  2944. #define ATH10K_FRAGMT_THRESHOLD_MIN 540
  2945. #define ATH10K_FRAGMT_THRESHOLD_MAX 2346
  2946. #define WMI_MAX_EVENT 0x1000
  2947. /* Maximum number of pending TXed WMI packets */
  2948. #define WMI_SKB_HEADROOM sizeof(struct wmi_cmd_hdr)
  2949. /* By default disable power save for IBSS */
  2950. #define ATH10K_DEFAULT_ATIM 0
  2951. struct ath10k;
  2952. struct ath10k_vif;
  2953. int ath10k_wmi_attach(struct ath10k *ar);
  2954. void ath10k_wmi_detach(struct ath10k *ar);
  2955. int ath10k_wmi_wait_for_service_ready(struct ath10k *ar);
  2956. int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar);
  2957. int ath10k_wmi_connect_htc_service(struct ath10k *ar);
  2958. int ath10k_wmi_pdev_set_channel(struct ath10k *ar,
  2959. const struct wmi_channel_arg *);
  2960. int ath10k_wmi_pdev_suspend_target(struct ath10k *ar);
  2961. int ath10k_wmi_pdev_resume_target(struct ath10k *ar);
  2962. int ath10k_wmi_pdev_set_regdomain(struct ath10k *ar, u16 rd, u16 rd2g,
  2963. u16 rd5g, u16 ctl2g, u16 ctl5g);
  2964. int ath10k_wmi_pdev_set_param(struct ath10k *ar, enum wmi_pdev_param id,
  2965. u32 value);
  2966. int ath10k_wmi_cmd_init(struct ath10k *ar);
  2967. int ath10k_wmi_start_scan(struct ath10k *ar, const struct wmi_start_scan_arg *);
  2968. void ath10k_wmi_start_scan_init(struct ath10k *ar, struct wmi_start_scan_arg *);
  2969. int ath10k_wmi_stop_scan(struct ath10k *ar,
  2970. const struct wmi_stop_scan_arg *arg);
  2971. int ath10k_wmi_vdev_create(struct ath10k *ar, u32 vdev_id,
  2972. enum wmi_vdev_type type,
  2973. enum wmi_vdev_subtype subtype,
  2974. const u8 macaddr[ETH_ALEN]);
  2975. int ath10k_wmi_vdev_delete(struct ath10k *ar, u32 vdev_id);
  2976. int ath10k_wmi_vdev_start(struct ath10k *ar,
  2977. const struct wmi_vdev_start_request_arg *);
  2978. int ath10k_wmi_vdev_restart(struct ath10k *ar,
  2979. const struct wmi_vdev_start_request_arg *);
  2980. int ath10k_wmi_vdev_stop(struct ath10k *ar, u32 vdev_id);
  2981. int ath10k_wmi_vdev_up(struct ath10k *ar, u32 vdev_id, u32 aid,
  2982. const u8 *bssid);
  2983. int ath10k_wmi_vdev_down(struct ath10k *ar, u32 vdev_id);
  2984. int ath10k_wmi_vdev_set_param(struct ath10k *ar, u32 vdev_id,
  2985. enum wmi_vdev_param param_id, u32 param_value);
  2986. int ath10k_wmi_vdev_install_key(struct ath10k *ar,
  2987. const struct wmi_vdev_install_key_arg *arg);
  2988. int ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id,
  2989. const u8 peer_addr[ETH_ALEN]);
  2990. int ath10k_wmi_peer_delete(struct ath10k *ar, u32 vdev_id,
  2991. const u8 peer_addr[ETH_ALEN]);
  2992. int ath10k_wmi_peer_flush(struct ath10k *ar, u32 vdev_id,
  2993. const u8 peer_addr[ETH_ALEN], u32 tid_bitmap);
  2994. int ath10k_wmi_peer_set_param(struct ath10k *ar, u32 vdev_id,
  2995. const u8 *peer_addr,
  2996. enum wmi_peer_param param_id, u32 param_value);
  2997. int ath10k_wmi_peer_assoc(struct ath10k *ar,
  2998. const struct wmi_peer_assoc_complete_arg *arg);
  2999. int ath10k_wmi_set_psmode(struct ath10k *ar, u32 vdev_id,
  3000. enum wmi_sta_ps_mode psmode);
  3001. int ath10k_wmi_set_sta_ps_param(struct ath10k *ar, u32 vdev_id,
  3002. enum wmi_sta_powersave_param param_id,
  3003. u32 value);
  3004. int ath10k_wmi_set_ap_ps_param(struct ath10k *ar, u32 vdev_id, const u8 *mac,
  3005. enum wmi_ap_ps_peer_param param_id, u32 value);
  3006. int ath10k_wmi_scan_chan_list(struct ath10k *ar,
  3007. const struct wmi_scan_chan_list_arg *arg);
  3008. int ath10k_wmi_beacon_send_nowait(struct ath10k *ar,
  3009. const struct wmi_bcn_tx_arg *arg);
  3010. int ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar,
  3011. const struct wmi_pdev_set_wmm_params_arg *arg);
  3012. int ath10k_wmi_request_stats(struct ath10k *ar, enum wmi_stats_id stats_id);
  3013. int ath10k_wmi_force_fw_hang(struct ath10k *ar,
  3014. enum wmi_force_fw_hang_type type, u32 delay_ms);
  3015. #endif /* _WMI_H_ */