wmi_unified_sta_api.h 15 KB

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