wmi.h 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527
  1. /*
  2. * Copyright (c) 2012-2016 Qualcomm Atheros, Inc.
  3. * Copyright (c) 2006-2012 Wilocity
  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. /*
  18. * This file contains the definitions of the WMI protocol specified in the
  19. * Wireless Module Interface (WMI) for the Qualcomm
  20. * 60 GHz wireless solution.
  21. * It includes definitions of all the commands and events.
  22. * Commands are messages from the host to the WM.
  23. * Events are messages from the WM to the host.
  24. *
  25. * This is an automatically generated file.
  26. */
  27. #ifndef __WILOCITY_WMI_H__
  28. #define __WILOCITY_WMI_H__
  29. /* General */
  30. #define WMI_MAX_ASSOC_STA (8)
  31. #define WMI_DEFAULT_ASSOC_STA (1)
  32. #define WMI_MAC_LEN (6)
  33. #define WMI_PROX_RANGE_NUM (3)
  34. #define WMI_MAX_LOSS_DMG_BEACONS (20)
  35. #define MAX_NUM_OF_SECTORS (128)
  36. /* Mailbox interface
  37. * used for commands and events
  38. */
  39. enum wmi_mid {
  40. MID_DEFAULT = 0x00,
  41. FIRST_DBG_MID_ID = 0x10,
  42. LAST_DBG_MID_ID = 0xFE,
  43. MID_BROADCAST = 0xFF,
  44. };
  45. /* FW capability IDs
  46. * Each ID maps to a bit in a 32-bit bitmask value provided by the FW to
  47. * the host
  48. */
  49. enum wmi_fw_capability {
  50. WMI_FW_CAPABILITY_FTM = 0,
  51. WMI_FW_CAPABILITY_PS_CONFIG = 1,
  52. WMI_FW_CAPABILITY_RF_SECTORS = 2,
  53. WMI_FW_CAPABILITY_MGMT_RETRY_LIMIT = 3,
  54. WMI_FW_CAPABILITY_MAX,
  55. };
  56. /* WMI_CMD_HDR */
  57. struct wmi_cmd_hdr {
  58. u8 mid;
  59. u8 reserved;
  60. __le16 command_id;
  61. __le32 fw_timestamp;
  62. } __packed;
  63. /* List of Commands */
  64. enum wmi_command_id {
  65. WMI_CONNECT_CMDID = 0x01,
  66. WMI_DISCONNECT_CMDID = 0x03,
  67. WMI_DISCONNECT_STA_CMDID = 0x04,
  68. WMI_START_SCAN_CMDID = 0x07,
  69. WMI_SET_BSS_FILTER_CMDID = 0x09,
  70. WMI_SET_PROBED_SSID_CMDID = 0x0A,
  71. WMI_SET_LISTEN_INT_CMDID = 0x0B,
  72. WMI_BCON_CTRL_CMDID = 0x0F,
  73. WMI_ADD_CIPHER_KEY_CMDID = 0x16,
  74. WMI_DELETE_CIPHER_KEY_CMDID = 0x17,
  75. WMI_PCP_CONF_CMDID = 0x18,
  76. WMI_SET_APPIE_CMDID = 0x3F,
  77. WMI_SET_WSC_STATUS_CMDID = 0x41,
  78. WMI_PXMT_RANGE_CFG_CMDID = 0x42,
  79. WMI_PXMT_SNR2_RANGE_CFG_CMDID = 0x43,
  80. WMI_MEM_READ_CMDID = 0x800,
  81. WMI_MEM_WR_CMDID = 0x801,
  82. WMI_ECHO_CMDID = 0x803,
  83. WMI_DEEP_ECHO_CMDID = 0x804,
  84. WMI_CONFIG_MAC_CMDID = 0x805,
  85. WMI_CONFIG_PHY_DEBUG_CMDID = 0x806,
  86. WMI_ADD_DEBUG_TX_PCKT_CMDID = 0x808,
  87. WMI_PHY_GET_STATISTICS_CMDID = 0x809,
  88. WMI_FS_TUNE_CMDID = 0x80A,
  89. WMI_CORR_MEASURE_CMDID = 0x80B,
  90. WMI_READ_RSSI_CMDID = 0x80C,
  91. WMI_TEMP_SENSE_CMDID = 0x80E,
  92. WMI_DC_CALIB_CMDID = 0x80F,
  93. WMI_SEND_TONE_CMDID = 0x810,
  94. WMI_IQ_TX_CALIB_CMDID = 0x811,
  95. WMI_IQ_RX_CALIB_CMDID = 0x812,
  96. WMI_SET_UCODE_IDLE_CMDID = 0x813,
  97. WMI_SET_WORK_MODE_CMDID = 0x815,
  98. WMI_LO_LEAKAGE_CALIB_CMDID = 0x816,
  99. WMI_MARLON_R_READ_CMDID = 0x818,
  100. WMI_MARLON_R_WRITE_CMDID = 0x819,
  101. WMI_MARLON_R_TXRX_SEL_CMDID = 0x81A,
  102. MAC_IO_STATIC_PARAMS_CMDID = 0x81B,
  103. MAC_IO_DYNAMIC_PARAMS_CMDID = 0x81C,
  104. WMI_SILENT_RSSI_CALIB_CMDID = 0x81D,
  105. WMI_RF_RX_TEST_CMDID = 0x81E,
  106. WMI_CFG_RX_CHAIN_CMDID = 0x820,
  107. WMI_VRING_CFG_CMDID = 0x821,
  108. WMI_BCAST_VRING_CFG_CMDID = 0x822,
  109. WMI_VRING_BA_EN_CMDID = 0x823,
  110. WMI_VRING_BA_DIS_CMDID = 0x824,
  111. WMI_RCP_ADDBA_RESP_CMDID = 0x825,
  112. WMI_RCP_DELBA_CMDID = 0x826,
  113. WMI_SET_SSID_CMDID = 0x827,
  114. WMI_GET_SSID_CMDID = 0x828,
  115. WMI_SET_PCP_CHANNEL_CMDID = 0x829,
  116. WMI_GET_PCP_CHANNEL_CMDID = 0x82A,
  117. WMI_SW_TX_REQ_CMDID = 0x82B,
  118. WMI_READ_MAC_RXQ_CMDID = 0x830,
  119. WMI_READ_MAC_TXQ_CMDID = 0x831,
  120. WMI_WRITE_MAC_RXQ_CMDID = 0x832,
  121. WMI_WRITE_MAC_TXQ_CMDID = 0x833,
  122. WMI_WRITE_MAC_XQ_FIELD_CMDID = 0x834,
  123. WMI_MLME_PUSH_CMDID = 0x835,
  124. WMI_BEAMFORMING_MGMT_CMDID = 0x836,
  125. WMI_BF_TXSS_MGMT_CMDID = 0x837,
  126. WMI_BF_SM_MGMT_CMDID = 0x838,
  127. WMI_BF_RXSS_MGMT_CMDID = 0x839,
  128. WMI_BF_TRIG_CMDID = 0x83A,
  129. WMI_LINK_MAINTAIN_CFG_WRITE_CMDID = 0x842,
  130. WMI_LINK_MAINTAIN_CFG_READ_CMDID = 0x843,
  131. WMI_SET_SECTORS_CMDID = 0x849,
  132. WMI_MAINTAIN_PAUSE_CMDID = 0x850,
  133. WMI_MAINTAIN_RESUME_CMDID = 0x851,
  134. WMI_RS_MGMT_CMDID = 0x852,
  135. WMI_RF_MGMT_CMDID = 0x853,
  136. WMI_THERMAL_THROTTLING_CTRL_CMDID = 0x854,
  137. WMI_THERMAL_THROTTLING_GET_STATUS_CMDID = 0x855,
  138. WMI_OTP_READ_CMDID = 0x856,
  139. WMI_OTP_WRITE_CMDID = 0x857,
  140. WMI_LED_CFG_CMDID = 0x858,
  141. /* Performance monitoring commands */
  142. WMI_BF_CTRL_CMDID = 0x862,
  143. WMI_NOTIFY_REQ_CMDID = 0x863,
  144. WMI_GET_STATUS_CMDID = 0x864,
  145. WMI_GET_RF_STATUS_CMDID = 0x866,
  146. WMI_GET_BASEBAND_TYPE_CMDID = 0x867,
  147. WMI_UNIT_TEST_CMDID = 0x900,
  148. WMI_HICCUP_CMDID = 0x901,
  149. WMI_FLASH_READ_CMDID = 0x902,
  150. WMI_FLASH_WRITE_CMDID = 0x903,
  151. /* Power management */
  152. WMI_TRAFFIC_DEFERRAL_CMDID = 0x904,
  153. WMI_TRAFFIC_RESUME_CMDID = 0x905,
  154. /* P2P */
  155. WMI_P2P_CFG_CMDID = 0x910,
  156. WMI_PORT_ALLOCATE_CMDID = 0x911,
  157. WMI_PORT_DELETE_CMDID = 0x912,
  158. WMI_POWER_MGMT_CFG_CMDID = 0x913,
  159. WMI_START_LISTEN_CMDID = 0x914,
  160. WMI_START_SEARCH_CMDID = 0x915,
  161. WMI_DISCOVERY_START_CMDID = 0x916,
  162. WMI_DISCOVERY_STOP_CMDID = 0x917,
  163. WMI_PCP_START_CMDID = 0x918,
  164. WMI_PCP_STOP_CMDID = 0x919,
  165. WMI_GET_PCP_FACTOR_CMDID = 0x91B,
  166. /* Power Save Configuration Commands */
  167. WMI_PS_DEV_PROFILE_CFG_CMDID = 0x91C,
  168. /* Not supported yet */
  169. WMI_PS_DEV_CFG_CMDID = 0x91D,
  170. /* Not supported yet */
  171. WMI_PS_DEV_CFG_READ_CMDID = 0x91E,
  172. /* Per MAC Power Save Configuration commands
  173. * Not supported yet
  174. */
  175. WMI_PS_MID_CFG_CMDID = 0x91F,
  176. /* Not supported yet */
  177. WMI_PS_MID_CFG_READ_CMDID = 0x920,
  178. WMI_RS_CFG_CMDID = 0x921,
  179. WMI_GET_DETAILED_RS_RES_CMDID = 0x922,
  180. WMI_AOA_MEAS_CMDID = 0x923,
  181. WMI_SET_MGMT_RETRY_LIMIT_CMDID = 0x930,
  182. WMI_GET_MGMT_RETRY_LIMIT_CMDID = 0x931,
  183. WMI_TOF_SESSION_START_CMDID = 0x991,
  184. WMI_TOF_GET_CAPABILITIES_CMDID = 0x992,
  185. WMI_TOF_SET_LCR_CMDID = 0x993,
  186. WMI_TOF_SET_LCI_CMDID = 0x994,
  187. WMI_TOF_CHANNEL_INFO_CMDID = 0x995,
  188. WMI_TOF_SET_TX_RX_OFFSET_CMDID = 0x997,
  189. WMI_TOF_GET_TX_RX_OFFSET_CMDID = 0x998,
  190. WMI_GET_RF_SECTOR_PARAMS_CMDID = 0x9A0,
  191. WMI_SET_RF_SECTOR_PARAMS_CMDID = 0x9A1,
  192. WMI_GET_SELECTED_RF_SECTOR_INDEX_CMDID = 0x9A2,
  193. WMI_SET_SELECTED_RF_SECTOR_INDEX_CMDID = 0x9A3,
  194. WMI_SET_RF_SECTOR_ON_CMDID = 0x9A4,
  195. WMI_PRIO_TX_SECTORS_ORDER_CMDID = 0x9A5,
  196. WMI_PRIO_TX_SECTORS_NUMBER_CMDID = 0x9A6,
  197. WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_CMDID = 0x9A7,
  198. WMI_SET_MAC_ADDRESS_CMDID = 0xF003,
  199. WMI_ABORT_SCAN_CMDID = 0xF007,
  200. WMI_SET_PROMISCUOUS_MODE_CMDID = 0xF041,
  201. WMI_GET_PMK_CMDID = 0xF048,
  202. WMI_SET_PASSPHRASE_CMDID = 0xF049,
  203. WMI_SEND_ASSOC_RES_CMDID = 0xF04A,
  204. WMI_SET_ASSOC_REQ_RELAY_CMDID = 0xF04B,
  205. WMI_MAC_ADDR_REQ_CMDID = 0xF04D,
  206. WMI_FW_VER_CMDID = 0xF04E,
  207. WMI_PMC_CMDID = 0xF04F,
  208. };
  209. /* WMI_CONNECT_CMDID */
  210. enum wmi_network_type {
  211. WMI_NETTYPE_INFRA = 0x01,
  212. WMI_NETTYPE_ADHOC = 0x02,
  213. WMI_NETTYPE_ADHOC_CREATOR = 0x04,
  214. WMI_NETTYPE_AP = 0x10,
  215. WMI_NETTYPE_P2P = 0x20,
  216. /* PCIE over 60g */
  217. WMI_NETTYPE_WBE = 0x40,
  218. };
  219. enum wmi_dot11_auth_mode {
  220. WMI_AUTH11_OPEN = 0x01,
  221. WMI_AUTH11_SHARED = 0x02,
  222. WMI_AUTH11_LEAP = 0x04,
  223. WMI_AUTH11_WSC = 0x08,
  224. };
  225. enum wmi_auth_mode {
  226. WMI_AUTH_NONE = 0x01,
  227. WMI_AUTH_WPA = 0x02,
  228. WMI_AUTH_WPA2 = 0x04,
  229. WMI_AUTH_WPA_PSK = 0x08,
  230. WMI_AUTH_WPA2_PSK = 0x10,
  231. WMI_AUTH_WPA_CCKM = 0x20,
  232. WMI_AUTH_WPA2_CCKM = 0x40,
  233. };
  234. enum wmi_crypto_type {
  235. WMI_CRYPT_NONE = 0x01,
  236. WMI_CRYPT_AES_GCMP = 0x20,
  237. };
  238. enum wmi_connect_ctrl_flag_bits {
  239. WMI_CONNECT_ASSOC_POLICY_USER = 0x01,
  240. WMI_CONNECT_SEND_REASSOC = 0x02,
  241. WMI_CONNECT_IGNORE_WPA_GROUP_CIPHER = 0x04,
  242. WMI_CONNECT_PROFILE_MATCH_DONE = 0x08,
  243. WMI_CONNECT_IGNORE_AAC_BEACON = 0x10,
  244. WMI_CONNECT_CSA_FOLLOW_BSS = 0x20,
  245. WMI_CONNECT_DO_WPA_OFFLOAD = 0x40,
  246. WMI_CONNECT_DO_NOT_DEAUTH = 0x80,
  247. };
  248. #define WMI_MAX_SSID_LEN (32)
  249. /* WMI_CONNECT_CMDID */
  250. struct wmi_connect_cmd {
  251. u8 network_type;
  252. u8 dot11_auth_mode;
  253. u8 auth_mode;
  254. u8 pairwise_crypto_type;
  255. u8 pairwise_crypto_len;
  256. u8 group_crypto_type;
  257. u8 group_crypto_len;
  258. u8 ssid_len;
  259. u8 ssid[WMI_MAX_SSID_LEN];
  260. u8 channel;
  261. u8 reserved0;
  262. u8 bssid[WMI_MAC_LEN];
  263. __le32 ctrl_flags;
  264. u8 dst_mac[WMI_MAC_LEN];
  265. u8 reserved1[2];
  266. } __packed;
  267. /* WMI_DISCONNECT_STA_CMDID */
  268. struct wmi_disconnect_sta_cmd {
  269. u8 dst_mac[WMI_MAC_LEN];
  270. __le16 disconnect_reason;
  271. } __packed;
  272. #define WMI_MAX_KEY_INDEX (3)
  273. #define WMI_MAX_KEY_LEN (32)
  274. #define WMI_PASSPHRASE_LEN (64)
  275. /* WMI_SET_PASSPHRASE_CMDID */
  276. struct wmi_set_passphrase_cmd {
  277. u8 ssid[WMI_MAX_SSID_LEN];
  278. u8 passphrase[WMI_PASSPHRASE_LEN];
  279. u8 ssid_len;
  280. u8 passphrase_len;
  281. } __packed;
  282. /* WMI_ADD_CIPHER_KEY_CMDID */
  283. enum wmi_key_usage {
  284. WMI_KEY_USE_PAIRWISE = 0x00,
  285. WMI_KEY_USE_RX_GROUP = 0x01,
  286. WMI_KEY_USE_TX_GROUP = 0x02,
  287. };
  288. struct wmi_add_cipher_key_cmd {
  289. u8 key_index;
  290. u8 key_type;
  291. /* enum wmi_key_usage */
  292. u8 key_usage;
  293. u8 key_len;
  294. /* key replay sequence counter */
  295. u8 key_rsc[8];
  296. u8 key[WMI_MAX_KEY_LEN];
  297. /* Additional Key Control information */
  298. u8 key_op_ctrl;
  299. u8 mac[WMI_MAC_LEN];
  300. } __packed;
  301. /* WMI_DELETE_CIPHER_KEY_CMDID */
  302. struct wmi_delete_cipher_key_cmd {
  303. u8 key_index;
  304. u8 mac[WMI_MAC_LEN];
  305. } __packed;
  306. /* WMI_START_SCAN_CMDID
  307. *
  308. * Start L1 scan operation
  309. *
  310. * Returned events:
  311. * - WMI_RX_MGMT_PACKET_EVENTID - for every probe resp.
  312. * - WMI_SCAN_COMPLETE_EVENTID
  313. */
  314. enum wmi_scan_type {
  315. WMI_ACTIVE_SCAN = 0x00,
  316. WMI_SHORT_SCAN = 0x01,
  317. WMI_PASSIVE_SCAN = 0x02,
  318. WMI_DIRECT_SCAN = 0x03,
  319. WMI_LONG_SCAN = 0x04,
  320. };
  321. /* WMI_START_SCAN_CMDID */
  322. struct wmi_start_scan_cmd {
  323. u8 direct_scan_mac_addr[WMI_MAC_LEN];
  324. /* run scan with discovery beacon. Relevant for ACTIVE scan only. */
  325. u8 discovery_mode;
  326. u8 reserved;
  327. /* Max duration in the home channel(ms) */
  328. __le32 dwell_time;
  329. /* Time interval between scans (ms) */
  330. __le32 force_scan_interval;
  331. /* enum wmi_scan_type */
  332. u8 scan_type;
  333. /* how many channels follow */
  334. u8 num_channels;
  335. /* channels ID's:
  336. * 0 - 58320 MHz
  337. * 1 - 60480 MHz
  338. * 2 - 62640 MHz
  339. */
  340. struct {
  341. u8 channel;
  342. u8 reserved;
  343. } channel_list[0];
  344. } __packed;
  345. /* WMI_SET_PROBED_SSID_CMDID */
  346. #define MAX_PROBED_SSID_INDEX (3)
  347. enum wmi_ssid_flag {
  348. /* disables entry */
  349. WMI_SSID_FLAG_DISABLE = 0x00,
  350. /* probes specified ssid */
  351. WMI_SSID_FLAG_SPECIFIC = 0x01,
  352. /* probes for any ssid */
  353. WMI_SSID_FLAG_ANY = 0x02,
  354. };
  355. struct wmi_probed_ssid_cmd {
  356. /* 0 to MAX_PROBED_SSID_INDEX */
  357. u8 entry_index;
  358. /* enum wmi_ssid_flag */
  359. u8 flag;
  360. u8 ssid_len;
  361. u8 ssid[WMI_MAX_SSID_LEN];
  362. } __packed;
  363. /* WMI_SET_APPIE_CMDID
  364. * Add Application specified IE to a management frame
  365. */
  366. #define WMI_MAX_IE_LEN (1024)
  367. /* Frame Types */
  368. enum wmi_mgmt_frame_type {
  369. WMI_FRAME_BEACON = 0x00,
  370. WMI_FRAME_PROBE_REQ = 0x01,
  371. WMI_FRAME_PROBE_RESP = 0x02,
  372. WMI_FRAME_ASSOC_REQ = 0x03,
  373. WMI_FRAME_ASSOC_RESP = 0x04,
  374. WMI_NUM_MGMT_FRAME = 0x05,
  375. };
  376. struct wmi_set_appie_cmd {
  377. /* enum wmi_mgmt_frame_type */
  378. u8 mgmt_frm_type;
  379. u8 reserved;
  380. /* Length of the IE to be added to MGMT frame */
  381. __le16 ie_len;
  382. u8 ie_info[0];
  383. } __packed;
  384. /* WMI_PXMT_RANGE_CFG_CMDID */
  385. struct wmi_pxmt_range_cfg_cmd {
  386. u8 dst_mac[WMI_MAC_LEN];
  387. __le16 range;
  388. } __packed;
  389. /* WMI_PXMT_SNR2_RANGE_CFG_CMDID */
  390. struct wmi_pxmt_snr2_range_cfg_cmd {
  391. s8 snr2range_arr[2];
  392. } __packed;
  393. /* WMI_RF_MGMT_CMDID */
  394. enum wmi_rf_mgmt_type {
  395. WMI_RF_MGMT_W_DISABLE = 0x00,
  396. WMI_RF_MGMT_W_ENABLE = 0x01,
  397. WMI_RF_MGMT_GET_STATUS = 0x02,
  398. };
  399. /* WMI_RF_MGMT_CMDID */
  400. struct wmi_rf_mgmt_cmd {
  401. __le32 rf_mgmt_type;
  402. } __packed;
  403. /* WMI_THERMAL_THROTTLING_CTRL_CMDID */
  404. #define THERMAL_THROTTLING_USE_DEFAULT_MAX_TXOP_LENGTH (0xFFFFFFFF)
  405. /* WMI_THERMAL_THROTTLING_CTRL_CMDID */
  406. struct wmi_thermal_throttling_ctrl_cmd {
  407. __le32 time_on_usec;
  408. __le32 time_off_usec;
  409. __le32 max_txop_length_usec;
  410. } __packed;
  411. /* WMI_RF_RX_TEST_CMDID */
  412. struct wmi_rf_rx_test_cmd {
  413. __le32 sector;
  414. } __packed;
  415. /* WMI_CORR_MEASURE_CMDID */
  416. struct wmi_corr_measure_cmd {
  417. __le32 freq_mhz;
  418. __le32 length_samples;
  419. __le32 iterations;
  420. } __packed;
  421. /* WMI_SET_SSID_CMDID */
  422. struct wmi_set_ssid_cmd {
  423. __le32 ssid_len;
  424. u8 ssid[WMI_MAX_SSID_LEN];
  425. } __packed;
  426. /* WMI_SET_PCP_CHANNEL_CMDID */
  427. struct wmi_set_pcp_channel_cmd {
  428. u8 channel;
  429. u8 reserved[3];
  430. } __packed;
  431. /* WMI_BCON_CTRL_CMDID */
  432. struct wmi_bcon_ctrl_cmd {
  433. __le16 bcon_interval;
  434. __le16 frag_num;
  435. __le64 ss_mask;
  436. u8 network_type;
  437. u8 pcp_max_assoc_sta;
  438. u8 disable_sec_offload;
  439. u8 disable_sec;
  440. u8 hidden_ssid;
  441. u8 is_go;
  442. u8 reserved[2];
  443. } __packed;
  444. /* WMI_PORT_ALLOCATE_CMDID */
  445. enum wmi_port_role {
  446. WMI_PORT_STA = 0x00,
  447. WMI_PORT_PCP = 0x01,
  448. WMI_PORT_AP = 0x02,
  449. WMI_PORT_P2P_DEV = 0x03,
  450. WMI_PORT_P2P_CLIENT = 0x04,
  451. WMI_PORT_P2P_GO = 0x05,
  452. };
  453. /* WMI_PORT_ALLOCATE_CMDID */
  454. struct wmi_port_allocate_cmd {
  455. u8 mac[WMI_MAC_LEN];
  456. u8 port_role;
  457. u8 mid;
  458. } __packed;
  459. /* WMI_PORT_DELETE_CMDID */
  460. struct wmi_port_delete_cmd {
  461. u8 mid;
  462. u8 reserved[3];
  463. } __packed;
  464. /* WMI_TRAFFIC_DEFERRAL_CMDID */
  465. struct wmi_traffic_deferral_cmd {
  466. /* Bit vector: bit[0] - wake on Unicast, bit[1] - wake on Broadcast */
  467. u8 wakeup_trigger;
  468. } __packed;
  469. /* WMI_P2P_CFG_CMDID */
  470. enum wmi_discovery_mode {
  471. WMI_DISCOVERY_MODE_NON_OFFLOAD = 0x00,
  472. WMI_DISCOVERY_MODE_OFFLOAD = 0x01,
  473. WMI_DISCOVERY_MODE_PEER2PEER = 0x02,
  474. };
  475. struct wmi_p2p_cfg_cmd {
  476. /* enum wmi_discovery_mode */
  477. u8 discovery_mode;
  478. u8 channel;
  479. /* base to listen/search duration calculation */
  480. __le16 bcon_interval;
  481. } __packed;
  482. /* WMI_POWER_MGMT_CFG_CMDID */
  483. enum wmi_power_source_type {
  484. WMI_POWER_SOURCE_BATTERY = 0x00,
  485. WMI_POWER_SOURCE_OTHER = 0x01,
  486. };
  487. struct wmi_power_mgmt_cfg_cmd {
  488. /* enum wmi_power_source_type */
  489. u8 power_source;
  490. u8 reserved[3];
  491. } __packed;
  492. /* WMI_PCP_START_CMDID */
  493. struct wmi_pcp_start_cmd {
  494. __le16 bcon_interval;
  495. u8 pcp_max_assoc_sta;
  496. u8 hidden_ssid;
  497. u8 is_go;
  498. u8 reserved0[7];
  499. u8 network_type;
  500. u8 channel;
  501. u8 disable_sec_offload;
  502. u8 disable_sec;
  503. } __packed;
  504. /* WMI_SW_TX_REQ_CMDID */
  505. struct wmi_sw_tx_req_cmd {
  506. u8 dst_mac[WMI_MAC_LEN];
  507. __le16 len;
  508. u8 payload[0];
  509. } __packed;
  510. struct wmi_sw_ring_cfg {
  511. __le64 ring_mem_base;
  512. __le16 ring_size;
  513. __le16 max_mpdu_size;
  514. } __packed;
  515. /* wmi_vring_cfg_schd */
  516. struct wmi_vring_cfg_schd {
  517. __le16 priority;
  518. __le16 timeslot_us;
  519. } __packed;
  520. enum wmi_vring_cfg_encap_trans_type {
  521. WMI_VRING_ENC_TYPE_802_3 = 0x00,
  522. WMI_VRING_ENC_TYPE_NATIVE_WIFI = 0x01,
  523. };
  524. enum wmi_vring_cfg_ds_cfg {
  525. WMI_VRING_DS_PBSS = 0x00,
  526. WMI_VRING_DS_STATION = 0x01,
  527. WMI_VRING_DS_AP = 0x02,
  528. WMI_VRING_DS_ADDR4 = 0x03,
  529. };
  530. enum wmi_vring_cfg_nwifi_ds_trans_type {
  531. WMI_NWIFI_TX_TRANS_MODE_NO = 0x00,
  532. WMI_NWIFI_TX_TRANS_MODE_AP2PBSS = 0x01,
  533. WMI_NWIFI_TX_TRANS_MODE_STA2PBSS = 0x02,
  534. };
  535. enum wmi_vring_cfg_schd_params_priority {
  536. WMI_SCH_PRIO_REGULAR = 0x00,
  537. WMI_SCH_PRIO_HIGH = 0x01,
  538. };
  539. #define CIDXTID_CID_POS (0)
  540. #define CIDXTID_CID_LEN (4)
  541. #define CIDXTID_CID_MSK (0xF)
  542. #define CIDXTID_TID_POS (4)
  543. #define CIDXTID_TID_LEN (4)
  544. #define CIDXTID_TID_MSK (0xF0)
  545. #define VRING_CFG_MAC_CTRL_LIFETIME_EN_POS (0)
  546. #define VRING_CFG_MAC_CTRL_LIFETIME_EN_LEN (1)
  547. #define VRING_CFG_MAC_CTRL_LIFETIME_EN_MSK (0x1)
  548. #define VRING_CFG_MAC_CTRL_AGGR_EN_POS (1)
  549. #define VRING_CFG_MAC_CTRL_AGGR_EN_LEN (1)
  550. #define VRING_CFG_MAC_CTRL_AGGR_EN_MSK (0x2)
  551. #define VRING_CFG_TO_RESOLUTION_VALUE_POS (0)
  552. #define VRING_CFG_TO_RESOLUTION_VALUE_LEN (6)
  553. #define VRING_CFG_TO_RESOLUTION_VALUE_MSK (0x3F)
  554. struct wmi_vring_cfg {
  555. struct wmi_sw_ring_cfg tx_sw_ring;
  556. /* 0-23 vrings */
  557. u8 ringid;
  558. u8 cidxtid;
  559. u8 encap_trans_type;
  560. /* 802.3 DS cfg */
  561. u8 ds_cfg;
  562. u8 nwifi_ds_trans_type;
  563. u8 mac_ctrl;
  564. u8 to_resolution;
  565. u8 agg_max_wsize;
  566. struct wmi_vring_cfg_schd schd_params;
  567. } __packed;
  568. enum wmi_vring_cfg_cmd_action {
  569. WMI_VRING_CMD_ADD = 0x00,
  570. WMI_VRING_CMD_MODIFY = 0x01,
  571. WMI_VRING_CMD_DELETE = 0x02,
  572. };
  573. /* WMI_VRING_CFG_CMDID */
  574. struct wmi_vring_cfg_cmd {
  575. __le32 action;
  576. struct wmi_vring_cfg vring_cfg;
  577. } __packed;
  578. struct wmi_bcast_vring_cfg {
  579. struct wmi_sw_ring_cfg tx_sw_ring;
  580. /* 0-23 vrings */
  581. u8 ringid;
  582. u8 encap_trans_type;
  583. /* 802.3 DS cfg */
  584. u8 ds_cfg;
  585. u8 nwifi_ds_trans_type;
  586. } __packed;
  587. /* WMI_BCAST_VRING_CFG_CMDID */
  588. struct wmi_bcast_vring_cfg_cmd {
  589. __le32 action;
  590. struct wmi_bcast_vring_cfg vring_cfg;
  591. } __packed;
  592. /* WMI_VRING_BA_EN_CMDID */
  593. struct wmi_vring_ba_en_cmd {
  594. u8 ringid;
  595. u8 agg_max_wsize;
  596. __le16 ba_timeout;
  597. u8 amsdu;
  598. u8 reserved[3];
  599. } __packed;
  600. /* WMI_VRING_BA_DIS_CMDID */
  601. struct wmi_vring_ba_dis_cmd {
  602. u8 ringid;
  603. u8 reserved;
  604. __le16 reason;
  605. } __packed;
  606. /* WMI_NOTIFY_REQ_CMDID */
  607. struct wmi_notify_req_cmd {
  608. u8 cid;
  609. u8 year;
  610. u8 month;
  611. u8 day;
  612. __le32 interval_usec;
  613. u8 hour;
  614. u8 minute;
  615. u8 second;
  616. u8 miliseconds;
  617. } __packed;
  618. /* WMI_CFG_RX_CHAIN_CMDID */
  619. enum wmi_sniffer_cfg_mode {
  620. WMI_SNIFFER_OFF = 0x00,
  621. WMI_SNIFFER_ON = 0x01,
  622. };
  623. enum wmi_sniffer_cfg_phy_info_mode {
  624. WMI_SNIFFER_PHY_INFO_DISABLED = 0x00,
  625. WMI_SNIFFER_PHY_INFO_ENABLED = 0x01,
  626. };
  627. enum wmi_sniffer_cfg_phy_support {
  628. WMI_SNIFFER_CP = 0x00,
  629. WMI_SNIFFER_DP = 0x01,
  630. WMI_SNIFFER_BOTH_PHYS = 0x02,
  631. };
  632. /* wmi_sniffer_cfg */
  633. struct wmi_sniffer_cfg {
  634. /* enum wmi_sniffer_cfg_mode */
  635. __le32 mode;
  636. /* enum wmi_sniffer_cfg_phy_info_mode */
  637. __le32 phy_info_mode;
  638. /* enum wmi_sniffer_cfg_phy_support */
  639. __le32 phy_support;
  640. u8 channel;
  641. u8 reserved[3];
  642. } __packed;
  643. enum wmi_cfg_rx_chain_cmd_action {
  644. WMI_RX_CHAIN_ADD = 0x00,
  645. WMI_RX_CHAIN_DEL = 0x01,
  646. };
  647. enum wmi_cfg_rx_chain_cmd_decap_trans_type {
  648. WMI_DECAP_TYPE_802_3 = 0x00,
  649. WMI_DECAP_TYPE_NATIVE_WIFI = 0x01,
  650. WMI_DECAP_TYPE_NONE = 0x02,
  651. };
  652. enum wmi_cfg_rx_chain_cmd_nwifi_ds_trans_type {
  653. WMI_NWIFI_RX_TRANS_MODE_NO = 0x00,
  654. WMI_NWIFI_RX_TRANS_MODE_PBSS2AP = 0x01,
  655. WMI_NWIFI_RX_TRANS_MODE_PBSS2STA = 0x02,
  656. };
  657. enum wmi_cfg_rx_chain_cmd_reorder_type {
  658. WMI_RX_HW_REORDER = 0x00,
  659. WMI_RX_SW_REORDER = 0x01,
  660. };
  661. #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_POS (0)
  662. #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_LEN (1)
  663. #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_MSK (0x1)
  664. #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_POS (1)
  665. #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_LEN (1)
  666. #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_MSK (0x2)
  667. #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_POS (0)
  668. #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_LEN (1)
  669. #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_MSK (0x1)
  670. #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_POS (1)
  671. #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_LEN (1)
  672. #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_MSK (0x2)
  673. #define L3_L4_CTRL_IPV4_CHECKSUM_EN_POS (0)
  674. #define L3_L4_CTRL_IPV4_CHECKSUM_EN_LEN (1)
  675. #define L3_L4_CTRL_IPV4_CHECKSUM_EN_MSK (0x1)
  676. #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_POS (1)
  677. #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_LEN (1)
  678. #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_MSK (0x2)
  679. #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_POS (0)
  680. #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_LEN (1)
  681. #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_MSK (0x1)
  682. #define RING_CTRL_OVERRIDE_WB_THRSH_POS (1)
  683. #define RING_CTRL_OVERRIDE_WB_THRSH_LEN (1)
  684. #define RING_CTRL_OVERRIDE_WB_THRSH_MSK (0x2)
  685. #define RING_CTRL_OVERRIDE_ITR_THRSH_POS (2)
  686. #define RING_CTRL_OVERRIDE_ITR_THRSH_LEN (1)
  687. #define RING_CTRL_OVERRIDE_ITR_THRSH_MSK (0x4)
  688. #define RING_CTRL_OVERRIDE_HOST_THRSH_POS (3)
  689. #define RING_CTRL_OVERRIDE_HOST_THRSH_LEN (1)
  690. #define RING_CTRL_OVERRIDE_HOST_THRSH_MSK (0x8)
  691. /* WMI_CFG_RX_CHAIN_CMDID */
  692. struct wmi_cfg_rx_chain_cmd {
  693. __le32 action;
  694. struct wmi_sw_ring_cfg rx_sw_ring;
  695. u8 mid;
  696. u8 decap_trans_type;
  697. u8 l2_802_3_offload_ctrl;
  698. u8 l2_nwifi_offload_ctrl;
  699. u8 vlan_id;
  700. u8 nwifi_ds_trans_type;
  701. u8 l3_l4_ctrl;
  702. u8 ring_ctrl;
  703. __le16 prefetch_thrsh;
  704. __le16 wb_thrsh;
  705. __le32 itr_value;
  706. __le16 host_thrsh;
  707. u8 reorder_type;
  708. u8 reserved;
  709. struct wmi_sniffer_cfg sniffer_cfg;
  710. __le16 max_rx_pl_per_desc;
  711. } __packed;
  712. /* WMI_RCP_ADDBA_RESP_CMDID */
  713. struct wmi_rcp_addba_resp_cmd {
  714. u8 cidxtid;
  715. u8 dialog_token;
  716. __le16 status_code;
  717. /* ieee80211_ba_parameterset field to send */
  718. __le16 ba_param_set;
  719. __le16 ba_timeout;
  720. } __packed;
  721. /* WMI_RCP_DELBA_CMDID */
  722. struct wmi_rcp_delba_cmd {
  723. u8 cidxtid;
  724. u8 reserved;
  725. __le16 reason;
  726. } __packed;
  727. /* WMI_RCP_ADDBA_REQ_CMDID */
  728. struct wmi_rcp_addba_req_cmd {
  729. u8 cidxtid;
  730. u8 dialog_token;
  731. /* ieee80211_ba_parameterset field as it received */
  732. __le16 ba_param_set;
  733. __le16 ba_timeout;
  734. /* ieee80211_ba_seqstrl field as it received */
  735. __le16 ba_seq_ctrl;
  736. } __packed;
  737. /* WMI_SET_MAC_ADDRESS_CMDID */
  738. struct wmi_set_mac_address_cmd {
  739. u8 mac[WMI_MAC_LEN];
  740. u8 reserved[2];
  741. } __packed;
  742. /* WMI_ECHO_CMDID
  743. * Check FW is alive
  744. * WMI_DEEP_ECHO_CMDID
  745. * Check FW and ucode are alive
  746. * Returned event: WMI_ECHO_RSP_EVENTID
  747. * same event for both commands
  748. */
  749. struct wmi_echo_cmd {
  750. __le32 value;
  751. } __packed;
  752. /* WMI_OTP_READ_CMDID */
  753. struct wmi_otp_read_cmd {
  754. __le32 addr;
  755. __le32 size;
  756. __le32 values;
  757. } __packed;
  758. /* WMI_OTP_WRITE_CMDID */
  759. struct wmi_otp_write_cmd {
  760. __le32 addr;
  761. __le32 size;
  762. __le32 values;
  763. } __packed;
  764. /* WMI_TEMP_SENSE_CMDID
  765. *
  766. * Measure MAC and radio temperatures
  767. *
  768. * Possible modes for temperature measurement
  769. */
  770. enum wmi_temperature_measure_mode {
  771. TEMPERATURE_USE_OLD_VALUE = 0x01,
  772. TEMPERATURE_MEASURE_NOW = 0x02,
  773. };
  774. /* WMI_TEMP_SENSE_CMDID */
  775. struct wmi_temp_sense_cmd {
  776. __le32 measure_baseband_en;
  777. __le32 measure_rf_en;
  778. __le32 measure_mode;
  779. } __packed;
  780. enum wmi_pmc_op {
  781. WMI_PMC_ALLOCATE = 0x00,
  782. WMI_PMC_RELEASE = 0x01,
  783. };
  784. /* WMI_PMC_CMDID */
  785. struct wmi_pmc_cmd {
  786. /* enum wmi_pmc_cmd_op_type */
  787. u8 op;
  788. u8 reserved;
  789. __le16 ring_size;
  790. __le64 mem_base;
  791. } __packed;
  792. enum wmi_aoa_meas_type {
  793. WMI_AOA_PHASE_MEAS = 0x00,
  794. WMI_AOA_PHASE_AMP_MEAS = 0x01,
  795. };
  796. /* WMI_AOA_MEAS_CMDID */
  797. struct wmi_aoa_meas_cmd {
  798. u8 mac_addr[WMI_MAC_LEN];
  799. /* channels IDs:
  800. * 0 - 58320 MHz
  801. * 1 - 60480 MHz
  802. * 2 - 62640 MHz
  803. */
  804. u8 channel;
  805. /* enum wmi_aoa_meas_type */
  806. u8 aoa_meas_type;
  807. __le32 meas_rf_mask;
  808. } __packed;
  809. /* WMI_SET_MGMT_RETRY_LIMIT_CMDID */
  810. struct wmi_set_mgmt_retry_limit_cmd {
  811. /* MAC retransmit limit for mgmt frames */
  812. u8 mgmt_retry_limit;
  813. /* alignment to 32b */
  814. u8 reserved[3];
  815. } __packed;
  816. enum wmi_tof_burst_duration {
  817. WMI_TOF_BURST_DURATION_250_USEC = 2,
  818. WMI_TOF_BURST_DURATION_500_USEC = 3,
  819. WMI_TOF_BURST_DURATION_1_MSEC = 4,
  820. WMI_TOF_BURST_DURATION_2_MSEC = 5,
  821. WMI_TOF_BURST_DURATION_4_MSEC = 6,
  822. WMI_TOF_BURST_DURATION_8_MSEC = 7,
  823. WMI_TOF_BURST_DURATION_16_MSEC = 8,
  824. WMI_TOF_BURST_DURATION_32_MSEC = 9,
  825. WMI_TOF_BURST_DURATION_64_MSEC = 10,
  826. WMI_TOF_BURST_DURATION_128_MSEC = 11,
  827. WMI_TOF_BURST_DURATION_NO_PREFERENCES = 15,
  828. };
  829. enum wmi_tof_session_start_flags {
  830. WMI_TOF_SESSION_START_FLAG_SECURED = 0x1,
  831. WMI_TOF_SESSION_START_FLAG_ASAP = 0x2,
  832. WMI_TOF_SESSION_START_FLAG_LCI_REQ = 0x4,
  833. WMI_TOF_SESSION_START_FLAG_LCR_REQ = 0x8,
  834. };
  835. /* WMI_TOF_SESSION_START_CMDID */
  836. struct wmi_ftm_dest_info {
  837. u8 channel;
  838. /* wmi_tof_session_start_flags_e */
  839. u8 flags;
  840. u8 initial_token;
  841. u8 num_of_ftm_per_burst;
  842. u8 num_of_bursts_exp;
  843. /* wmi_tof_burst_duration_e */
  844. u8 burst_duration;
  845. /* Burst Period indicate interval between two consecutive burst
  846. * instances, in units of 100 ms
  847. */
  848. __le16 burst_period;
  849. u8 dst_mac[WMI_MAC_LEN];
  850. __le16 reserved;
  851. } __packed;
  852. /* WMI_TOF_SESSION_START_CMDID */
  853. struct wmi_tof_session_start_cmd {
  854. __le32 session_id;
  855. u8 num_of_aoa_measures;
  856. u8 aoa_type;
  857. __le16 num_of_dest;
  858. u8 reserved[4];
  859. struct wmi_ftm_dest_info ftm_dest_info[0];
  860. } __packed;
  861. enum wmi_tof_channel_info_report_type {
  862. WMI_TOF_CHANNEL_INFO_TYPE_CIR = 0x1,
  863. WMI_TOF_CHANNEL_INFO_TYPE_RSSI = 0x2,
  864. WMI_TOF_CHANNEL_INFO_TYPE_SNR = 0x4,
  865. WMI_TOF_CHANNEL_INFO_TYPE_DEBUG_DATA = 0x8,
  866. WMI_TOF_CHANNEL_INFO_TYPE_VENDOR_SPECIFIC = 0x10,
  867. };
  868. /* WMI_TOF_CHANNEL_INFO_CMDID */
  869. struct wmi_tof_channel_info_cmd {
  870. /* wmi_tof_channel_info_report_type_e */
  871. __le32 channel_info_report_request;
  872. } __packed;
  873. /* WMI_TOF_SET_TX_RX_OFFSET_CMDID */
  874. struct wmi_tof_set_tx_rx_offset_cmd {
  875. /* TX delay offset */
  876. __le32 tx_offset;
  877. /* RX delay offset */
  878. __le32 rx_offset;
  879. __le32 reserved[2];
  880. } __packed;
  881. /* WMI Events
  882. * List of Events (target to host)
  883. */
  884. enum wmi_event_id {
  885. WMI_READY_EVENTID = 0x1001,
  886. WMI_CONNECT_EVENTID = 0x1002,
  887. WMI_DISCONNECT_EVENTID = 0x1003,
  888. WMI_SCAN_COMPLETE_EVENTID = 0x100A,
  889. WMI_REPORT_STATISTICS_EVENTID = 0x100B,
  890. WMI_RD_MEM_RSP_EVENTID = 0x1800,
  891. WMI_FW_READY_EVENTID = 0x1801,
  892. WMI_EXIT_FAST_MEM_ACC_MODE_EVENTID = 0x200,
  893. WMI_ECHO_RSP_EVENTID = 0x1803,
  894. WMI_FS_TUNE_DONE_EVENTID = 0x180A,
  895. WMI_CORR_MEASURE_EVENTID = 0x180B,
  896. WMI_READ_RSSI_EVENTID = 0x180C,
  897. WMI_TEMP_SENSE_DONE_EVENTID = 0x180E,
  898. WMI_DC_CALIB_DONE_EVENTID = 0x180F,
  899. WMI_IQ_TX_CALIB_DONE_EVENTID = 0x1811,
  900. WMI_IQ_RX_CALIB_DONE_EVENTID = 0x1812,
  901. WMI_SET_WORK_MODE_DONE_EVENTID = 0x1815,
  902. WMI_LO_LEAKAGE_CALIB_DONE_EVENTID = 0x1816,
  903. WMI_MARLON_R_READ_DONE_EVENTID = 0x1818,
  904. WMI_MARLON_R_WRITE_DONE_EVENTID = 0x1819,
  905. WMI_MARLON_R_TXRX_SEL_DONE_EVENTID = 0x181A,
  906. WMI_SILENT_RSSI_CALIB_DONE_EVENTID = 0x181D,
  907. WMI_RF_RX_TEST_DONE_EVENTID = 0x181E,
  908. WMI_CFG_RX_CHAIN_DONE_EVENTID = 0x1820,
  909. WMI_VRING_CFG_DONE_EVENTID = 0x1821,
  910. WMI_BA_STATUS_EVENTID = 0x1823,
  911. WMI_RCP_ADDBA_REQ_EVENTID = 0x1824,
  912. WMI_RCP_ADDBA_RESP_SENT_EVENTID = 0x1825,
  913. WMI_DELBA_EVENTID = 0x1826,
  914. WMI_GET_SSID_EVENTID = 0x1828,
  915. WMI_GET_PCP_CHANNEL_EVENTID = 0x182A,
  916. WMI_SW_TX_COMPLETE_EVENTID = 0x182B,
  917. WMI_READ_MAC_RXQ_EVENTID = 0x1830,
  918. WMI_READ_MAC_TXQ_EVENTID = 0x1831,
  919. WMI_WRITE_MAC_RXQ_EVENTID = 0x1832,
  920. WMI_WRITE_MAC_TXQ_EVENTID = 0x1833,
  921. WMI_WRITE_MAC_XQ_FIELD_EVENTID = 0x1834,
  922. WMI_BEAMFORMING_MGMT_DONE_EVENTID = 0x1836,
  923. WMI_BF_TXSS_MGMT_DONE_EVENTID = 0x1837,
  924. WMI_BF_RXSS_MGMT_DONE_EVENTID = 0x1839,
  925. WMI_RS_MGMT_DONE_EVENTID = 0x1852,
  926. WMI_RF_MGMT_STATUS_EVENTID = 0x1853,
  927. WMI_THERMAL_THROTTLING_STATUS_EVENTID = 0x1855,
  928. WMI_BF_SM_MGMT_DONE_EVENTID = 0x1838,
  929. WMI_RX_MGMT_PACKET_EVENTID = 0x1840,
  930. WMI_TX_MGMT_PACKET_EVENTID = 0x1841,
  931. WMI_LINK_MAINTAIN_CFG_WRITE_DONE_EVENTID = 0x1842,
  932. WMI_LINK_MAINTAIN_CFG_READ_DONE_EVENTID = 0x1843,
  933. WMI_OTP_READ_RESULT_EVENTID = 0x1856,
  934. WMI_LED_CFG_DONE_EVENTID = 0x1858,
  935. /* Performance monitoring events */
  936. WMI_DATA_PORT_OPEN_EVENTID = 0x1860,
  937. WMI_WBE_LINK_DOWN_EVENTID = 0x1861,
  938. WMI_BF_CTRL_DONE_EVENTID = 0x1862,
  939. WMI_NOTIFY_REQ_DONE_EVENTID = 0x1863,
  940. WMI_GET_STATUS_DONE_EVENTID = 0x1864,
  941. WMI_VRING_EN_EVENTID = 0x1865,
  942. WMI_GET_RF_STATUS_EVENTID = 0x1866,
  943. WMI_GET_BASEBAND_TYPE_EVENTID = 0x1867,
  944. WMI_UNIT_TEST_EVENTID = 0x1900,
  945. WMI_FLASH_READ_DONE_EVENTID = 0x1902,
  946. WMI_FLASH_WRITE_DONE_EVENTID = 0x1903,
  947. /* Power management */
  948. WMI_TRAFFIC_DEFERRAL_EVENTID = 0x1904,
  949. WMI_TRAFFIC_RESUME_EVENTID = 0x1905,
  950. /* P2P */
  951. WMI_P2P_CFG_DONE_EVENTID = 0x1910,
  952. WMI_PORT_ALLOCATED_EVENTID = 0x1911,
  953. WMI_PORT_DELETED_EVENTID = 0x1912,
  954. WMI_LISTEN_STARTED_EVENTID = 0x1914,
  955. WMI_SEARCH_STARTED_EVENTID = 0x1915,
  956. WMI_DISCOVERY_STARTED_EVENTID = 0x1916,
  957. WMI_DISCOVERY_STOPPED_EVENTID = 0x1917,
  958. WMI_PCP_STARTED_EVENTID = 0x1918,
  959. WMI_PCP_STOPPED_EVENTID = 0x1919,
  960. WMI_PCP_FACTOR_EVENTID = 0x191A,
  961. /* Power Save Configuration Events */
  962. WMI_PS_DEV_PROFILE_CFG_EVENTID = 0x191C,
  963. /* Not supported yet */
  964. WMI_PS_DEV_CFG_EVENTID = 0x191D,
  965. /* Not supported yet */
  966. WMI_PS_DEV_CFG_READ_EVENTID = 0x191E,
  967. /* Not supported yet */
  968. WMI_PS_MID_CFG_EVENTID = 0x191F,
  969. /* Not supported yet */
  970. WMI_PS_MID_CFG_READ_EVENTID = 0x1920,
  971. WMI_RS_CFG_DONE_EVENTID = 0x1921,
  972. WMI_GET_DETAILED_RS_RES_EVENTID = 0x1922,
  973. WMI_AOA_MEAS_EVENTID = 0x1923,
  974. WMI_SET_MGMT_RETRY_LIMIT_EVENTID = 0x1930,
  975. WMI_GET_MGMT_RETRY_LIMIT_EVENTID = 0x1931,
  976. WMI_TOF_SESSION_END_EVENTID = 0x1991,
  977. WMI_TOF_GET_CAPABILITIES_EVENTID = 0x1992,
  978. WMI_TOF_SET_LCR_EVENTID = 0x1993,
  979. WMI_TOF_SET_LCI_EVENTID = 0x1994,
  980. WMI_TOF_FTM_PER_DEST_RES_EVENTID = 0x1995,
  981. WMI_TOF_CHANNEL_INFO_EVENTID = 0x1996,
  982. WMI_TOF_SET_TX_RX_OFFSET_EVENTID = 0x1997,
  983. WMI_TOF_GET_TX_RX_OFFSET_EVENTID = 0x1998,
  984. WMI_GET_RF_SECTOR_PARAMS_DONE_EVENTID = 0x19A0,
  985. WMI_SET_RF_SECTOR_PARAMS_DONE_EVENTID = 0x19A1,
  986. WMI_GET_SELECTED_RF_SECTOR_INDEX_DONE_EVENTID = 0x19A2,
  987. WMI_SET_SELECTED_RF_SECTOR_INDEX_DONE_EVENTID = 0x19A3,
  988. WMI_SET_RF_SECTOR_ON_DONE_EVENTID = 0x19A4,
  989. WMI_PRIO_TX_SECTORS_ORDER_EVENTID = 0x19A5,
  990. WMI_PRIO_TX_SECTORS_NUMBER_EVENTID = 0x19A6,
  991. WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID = 0x19A7,
  992. WMI_SET_CHANNEL_EVENTID = 0x9000,
  993. WMI_ASSOC_REQ_EVENTID = 0x9001,
  994. WMI_EAPOL_RX_EVENTID = 0x9002,
  995. WMI_MAC_ADDR_RESP_EVENTID = 0x9003,
  996. WMI_FW_VER_EVENTID = 0x9004,
  997. WMI_ACS_PASSIVE_SCAN_COMPLETE_EVENTID = 0x9005,
  998. };
  999. /* Events data structures */
  1000. enum wmi_fw_status {
  1001. WMI_FW_STATUS_SUCCESS = 0x00,
  1002. WMI_FW_STATUS_FAILURE = 0x01,
  1003. };
  1004. /* WMI_RF_MGMT_STATUS_EVENTID */
  1005. enum wmi_rf_status {
  1006. WMI_RF_ENABLED = 0x00,
  1007. WMI_RF_DISABLED_HW = 0x01,
  1008. WMI_RF_DISABLED_SW = 0x02,
  1009. WMI_RF_DISABLED_HW_SW = 0x03,
  1010. };
  1011. /* WMI_RF_MGMT_STATUS_EVENTID */
  1012. struct wmi_rf_mgmt_status_event {
  1013. __le32 rf_status;
  1014. } __packed;
  1015. /* WMI_THERMAL_THROTTLING_STATUS_EVENTID */
  1016. struct wmi_thermal_throttling_status_event {
  1017. __le32 time_on_usec;
  1018. __le32 time_off_usec;
  1019. __le32 max_txop_length_usec;
  1020. } __packed;
  1021. /* WMI_GET_STATUS_DONE_EVENTID */
  1022. struct wmi_get_status_done_event {
  1023. __le32 is_associated;
  1024. u8 cid;
  1025. u8 reserved0[3];
  1026. u8 bssid[WMI_MAC_LEN];
  1027. u8 channel;
  1028. u8 reserved1;
  1029. u8 network_type;
  1030. u8 reserved2[3];
  1031. __le32 ssid_len;
  1032. u8 ssid[WMI_MAX_SSID_LEN];
  1033. __le32 rf_status;
  1034. __le32 is_secured;
  1035. } __packed;
  1036. /* WMI_FW_VER_EVENTID */
  1037. struct wmi_fw_ver_event {
  1038. /* FW image version */
  1039. __le32 fw_major;
  1040. __le32 fw_minor;
  1041. __le32 fw_subminor;
  1042. __le32 fw_build;
  1043. /* FW image build time stamp */
  1044. __le32 hour;
  1045. __le32 minute;
  1046. __le32 second;
  1047. __le32 day;
  1048. __le32 month;
  1049. __le32 year;
  1050. /* Boot Loader image version */
  1051. __le32 bl_major;
  1052. __le32 bl_minor;
  1053. __le32 bl_subminor;
  1054. __le32 bl_build;
  1055. /* The number of entries in the FW capabilies array */
  1056. u8 fw_capabilities_len;
  1057. u8 reserved[3];
  1058. /* FW capabilities info
  1059. * Must be the last member of the struct
  1060. */
  1061. __le32 fw_capabilities[0];
  1062. } __packed;
  1063. /* WMI_GET_RF_STATUS_EVENTID */
  1064. enum rf_type {
  1065. RF_UNKNOWN = 0x00,
  1066. RF_MARLON = 0x01,
  1067. RF_SPARROW = 0x02,
  1068. };
  1069. /* WMI_GET_RF_STATUS_EVENTID */
  1070. enum board_file_rf_type {
  1071. BF_RF_MARLON = 0x00,
  1072. BF_RF_SPARROW = 0x01,
  1073. };
  1074. /* WMI_GET_RF_STATUS_EVENTID */
  1075. enum rf_status {
  1076. RF_OK = 0x00,
  1077. RF_NO_COMM = 0x01,
  1078. RF_WRONG_BOARD_FILE = 0x02,
  1079. };
  1080. /* WMI_GET_RF_STATUS_EVENTID */
  1081. struct wmi_get_rf_status_event {
  1082. /* enum rf_type */
  1083. __le32 rf_type;
  1084. /* attached RFs bit vector */
  1085. __le32 attached_rf_vector;
  1086. /* enabled RFs bit vector */
  1087. __le32 enabled_rf_vector;
  1088. /* enum rf_status, refers to enabled RFs */
  1089. u8 rf_status[32];
  1090. /* enum board file RF type */
  1091. __le32 board_file_rf_type;
  1092. /* board file platform type */
  1093. __le32 board_file_platform_type;
  1094. /* board file version */
  1095. __le32 board_file_version;
  1096. __le32 reserved[2];
  1097. } __packed;
  1098. /* WMI_GET_BASEBAND_TYPE_EVENTID */
  1099. enum baseband_type {
  1100. BASEBAND_UNKNOWN = 0x00,
  1101. BASEBAND_SPARROW_M_A0 = 0x03,
  1102. BASEBAND_SPARROW_M_A1 = 0x04,
  1103. BASEBAND_SPARROW_M_B0 = 0x05,
  1104. BASEBAND_SPARROW_M_C0 = 0x06,
  1105. BASEBAND_SPARROW_M_D0 = 0x07,
  1106. BASEBAND_TALYN_M_A0 = 0x08,
  1107. };
  1108. /* WMI_GET_BASEBAND_TYPE_EVENTID */
  1109. struct wmi_get_baseband_type_event {
  1110. /* enum baseband_type */
  1111. __le32 baseband_type;
  1112. } __packed;
  1113. /* WMI_MAC_ADDR_RESP_EVENTID */
  1114. struct wmi_mac_addr_resp_event {
  1115. u8 mac[WMI_MAC_LEN];
  1116. u8 auth_mode;
  1117. u8 crypt_mode;
  1118. __le32 offload_mode;
  1119. } __packed;
  1120. /* WMI_EAPOL_RX_EVENTID */
  1121. struct wmi_eapol_rx_event {
  1122. u8 src_mac[WMI_MAC_LEN];
  1123. __le16 eapol_len;
  1124. u8 eapol[0];
  1125. } __packed;
  1126. /* WMI_READY_EVENTID */
  1127. enum wmi_phy_capability {
  1128. WMI_11A_CAPABILITY = 0x01,
  1129. WMI_11G_CAPABILITY = 0x02,
  1130. WMI_11AG_CAPABILITY = 0x03,
  1131. WMI_11NA_CAPABILITY = 0x04,
  1132. WMI_11NG_CAPABILITY = 0x05,
  1133. WMI_11NAG_CAPABILITY = 0x06,
  1134. WMI_11AD_CAPABILITY = 0x07,
  1135. WMI_11N_CAPABILITY_OFFSET = 0x03,
  1136. };
  1137. struct wmi_ready_event {
  1138. __le32 sw_version;
  1139. __le32 abi_version;
  1140. u8 mac[WMI_MAC_LEN];
  1141. /* enum wmi_phy_capability */
  1142. u8 phy_capability;
  1143. u8 numof_additional_mids;
  1144. } __packed;
  1145. /* WMI_NOTIFY_REQ_DONE_EVENTID */
  1146. struct wmi_notify_req_done_event {
  1147. /* beamforming status, 0: fail; 1: OK; 2: retrying */
  1148. __le32 status;
  1149. __le64 tsf;
  1150. __le32 snr_val;
  1151. __le32 tx_tpt;
  1152. __le32 tx_goodput;
  1153. __le32 rx_goodput;
  1154. __le16 bf_mcs;
  1155. __le16 my_rx_sector;
  1156. __le16 my_tx_sector;
  1157. __le16 other_rx_sector;
  1158. __le16 other_tx_sector;
  1159. __le16 range;
  1160. u8 sqi;
  1161. u8 reserved[3];
  1162. } __packed;
  1163. /* WMI_CONNECT_EVENTID */
  1164. struct wmi_connect_event {
  1165. u8 channel;
  1166. u8 reserved0;
  1167. u8 bssid[WMI_MAC_LEN];
  1168. __le16 listen_interval;
  1169. __le16 beacon_interval;
  1170. u8 network_type;
  1171. u8 reserved1[3];
  1172. u8 beacon_ie_len;
  1173. u8 assoc_req_len;
  1174. u8 assoc_resp_len;
  1175. u8 cid;
  1176. u8 reserved2[3];
  1177. /* not in use */
  1178. u8 assoc_info[0];
  1179. } __packed;
  1180. /* WMI_DISCONNECT_EVENTID */
  1181. enum wmi_disconnect_reason {
  1182. WMI_DIS_REASON_NO_NETWORK_AVAIL = 0x01,
  1183. /* bmiss */
  1184. WMI_DIS_REASON_LOST_LINK = 0x02,
  1185. WMI_DIS_REASON_DISCONNECT_CMD = 0x03,
  1186. WMI_DIS_REASON_BSS_DISCONNECTED = 0x04,
  1187. WMI_DIS_REASON_AUTH_FAILED = 0x05,
  1188. WMI_DIS_REASON_ASSOC_FAILED = 0x06,
  1189. WMI_DIS_REASON_NO_RESOURCES_AVAIL = 0x07,
  1190. WMI_DIS_REASON_CSERV_DISCONNECT = 0x08,
  1191. WMI_DIS_REASON_INVALID_PROFILE = 0x0A,
  1192. WMI_DIS_REASON_DOT11H_CHANNEL_SWITCH = 0x0B,
  1193. WMI_DIS_REASON_PROFILE_MISMATCH = 0x0C,
  1194. WMI_DIS_REASON_CONNECTION_EVICTED = 0x0D,
  1195. WMI_DIS_REASON_IBSS_MERGE = 0x0E,
  1196. };
  1197. struct wmi_disconnect_event {
  1198. /* reason code, see 802.11 spec. */
  1199. __le16 protocol_reason_status;
  1200. /* set if known */
  1201. u8 bssid[WMI_MAC_LEN];
  1202. /* see enum wmi_disconnect_reason */
  1203. u8 disconnect_reason;
  1204. /* last assoc req may passed to host - not in used */
  1205. u8 assoc_resp_len;
  1206. /* last assoc req may passed to host - not in used */
  1207. u8 assoc_info[0];
  1208. } __packed;
  1209. /* WMI_SCAN_COMPLETE_EVENTID */
  1210. enum scan_status {
  1211. WMI_SCAN_SUCCESS = 0x00,
  1212. WMI_SCAN_FAILED = 0x01,
  1213. WMI_SCAN_ABORTED = 0x02,
  1214. WMI_SCAN_REJECTED = 0x03,
  1215. WMI_SCAN_ABORT_REJECTED = 0x04,
  1216. };
  1217. struct wmi_scan_complete_event {
  1218. /* enum scan_status */
  1219. __le32 status;
  1220. } __packed;
  1221. /* WMI_ACS_PASSIVE_SCAN_COMPLETE_EVENT */
  1222. enum wmi_acs_info_bitmask {
  1223. WMI_ACS_INFO_BITMASK_BEACON_FOUND = 0x01,
  1224. WMI_ACS_INFO_BITMASK_BUSY_TIME = 0x02,
  1225. WMI_ACS_INFO_BITMASK_TX_TIME = 0x04,
  1226. WMI_ACS_INFO_BITMASK_RX_TIME = 0x08,
  1227. WMI_ACS_INFO_BITMASK_NOISE = 0x10,
  1228. };
  1229. struct scan_acs_info {
  1230. u8 channel;
  1231. u8 beacon_found;
  1232. /* msec */
  1233. __le16 busy_time;
  1234. __le16 tx_time;
  1235. __le16 rx_time;
  1236. u8 noise;
  1237. u8 reserved[3];
  1238. } __packed;
  1239. struct wmi_acs_passive_scan_complete_event {
  1240. __le32 dwell_time;
  1241. /* valid fields within channel info according to
  1242. * their appearance in struct order
  1243. */
  1244. __le16 filled;
  1245. u8 num_scanned_channels;
  1246. u8 reserved;
  1247. struct scan_acs_info scan_info_list[0];
  1248. } __packed;
  1249. /* WMI_BA_STATUS_EVENTID */
  1250. enum wmi_vring_ba_status {
  1251. WMI_BA_AGREED = 0x00,
  1252. WMI_BA_NON_AGREED = 0x01,
  1253. /* BA_EN in middle of teardown flow */
  1254. WMI_BA_TD_WIP = 0x02,
  1255. /* BA_DIS or BA_EN in middle of BA SETUP flow */
  1256. WMI_BA_SETUP_WIP = 0x03,
  1257. /* BA_EN when the BA session is already active */
  1258. WMI_BA_SESSION_ACTIVE = 0x04,
  1259. /* BA_DIS when the BA session is not active */
  1260. WMI_BA_SESSION_NOT_ACTIVE = 0x05,
  1261. };
  1262. struct wmi_ba_status_event {
  1263. /* enum wmi_vring_ba_status */
  1264. __le16 status;
  1265. u8 reserved[2];
  1266. u8 ringid;
  1267. u8 agg_wsize;
  1268. __le16 ba_timeout;
  1269. u8 amsdu;
  1270. } __packed;
  1271. /* WMI_DELBA_EVENTID */
  1272. struct wmi_delba_event {
  1273. u8 cidxtid;
  1274. u8 from_initiator;
  1275. __le16 reason;
  1276. } __packed;
  1277. /* WMI_VRING_CFG_DONE_EVENTID */
  1278. struct wmi_vring_cfg_done_event {
  1279. u8 ringid;
  1280. u8 status;
  1281. u8 reserved[2];
  1282. __le32 tx_vring_tail_ptr;
  1283. } __packed;
  1284. /* WMI_RCP_ADDBA_RESP_SENT_EVENTID */
  1285. struct wmi_rcp_addba_resp_sent_event {
  1286. u8 cidxtid;
  1287. u8 reserved;
  1288. __le16 status;
  1289. } __packed;
  1290. /* WMI_RCP_ADDBA_REQ_EVENTID */
  1291. struct wmi_rcp_addba_req_event {
  1292. u8 cidxtid;
  1293. u8 dialog_token;
  1294. /* ieee80211_ba_parameterset as it received */
  1295. __le16 ba_param_set;
  1296. __le16 ba_timeout;
  1297. /* ieee80211_ba_seqstrl field as it received */
  1298. __le16 ba_seq_ctrl;
  1299. } __packed;
  1300. /* WMI_CFG_RX_CHAIN_DONE_EVENTID */
  1301. enum wmi_cfg_rx_chain_done_event_status {
  1302. WMI_CFG_RX_CHAIN_SUCCESS = 0x01,
  1303. };
  1304. struct wmi_cfg_rx_chain_done_event {
  1305. /* V-Ring Tail pointer */
  1306. __le32 rx_ring_tail_ptr;
  1307. __le32 status;
  1308. } __packed;
  1309. /* WMI_WBE_LINK_DOWN_EVENTID */
  1310. enum wmi_wbe_link_down_event_reason {
  1311. WMI_WBE_REASON_USER_REQUEST = 0x00,
  1312. WMI_WBE_REASON_RX_DISASSOC = 0x01,
  1313. WMI_WBE_REASON_BAD_PHY_LINK = 0x02,
  1314. };
  1315. /* WMI_WBE_LINK_DOWN_EVENTID */
  1316. struct wmi_wbe_link_down_event {
  1317. u8 cid;
  1318. u8 reserved[3];
  1319. __le32 reason;
  1320. } __packed;
  1321. /* WMI_DATA_PORT_OPEN_EVENTID */
  1322. struct wmi_data_port_open_event {
  1323. u8 cid;
  1324. u8 reserved[3];
  1325. } __packed;
  1326. /* WMI_VRING_EN_EVENTID */
  1327. struct wmi_vring_en_event {
  1328. u8 vring_index;
  1329. u8 reserved[3];
  1330. } __packed;
  1331. /* WMI_GET_PCP_CHANNEL_EVENTID */
  1332. struct wmi_get_pcp_channel_event {
  1333. u8 channel;
  1334. u8 reserved[3];
  1335. } __packed;
  1336. /* WMI_P2P_CFG_DONE_EVENTID */
  1337. struct wmi_p2p_cfg_done_event {
  1338. /* wmi_fw_status */
  1339. u8 status;
  1340. u8 reserved[3];
  1341. } __packed;
  1342. /* WMI_PORT_ALLOCATED_EVENTID */
  1343. struct wmi_port_allocated_event {
  1344. /* wmi_fw_status */
  1345. u8 status;
  1346. u8 reserved[3];
  1347. } __packed;
  1348. /* WMI_PORT_DELETED_EVENTID */
  1349. struct wmi_port_deleted_event {
  1350. /* wmi_fw_status */
  1351. u8 status;
  1352. u8 reserved[3];
  1353. } __packed;
  1354. /* WMI_LISTEN_STARTED_EVENTID */
  1355. struct wmi_listen_started_event {
  1356. /* wmi_fw_status */
  1357. u8 status;
  1358. u8 reserved[3];
  1359. } __packed;
  1360. /* WMI_SEARCH_STARTED_EVENTID */
  1361. struct wmi_search_started_event {
  1362. /* wmi_fw_status */
  1363. u8 status;
  1364. u8 reserved[3];
  1365. } __packed;
  1366. /* WMI_PCP_STARTED_EVENTID */
  1367. struct wmi_pcp_started_event {
  1368. /* wmi_fw_status */
  1369. u8 status;
  1370. u8 reserved[3];
  1371. } __packed;
  1372. /* WMI_PCP_FACTOR_EVENTID */
  1373. struct wmi_pcp_factor_event {
  1374. __le32 pcp_factor;
  1375. } __packed;
  1376. enum wmi_sw_tx_status {
  1377. WMI_TX_SW_STATUS_SUCCESS = 0x00,
  1378. WMI_TX_SW_STATUS_FAILED_NO_RESOURCES = 0x01,
  1379. WMI_TX_SW_STATUS_FAILED_TX = 0x02,
  1380. };
  1381. /* WMI_SW_TX_COMPLETE_EVENTID */
  1382. struct wmi_sw_tx_complete_event {
  1383. /* enum wmi_sw_tx_status */
  1384. u8 status;
  1385. u8 reserved[3];
  1386. } __packed;
  1387. /* WMI_CORR_MEASURE_EVENTID */
  1388. struct wmi_corr_measure_event {
  1389. /* signed */
  1390. __le32 i;
  1391. /* signed */
  1392. __le32 q;
  1393. /* signed */
  1394. __le32 image_i;
  1395. /* signed */
  1396. __le32 image_q;
  1397. } __packed;
  1398. /* WMI_READ_RSSI_EVENTID */
  1399. struct wmi_read_rssi_event {
  1400. __le32 ina_rssi_adc_dbm;
  1401. } __packed;
  1402. /* WMI_GET_SSID_EVENTID */
  1403. struct wmi_get_ssid_event {
  1404. __le32 ssid_len;
  1405. u8 ssid[WMI_MAX_SSID_LEN];
  1406. } __packed;
  1407. /* wmi_rx_mgmt_info */
  1408. struct wmi_rx_mgmt_info {
  1409. u8 mcs;
  1410. s8 snr;
  1411. u8 range;
  1412. u8 sqi;
  1413. __le16 stype;
  1414. __le16 status;
  1415. __le32 len;
  1416. /* Not resolved when == 0xFFFFFFFF ==> Broadcast to all MIDS */
  1417. u8 qid;
  1418. /* Not resolved when == 0xFFFFFFFF ==> Broadcast to all MIDS */
  1419. u8 mid;
  1420. u8 cid;
  1421. /* From Radio MNGR */
  1422. u8 channel;
  1423. } __packed;
  1424. /* wmi_otp_read_write_cmd */
  1425. struct wmi_otp_read_write_cmd {
  1426. __le32 addr;
  1427. __le32 size;
  1428. u8 values[0];
  1429. } __packed;
  1430. /* WMI_OTP_READ_RESULT_EVENTID */
  1431. struct wmi_otp_read_result_event {
  1432. u8 payload[0];
  1433. } __packed;
  1434. /* WMI_TX_MGMT_PACKET_EVENTID */
  1435. struct wmi_tx_mgmt_packet_event {
  1436. u8 payload[0];
  1437. } __packed;
  1438. /* WMI_RX_MGMT_PACKET_EVENTID */
  1439. struct wmi_rx_mgmt_packet_event {
  1440. struct wmi_rx_mgmt_info info;
  1441. u8 payload[0];
  1442. } __packed;
  1443. /* WMI_ECHO_RSP_EVENTID */
  1444. struct wmi_echo_rsp_event {
  1445. __le32 echoed_value;
  1446. } __packed;
  1447. /* WMI_TEMP_SENSE_DONE_EVENTID
  1448. *
  1449. * Measure MAC and radio temperatures
  1450. */
  1451. struct wmi_temp_sense_done_event {
  1452. /* Temperature times 1000 (actual temperature will be achieved by
  1453. * dividing the value by 1000)
  1454. */
  1455. __le32 baseband_t1000;
  1456. /* Temperature times 1000 (actual temperature will be achieved by
  1457. * dividing the value by 1000)
  1458. */
  1459. __le32 rf_t1000;
  1460. } __packed;
  1461. #define WMI_SCAN_DWELL_TIME_MS (100)
  1462. #define WMI_SURVEY_TIMEOUT_MS (10000)
  1463. enum wmi_hidden_ssid {
  1464. WMI_HIDDEN_SSID_DISABLED = 0x00,
  1465. WMI_HIDDEN_SSID_SEND_EMPTY = 0x10,
  1466. WMI_HIDDEN_SSID_CLEAR = 0xFE,
  1467. };
  1468. /* WMI_LED_CFG_CMDID
  1469. *
  1470. * Configure LED On\Off\Blinking operation
  1471. *
  1472. * Returned events:
  1473. * - WMI_LED_CFG_DONE_EVENTID
  1474. */
  1475. enum led_mode {
  1476. LED_DISABLE = 0x00,
  1477. LED_ENABLE = 0x01,
  1478. };
  1479. /* The names of the led as
  1480. * described on HW schemes.
  1481. */
  1482. enum wmi_led_id {
  1483. WMI_LED_WLAN = 0x00,
  1484. WMI_LED_WPAN = 0x01,
  1485. WMI_LED_WWAN = 0x02,
  1486. };
  1487. /* Led polarity mode. */
  1488. enum wmi_led_polarity {
  1489. LED_POLARITY_HIGH_ACTIVE = 0x00,
  1490. LED_POLARITY_LOW_ACTIVE = 0x01,
  1491. };
  1492. /* Combination of on and off
  1493. * creates the blinking period
  1494. */
  1495. struct wmi_led_blink_mode {
  1496. __le32 blink_on;
  1497. __le32 blink_off;
  1498. } __packed;
  1499. /* WMI_LED_CFG_CMDID */
  1500. struct wmi_led_cfg_cmd {
  1501. /* enum led_mode_e */
  1502. u8 led_mode;
  1503. /* enum wmi_led_id_e */
  1504. u8 id;
  1505. /* slow speed blinking combination */
  1506. struct wmi_led_blink_mode slow_blink_cfg;
  1507. /* medium speed blinking combination */
  1508. struct wmi_led_blink_mode medium_blink_cfg;
  1509. /* high speed blinking combination */
  1510. struct wmi_led_blink_mode fast_blink_cfg;
  1511. /* polarity of the led */
  1512. u8 led_polarity;
  1513. /* reserved */
  1514. u8 reserved;
  1515. } __packed;
  1516. /* WMI_LED_CFG_DONE_EVENTID */
  1517. struct wmi_led_cfg_done_event {
  1518. /* led config status */
  1519. __le32 status;
  1520. } __packed;
  1521. #define WMI_NUM_MCS (13)
  1522. /* Rate search parameters configuration per connection */
  1523. struct wmi_rs_cfg {
  1524. /* The maximal allowed PER for each MCS
  1525. * MCS will be considered as failed if PER during RS is higher
  1526. */
  1527. u8 per_threshold[WMI_NUM_MCS];
  1528. /* Number of MPDUs for each MCS
  1529. * this is the minimal statistic required to make an educated
  1530. * decision
  1531. */
  1532. u8 min_frame_cnt[WMI_NUM_MCS];
  1533. /* stop threshold [0-100] */
  1534. u8 stop_th;
  1535. /* MCS1 stop threshold [0-100] */
  1536. u8 mcs1_fail_th;
  1537. u8 max_back_failure_th;
  1538. /* Debug feature for disabling internal RS trigger (which is
  1539. * currently triggered by BF Done)
  1540. */
  1541. u8 dbg_disable_internal_trigger;
  1542. __le32 back_failure_mask;
  1543. __le32 mcs_en_vec;
  1544. } __packed;
  1545. /* WMI_RS_CFG_CMDID */
  1546. struct wmi_rs_cfg_cmd {
  1547. /* connection id */
  1548. u8 cid;
  1549. /* enable or disable rate search */
  1550. u8 rs_enable;
  1551. /* rate search configuration */
  1552. struct wmi_rs_cfg rs_cfg;
  1553. } __packed;
  1554. /* WMI_RS_CFG_DONE_EVENTID */
  1555. struct wmi_rs_cfg_done_event {
  1556. u8 cid;
  1557. /* enum wmi_fw_status */
  1558. u8 status;
  1559. u8 reserved[2];
  1560. } __packed;
  1561. /* WMI_GET_DETAILED_RS_RES_CMDID */
  1562. struct wmi_get_detailed_rs_res_cmd {
  1563. /* connection id */
  1564. u8 cid;
  1565. u8 reserved[3];
  1566. } __packed;
  1567. /* RS results status */
  1568. enum wmi_rs_results_status {
  1569. WMI_RS_RES_VALID = 0x00,
  1570. WMI_RS_RES_INVALID = 0x01,
  1571. };
  1572. /* Rate search results */
  1573. struct wmi_rs_results {
  1574. /* number of sent MPDUs */
  1575. u8 num_of_tx_pkt[WMI_NUM_MCS];
  1576. /* number of non-acked MPDUs */
  1577. u8 num_of_non_acked_pkt[WMI_NUM_MCS];
  1578. /* RS timestamp */
  1579. __le32 tsf;
  1580. /* RS selected MCS */
  1581. u8 mcs;
  1582. } __packed;
  1583. /* WMI_GET_DETAILED_RS_RES_EVENTID */
  1584. struct wmi_get_detailed_rs_res_event {
  1585. u8 cid;
  1586. /* enum wmi_rs_results_status */
  1587. u8 status;
  1588. /* detailed rs results */
  1589. struct wmi_rs_results rs_results;
  1590. u8 reserved[3];
  1591. } __packed;
  1592. /* broadcast connection ID */
  1593. #define WMI_LINK_MAINTAIN_CFG_CID_BROADCAST (0xFFFFFFFF)
  1594. /* Types wmi_link_maintain_cfg presets for WMI_LINK_MAINTAIN_CFG_WRITE_CMD */
  1595. enum wmi_link_maintain_cfg_type {
  1596. /* AP/PCP default normal (non-FST) configuration settings */
  1597. WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_NORMAL_AP = 0x00,
  1598. /* AP/PCP default FST configuration settings */
  1599. WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_FST_AP = 0x01,
  1600. /* STA default normal (non-FST) configuration settings */
  1601. WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_NORMAL_STA = 0x02,
  1602. /* STA default FST configuration settings */
  1603. WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_FST_STA = 0x03,
  1604. /* custom configuration settings */
  1605. WMI_LINK_MAINTAIN_CFG_TYPE_CUSTOM = 0x04,
  1606. /* number of defined configuration types */
  1607. WMI_LINK_MAINTAIN_CFG_TYPES_NUM = 0x05,
  1608. };
  1609. /* Response status codes for WMI_LINK_MAINTAIN_CFG_WRITE/READ commands */
  1610. enum wmi_link_maintain_cfg_response_status {
  1611. /* WMI_LINK_MAINTAIN_CFG_WRITE/READ command successfully accomplished
  1612. */
  1613. WMI_LINK_MAINTAIN_CFG_RESPONSE_STATUS_OK = 0x00,
  1614. /* ERROR due to bad argument in WMI_LINK_MAINTAIN_CFG_WRITE/READ
  1615. * command request
  1616. */
  1617. WMI_LINK_MAINTAIN_CFG_RESPONSE_STATUS_BAD_ARGUMENT = 0x01,
  1618. };
  1619. /* Link Loss and Keep Alive configuration */
  1620. struct wmi_link_maintain_cfg {
  1621. /* link_loss_enable_detectors_vec */
  1622. __le32 link_loss_enable_detectors_vec;
  1623. /* detectors check period usec */
  1624. __le32 check_link_loss_period_usec;
  1625. /* max allowed tx ageing */
  1626. __le32 tx_ageing_threshold_usec;
  1627. /* keep alive period for high SNR */
  1628. __le32 keep_alive_period_usec_high_snr;
  1629. /* keep alive period for low SNR */
  1630. __le32 keep_alive_period_usec_low_snr;
  1631. /* lower snr limit for keep alive period update */
  1632. __le32 keep_alive_snr_threshold_low_db;
  1633. /* upper snr limit for keep alive period update */
  1634. __le32 keep_alive_snr_threshold_high_db;
  1635. /* num of successive bad bcons causing link-loss */
  1636. __le32 bad_beacons_num_threshold;
  1637. /* SNR limit for bad_beacons_detector */
  1638. __le32 bad_beacons_snr_threshold_db;
  1639. } __packed;
  1640. /* WMI_LINK_MAINTAIN_CFG_WRITE_CMDID */
  1641. struct wmi_link_maintain_cfg_write_cmd {
  1642. /* enum wmi_link_maintain_cfg_type_e - type of requested default
  1643. * configuration to be applied
  1644. */
  1645. __le32 cfg_type;
  1646. /* requested connection ID or WMI_LINK_MAINTAIN_CFG_CID_BROADCAST */
  1647. __le32 cid;
  1648. /* custom configuration settings to be applied (relevant only if
  1649. * cfg_type==WMI_LINK_MAINTAIN_CFG_TYPE_CUSTOM)
  1650. */
  1651. struct wmi_link_maintain_cfg lm_cfg;
  1652. } __packed;
  1653. /* WMI_LINK_MAINTAIN_CFG_READ_CMDID */
  1654. struct wmi_link_maintain_cfg_read_cmd {
  1655. /* connection ID which configuration settings are requested */
  1656. __le32 cid;
  1657. } __packed;
  1658. /* WMI_LINK_MAINTAIN_CFG_WRITE_DONE_EVENTID */
  1659. struct wmi_link_maintain_cfg_write_done_event {
  1660. /* requested connection ID */
  1661. __le32 cid;
  1662. /* wmi_link_maintain_cfg_response_status_e - write status */
  1663. __le32 status;
  1664. } __packed;
  1665. /* \WMI_LINK_MAINTAIN_CFG_READ_DONE_EVENT */
  1666. struct wmi_link_maintain_cfg_read_done_event {
  1667. /* requested connection ID */
  1668. __le32 cid;
  1669. /* wmi_link_maintain_cfg_response_status_e - read status */
  1670. __le32 status;
  1671. /* Retrieved configuration settings */
  1672. struct wmi_link_maintain_cfg lm_cfg;
  1673. } __packed;
  1674. enum wmi_traffic_deferral_status {
  1675. WMI_TRAFFIC_DEFERRAL_APPROVED = 0x0,
  1676. WMI_TRAFFIC_DEFERRAL_REJECTED = 0x1,
  1677. };
  1678. /* WMI_TRAFFIC_DEFERRAL_EVENTID */
  1679. struct wmi_traffic_deferral_event {
  1680. /* enum wmi_traffic_deferral_status_e */
  1681. u8 status;
  1682. } __packed;
  1683. enum wmi_traffic_resume_status {
  1684. WMI_TRAFFIC_RESUME_SUCCESS = 0x0,
  1685. WMI_TRAFFIC_RESUME_FAILED = 0x1,
  1686. };
  1687. /* WMI_TRAFFIC_RESUME_EVENTID */
  1688. struct wmi_traffic_resume_event {
  1689. /* enum wmi_traffic_resume_status_e */
  1690. u8 status;
  1691. } __packed;
  1692. /* Power Save command completion status codes */
  1693. enum wmi_ps_cfg_cmd_status {
  1694. WMI_PS_CFG_CMD_STATUS_SUCCESS = 0x00,
  1695. WMI_PS_CFG_CMD_STATUS_BAD_PARAM = 0x01,
  1696. /* other error */
  1697. WMI_PS_CFG_CMD_STATUS_ERROR = 0x02,
  1698. };
  1699. /* Device Power Save Profiles */
  1700. enum wmi_ps_profile_type {
  1701. WMI_PS_PROFILE_TYPE_DEFAULT = 0x00,
  1702. WMI_PS_PROFILE_TYPE_PS_DISABLED = 0x01,
  1703. WMI_PS_PROFILE_TYPE_MAX_PS = 0x02,
  1704. WMI_PS_PROFILE_TYPE_LOW_LATENCY_PS = 0x03,
  1705. };
  1706. /* WMI_PS_DEV_PROFILE_CFG_CMDID
  1707. *
  1708. * Power save profile to be used by the device
  1709. *
  1710. * Returned event:
  1711. * - WMI_PS_DEV_PROFILE_CFG_EVENTID
  1712. */
  1713. struct wmi_ps_dev_profile_cfg_cmd {
  1714. /* wmi_ps_profile_type_e */
  1715. u8 ps_profile;
  1716. u8 reserved[3];
  1717. } __packed;
  1718. /* WMI_PS_DEV_PROFILE_CFG_EVENTID */
  1719. struct wmi_ps_dev_profile_cfg_event {
  1720. /* wmi_ps_cfg_cmd_status_e */
  1721. __le32 status;
  1722. } __packed;
  1723. enum wmi_ps_level {
  1724. WMI_PS_LEVEL_DEEP_SLEEP = 0x00,
  1725. WMI_PS_LEVEL_SHALLOW_SLEEP = 0x01,
  1726. /* awake = all PS mechanisms are disabled */
  1727. WMI_PS_LEVEL_AWAKE = 0x02,
  1728. };
  1729. enum wmi_ps_deep_sleep_clk_level {
  1730. /* 33k */
  1731. WMI_PS_DEEP_SLEEP_CLK_LEVEL_RTC = 0x00,
  1732. /* 10k */
  1733. WMI_PS_DEEP_SLEEP_CLK_LEVEL_OSC = 0x01,
  1734. /* @RTC Low latency */
  1735. WMI_PS_DEEP_SLEEP_CLK_LEVEL_RTC_LT = 0x02,
  1736. WMI_PS_DEEP_SLEEP_CLK_LEVEL_XTAL = 0x03,
  1737. WMI_PS_DEEP_SLEEP_CLK_LEVEL_SYSCLK = 0x04,
  1738. /* Not Applicable */
  1739. WMI_PS_DEEP_SLEEP_CLK_LEVEL_N_A = 0xFF,
  1740. };
  1741. /* Response by the FW to a D3 entry request */
  1742. enum wmi_ps_d3_resp_policy {
  1743. WMI_PS_D3_RESP_POLICY_DEFAULT = 0x00,
  1744. /* debug -D3 req is always denied */
  1745. WMI_PS_D3_RESP_POLICY_DENIED = 0x01,
  1746. /* debug -D3 req is always approved */
  1747. WMI_PS_D3_RESP_POLICY_APPROVED = 0x02,
  1748. };
  1749. /* Device common power save configurations */
  1750. struct wmi_ps_dev_cfg {
  1751. /* lowest level of PS allowed while unassociated, enum wmi_ps_level_e
  1752. */
  1753. u8 ps_unassoc_min_level;
  1754. /* lowest deep sleep clock level while nonassoc, enum
  1755. * wmi_ps_deep_sleep_clk_level_e
  1756. */
  1757. u8 ps_unassoc_deep_sleep_min_level;
  1758. /* lowest level of PS allowed while associated, enum wmi_ps_level_e */
  1759. u8 ps_assoc_min_level;
  1760. /* lowest deep sleep clock level while assoc, enum
  1761. * wmi_ps_deep_sleep_clk_level_e
  1762. */
  1763. u8 ps_assoc_deep_sleep_min_level;
  1764. /* enum wmi_ps_deep_sleep_clk_level_e */
  1765. u8 ps_assoc_low_latency_ds_min_level;
  1766. /* enum wmi_ps_d3_resp_policy_e */
  1767. u8 ps_D3_response_policy;
  1768. /* BOOL */
  1769. u8 ps_D3_pm_pme_enabled;
  1770. /* BOOL */
  1771. u8 ps_halp_enable;
  1772. u8 ps_deep_sleep_enter_thresh_msec;
  1773. /* BOOL */
  1774. u8 ps_voltage_scaling_en;
  1775. } __packed;
  1776. /* WMI_PS_DEV_CFG_CMDID
  1777. *
  1778. * Configure common Power Save parameters of the device and all MIDs.
  1779. *
  1780. * Returned event:
  1781. * - WMI_PS_DEV_CFG_EVENTID
  1782. */
  1783. struct wmi_ps_dev_cfg_cmd {
  1784. /* Device Power Save configuration to be applied */
  1785. struct wmi_ps_dev_cfg ps_dev_cfg;
  1786. /* alignment to 32b */
  1787. u8 reserved[2];
  1788. } __packed;
  1789. /* WMI_PS_DEV_CFG_EVENTID */
  1790. struct wmi_ps_dev_cfg_event {
  1791. /* wmi_ps_cfg_cmd_status_e */
  1792. __le32 status;
  1793. } __packed;
  1794. /* WMI_PS_DEV_CFG_READ_CMDID
  1795. *
  1796. * request to retrieve device Power Save configuration
  1797. * (WMI_PS_DEV_CFG_CMD params)
  1798. *
  1799. * Returned event:
  1800. * - WMI_PS_DEV_CFG_READ_EVENTID
  1801. */
  1802. struct wmi_ps_dev_cfg_read_cmd {
  1803. __le32 reserved;
  1804. } __packed;
  1805. /* WMI_PS_DEV_CFG_READ_EVENTID */
  1806. struct wmi_ps_dev_cfg_read_event {
  1807. /* wmi_ps_cfg_cmd_status_e */
  1808. __le32 status;
  1809. /* Retrieved device Power Save configuration (WMI_PS_DEV_CFG_CMD
  1810. * params)
  1811. */
  1812. struct wmi_ps_dev_cfg dev_ps_cfg;
  1813. /* alignment to 32b */
  1814. u8 reserved[2];
  1815. } __packed;
  1816. /* Per Mac Power Save configurations */
  1817. struct wmi_ps_mid_cfg {
  1818. /* Low power RX in BTI is enabled, BOOL */
  1819. u8 beacon_lprx_enable;
  1820. /* Sync to sector ID enabled, BOOL */
  1821. u8 beacon_sync_to_sectorId_enable;
  1822. /* Low power RX in DTI is enabled, BOOL */
  1823. u8 frame_exchange_lprx_enable;
  1824. /* Sleep Cycle while in scheduled PS, 1-31 */
  1825. u8 scheduled_sleep_cycle_pow2;
  1826. /* Stay Awake for k BIs every (sleep_cycle - k) BIs, 1-31 */
  1827. u8 scheduled_num_of_awake_bis;
  1828. u8 am_to_traffic_load_thresh_mbp;
  1829. u8 traffic_to_am_load_thresh_mbps;
  1830. u8 traffic_to_am_num_of_no_traffic_bis;
  1831. /* BOOL */
  1832. u8 continuous_traffic_psm;
  1833. __le16 no_traffic_to_min_usec;
  1834. __le16 no_traffic_to_max_usec;
  1835. __le16 snoozing_sleep_interval_milisec;
  1836. u8 max_no_data_awake_events;
  1837. /* Trigger WEB after k failed beacons */
  1838. u8 num_of_failed_beacons_rx_to_trigger_web;
  1839. /* Trigger BF after k failed beacons */
  1840. u8 num_of_failed_beacons_rx_to_trigger_bf;
  1841. /* Trigger SOB after k successful beacons */
  1842. u8 num_of_successful_beacons_rx_to_trigger_sob;
  1843. } __packed;
  1844. /* WMI_PS_MID_CFG_CMDID
  1845. *
  1846. * Configure Power Save parameters of a specific MID.
  1847. * These parameters are relevant for the specific BSS this MID belongs to.
  1848. *
  1849. * Returned event:
  1850. * - WMI_PS_MID_CFG_EVENTID
  1851. */
  1852. struct wmi_ps_mid_cfg_cmd {
  1853. /* MAC ID */
  1854. u8 mid;
  1855. /* mid PS configuration to be applied */
  1856. struct wmi_ps_mid_cfg ps_mid_cfg;
  1857. } __packed;
  1858. /* WMI_PS_MID_CFG_EVENTID */
  1859. struct wmi_ps_mid_cfg_event {
  1860. /* MAC ID */
  1861. u8 mid;
  1862. /* alignment to 32b */
  1863. u8 reserved[3];
  1864. /* wmi_ps_cfg_cmd_status_e */
  1865. __le32 status;
  1866. } __packed;
  1867. /* WMI_PS_MID_CFG_READ_CMDID
  1868. *
  1869. * request to retrieve Power Save configuration of mid
  1870. * (WMI_PS_MID_CFG_CMD params)
  1871. *
  1872. * Returned event:
  1873. * - WMI_PS_MID_CFG_READ_EVENTID
  1874. */
  1875. struct wmi_ps_mid_cfg_read_cmd {
  1876. /* MAC ID */
  1877. u8 mid;
  1878. /* alignment to 32b */
  1879. u8 reserved[3];
  1880. } __packed;
  1881. /* WMI_PS_MID_CFG_READ_EVENTID */
  1882. struct wmi_ps_mid_cfg_read_event {
  1883. /* MAC ID */
  1884. u8 mid;
  1885. /* Retrieved MID Power Save configuration(WMI_PS_MID_CFG_CMD params) */
  1886. struct wmi_ps_mid_cfg mid_ps_cfg;
  1887. /* wmi_ps_cfg_cmd_status_e */
  1888. __le32 status;
  1889. } __packed;
  1890. #define WMI_AOA_MAX_DATA_SIZE (128)
  1891. enum wmi_aoa_meas_status {
  1892. WMI_AOA_MEAS_SUCCESS = 0x00,
  1893. WMI_AOA_MEAS_PEER_INCAPABLE = 0x01,
  1894. WMI_AOA_MEAS_FAILURE = 0x02,
  1895. };
  1896. /* WMI_AOA_MEAS_EVENTID */
  1897. struct wmi_aoa_meas_event {
  1898. u8 mac_addr[WMI_MAC_LEN];
  1899. /* channels IDs:
  1900. * 0 - 58320 MHz
  1901. * 1 - 60480 MHz
  1902. * 2 - 62640 MHz
  1903. */
  1904. u8 channel;
  1905. /* enum wmi_aoa_meas_type */
  1906. u8 aoa_meas_type;
  1907. /* Measurments are from RFs, defined by the mask */
  1908. __le32 meas_rf_mask;
  1909. /* enum wmi_aoa_meas_status */
  1910. u8 meas_status;
  1911. u8 reserved;
  1912. /* Length of meas_data in bytes */
  1913. __le16 length;
  1914. u8 meas_data[WMI_AOA_MAX_DATA_SIZE];
  1915. } __packed;
  1916. /* WMI_SET_MGMT_RETRY_LIMIT_EVENTID */
  1917. struct wmi_set_mgmt_retry_limit_event {
  1918. /* enum wmi_fw_status */
  1919. u8 status;
  1920. /* alignment to 32b */
  1921. u8 reserved[3];
  1922. } __packed;
  1923. /* WMI_GET_MGMT_RETRY_LIMIT_EVENTID */
  1924. struct wmi_get_mgmt_retry_limit_event {
  1925. /* MAC retransmit limit for mgmt frames */
  1926. u8 mgmt_retry_limit;
  1927. /* alignment to 32b */
  1928. u8 reserved[3];
  1929. } __packed;
  1930. /* WMI_TOF_GET_CAPABILITIES_EVENTID */
  1931. struct wmi_tof_get_capabilities_event {
  1932. u8 ftm_capability;
  1933. /* maximum supported number of destination to start TOF */
  1934. u8 max_num_of_dest;
  1935. /* maximum supported number of measurements per burst */
  1936. u8 max_num_of_meas_per_burst;
  1937. u8 reserved;
  1938. /* maximum supported multi bursts */
  1939. __le16 max_multi_bursts_sessions;
  1940. /* maximum supported FTM burst duration , wmi_tof_burst_duration_e */
  1941. __le16 max_ftm_burst_duration;
  1942. /* AOA supported types */
  1943. __le32 aoa_supported_types;
  1944. } __packed;
  1945. enum wmi_tof_session_end_status {
  1946. WMI_TOF_SESSION_END_NO_ERROR = 0x00,
  1947. WMI_TOF_SESSION_END_FAIL = 0x01,
  1948. WMI_TOF_SESSION_END_PARAMS_ERROR = 0x02,
  1949. WMI_TOF_SESSION_END_ABORTED = 0x03,
  1950. };
  1951. /* WMI_TOF_SESSION_END_EVENTID */
  1952. struct wmi_tof_session_end_event {
  1953. /* FTM session ID */
  1954. __le32 session_id;
  1955. /* wmi_tof_session_end_status_e */
  1956. u8 status;
  1957. u8 reserved[3];
  1958. } __packed;
  1959. /* Responder FTM Results */
  1960. struct wmi_responder_ftm_res {
  1961. u8 t1[6];
  1962. u8 t2[6];
  1963. u8 t3[6];
  1964. u8 t4[6];
  1965. __le16 tod_err;
  1966. __le16 toa_err;
  1967. __le16 tod_err_initiator;
  1968. __le16 toa_err_initiator;
  1969. } __packed;
  1970. enum wmi_tof_ftm_per_dest_res_status {
  1971. WMI_PER_DEST_RES_NO_ERROR = 0x00,
  1972. WMI_PER_DEST_RES_TX_RX_FAIL = 0x01,
  1973. WMI_PER_DEST_RES_PARAM_DONT_MATCH = 0x02,
  1974. };
  1975. enum wmi_tof_ftm_per_dest_res_flags {
  1976. WMI_PER_DEST_RES_REQ_START = 0x01,
  1977. WMI_PER_DEST_RES_BURST_REPORT_END = 0x02,
  1978. WMI_PER_DEST_RES_REQ_END = 0x04,
  1979. WMI_PER_DEST_RES_PARAM_UPDATE = 0x08,
  1980. };
  1981. /* WMI_TOF_FTM_PER_DEST_RES_EVENTID */
  1982. struct wmi_tof_ftm_per_dest_res_event {
  1983. /* FTM session ID */
  1984. __le32 session_id;
  1985. /* destination MAC address */
  1986. u8 dst_mac[WMI_MAC_LEN];
  1987. /* wmi_tof_ftm_per_dest_res_flags_e */
  1988. u8 flags;
  1989. /* wmi_tof_ftm_per_dest_res_status_e */
  1990. u8 status;
  1991. /* responder ASAP */
  1992. u8 responder_asap;
  1993. /* responder number of FTM per burst */
  1994. u8 responder_num_ftm_per_burst;
  1995. /* responder number of FTM burst exponent */
  1996. u8 responder_num_ftm_bursts_exp;
  1997. /* responder burst duration ,wmi_tof_burst_duration_e */
  1998. u8 responder_burst_duration;
  1999. /* responder burst period, indicate interval between two consecutive
  2000. * burst instances, in units of 100 ms
  2001. */
  2002. __le16 responder_burst_period;
  2003. /* receive burst counter */
  2004. __le16 bursts_cnt;
  2005. /* tsf of responder start burst */
  2006. __le32 tsf_sync;
  2007. /* actual received ftm per burst */
  2008. u8 actual_ftm_per_burst;
  2009. u8 reserved0[7];
  2010. struct wmi_responder_ftm_res responder_ftm_res[0];
  2011. } __packed;
  2012. enum wmi_tof_channel_info_type {
  2013. WMI_TOF_CHANNEL_INFO_AOA = 0x00,
  2014. WMI_TOF_CHANNEL_INFO_LCI = 0x01,
  2015. WMI_TOF_CHANNEL_INFO_LCR = 0x02,
  2016. WMI_TOF_CHANNEL_INFO_VENDOR_SPECIFIC = 0x03,
  2017. WMI_TOF_CHANNEL_INFO_CIR = 0x04,
  2018. WMI_TOF_CHANNEL_INFO_RSSI = 0x05,
  2019. WMI_TOF_CHANNEL_INFO_SNR = 0x06,
  2020. WMI_TOF_CHANNEL_INFO_DEBUG = 0x07,
  2021. };
  2022. /* WMI_TOF_CHANNEL_INFO_EVENTID */
  2023. struct wmi_tof_channel_info_event {
  2024. /* FTM session ID */
  2025. __le32 session_id;
  2026. /* destination MAC address */
  2027. u8 dst_mac[WMI_MAC_LEN];
  2028. /* wmi_tof_channel_info_type_e */
  2029. u8 type;
  2030. /* data report length */
  2031. u8 len;
  2032. /* data report payload */
  2033. u8 report[0];
  2034. } __packed;
  2035. /* WMI_TOF_SET_TX_RX_OFFSET_EVENTID */
  2036. struct wmi_tof_set_tx_rx_offset_event {
  2037. /* enum wmi_fw_status */
  2038. u8 status;
  2039. u8 reserved[3];
  2040. } __packed;
  2041. /* WMI_TOF_GET_TX_RX_OFFSET_EVENTID */
  2042. struct wmi_tof_get_tx_rx_offset_event {
  2043. /* enum wmi_fw_status */
  2044. u8 status;
  2045. u8 reserved1[3];
  2046. /* TX delay offset */
  2047. __le32 tx_offset;
  2048. /* RX delay offset */
  2049. __le32 rx_offset;
  2050. __le32 reserved2[2];
  2051. } __packed;
  2052. /* Result status codes for WMI commands */
  2053. enum wmi_rf_sector_status {
  2054. WMI_RF_SECTOR_STATUS_SUCCESS = 0x00,
  2055. WMI_RF_SECTOR_STATUS_BAD_PARAMETERS_ERROR = 0x01,
  2056. WMI_RF_SECTOR_STATUS_BUSY_ERROR = 0x02,
  2057. WMI_RF_SECTOR_STATUS_NOT_SUPPORTED_ERROR = 0x03,
  2058. };
  2059. /* Types of the RF sector (TX,RX) */
  2060. enum wmi_rf_sector_type {
  2061. WMI_RF_SECTOR_TYPE_RX = 0x00,
  2062. WMI_RF_SECTOR_TYPE_TX = 0x01,
  2063. };
  2064. /* Content of RF Sector (six 32-bits registers) */
  2065. struct wmi_rf_sector_info {
  2066. /* Phase values for RF Chains[15-0] (2bits per RF chain) */
  2067. __le32 psh_hi;
  2068. /* Phase values for RF Chains[31-16] (2bits per RF chain) */
  2069. __le32 psh_lo;
  2070. /* ETYPE Bit0 for all RF chains[31-0] - bit0 of Edge amplifier gain
  2071. * index
  2072. */
  2073. __le32 etype0;
  2074. /* ETYPE Bit1 for all RF chains[31-0] - bit1 of Edge amplifier gain
  2075. * index
  2076. */
  2077. __le32 etype1;
  2078. /* ETYPE Bit2 for all RF chains[31-0] - bit2 of Edge amplifier gain
  2079. * index
  2080. */
  2081. __le32 etype2;
  2082. /* D-Type values (3bits each) for 8 Distribution amplifiers + X16
  2083. * switch bits
  2084. */
  2085. __le32 dtype_swch_off;
  2086. } __packed;
  2087. #define WMI_INVALID_RF_SECTOR_INDEX (0xFFFF)
  2088. #define WMI_MAX_RF_MODULES_NUM (8)
  2089. /* WMI_GET_RF_SECTOR_PARAMS_CMD */
  2090. struct wmi_get_rf_sector_params_cmd {
  2091. /* Sector number to be retrieved */
  2092. __le16 sector_idx;
  2093. /* enum wmi_rf_sector_type - type of requested RF sector */
  2094. u8 sector_type;
  2095. /* bitmask vector specifying destination RF modules */
  2096. u8 rf_modules_vec;
  2097. } __packed;
  2098. /* \WMI_GET_RF_SECTOR_PARAMS_DONE_EVENT */
  2099. struct wmi_get_rf_sector_params_done_event {
  2100. /* result status of WMI_GET_RF_SECTOR_PARAMS_CMD (enum
  2101. * wmi_rf_sector_status)
  2102. */
  2103. u8 status;
  2104. /* align next field to U64 boundary */
  2105. u8 reserved[7];
  2106. /* TSF timestamp when RF sectors where retrieved */
  2107. __le64 tsf;
  2108. /* Content of RF sector retrieved from each RF module */
  2109. struct wmi_rf_sector_info sectors_info[WMI_MAX_RF_MODULES_NUM];
  2110. } __packed;
  2111. /* WMI_SET_RF_SECTOR_PARAMS_CMD */
  2112. struct wmi_set_rf_sector_params_cmd {
  2113. /* Sector number to be retrieved */
  2114. __le16 sector_idx;
  2115. /* enum wmi_rf_sector_type - type of requested RF sector */
  2116. u8 sector_type;
  2117. /* bitmask vector specifying destination RF modules */
  2118. u8 rf_modules_vec;
  2119. /* Content of RF sector to be written to each RF module */
  2120. struct wmi_rf_sector_info sectors_info[WMI_MAX_RF_MODULES_NUM];
  2121. } __packed;
  2122. /* \WMI_SET_RF_SECTOR_PARAMS_DONE_EVENT */
  2123. struct wmi_set_rf_sector_params_done_event {
  2124. /* result status of WMI_SET_RF_SECTOR_PARAMS_CMD (enum
  2125. * wmi_rf_sector_status)
  2126. */
  2127. u8 status;
  2128. } __packed;
  2129. /* WMI_GET_SELECTED_RF_SECTOR_INDEX_CMD - Get RF sector index selected by
  2130. * TXSS/BRP for communication with specified CID
  2131. */
  2132. struct wmi_get_selected_rf_sector_index_cmd {
  2133. /* Connection/Station ID in [0:7] range */
  2134. u8 cid;
  2135. /* type of requested RF sector (enum wmi_rf_sector_type) */
  2136. u8 sector_type;
  2137. /* align to U32 boundary */
  2138. u8 reserved[2];
  2139. } __packed;
  2140. /* \WMI_GET_SELECTED_RF_SECTOR_INDEX_DONE_EVENT - Returns retrieved RF sector
  2141. * index selected by TXSS/BRP for communication with specified CID
  2142. */
  2143. struct wmi_get_selected_rf_sector_index_done_event {
  2144. /* Retrieved sector index selected in TXSS (for TX sector request) or
  2145. * BRP (for RX sector request)
  2146. */
  2147. __le16 sector_idx;
  2148. /* result status of WMI_GET_SELECTED_RF_SECTOR_INDEX_CMD (enum
  2149. * wmi_rf_sector_status)
  2150. */
  2151. u8 status;
  2152. /* align next field to U64 boundary */
  2153. u8 reserved[5];
  2154. /* TSF timestamp when result was retrieved */
  2155. __le64 tsf;
  2156. } __packed;
  2157. /* WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD - Force RF sector index for
  2158. * communication with specified CID. Assumes that TXSS/BRP is disabled by
  2159. * other command
  2160. */
  2161. struct wmi_set_selected_rf_sector_index_cmd {
  2162. /* Connection/Station ID in [0:7] range */
  2163. u8 cid;
  2164. /* type of requested RF sector (enum wmi_rf_sector_type) */
  2165. u8 sector_type;
  2166. /* Forced sector index */
  2167. __le16 sector_idx;
  2168. } __packed;
  2169. /* \WMI_SET_SELECTED_RF_SECTOR_INDEX_DONE_EVENT - Success/Fail status for
  2170. * WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD
  2171. */
  2172. struct wmi_set_selected_rf_sector_index_done_event {
  2173. /* result status of WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD (enum
  2174. * wmi_rf_sector_status)
  2175. */
  2176. u8 status;
  2177. /* align to U32 boundary */
  2178. u8 reserved[3];
  2179. } __packed;
  2180. /* WMI_SET_RF_SECTOR_ON_CMD - Activates specified sector for specified rf
  2181. * modules
  2182. */
  2183. struct wmi_set_rf_sector_on_cmd {
  2184. /* Sector index to be activated */
  2185. __le16 sector_idx;
  2186. /* type of requested RF sector (enum wmi_rf_sector_type) */
  2187. u8 sector_type;
  2188. /* bitmask vector specifying destination RF modules */
  2189. u8 rf_modules_vec;
  2190. } __packed;
  2191. /* \WMI_SET_RF_SECTOR_ON_DONE_EVENT - Success/Fail status for
  2192. * WMI_SET_RF_SECTOR_ON_CMD
  2193. */
  2194. struct wmi_set_rf_sector_on_done_event {
  2195. /* result status of WMI_SET_RF_SECTOR_ON_CMD (enum
  2196. * wmi_rf_sector_status)
  2197. */
  2198. u8 status;
  2199. /* align to U32 boundary */
  2200. u8 reserved[3];
  2201. } __packed;
  2202. enum wmi_sector_sweep_type {
  2203. WMI_SECTOR_SWEEP_TYPE_TXSS = 0x00,
  2204. WMI_SECTOR_SWEEP_TYPE_BCON = 0x01,
  2205. WMI_SECTOR_SWEEP_TYPE_TXSS_AND_BCON = 0x02,
  2206. WMI_SECTOR_SWEEP_TYPE_NUM = 0x03,
  2207. };
  2208. /* WMI_PRIO_TX_SECTORS_ORDER_CMDID
  2209. *
  2210. * Set the order of TX sectors in TXSS and/or Beacon(AP).
  2211. *
  2212. * Returned event:
  2213. * - WMI_PRIO_TX_SECTORS_ORDER_EVENTID
  2214. */
  2215. struct wmi_prio_tx_sectors_order_cmd {
  2216. /* tx sectors order to be applied, 0xFF for end of array */
  2217. u8 tx_sectors_priority_array[MAX_NUM_OF_SECTORS];
  2218. /* enum wmi_sector_sweep_type, TXSS and/or Beacon */
  2219. u8 sector_sweep_type;
  2220. /* needed only for TXSS configuration */
  2221. u8 cid;
  2222. /* alignment to 32b */
  2223. u8 reserved[2];
  2224. } __packed;
  2225. /* completion status codes */
  2226. enum wmi_prio_tx_sectors_cmd_status {
  2227. WMI_PRIO_TX_SECT_CMD_STATUS_SUCCESS = 0x00,
  2228. WMI_PRIO_TX_SECT_CMD_STATUS_BAD_PARAM = 0x01,
  2229. /* other error */
  2230. WMI_PRIO_TX_SECT_CMD_STATUS_ERROR = 0x02,
  2231. };
  2232. /* WMI_PRIO_TX_SECTORS_ORDER_EVENTID */
  2233. struct wmi_prio_tx_sectors_order_event {
  2234. /* enum wmi_prio_tx_sectors_cmd_status */
  2235. u8 status;
  2236. /* alignment to 32b */
  2237. u8 reserved[3];
  2238. } __packed;
  2239. struct wmi_prio_tx_sectors_num_cmd {
  2240. /* [0-128], 0 = No changes */
  2241. u8 beacon_number_of_sectors;
  2242. /* [0-128], 0 = No changes */
  2243. u8 txss_number_of_sectors;
  2244. /* [0-8] needed only for TXSS configuration */
  2245. u8 cid;
  2246. } __packed;
  2247. /* WMI_PRIO_TX_SECTORS_NUMBER_CMDID
  2248. *
  2249. * Set the number of active sectors in TXSS and/or Beacon.
  2250. *
  2251. * Returned event:
  2252. * - WMI_PRIO_TX_SECTORS_NUMBER_EVENTID
  2253. */
  2254. struct wmi_prio_tx_sectors_number_cmd {
  2255. struct wmi_prio_tx_sectors_num_cmd active_sectors_num;
  2256. /* alignment to 32b */
  2257. u8 reserved;
  2258. } __packed;
  2259. /* WMI_PRIO_TX_SECTORS_NUMBER_EVENTID */
  2260. struct wmi_prio_tx_sectors_number_event {
  2261. /* enum wmi_prio_tx_sectors_cmd_status */
  2262. u8 status;
  2263. /* alignment to 32b */
  2264. u8 reserved[3];
  2265. } __packed;
  2266. /* WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_CMDID
  2267. *
  2268. * Set default sectors order and number (hard coded in board file)
  2269. * in TXSS and/or Beacon.
  2270. *
  2271. * Returned event:
  2272. * - WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID
  2273. */
  2274. struct wmi_prio_tx_sectors_set_default_cfg_cmd {
  2275. /* enum wmi_sector_sweep_type, TXSS and/or Beacon */
  2276. u8 sector_sweep_type;
  2277. /* needed only for TXSS configuration */
  2278. u8 cid;
  2279. /* alignment to 32b */
  2280. u8 reserved[2];
  2281. } __packed;
  2282. /* WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID */
  2283. struct wmi_prio_tx_sectors_set_default_cfg_event {
  2284. /* enum wmi_prio_tx_sectors_cmd_status */
  2285. u8 status;
  2286. /* alignment to 32b */
  2287. u8 reserved[3];
  2288. } __packed;
  2289. #endif /* __WILOCITY_WMI_H__ */