wmi.h 85 KB

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