wmi_unified_sta_api.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. /*
  2. * Copyright (c) 2013-2020 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_handle: 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(wmi_unified_t wmi_handle,
  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_handle: 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
  52. wmi_unified_set_sta_keep_alive_cmd(wmi_unified_t wmi_handle,
  53. struct sta_keep_alive_params *params);
  54. /**
  55. * wmi_unified_vdev_set_gtx_cfg_cmd() - set GTX params
  56. * @wmi_handle: wmi handle
  57. * @if_id: vdev id
  58. * @gtx_info: GTX config params
  59. *
  60. * This function set GTX related params in firmware.
  61. *
  62. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  63. */
  64. QDF_STATUS
  65. wmi_unified_vdev_set_gtx_cfg_cmd(wmi_unified_t wmi_handle, uint32_t if_id,
  66. struct wmi_gtx_config *gtx_info);
  67. #ifdef FEATURE_BLACKLIST_MGR
  68. /**
  69. * wmi_unified_send_reject_ap_list() - send the reject ap list maintained by
  70. * BLM to FW for roaming cases.
  71. * @wmi_handle: wmi handle
  72. * @reject_params: This contains the reject ap list, and the num of BSSIDs.
  73. *
  74. * Return: QDF_STATUS_SUCCESS for success or error code
  75. */
  76. QDF_STATUS
  77. wmi_unified_send_reject_ap_list(struct wmi_unified *wmi_handle,
  78. struct reject_ap_params *reject_params);
  79. #endif
  80. /**
  81. * wmi_unified_process_dhcp_ind() - process dhcp indication from SME
  82. * @wmi_handle: wmi handle
  83. * @ta_dhcp_ind: DHCP indication parameter
  84. *
  85. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  86. */
  87. QDF_STATUS wmi_unified_process_dhcp_ind(
  88. wmi_unified_t wmi_handle,
  89. wmi_peer_set_param_cmd_fixed_param *ta_dhcp_ind);
  90. /**
  91. * wmi_unified_get_link_speed_cmd() -send command to get linkspeed
  92. * @wmi_handle: wmi handle
  93. * @peer_macaddr: peer MAC address
  94. *
  95. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  96. */
  97. QDF_STATUS wmi_unified_get_link_speed_cmd(wmi_unified_t wmi_handle,
  98. wmi_mac_addr peer_macaddr);
  99. /**
  100. * wmi_unified_fw_profiling_data_cmd() - send FW profiling cmd to WLAN FW
  101. * @wmi_handle: wmi handle
  102. * @cmd: Profiling command index
  103. * @value1: parameter1 value
  104. * @value2: parameter2 value
  105. *
  106. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  107. */
  108. QDF_STATUS wmi_unified_fw_profiling_data_cmd(wmi_unified_t wmi_handle,
  109. uint32_t cmd,
  110. uint32_t value1,
  111. uint32_t value2);
  112. /**
  113. * wmi_unified_nat_keepalive_en_cmd() - enable NAT keepalive filter
  114. * @wmi_handle: wmi handle
  115. * @vdev_id: vdev id
  116. *
  117. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  118. */
  119. QDF_STATUS wmi_unified_nat_keepalive_en_cmd(wmi_unified_t wmi_handle,
  120. uint8_t vdev_id);
  121. /**
  122. * wmi_unified_wlm_latency_level_cmd() - set latency level
  123. * @wmi_handle: wmi handle
  124. * @param: WLM parameters
  125. *
  126. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  127. */
  128. QDF_STATUS
  129. wmi_unified_wlm_latency_level_cmd(wmi_unified_t wmi_handle,
  130. struct wlm_latency_level_param *param);
  131. /**
  132. * wmi_unified_process_set_ie_info_cmd() - Function to send IE info to firmware
  133. * @wmi_handle: Pointer to WMi handle
  134. * @ie_data: Pointer for ie data
  135. *
  136. * This function sends IE information to firmware
  137. *
  138. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  139. */
  140. QDF_STATUS
  141. wmi_unified_process_set_ie_info_cmd(wmi_unified_t wmi_handle,
  142. struct vdev_ie_info_param *ie_info);
  143. /**
  144. * wmi_unified_set_base_macaddr_indicate_cmd() - set base mac address in fw
  145. * @wmi_handle: wmi handle
  146. * @custom_addr: base mac address
  147. *
  148. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  149. */
  150. QDF_STATUS wmi_unified_set_base_macaddr_indicate_cmd(wmi_unified_t wmi_handle,
  151. uint8_t *custom_addr);
  152. #ifdef FEATURE_WLAN_TDLS
  153. /**
  154. * wmi_unified_set_tdls_offchan_mode_cmd() - set tdls off channel mode
  155. * @wmi_handle: wmi handle
  156. * @chan_switch_params: Pointer to tdls channel switch parameter structure
  157. *
  158. * This function sets tdls off channel mode
  159. *
  160. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures;
  161. * Negative errno otherwise
  162. */
  163. QDF_STATUS wmi_unified_set_tdls_offchan_mode_cmd(
  164. wmi_unified_t wmi_handle,
  165. struct tdls_channel_switch_params *chan_switch_params);
  166. /**
  167. * wmi_unified_update_fw_tdls_state_cmd() - send enable/disable tdls for a vdev
  168. * @wmi_handle: wmi handle
  169. * @tdls_param: TDLS params
  170. * @tdls_state: TDLS state
  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(wmi_unified_t wmi_handle,
  175. struct tdls_info *tdls_param,
  176. enum wmi_tdls_state tdls_state);
  177. /**
  178. * wmi_unified_update_tdls_peer_state_cmd() - update TDLS peer state
  179. * @wmi_handle: wmi handle
  180. * @peer_state: 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(wmi_unified_t wmi_handle,
  185. struct tdls_peer_update_state *peer_state,
  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. * @evt_buf: pointer to event buffer
  191. * @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(wmi_unified_t wmi_handle,
  196. void *evt_buf,
  197. struct tdls_event_info *param);
  198. #endif /* FEATURE_WLAN_TDLS */
  199. /**
  200. * wmi_unified_send_sar_limit_cmd() - send sar limit cmd to fw
  201. * @wmi_handle: wmi handle
  202. * @params: sar limit command params
  203. *
  204. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  205. */
  206. QDF_STATUS wmi_unified_send_sar_limit_cmd(wmi_unified_t wmi_handle,
  207. struct sar_limit_cmd_params *params);
  208. /**
  209. * wmi_unified_get_sar_limit_cmd() - request current SAR limits from FW
  210. * @wmi_handle: wmi handle
  211. *
  212. * Return: QDF_STATUS_SUCCESS for success or error code
  213. */
  214. QDF_STATUS wmi_unified_get_sar_limit_cmd(wmi_unified_t wmi_handle);
  215. /**
  216. * wmi_unified_extract_sar_limit_event() - extract SAR limits from FW event
  217. * @wmi_handle: wmi handle
  218. * @evt_buf: event buffer received from firmware
  219. * @event: SAR limit event which is to be populated by data extracted from
  220. * the @evt_buf buffer
  221. *
  222. * Return: QDF_STATUS_SUCCESS for success or error code
  223. */
  224. QDF_STATUS wmi_unified_extract_sar_limit_event(wmi_unified_t wmi_handle,
  225. uint8_t *evt_buf,
  226. struct sar_limit_event *event);
  227. /**
  228. * wmi_unified_extract_sar2_result_event() - extract SAR limits from FW event
  229. * @handle: wmi handle
  230. * @event: event buffer received from firmware
  231. * @len: length of the event buffer
  232. *
  233. * Return: QDF_STATUS_SUCCESS for success or error code
  234. */
  235. QDF_STATUS wmi_unified_extract_sar2_result_event(void *handle,
  236. uint8_t *event, uint32_t len);
  237. /*
  238. * wmi_unified_set_del_pmkid_cache() - set delete PMKID
  239. * @wmi_handle: wma handle
  240. * @pmksa: pointer to pmk cache entry
  241. *
  242. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  243. */
  244. QDF_STATUS
  245. wmi_unified_set_del_pmkid_cache(wmi_unified_t wmi_handle,
  246. struct wmi_unified_pmk_cache *pmksa);
  247. /**
  248. * wmi_unified_del_ts_cmd() - send DELTS request to fw
  249. * @wmi_handle: wmi handle
  250. * @vdev_id: vdev id
  251. * @ac: ac param
  252. *
  253. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  254. */
  255. QDF_STATUS wmi_unified_del_ts_cmd(wmi_unified_t wmi_handle, uint8_t vdev_id,
  256. uint8_t ac);
  257. /**
  258. * wmi_unified_aggr_qos_cmd() - send aggr qos request to fw
  259. * @wmi_handle: handle to wmi
  260. * @aggr_qos_rsp_msg: combined struct for all ADD_TS requests.
  261. *
  262. * A function to handle WMI_AGGR_QOS_REQ. This will send out
  263. * ADD_TS requestes to firmware in loop for all the ACs with
  264. * active flow.
  265. *
  266. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  267. */
  268. QDF_STATUS wmi_unified_aggr_qos_cmd(
  269. wmi_unified_t wmi_handle,
  270. struct aggr_add_ts_param *aggr_qos_rsp_msg);
  271. /**
  272. * wmi_unified_add_ts_cmd() - send ADDTS request to fw
  273. * @wmi_handle: wmi handle
  274. * @msg: ADDTS params
  275. *
  276. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  277. */
  278. QDF_STATUS wmi_unified_add_ts_cmd(wmi_unified_t wmi_handle,
  279. struct add_ts_param *msg);
  280. /**
  281. * wmi_unified_process_add_periodic_tx_ptrn_cmd() - add periodic tx pattern
  282. * @wmi_handle: wmi handle
  283. * @pattern: tx pattern parameters
  284. * @vdev_id: vdev id
  285. *
  286. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  287. */
  288. QDF_STATUS wmi_unified_process_add_periodic_tx_ptrn_cmd(
  289. wmi_unified_t wmi_handle,
  290. struct periodic_tx_pattern *pattern,
  291. uint8_t vdev_id);
  292. /**
  293. * wmi_unified_process_del_periodic_tx_ptrn_cmd() - del periodic tx ptrn
  294. * @wmi_handle: wmi handle
  295. * @vdev_id: vdev id
  296. * @pattern_id: pattern id
  297. *
  298. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  299. */
  300. QDF_STATUS
  301. wmi_unified_process_del_periodic_tx_ptrn_cmd(wmi_unified_t wmi_handle,
  302. uint8_t vdev_id,
  303. uint8_t pattern_id);
  304. /**
  305. * wmi_unified_set_auto_shutdown_timer_cmd() - sets auto shutdown
  306. * timer in firmware
  307. * @wmi_handle: wmi handle
  308. * @timer_val: auto shutdown timer value
  309. *
  310. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  311. */
  312. QDF_STATUS wmi_unified_set_auto_shutdown_timer_cmd(wmi_unified_t wmi_handle,
  313. uint32_t timer_val);
  314. /**
  315. * wmi_unified_set_led_flashing_cmd() - set led flashing in fw
  316. * @wmi_handle: wmi handle
  317. * @flashing: flashing request
  318. *
  319. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  320. */
  321. QDF_STATUS
  322. wmi_unified_set_led_flashing_cmd(wmi_unified_t wmi_handle,
  323. struct flashing_req_params *flashing);
  324. /**
  325. * wmi_unified_process_ch_avoid_update_cmd() - handles channel avoid
  326. * update request
  327. * @wmi_handle: wmi handle
  328. *
  329. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  330. */
  331. QDF_STATUS wmi_unified_process_ch_avoid_update_cmd(wmi_unified_t wmi_handle);
  332. /**
  333. * wmi_unified_pdev_set_pcl_cmd() - Send WMI_SOC_SET_PCL_CMDID to FW
  334. * @wmi_handle: wmi handle
  335. * @msg: PCL structure containing the PCL and the number of channels
  336. *
  337. * WMI_SOC_SET_PCL_CMDID provides a Preferred Channel List (PCL) to the WLAN
  338. * firmware. The DBS Manager is the consumer of this information in the WLAN
  339. * firmware. The channel list will be used when a Virtual DEVice (VDEV) needs
  340. * to migrate to a new channel without host driver involvement. An example of
  341. * this behavior is Legacy Fast Roaming (LFR 3.0). Generally, the host will
  342. * manage the channel selection without firmware involvement.
  343. *
  344. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  345. */
  346. QDF_STATUS wmi_unified_pdev_set_pcl_cmd(wmi_unified_t wmi_handle,
  347. struct wmi_pcl_chan_weights *msg);
  348. #ifdef WLAN_POLICY_MGR_ENABLE
  349. /**
  350. * wmi_unified_pdev_set_dual_mac_config_cmd() - Set dual mac config to FW
  351. * @wmi_handle: wmi handle
  352. * @msg: Dual MAC config parameters
  353. *
  354. * Configures WLAN firmware with the dual MAC features
  355. *
  356. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures.
  357. */
  358. QDF_STATUS wmi_unified_pdev_set_dual_mac_config_cmd(
  359. wmi_unified_t wmi_handle,
  360. struct policy_mgr_dual_mac_config *msg);
  361. #endif /* WLAN_POLICY_MGR_ENABLE */
  362. /**
  363. * wmi_unified_send_adapt_dwelltime_params_cmd() - send wmi cmd of
  364. * adaptive dwelltime configuration params
  365. * @wma_handle: wma handler
  366. * @wmi_param: pointer to dwelltime_params
  367. *
  368. * Return: QDF_STATUS_SUCCESS on success and QDF failure reason code for failure
  369. */
  370. QDF_STATUS wmi_unified_send_adapt_dwelltime_params_cmd(
  371. wmi_unified_t wmi_handle,
  372. struct wmi_adaptive_dwelltime_params *wmi_param);
  373. /**
  374. * wmi_unified_send_dbs_scan_sel_params_cmd() - send wmi cmd of
  375. * DBS scan selection configuration params
  376. * @wma_handle: wma handler
  377. * @wmi_param: pointer to wmi_dbs_scan_sel_params
  378. *
  379. * Return: QDF_STATUS_SUCCESS on success and QDF failure reason code for failure
  380. */
  381. QDF_STATUS wmi_unified_send_dbs_scan_sel_params_cmd(
  382. wmi_unified_t wmi_handle,
  383. struct wmi_dbs_scan_sel_params *wmi_param);
  384. /**
  385. * wmi_unified_set_arp_stats_req() - set arp stats request
  386. * @wmi_handle: wmi handle
  387. * @req_buf: pointer to set_arp_stats
  388. *
  389. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  390. */
  391. QDF_STATUS wmi_unified_set_arp_stats_req(wmi_unified_t wmi_handle,
  392. struct set_arp_stats *req_buf);
  393. /**
  394. * wmi_unified_get_arp_stats_req() - get arp stats request
  395. * @wmi_handle: wmi handle
  396. * @req_buf: pointer to get_arp_stats
  397. *
  398. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  399. */
  400. QDF_STATUS wmi_unified_get_arp_stats_req(wmi_unified_t wmi_handle,
  401. struct get_arp_stats *req_buf);
  402. /**
  403. * wmi_unified_peer_unmap_conf_send() - send PEER unmap conf command to fw
  404. * @wmi_handle: wmi handle
  405. * @vdev_id: vdev id
  406. * @peer_id_cnt: number of peer id
  407. * @peer_id_list: list of peer ids
  408. *
  409. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  410. */
  411. QDF_STATUS wmi_unified_peer_unmap_conf_send(wmi_unified_t wmi_handle,
  412. uint8_t vdev_id,
  413. uint32_t peer_id_cnt,
  414. uint16_t *peer_id_list);
  415. /**
  416. * wmi_unified_send_ocl_cmd() - send OCL command
  417. * @wmi_handle: wmi handle
  418. * @param: OCL commang parameters
  419. *
  420. * Send WMI_SET_OCL_CMDID parameters to fw.
  421. *
  422. * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
  423. */
  424. QDF_STATUS
  425. wmi_unified_send_ocl_cmd(wmi_unified_t wmi_handle,
  426. struct ocl_cmd_params *param);
  427. #endif /* _WMI_UNIFIED_STA_API_H_ */