xref: /wlan-driver/qca-wifi-host-cmn/umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021,2023-2024 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  * DOC: vdev_mgr_ops.h
22  *
23  * This header file provides API declarations for filling data structures
24  * and sending vdev mgmt commands to target_if/mlme/vdev_mgr
25  */
26 
27 #ifndef __VDEV_MGR_OPS_H__
28 #define __VDEV_MGR_OPS_H__
29 
30 #include <wlan_objmgr_vdev_obj.h>
31 #include <wlan_vdev_mgr_tgt_if_tx_defs.h>
32 #include <wlan_mlme_dbg.h>
33 #include "include/wlan_vdev_mlme.h"
34 
35 /**
36  * vdev_mgr_create_send() - MLME API to create command to
37  * target_if
38  * @mlme_obj: pointer to vdev_mlme_obj
39  *
40  * Return: QDF_STATUS - Success or Failure
41  */
42 QDF_STATUS vdev_mgr_create_send(struct vdev_mlme_obj *mlme_obj);
43 
44 /**
45  * vdev_mgr_start_send() - MLME API to send start request to
46  * target_if
47  * @mlme_obj: pointer to vdev_mlme_obj
48  * @restart: flag to indicate type of request START/RESTART
49  *
50  * Return: QDF_STATUS - Success or Failure
51  */
52 QDF_STATUS vdev_mgr_start_send(struct vdev_mlme_obj *mlme_obj, bool restart);
53 
54 /**
55  * vdev_mgr_delete_send() - MLME API to send delete request to
56  * target_if
57  * @mlme_obj: pointer to vdev_mlme_obj
58  *
59  * Return: QDF_STATUS - Success or Failure
60  */
61 QDF_STATUS vdev_mgr_delete_send(struct vdev_mlme_obj *mlme_obj);
62 
63 /**
64  * vdev_mgr_peer_flush_tids_send () - MLME API to setup peer flush tids
65  * @mlme_obj: pointer to vdev_mlme_obj
66  * @mac: pointer to peer mac address
67  * @peer_tid_bitmap: peer tid bitmap
68  *
69  * Return: QDF_STATUS - Success or Failure
70  */
71 QDF_STATUS vdev_mgr_peer_flush_tids_send(struct vdev_mlme_obj *mlme_obj,
72 					 uint8_t *mac,
73 					 uint32_t peer_tid_bitmap);
74 /**
75  * vdev_mgr_stop_send () - MLME API to send STOP request
76  * @mlme_obj: pointer to vdev_mlme_obj
77  *
78  * Return: QDF_STATUS - Success or Failure
79  */
80 QDF_STATUS vdev_mgr_stop_send(struct vdev_mlme_obj *mlme_obj);
81 
82 /**
83  * vdev_mgr_up_send () - MLME API to send UP command
84  * @mlme_obj: pointer to vdev_mlme_obj
85  *
86  * Return: QDF_STATUS - Success or Failure
87  */
88 QDF_STATUS vdev_mgr_up_send(struct vdev_mlme_obj *mlme_obj);
89 
90 /**
91  * vdev_mgr_down_send () - MLME API to send down command
92  * @mlme_obj: pointer to vdev_mlme_obj
93  *
94  * Return: QDF_STATUS - Success or Failure
95  */
96 QDF_STATUS vdev_mgr_down_send(struct vdev_mlme_obj *mlme_obj);
97 
98 /**
99  * vdev_mgr_set_param_send() - MLME API to send vdev param
100  * @mlme_obj: pointer to vdev_mlme_obj
101  * @param_id: parameter id
102  * @param_value: value corresponding to parameter id
103  *
104  * Return: QDF_STATUS - Success or Failure
105  */
106 QDF_STATUS vdev_mgr_set_param_send(struct vdev_mlme_obj *mlme_obj,
107 				   uint32_t param_id,
108 				   uint32_t param_value);
109 
110 /**
111  * vdev_mgr_set_neighbour_rx_cmd_send() - MLME API to send neighbour Rx
112  * cmd
113  * @mlme_obj: pointer to vdev_mlme_obj
114  * @param: pointer to set neighbour rx params
115  *
116  * Return: QDF_STATUS - Success or Failure
117  */
118 QDF_STATUS vdev_mgr_set_neighbour_rx_cmd_send(
119 				struct vdev_mlme_obj *mlme_obj,
120 				struct set_neighbour_rx_params *param);
121 
122 /**
123  * vdev_mgr_nac_rssi_send() - MLME API to send nac rssi
124  * @mlme_obj: pointer to vdev_mlme_obj
125  * @param: pointer to vdev_scan_nac_rssi_params
126  *
127  * Return: QDF_STATUS - Success or Failure
128  */
129 QDF_STATUS vdev_mgr_nac_rssi_send(
130 			struct vdev_mlme_obj *mlme_obj,
131 			struct vdev_scan_nac_rssi_params *param);
132 
133 /**
134  * vdev_mgr_sifs_trigger_send() - MLME API to send SIFS trigger
135  * @mlme_obj: pointer to vdev_mlme_obj
136  * @param_value: parameter value
137  *
138  * Return: QDF_STATUS - Success or Failure
139  */
140 QDF_STATUS vdev_mgr_sifs_trigger_send(
141 			struct vdev_mlme_obj *mlme_obj,
142 			uint32_t param_value);
143 
144 /**
145  * vdev_mgr_set_custom_aggr_size_send() - MLME API to send custom aggr size
146  * @mlme_obj: pointer to vdev_mlme_obj
147  * @is_amsdu: boolean to indicate value corresponds to amsdu/ampdu
148  *
149  * Return: QDF_STATUS - Success or Failure
150  */
151 QDF_STATUS vdev_mgr_set_custom_aggr_size_send(
152 			struct vdev_mlme_obj *mlme_obj, bool is_amsdu);
153 
154 /**
155  * vdev_mgr_config_ratemask_cmd_send() - MLME API to send ratemask
156  * @mlme_obj: pointer to vdev_mlme_obj
157  * @type: type of ratemask configuration
158  * @lower32: Lower 32 bits in the 1st 64-bit value
159  * @higher32: Higher 32 bits in the 1st 64-bit value
160  * @lower32_2: Lower 32 bits in the 2nd 64-bit value
161  *
162  * Return: QDF_STATUS - Success or Failure
163  */
164 QDF_STATUS vdev_mgr_config_ratemask_cmd_send(
165 				struct vdev_mlme_obj *mlme_obj,
166 				uint8_t type,
167 				uint32_t lower32,
168 				uint32_t higher32,
169 				uint32_t lower32_2);
170 
171 /**
172  * vdev_mgr_beacon_stop() - MLME API to stop beacon
173  * @mlme_obj: pointer to vdev_mlme_obj
174  *
175  * Return: QDF_STATUS - Success or Failure
176  */
177 QDF_STATUS vdev_mgr_beacon_stop(struct vdev_mlme_obj *mlme_obj);
178 
179 /**
180  * vdev_mgr_beacon_free() - MLME API to free beacon
181  * @mlme_obj: pointer to vdev_mlme_obj
182  *
183  * Return: QDF_STATUS - Success or Failure
184  */
185 QDF_STATUS vdev_mgr_beacon_free(struct vdev_mlme_obj *mlme_obj);
186 
187 /**
188  * vdev_mgr_beacon_send() - MLME API to send beacon
189  * @mlme_obj: pointer to vdev_mlme_obj
190  * @param: pointer to beacon_params
191  *
192  * Return: QDF_STATUS - Success or Failure
193  */
194 QDF_STATUS vdev_mgr_beacon_send(struct vdev_mlme_obj *mlme_obj,
195 				struct beacon_params *param);
196 
197 /**
198  * vdev_mgr_beacon_tmpl_send() - MLME API to send beacon template
199  * @mlme_obj: pointer to vdev_mlme_obj
200  * @param: pointer to beacon_tmpl_params
201  *
202  * Return: QDF_STATUS - Success or Failure
203  */
204 QDF_STATUS vdev_mgr_beacon_tmpl_send(struct vdev_mlme_obj *mlme_obj,
205 				     struct beacon_tmpl_params *param);
206 
207 /**
208  * vdev_mgr_bcn_miss_offload_send() - MLME API to send bcn miss offload
209  * @mlme_obj: pointer to vdev_mlme_obj
210  *
211  * Return: QDF_STATUS - Success or Failure
212  */
213 QDF_STATUS vdev_mgr_bcn_miss_offload_send(struct vdev_mlme_obj *mlme_obj);
214 
215 /**
216  * vdev_mgr_multiple_restart_send() - MLME API to send multiple vdev restart
217  * @pdev: pointer to pdev object
218  * @chan: pointer to channel param structure
219  * @disable_hw_ack: ddisable hw ack value
220  * @vdev_ids: pointer to list of vdev ids which require restart
221  * @num_vdevs: number of vdevs in list
222  * @mvr_param: multiple vdev restart param
223  *
224  * Return: QDF_STATUS - Success or Failure
225  */
226 QDF_STATUS vdev_mgr_multiple_restart_send(
227 					struct wlan_objmgr_pdev *pdev,
228 					struct mlme_channel_param *chan,
229 					uint32_t disable_hw_ack,
230 					uint32_t *vdev_ids,
231 					uint32_t num_vdevs,
232 					struct vdev_mlme_mvr_param *mvr_param);
233 
234 /**
235  * vdev_mgr_peer_delete_all_send() - MLME API to send peer delete all request
236  * @mlme_obj: pointer to vdev_mlme_obj
237  *
238  * Return: QDF_STATUS - Success or Failure
239  */
240 QDF_STATUS vdev_mgr_peer_delete_all_send(struct vdev_mlme_obj *mlme_obj);
241 
242 #ifdef WLAN_BCN_RATECODE_ENABLE
vdev_mgr_fetch_ratecode(struct vdev_mlme_obj * mlme_obj)243 static inline uint32_t vdev_mgr_fetch_ratecode(struct vdev_mlme_obj *mlme_obj)
244 {
245 	return mlme_obj->mgmt.rate_info.bcn_tx_rate_code;
246 }
247 #else
vdev_mgr_fetch_ratecode(struct vdev_mlme_obj * mlme_obj)248 static inline uint32_t vdev_mgr_fetch_ratecode(struct vdev_mlme_obj *mlme_obj)
249 {
250 	return mlme_obj->mgmt.rate_info.bcn_tx_rate;
251 }
252 #endif
253 
254 #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
255 /**
256  * vdev_mgr_send_set_mac_addr() - Send set MAC address command to FW
257  * @mac_addr: VDEV MAC address
258  * @mld_addr: VDEV MLD address
259  * @vdev: Pointer to object manager VDEV
260  *
261  * API to send set MAC address request to FW
262  *
263  * Return: QDF_STATUS
264  */
265 QDF_STATUS vdev_mgr_send_set_mac_addr(struct qdf_mac_addr mac_addr,
266 				      struct qdf_mac_addr mld_addr,
267 				      struct wlan_objmgr_vdev *vdev);
268 #endif
269 
270 /**
271  * vdev_mgr_configure_fd_for_sap() - Configure the FILS FD params to the
272  * firmware
273  * @mlme_obj: pointer to vdev_mlme_obj
274  *
275  * Return: QDF_STATUS
276  */
277 QDF_STATUS vdev_mgr_configure_fd_for_sap(struct vdev_mlme_obj *mlme_obj);
278 #endif /* __VDEV_MGR_OPS_H__ */
279