wmi_unified_sta_api.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. /*
  2. * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * DOC: Implement API's specific to STA component.
  20. */
  21. #ifndef _WMI_UNIFIED_STA_API_H_
  22. #define _WMI_UNIFIED_STA_API_H_
  23. #include "wlan_disa_public_struct.h"
  24. #include "wlan_tdls_public_structs.h"
  25. #include "wlan_policy_mgr_public_struct.h"
  26. #include "wmi_unified_sta_param.h"
  27. struct policy_mgr_dual_mac_config;
  28. /**
  29. * wmi_unified_set_sta_sa_query_param_cmd() - set sta sa query parameters
  30. * @wmi_hdl: wmi handle
  31. * @vdev_id: vdev id
  32. * @max_retries: max retries
  33. * @retry_interval: retry interval
  34. * This function sets sta query related parameters in fw.
  35. *
  36. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  37. */
  38. QDF_STATUS wmi_unified_set_sta_sa_query_param_cmd(void *wmi_hdl,
  39. uint8_t vdev_id,
  40. uint32_t max_retries,
  41. uint32_t retry_interval);
  42. /**
  43. * wmi_unified_set_sta_keep_alive_cmd() - set sta keep alive parameters
  44. * @wmi_hdl: wmi handle
  45. * @params: sta keep alive parameter
  46. *
  47. * This function sets keep alive related parameters in fw.
  48. *
  49. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  50. */
  51. QDF_STATUS wmi_unified_set_sta_keep_alive_cmd(void *wmi_hdl,
  52. struct sta_params *params);
  53. /**
  54. * wmi_unified_vdev_set_gtx_cfg_cmd() - set GTX params
  55. * @wmi_hdl: wmi handle
  56. * @if_id: vdev id
  57. * @gtx_info: GTX config params
  58. *
  59. * This function set GTX related params in firmware.
  60. *
  61. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  62. */
  63. QDF_STATUS wmi_unified_vdev_set_gtx_cfg_cmd(void *wmi_hdl, uint32_t if_id,
  64. struct wmi_gtx_config *gtx_info);
  65. #ifdef WLAN_FEATURE_DISA
  66. /**
  67. * wmi_unified_encrypt_decrypt_send_cmd() - send encryptdecrypt cmd to fw
  68. * @wmi_hdl: wmi handle
  69. * @params: encrypt/decrypt params
  70. *
  71. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  72. */
  73. QDF_STATUS wmi_unified_encrypt_decrypt_send_cmd(void *wmi_hdl,
  74. struct disa_encrypt_decrypt_req_params *params);
  75. /**
  76. * wmi_extract_encrypt_decrypt_resp_params() -
  77. * extract encrypt decrypt resp params from event buffer
  78. * @wmi_handle: wmi handle
  79. * @evt_buf: pointer to event buffer
  80. * @resp: encrypt decrypt resp params
  81. *
  82. * Return: QDF_STATUS_SUCCESS for success or error code
  83. */
  84. QDF_STATUS wmi_extract_encrypt_decrypt_resp_params(void *wmi_hdl,
  85. uint8_t *evt_buf,
  86. struct disa_encrypt_decrypt_resp_params *resp);
  87. #endif /* WLAN_FEATURE_DISA */
  88. /**
  89. * wmi_unified_process_dhcp_ind() - process dhcp indication from SME
  90. * @wmi_handle: wmi handle
  91. * @ta_dhcp_ind: DHCP indication parameter
  92. *
  93. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  94. */
  95. QDF_STATUS wmi_unified_process_dhcp_ind(void *wmi_hdl,
  96. wmi_peer_set_param_cmd_fixed_param *ta_dhcp_ind);
  97. /**
  98. * wmi_unified_get_link_speed_cmd() -send command to get linkspeed
  99. * @wmi_handle: wmi handle
  100. * @pLinkSpeed: link speed info
  101. *
  102. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  103. */
  104. QDF_STATUS wmi_unified_get_link_speed_cmd(void *wmi_hdl,
  105. wmi_mac_addr peer_macaddr);
  106. /**
  107. * wmi_unified_fw_profiling_data_cmd() - send FW profiling cmd to WLAN FW
  108. * @wmi_handl: wmi handle
  109. * @cmd: Profiling command index
  110. * @value1: parameter1 value
  111. * @value2: parameter2 value
  112. *
  113. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  114. */
  115. QDF_STATUS wmi_unified_fw_profiling_data_cmd(void *wmi_hdl,
  116. uint32_t cmd, uint32_t value1, uint32_t value2);
  117. /**
  118. * wmi_unified_nat_keepalive_en_cmd() - enable NAT keepalive filter
  119. * @wmi_handle: wmi handle
  120. * @vdev_id: vdev id
  121. *
  122. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  123. */
  124. QDF_STATUS wmi_unified_nat_keepalive_en_cmd(void *wmi_hdl, uint8_t vdev_id);
  125. /**
  126. * wmi_unified_set_latency_config_cmd()
  127. * @wmi_handle: wmi handle
  128. * @param: WLM parameters
  129. *
  130. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  131. */
  132. QDF_STATUS wmi_unified_wlm_latency_level_cmd(void *wmi_hdl,
  133. struct wlm_latency_level_param *param);
  134. /**
  135. * wmi_unified_process_set_ie_info_cmd() - Function to send IE info to firmware
  136. * @wmi_handle: Pointer to WMi handle
  137. * @ie_data: Pointer for ie data
  138. *
  139. * This function sends IE information to firmware
  140. *
  141. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  142. */
  143. QDF_STATUS wmi_unified_process_set_ie_info_cmd(void *wmi_hdl,
  144. struct vdev_ie_info_param *ie_info);
  145. /**
  146. * wmi_unified_set_base_macaddr_indicate_cmd() - set base mac address in fw
  147. * @wmi_hdl: wmi handle
  148. * @custom_addr: base mac address
  149. *
  150. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  151. */
  152. QDF_STATUS wmi_unified_set_base_macaddr_indicate_cmd(void *wmi_hdl,
  153. uint8_t *custom_addr);
  154. #ifdef CONVERGED_TDLS_ENABLE
  155. /**
  156. * wmi_unified_set_tdls_offchan_mode_cmd() - set tdls off channel mode
  157. * @wmi_handle: wmi handle
  158. * @chan_switch_params: Pointer to tdls channel switch parameter structure
  159. *
  160. * This function sets tdls off channel mode
  161. *
  162. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures;
  163. * Negative errno otherwise
  164. */
  165. QDF_STATUS wmi_unified_set_tdls_offchan_mode_cmd(void *wmi_hdl,
  166. struct tdls_channel_switch_params *chan_switch_params);
  167. /**
  168. * wmi_unified_update_fw_tdls_state_cmd() - send enable/disable tdls for a vdev
  169. * @wmi_handle: wmi handle
  170. * @pwmaTdlsparams: TDLS params
  171. *
  172. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  173. */
  174. QDF_STATUS wmi_unified_update_fw_tdls_state_cmd(void *wmi_hdl,
  175. void *tdls_param,
  176. uint8_t tdls_state);
  177. /**
  178. * wmi_unified_update_tdls_peer_state_cmd() - update TDLS peer state
  179. * @wmi_handle: wmi handle
  180. * @peerStateParams: TDLS peer state params
  181. *
  182. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  183. */
  184. QDF_STATUS wmi_unified_update_tdls_peer_state_cmd(void *wmi_hdl,
  185. struct tdls_peer_state_params *peerStateParams,
  186. uint32_t *ch_mhz);
  187. /**
  188. * wmi_extract_vdev_tdls_ev_param - extract vdev tdls param from event
  189. * @wmi_handle: wmi handle
  190. * @param evt_buf: pointer to event buffer
  191. * @param param: Pointer to hold vdev tdls param
  192. *
  193. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  194. */
  195. QDF_STATUS wmi_extract_vdev_tdls_ev_param(void *wmi_hdl, void *evt_buf,
  196. struct tdls_event_info *param);
  197. #endif /* CONVERGED_TDLS_ENABLE */
  198. /**
  199. * wmi_unified_send_sar_limit_cmd() - send sar limit cmd to fw
  200. * @wmi_hdl: wmi handle
  201. * @params: sar limit command params
  202. *
  203. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  204. */
  205. QDF_STATUS wmi_unified_send_sar_limit_cmd(void *wmi_hdl,
  206. struct sar_limit_cmd_params *params);
  207. /**
  208. * wmi_unified_get_sar_limit_cmd() - request current SAR limits from FW
  209. * @wmi_hdl: wmi handle
  210. *
  211. * Return: QDF_STATUS_SUCCESS for success or error code
  212. */
  213. QDF_STATUS wmi_unified_get_sar_limit_cmd(void *wmi_hdl);
  214. /**
  215. * wmi_unified_extract_sar_limit_event() - extract SAR limits from FW event
  216. * @wmi_hdl: wmi handle
  217. * @evt_buf: event buffer received from firmware
  218. * @event: SAR limit event which is to be populated by data extracted from
  219. * the @evt_buf buffer
  220. *
  221. * Return: QDF_STATUS_SUCCESS for success or error code
  222. */
  223. QDF_STATUS wmi_unified_extract_sar_limit_event(void *wmi_hdl,
  224. uint8_t *evt_buf,
  225. struct sar_limit_event *event);
  226. /**
  227. * wmi_unified_extract_sar2_result_event() - extract SAR limits from FW event
  228. * @handle: wmi handle
  229. * @event: event buffer received from firmware
  230. * @len: length of the event buffer
  231. *
  232. * Return: QDF_STATUS_SUCCESS for success or error code
  233. */
  234. QDF_STATUS wmi_unified_extract_sar2_result_event(void *handle,
  235. uint8_t *event, uint32_t len);
  236. /*
  237. * wmi_unified_set_del_pmkid_cache() - set delete PMKID
  238. * @wmi_hdl: wma handle
  239. * @pmksa: pointer to pmk cache entry
  240. *
  241. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  242. */
  243. QDF_STATUS wmi_unified_set_del_pmkid_cache(void *wmi_hdl,
  244. struct wmi_unified_pmk_cache *pmksa);
  245. /**
  246. * wmi_unified_del_ts_cmd() - send DELTS request to fw
  247. * @wmi_handle: wmi handle
  248. * @msg: delts params
  249. *
  250. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  251. */
  252. QDF_STATUS wmi_unified_del_ts_cmd(void *wmi_hdl, uint8_t vdev_id,
  253. uint8_t ac);
  254. /**
  255. * wmi_unified_aggr_qos_cmd() - send aggr qos request to fw
  256. * @wmi_handle: handle to wmi
  257. * @aggr_qos_rsp_msg - combined struct for all ADD_TS requests.
  258. *
  259. * A function to handle WMI_AGGR_QOS_REQ. This will send out
  260. * ADD_TS requestes to firmware in loop for all the ACs with
  261. * active flow.
  262. *
  263. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  264. */
  265. QDF_STATUS wmi_unified_aggr_qos_cmd(void *wmi_hdl,
  266. struct aggr_add_ts_param *aggr_qos_rsp_msg);
  267. /**
  268. * wmi_unified_add_ts_cmd() - send ADDTS request to fw
  269. * @wmi_handle: wmi handle
  270. * @msg: ADDTS params
  271. *
  272. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  273. */
  274. QDF_STATUS wmi_unified_add_ts_cmd(void *wmi_hdl,
  275. struct add_ts_param *msg);
  276. /**
  277. * wmi_unified_process_add_periodic_tx_ptrn_cmd - add periodic tx ptrn
  278. * @wmi_handle: wmi handle
  279. * @pAddPeriodicTxPtrnParams: tx ptrn params
  280. *
  281. * Retrun: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  282. */
  283. QDF_STATUS wmi_unified_process_add_periodic_tx_ptrn_cmd(void *wmi_hdl,
  284. struct periodic_tx_pattern *
  285. pAddPeriodicTxPtrnParams,
  286. uint8_t vdev_id);
  287. /**
  288. * wmi_unified_process_del_periodic_tx_ptrn_cmd - del periodic tx ptrn
  289. * @wmi_handle: wmi handle
  290. * @vdev_id: vdev id
  291. * @pattern_id: pattern id
  292. *
  293. * Retrun: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  294. */
  295. QDF_STATUS wmi_unified_process_del_periodic_tx_ptrn_cmd(void *wmi_hdl,
  296. uint8_t vdev_id,
  297. uint8_t pattern_id);
  298. /**
  299. * wmi_unified_set_auto_shutdown_timer_cmd() - sets auto shutdown
  300. * timer in firmware
  301. * @wmi_handle: wmi handle
  302. * @timer_val: auto shutdown timer value
  303. *
  304. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  305. */
  306. QDF_STATUS wmi_unified_set_auto_shutdown_timer_cmd(void *wmi_hdl,
  307. uint32_t timer_val);
  308. /**
  309. * wmi_unified_set_led_flashing_cmd() - set led flashing in fw
  310. * @wmi_hdl: wmi handle
  311. * @flashing: flashing request
  312. *
  313. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  314. */
  315. QDF_STATUS wmi_unified_set_led_flashing_cmd(void *wmi_hdl,
  316. struct flashing_req_params *flashing);
  317. /**
  318. * wmi_unified_process_ch_avoid_update_cmd() - handles channel avoid
  319. * update request
  320. * @wmi_handle: wmi handle
  321. * @ch_avoid_update_req: channel avoid update params
  322. *
  323. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  324. */
  325. QDF_STATUS wmi_unified_process_ch_avoid_update_cmd(void *wmi_hdl);
  326. /**
  327. * wmi_unified_pdev_set_pcl_cmd() - Send WMI_SOC_SET_PCL_CMDID to FW
  328. * @wmi_hdl: wmi handle
  329. * @msg: PCL structure containing the PCL and the number of channels
  330. *
  331. * WMI_SOC_SET_PCL_CMDID provides a Preferred Channel List (PCL) to the WLAN
  332. * firmware. The DBS Manager is the consumer of this information in the WLAN
  333. * firmware. The channel list will be used when a Virtual DEVice (VDEV) needs
  334. * to migrate to a new channel without host driver involvement. An example of
  335. * this behavior is Legacy Fast Roaming (LFR 3.0). Generally, the host will
  336. * manage the channel selection without firmware involvement.
  337. *
  338. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  339. */
  340. QDF_STATUS wmi_unified_pdev_set_pcl_cmd(void *wmi_hdl,
  341. struct wmi_pcl_chan_weights *msg);
  342. /**
  343. * wmi_unified_soc_set_hw_mode_cmd() - Send WMI_SOC_SET_HW_MODE_CMDID to FW
  344. * @wmi_hdl: wmi handle
  345. * @msg: Structure containing the following parameters
  346. *
  347. * - hw_mode_index: The HW_Mode field is a enumerated type that is selected
  348. * from the HW_Mode table, which is returned in the WMI_SERVICE_READY_EVENTID.
  349. *
  350. * Provides notification to the WLAN firmware that host driver is requesting a
  351. * HardWare (HW) Mode change. This command is needed to support iHelium in the
  352. * configurations that include the Dual Band Simultaneous (DBS) feature.
  353. *
  354. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  355. */
  356. QDF_STATUS wmi_unified_soc_set_hw_mode_cmd(void *wmi_hdl,
  357. uint32_t hw_mode_index);
  358. #ifdef WLAN_POLICY_MGR_ENABLE
  359. /**
  360. * wmi_unified_pdev_set_dual_mac_config_cmd() - Set dual mac config to FW
  361. * @wmi_hdl: wmi handle
  362. * @msg: Dual MAC config parameters
  363. *
  364. * Configures WLAN firmware with the dual MAC features
  365. *
  366. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures.
  367. */
  368. QDF_STATUS wmi_unified_pdev_set_dual_mac_config_cmd(void *wmi_hdl,
  369. struct policy_mgr_dual_mac_config *msg);
  370. #endif /* WLAN_POLICY_MGR_ENABLE */
  371. /**
  372. * wmi_unified_send_adapt_dwelltime_params_cmd() - send wmi cmd of
  373. * adaptive dwelltime configuration params
  374. * @wma_handle: wma handler
  375. * @dwelltime_params: pointer to dwelltime_params
  376. *
  377. * Return: QDF_STATUS_SUCCESS on success and QDF failure reason code for failure
  378. */
  379. QDF_STATUS wmi_unified_send_adapt_dwelltime_params_cmd(void *wmi_hdl,
  380. struct wmi_adaptive_dwelltime_params *
  381. wmi_param);
  382. /**
  383. * wmi_unified_send_dbs_scan_sel_params_cmd() - send wmi cmd of
  384. * DBS scan selection configuration params
  385. * @wma_handle: wma handler
  386. * @dbs_scan_params: pointer to wmi_dbs_scan_sel_params
  387. *
  388. * Return: QDF_STATUS_SUCCESS on success and QDF failure reason code for failure
  389. */
  390. QDF_STATUS wmi_unified_send_dbs_scan_sel_params_cmd(void *wmi_hdl,
  391. struct wmi_dbs_scan_sel_params *wmi_param);
  392. /**
  393. * wmi_unified_set_arp_stats_req() - set arp stats request
  394. * @wmi_hdl: wmi handle
  395. * @req_buf: pointer to set_arp_stats
  396. *
  397. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  398. */
  399. QDF_STATUS wmi_unified_set_arp_stats_req(void *wmi_hdl,
  400. struct set_arp_stats *req_buf);
  401. /**
  402. * wmi_unified_get_arp_stats_req() - get arp stats request
  403. * @wmi_hdl: wmi handle
  404. * @req_buf: pointer to get_arp_stats
  405. *
  406. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  407. */
  408. QDF_STATUS wmi_unified_get_arp_stats_req(void *wmi_hdl,
  409. struct get_arp_stats *req_buf);
  410. /**
  411. * wmi_unified_peer_unmap_conf_send() - send PEER unmap conf command to fw
  412. * @wmi: wmi handle
  413. * @vdev_id: vdev id
  414. * @peer_id_cnt: number of peer id
  415. * @peer_id_list: list of peer ids
  416. *
  417. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  418. */
  419. QDF_STATUS wmi_unified_peer_unmap_conf_send(void *wmi_hdl,
  420. uint8_t vdev_id,
  421. uint32_t peer_id_cnt,
  422. uint16_t *peer_id_list);
  423. #endif /* _WMI_UNIFIED_STA_API_H_ */