1 /*
2 * Copyright (c) 2016-2021 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 /*
21 * This file contains the API declarations for the Unified Wireless Module
22 * Interface (WMI).
23 */
24
25 #ifndef _WMI_UNIFIED_VDEV_API_H_
26 #define _WMI_UNIFIED_VDEV_API_H_
27
28 #include <wmi_unified_api.h>
29
30 /**
31 * wmi_unified_peer_filter_set_tx_cmd_send() - WMI set tx peer filter function
32 * @wmi_handle: handle to WMI.
33 * @macaddr: MAC address
34 * @param: pointer to hold peer filter parameter
35 *
36 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
37 */
38 QDF_STATUS
39 wmi_unified_peer_filter_set_tx_cmd_send(struct wmi_unified *wmi_handle,
40 uint8_t macaddr[],
41 struct set_tx_peer_filter *param);
42
43 /**
44 * wmi_unified_vdev_set_neighbour_rx_cmd_send() - WMI set neighbour rx function
45 * @wmi_handle: handle to WMI.
46 * @macaddr: MAC address
47 * @param: pointer to hold neighbour rx parameter
48 *
49 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
50 */
51 QDF_STATUS wmi_unified_vdev_set_neighbour_rx_cmd_send(
52 struct wmi_unified *wmi_handle,
53 uint8_t macaddr[QDF_MAC_ADDR_SIZE],
54 struct set_neighbour_rx_params *param);
55
56 /**
57 * wmi_unified_vdev_config_ratemask_cmd_send() - WMI config ratemask function
58 * @wmi_handle: handle to WMI.
59 * @param: pointer to hold config ratemask param
60 *
61 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
62 */
63 QDF_STATUS
64 wmi_unified_vdev_config_ratemask_cmd_send(struct wmi_unified *wmi_handle,
65 struct config_ratemask_params *param);
66
67 /**
68 * wmi_unified_send_multiple_vdev_restart_req_cmd() - send multiple vdev restart
69 * @wmi_handle: wmi handle
70 * @param: multiple vdev restart parameter
71 *
72 * Send WMI_PDEV_MULTIPLE_VDEV_RESTART_REQUEST_CMDID parameters to fw.
73 *
74 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
75 */
76 QDF_STATUS wmi_unified_send_multiple_vdev_restart_req_cmd(
77 struct wmi_unified *wmi_handle,
78 struct multiple_vdev_restart_params *param);
79
80 /**
81 * wmi_unified_send_multiple_vdev_set_param_cmd() - Send multiple vdev set param
82 * command
83 * @wmi_handle: wmi handle
84 * @param: multiple vdev restart parameter
85 *
86 * Send WMI_PDEV_MULTIPLE_VDEV_SET_PARAM_CMDID parameters to fw.
87 *
88 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
89 */
90 QDF_STATUS wmi_unified_send_multiple_vdev_set_param_cmd(
91 struct wmi_unified *wmi_handle,
92 struct multiple_vdev_set_param *param);
93
94 /**
95 * wmi_unified_beacon_send_cmd() - WMI beacon send function
96 * @wmi_handle: handle to WMI.
97 * @param: pointer to hold beacon send cmd parameter
98 *
99 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
100 */
101 QDF_STATUS wmi_unified_beacon_send_cmd(struct wmi_unified *wmi_handle,
102 struct beacon_params *param);
103
104 /**
105 * wmi_extract_vdev_start_resp() - extract vdev start response
106 * @wmi_handle: wmi handle
107 * @evt_buf: pointer to event buffer
108 * @vdev_rsp: Pointer to hold vdev response
109 *
110 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
111 */
112 QDF_STATUS
113 wmi_extract_vdev_start_resp(struct wmi_unified *wmi_handle, void *evt_buf,
114 struct vdev_start_response *vdev_rsp);
115
116 /**
117 * wmi_extract_vdev_stopped_param() - extract vdev stop param from event
118 * @wmi_handle: wmi handle
119 * @evt_buf: pointer to event buffer
120 * @vdev_id: Pointer to hold vdev identifier
121 *
122 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
123 */
124 QDF_STATUS
125 wmi_extract_vdev_stopped_param(struct wmi_unified *wmi_handle, void *evt_buf,
126 uint32_t *vdev_id);
127
128 /**
129 * wmi_send_peer_vlan_config() - send peer vlan configuration
130 * @wmi_handle: wmi handle
131 * @mac_addr: mac address of the peer
132 * @param: vlan parameter
133 */
134 QDF_STATUS
135 wmi_send_peer_vlan_config(struct wmi_unified *wmi_handle,
136 uint8_t *mac_addr,
137 struct peer_vlan_config_param param);
138
139 /**
140 * wmi_extract_vdev_delete_resp() - extract vdev delete response
141 * @wmi_handle: wmi handle
142 * @evt_buf: pointer to event buffer
143 * @vdev_del_resp: Pointer to hold vdev delete response
144 *
145 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
146 */
147 QDF_STATUS
148 wmi_extract_vdev_delete_resp(struct wmi_unified *wmi_handle, void *evt_buf,
149 struct vdev_delete_response *vdev_del_resp);
150
151 /**
152 * wmi_extract_vdev_peer_delete_all_response_event() - extract peer delete all
153 * response
154 * @wmi_handle: wmi handle
155 * @evt_buf: pointer to event buffer
156 * @delete_rsp: Pointer to hold peer delete all response
157 *
158 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
159 */
160 QDF_STATUS wmi_extract_vdev_peer_delete_all_response_event(
161 struct wmi_unified *wmi_handle,
162 void *evt_buf,
163 struct peer_delete_all_response *delete_rsp);
164
165 /**
166 * wmi_extract_ext_tbttoffset_num_vdevs() - extract ext tbtt offset num vdev
167 * @wmi_handle: wmi handle
168 * @evt_buf: pointer to event buffer
169 * @num_vdevs: Pointer to hold num vdev
170 *
171 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
172 */
173 QDF_STATUS
174 wmi_extract_ext_tbttoffset_num_vdevs(struct wmi_unified *wmi_handle,
175 void *evt_buf, uint32_t *num_vdevs);
176
177 /**
178 * wmi_extract_tbttoffset_num_vdevs() - extract tbtt offset num vdev
179 * @wmi_handle: wmi handle
180 * @evt_buf: pointer to event buffer
181 * @num_vdevs: Pointer to hold num vdev
182 *
183 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
184 */
185 QDF_STATUS
186 wmi_extract_tbttoffset_num_vdevs(struct wmi_unified *wmi_handle, void *evt_buf,
187 uint32_t *num_vdevs);
188
189 /**
190 * wmi_extract_multi_vdev_restart_resp_event() - extract multi vdev restart
191 * response
192 * @wmi_handle: wmi handle
193 * @evt_buf: pointer to event buffer
194 * @restart_rsp: Pointer to hold multi vdev restart response
195 *
196 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
197 */
198 QDF_STATUS wmi_extract_multi_vdev_restart_resp_event(
199 struct wmi_unified *wmi_handle,
200 void *evt_buf,
201 struct multi_vdev_restart_resp *restart_rsp);
202
203 /**
204 * wmi_unified_multisoc_tbtt_sync_cmd() - Send cmd to sync tbtt in multisoc case
205 * @wmi_handle: wmi handle
206 * @param: params received in rnr_tbtt_multisoc_sync_param
207 *
208 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
209 */
210 QDF_STATUS
211 wmi_unified_multisoc_tbtt_sync_cmd(wmi_unified_t wmi_handle,
212 struct rnr_tbtt_multisoc_sync_param *param);
213
214 #ifdef WLAN_FEATURE_SR
215 /**
216 * wmi_unified_vdev_param_sr_prohibit_send() - send vdev SR prohibit command
217 * @wmi_hdl: wmi handle
218 * @srp_param: SR Prohibit parameters
219 *
220 * Return: QDF_STATUS_SUCCESS for success or error code
221 */
222 QDF_STATUS
223 wmi_unified_vdev_param_sr_prohibit_send(wmi_unified_t wmi_hdl,
224 struct sr_prohibit_param *srp_param);
225 #else
226 static inline QDF_STATUS
wmi_unified_vdev_param_sr_prohibit_send(wmi_unified_t wmi_hdl,struct sr_prohibit_param * srp_param)227 wmi_unified_vdev_param_sr_prohibit_send(wmi_unified_t wmi_hdl,
228 struct sr_prohibit_param *srp_param)
229 {
230 return QDF_STATUS_SUCCESS;
231 }
232 #endif
233 #endif
234