wmi_unified_pmo_api.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. /*
  2. * Copyright (c) 2017-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: This file contains the API definitions for the Unified Wireless Module
  20. * Interface (WMI) which are specific to Power management offloads (PMO).
  21. */
  22. #ifndef _WMI_UNIFIED_PMO_API_H_
  23. #define _WMI_UNIFIED_PMO_API_H_
  24. #include "wlan_pmo_tgt_api.h"
  25. #include "wlan_pmo_arp_public_struct.h"
  26. #include "wlan_pmo_ns_public_struct.h"
  27. #include "wlan_pmo_gtk_public_struct.h"
  28. #include "wlan_pmo_wow_public_struct.h"
  29. #include "wlan_pmo_pkt_filter_public_struct.h"
  30. #ifdef FEATURE_WLAN_D0WOW
  31. /**
  32. * wmi_unified_d0wow_enable_send() - WMI d0 wow enable function
  33. * @param wmi_handle: handle to WMI.
  34. * @mac_id: radio context
  35. *
  36. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  37. */
  38. QDF_STATUS wmi_unified_d0wow_enable_send(void *wmi_hdl, uint8_t mac_id);
  39. /**
  40. * wmi_unified_d0wow_disable_send() - WMI d0 wow disable function
  41. * @param wmi_handle: handle to WMI.
  42. * @mac_id: radio context
  43. *
  44. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  45. */
  46. QDF_STATUS wmi_unified_d0wow_disable_send(void *wmi_hdl, uint8_t mac_id);
  47. #endif /* FEATURE_WLAN_D0WOW */
  48. /**
  49. * wmi_unified_add_wow_wakeup_event_cmd() - Configures wow wakeup events.
  50. * @wmi_handle: wmi handle
  51. * @vdev_id: vdev id
  52. * @bitmap: Event bitmap
  53. * @enable: enable/disable
  54. *
  55. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  56. */
  57. QDF_STATUS wmi_unified_add_wow_wakeup_event_cmd(void *wmi_hdl,
  58. uint32_t vdev_id,
  59. uint32_t *bitmap,
  60. bool enable);
  61. /**
  62. * wmi_unified_wow_patterns_to_fw_cmd() - Sends WOW patterns to FW.
  63. * @wmi_handle: wmi handle
  64. * @vdev_id: vdev id
  65. * @ptrn_id: pattern id
  66. * @ptrn: pattern
  67. * @ptrn_len: pattern length
  68. * @ptrn_offset: pattern offset
  69. * @mask: mask
  70. * @mask_len: mask length
  71. * @user: true for user configured pattern and false for default pattern
  72. * @default_patterns: default patterns
  73. *
  74. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  75. */
  76. QDF_STATUS wmi_unified_wow_patterns_to_fw_cmd(void *wmi_hdl,
  77. uint8_t vdev_id, uint8_t ptrn_id,
  78. const uint8_t *ptrn, uint8_t ptrn_len,
  79. uint8_t ptrn_offset, const uint8_t *mask,
  80. uint8_t mask_len, bool user,
  81. uint8_t default_patterns);
  82. /**
  83. * wmi_unified_add_clear_mcbc_filter_cmd() - set mcast filter command to fw
  84. * @wmi_handle: wmi handle
  85. * @vdev_id: vdev id
  86. * @multicastAddr: mcast address
  87. * @clearList: clear list flag
  88. *
  89. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  90. */
  91. QDF_STATUS wmi_unified_add_clear_mcbc_filter_cmd(void *wmi_hdl,
  92. uint8_t vdev_id,
  93. struct qdf_mac_addr multicast_addr,
  94. bool clearList);
  95. /**
  96. * wmi_unified_multiple_add_clear_mcbc_filter_cmd() - send multiple mcast
  97. * filter command to fw
  98. * @wmi_handle: wmi handle
  99. * @vdev_id: vdev id
  100. * @mcast_filter_params: mcast filter params
  101. *
  102. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  103. */
  104. QDF_STATUS wmi_unified_multiple_add_clear_mcbc_filter_cmd(void *wmi_hdl,
  105. uint8_t vdev_id,
  106. struct pmo_mcast_filter_params *filter_param);
  107. #ifdef FEATURE_WLAN_RA_FILTERING
  108. /**
  109. * wmi_unified_wow_sta_ra_filter_cmd() - set RA filter pattern in fw
  110. * @wmi_handle: wmi handle
  111. * @vdev_id: vdev id
  112. *
  113. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  114. */
  115. QDF_STATUS wmi_unified_wow_sta_ra_filter_cmd(void *wmi_hdl,
  116. uint8_t vdev_id,
  117. uint8_t default_pattern,
  118. uint16_t rate_limit_interval);
  119. #endif
  120. /**
  121. * wmi_unified_enable_enhance_multicast_offload() - enhance multicast offload
  122. * @wmi_hdl: wmi handle
  123. * @vdev_id: vdev id
  124. * @action: true for enable else false
  125. *
  126. * To configure enhance multicast offload in to firmware
  127. *
  128. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  129. */
  130. QDF_STATUS wmi_unified_enable_enhance_multicast_offload_cmd(
  131. void *wmi_hdl, uint8_t vdev_id, bool action);
  132. /**
  133. * wmi_extract_gtk_rsp_event() - extract gtk rsp params from event
  134. * @wmi_handle: wmi handle
  135. * @evt_buf: pointer to event buffer
  136. * @gtk_rsp_param: Pointer to gtk rsp parameters
  137. * @ len: len of gtk rsp event
  138. *
  139. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  140. */
  141. QDF_STATUS wmi_extract_gtk_rsp_event(void *wmi_hdl, void *evt_buf,
  142. struct pmo_gtk_rsp_params *gtk_rsp_param, uint32_t len);
  143. /**
  144. * wmi_unified_process_gtk_offload_getinfo_cmd() - send GTK offload cmd to fw
  145. * @wmi_handle: wmi handle
  146. * @params: GTK offload params
  147. *
  148. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  149. */
  150. QDF_STATUS wmi_unified_process_gtk_offload_getinfo_cmd(void *wmi_hdl,
  151. uint8_t vdev_id,
  152. uint64_t offload_req_opcode);
  153. /**
  154. * wmi_unified_action_frame_patterns_cmd() - send action filter wmi cmd
  155. * @wmi_handle: wmi handler
  156. * @action_params: pointer to action_params
  157. *
  158. * Return: 0 for success, otherwise appropriate error code
  159. */
  160. QDF_STATUS wmi_unified_action_frame_patterns_cmd(void *wmi_hdl,
  161. struct pmo_action_wakeup_set_params *action_params);
  162. /**
  163. * wmi_unified_send_gtk_offload_cmd() - send GTK offload command to fw
  164. * @wmi_handle: wmi handle
  165. * @vdev_id: vdev id
  166. * @params: GTK offload parameters
  167. *
  168. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  169. */
  170. QDF_STATUS wmi_unified_send_gtk_offload_cmd(void *wmi_hdl, uint8_t vdev_id,
  171. struct pmo_gtk_req *params,
  172. bool enable_offload,
  173. uint32_t gtk_offload_opcode);
  174. /**
  175. * wmi_unified_enable_arp_ns_offload_cmd() - enable ARP NS offload
  176. * @wmi_hdl: wmi handle
  177. * @param: offload request
  178. *
  179. * To configure ARP NS off load data to firmware
  180. * when target goes to wow mode.
  181. *
  182. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  183. */
  184. QDF_STATUS wmi_unified_enable_arp_ns_offload_cmd(void *wmi_hdl,
  185. struct pmo_arp_offload_params *arp_offload_req,
  186. struct pmo_ns_offload_params *ns_offload_req,
  187. uint8_t vdev_id);
  188. /**
  189. * wmi_unified_conf_hw_filter_cmd() - Configure hardware filter in DTIM mode
  190. * @opaque_wmi: wmi handle
  191. * @req: request parameters to configure to firmware
  192. *
  193. * Return: QDF_STATUS
  194. */
  195. QDF_STATUS wmi_unified_conf_hw_filter_cmd(void *opaque_wmi,
  196. struct pmo_hw_filter_params *req);
  197. #ifdef FEATURE_WLAN_LPHB
  198. /**
  199. * wmi_unified_lphb_config_hbenable_cmd() - enable command of LPHB configuration
  200. * @wmi_handle: wmi handle
  201. * @lphb_conf_req: configuration info
  202. *
  203. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  204. */
  205. QDF_STATUS wmi_unified_lphb_config_hbenable_cmd(void *wmi_hdl,
  206. wmi_hb_set_enable_cmd_fixed_param *params);
  207. /**
  208. * wmi_unified_lphb_config_tcp_params_cmd() - set tcp params of LPHB config req
  209. * @wmi_handle: wmi handle
  210. * @lphb_conf_req: lphb config request
  211. *
  212. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  213. */
  214. QDF_STATUS wmi_unified_lphb_config_tcp_params_cmd(void *wmi_hdl,
  215. wmi_hb_set_tcp_params_cmd_fixed_param *lphb_conf_req);
  216. /**
  217. * wmi_unified_lphb_config_tcp_pkt_filter_cmd() - config LPHB tcp packet filter
  218. * @wmi_handle: wmi handle
  219. * @lphb_conf_req: lphb config request
  220. *
  221. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  222. */
  223. QDF_STATUS wmi_unified_lphb_config_tcp_pkt_filter_cmd(void *wmi_hdl,
  224. wmi_hb_set_tcp_pkt_filter_cmd_fixed_param *g_hb_tcp_filter_fp);
  225. /**
  226. * wmi_unified_lphb_config_udp_params_cmd() - configure LPHB udp param command
  227. * @wmi_handle: wmi handle
  228. * @lphb_conf_req: lphb config request
  229. *
  230. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  231. */
  232. QDF_STATUS wmi_unified_lphb_config_udp_params_cmd(void *wmi_hdl,
  233. wmi_hb_set_udp_params_cmd_fixed_param *lphb_conf_req);
  234. /**
  235. * wmi_unified_lphb_config_udp_pkt_filter_cmd() - configure LPHB udp pkt filter
  236. * @wmi_handle: wmi handle
  237. * @lphb_conf_req: lphb config request
  238. *
  239. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  240. */
  241. QDF_STATUS wmi_unified_lphb_config_udp_pkt_filter_cmd(void *wmi_hdl,
  242. wmi_hb_set_udp_pkt_filter_cmd_fixed_param *lphb_conf_req);
  243. #endif /* FEATURE_WLAN_LPHB */
  244. #ifdef WLAN_FEATURE_PACKET_FILTERING
  245. /**
  246. * wmi_unified_enable_disable_packet_filter_cmd() - enable/disable packet filter
  247. * @wmi_handle: wmi handle
  248. * @vdev_id: vdev id
  249. * @enable: Flag to enable/disable packet filter
  250. *
  251. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  252. */
  253. QDF_STATUS wmi_unified_enable_disable_packet_filter_cmd(void *wmi_hdl,
  254. uint8_t vdev_id,
  255. bool enable);
  256. /**
  257. * wmi_unified_config_packet_filter_cmd() - configure packet filter in target
  258. * @wmi_handle: wmi handle
  259. * @vdev_id: vdev id
  260. * @rcv_filter_param: Packet filter parameters
  261. * @filter_id: Filter id
  262. * @enable: Flag to add/delete packet filter configuration
  263. *
  264. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  265. */
  266. QDF_STATUS wmi_unified_config_packet_filter_cmd(void *wmi_hdl,
  267. uint8_t vdev_id, struct pmo_rcv_pkt_fltr_cfg *rcv_filter_param,
  268. uint8_t filter_id, bool enable);
  269. #endif /* WLAN_FEATURE_PACKET_FILTERING */
  270. /**
  271. * wmi_unified_wow_delete_pattern_cmd() - delete wow pattern in target
  272. * @wmi_handle: wmi handle
  273. * @ptrn_id: pattern id
  274. * @vdev_id: vdev id
  275. *
  276. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  277. */
  278. QDF_STATUS wmi_unified_wow_delete_pattern_cmd(void *wmi_hdl, uint8_t ptrn_id,
  279. uint8_t vdev_id);
  280. /**
  281. * wmi_unified_host_wakeup_ind_to_fw_cmd() - send wakeup ind to fw
  282. * @wmi_handle: wmi handle
  283. *
  284. * Sends host wakeup indication to FW. On receiving this indication,
  285. * FW will come out of WOW.
  286. *
  287. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  288. */
  289. QDF_STATUS wmi_unified_host_wakeup_ind_to_fw_cmd(void *wmi_hdl);
  290. /**
  291. * wmi_unified_wow_timer_pattern_cmd() - set timer pattern tlv, so that
  292. * firmware will wake up host after
  293. * specified time is elapsed
  294. * @wmi_handle: wmi handle
  295. * @vdev_id: vdev id
  296. * @cookie: value to identify reason why host set up wake call.
  297. * @time: time in ms
  298. *
  299. * Return: QDF status
  300. */
  301. QDF_STATUS wmi_unified_wow_timer_pattern_cmd(void *wmi_hdl, uint8_t vdev_id,
  302. uint32_t cookie, uint32_t time);
  303. #ifdef WLAN_FEATURE_EXTWOW_SUPPORT
  304. /**
  305. * wmi_unified_enable_ext_wow_cmd() - enable ext wow in fw
  306. * @wmi_handle: wmi handle
  307. * @params: ext wow params
  308. *
  309. * Return:QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  310. */
  311. QDF_STATUS wmi_unified_enable_ext_wow_cmd(void *wmi_hdl,
  312. struct ext_wow_params *params);
  313. /**
  314. * wmi_unified_set_app_type2_params_in_fw_cmd() - set app type2 params in fw
  315. * @wmi_handle: wmi handle
  316. * @appType2Params: app type2 params
  317. *
  318. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  319. */
  320. QDF_STATUS wmi_unified_set_app_type2_params_in_fw_cmd(void *wmi_hdl,
  321. struct app_type2_params *appType2Params);
  322. /**
  323. * wmi_unified_app_type1_params_in_fw_cmd() - set app type1 params in fw
  324. * @wmi_hdl: wmi handle
  325. * @app_type1_params: app type1 params
  326. *
  327. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  328. */
  329. QDF_STATUS wmi_unified_app_type1_params_in_fw_cmd(void *wmi_hdl,
  330. struct app_type1_params *app_type1_params);
  331. #endif /* WLAN_FEATURE_EXTWOW_SUPPORT */
  332. #endif /* _WMI_UNIFIED_PMO_API_H_ */