wmi.h 53 KB

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