1  /*
2   * Copyright (c) 2016-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  #ifndef _WMI_UNIFIED_APF_TLV_H_
20  #define _WMI_UNIFIED_APF_TLV_H_
21  
22  #ifdef FEATURE_WLAN_APF
23  
24  #include "wmi_unified.h"
25  #include "wmi_unified_api.h"
26  #include "wmi_unified_param.h"
27  
28  /**
29   * wmi_send_set_active_apf_mode_cmd_tlv() - configure active APF mode in FW
30   * @wmi_handle: the WMI handle
31   * @vdev_id: the Id of the vdev to apply the configuration to
32   * @ucast_mode: the active APF mode to configure for unicast packets
33   * @mcast_bcast_mode: the active APF mode to configure for multicast/broadcast
34   * packets
35   *
36   * Return: QDF status
37   */
38  QDF_STATUS
39  wmi_send_set_active_apf_mode_cmd_tlv(wmi_unified_t wmi_handle,
40  				     uint8_t vdev_id,
41  				     enum wmi_host_active_apf_mode ucast_mode,
42  				     enum wmi_host_active_apf_mode
43  							      mcast_bcast_mode);
44  
45  /**
46   * wmi_send_apf_enable_cmd_tlv() - send cmd to enable/disable APF interpreter
47   * @wmi_handle: the WMI handle
48   * @vdev_id: VDEV on which APF interpreter is to be enabled/disabled
49   * @enable: true: enable, false: disable
50   *
51   * Return: QDF status
52   */
53  QDF_STATUS
54  wmi_send_apf_enable_cmd_tlv(wmi_unified_t wmi_handle, uint32_t vdev_id,
55  			    bool enable);
56  
57  /**
58   * wmi_send_apf_write_work_memory_cmd_tlv() - send cmd to write into the APF
59   * work
60   * memory
61   * @wmi_handle: the WMI handle
62   * @apf_write_params: parameters and buffer pointer for the write
63   *
64   * Return: QDF status
65   */
66  QDF_STATUS
67  wmi_send_apf_write_work_memory_cmd_tlv(wmi_unified_t wmi_handle,
68  				       struct wmi_apf_write_memory_params
69  							     *apf_write_params);
70  
71  /**
72   * wmi_send_apf_read_work_memory_cmd_tlv() - send cmd to read part of APF
73   * work memory
74   * @wmi_handle: the WMI handle
75   * @apf_read_params: contains relative address and length to read from
76   *
77   * Return: QDF status
78   */
79  QDF_STATUS
80  wmi_send_apf_read_work_memory_cmd_tlv(wmi_unified_t wmi_handle,
81  				      struct wmi_apf_read_memory_params
82  							      *apf_read_params);
83  
84  /**
85   * wmi_extract_apf_read_memory_resp_event_tlv() - extract read memory response
86   * event into the given structure pointer
87   * @wmi_handle: the WMI handle
88   * @evt_buf: Pointer to the event buffer
89   * @resp: pointer to memory to extract event parameters into
90   *
91   * Return: QDF status
92   */
93  QDF_STATUS
94  wmi_extract_apf_read_memory_resp_event_tlv(wmi_unified_t wmi_handle,
95  				void *evt_buf,
96  				struct wmi_apf_read_memory_resp_event_params
97  									 *resp);
98  #endif /* FEATURE_WLAN_APF */
99  
100  #endif /* _WMI_UNIFIED_APF_TLV_H_ */
101