xref: /wlan-driver/qcacld-3.0/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
6*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name  * above copyright notice and this permission notice appear in all
8*5113495bSYour Name  * copies.
9*5113495bSYour Name  *
10*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name  */
19*5113495bSYour Name /**
20*5113495bSYour Name  * DOC: define UCFG APIs exposed by the mlme component
21*5113495bSYour Name  */
22*5113495bSYour Name 
23*5113495bSYour Name #include "cfg_ucfg_api.h"
24*5113495bSYour Name #include "cfg_mlme_sta.h"
25*5113495bSYour Name #include "wlan_mlme_main.h"
26*5113495bSYour Name #include "wlan_mlme_api.h"
27*5113495bSYour Name #include "wlan_mlme_ucfg_api.h"
28*5113495bSYour Name #include "wlan_objmgr_pdev_obj.h"
29*5113495bSYour Name #include "wlan_mlme_vdev_mgr_interface.h"
30*5113495bSYour Name #include <include/wlan_pdev_mlme.h>
31*5113495bSYour Name #include "wlan_pdev_mlme_api.h"
32*5113495bSYour Name #include <wlan_psoc_mlme_api.h>
33*5113495bSYour Name #include "wlan_vdev_mgr_tgt_if_tx_api.h"
34*5113495bSYour Name #include "wlan_policy_mgr_public_struct.h"
35*5113495bSYour Name #include "spatial_reuse_api.h"
36*5113495bSYour Name 
ucfg_mlme_global_init(void)37*5113495bSYour Name QDF_STATUS ucfg_mlme_global_init(void)
38*5113495bSYour Name {
39*5113495bSYour Name 	mlme_register_mlme_ext_ops();
40*5113495bSYour Name 
41*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
42*5113495bSYour Name }
43*5113495bSYour Name 
ucfg_mlme_global_deinit(void)44*5113495bSYour Name QDF_STATUS ucfg_mlme_global_deinit(void)
45*5113495bSYour Name {
46*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
47*5113495bSYour Name }
48*5113495bSYour Name 
ucfg_mlme_init(void)49*5113495bSYour Name QDF_STATUS ucfg_mlme_init(void)
50*5113495bSYour Name {
51*5113495bSYour Name 	QDF_STATUS status;
52*5113495bSYour Name 
53*5113495bSYour Name 	status = wlan_objmgr_register_peer_create_handler(
54*5113495bSYour Name 			WLAN_UMAC_COMP_MLME,
55*5113495bSYour Name 			mlme_peer_object_created_notification,
56*5113495bSYour Name 			NULL);
57*5113495bSYour Name 	if (QDF_IS_STATUS_ERROR(status)) {
58*5113495bSYour Name 		mlme_legacy_err("peer create register notification failed");
59*5113495bSYour Name 		return QDF_STATUS_E_FAILURE;
60*5113495bSYour Name 	}
61*5113495bSYour Name 
62*5113495bSYour Name 	status = wlan_objmgr_register_peer_destroy_handler(
63*5113495bSYour Name 			WLAN_UMAC_COMP_MLME,
64*5113495bSYour Name 			mlme_peer_object_destroyed_notification,
65*5113495bSYour Name 			NULL);
66*5113495bSYour Name 	if (QDF_IS_STATUS_ERROR(status)) {
67*5113495bSYour Name 		mlme_legacy_err("peer destroy register notification failed");
68*5113495bSYour Name 		return QDF_STATUS_E_FAILURE;
69*5113495bSYour Name 	}
70*5113495bSYour Name 
71*5113495bSYour Name 	mlme_register_mlo_ext_ops();
72*5113495bSYour Name 	return status;
73*5113495bSYour Name }
74*5113495bSYour Name 
ucfg_mlme_deinit(void)75*5113495bSYour Name QDF_STATUS ucfg_mlme_deinit(void)
76*5113495bSYour Name {
77*5113495bSYour Name 	QDF_STATUS status;
78*5113495bSYour Name 
79*5113495bSYour Name 	mlme_unregister_mlo_ext_ops();
80*5113495bSYour Name 	status = wlan_objmgr_unregister_peer_destroy_handler(
81*5113495bSYour Name 			WLAN_UMAC_COMP_MLME,
82*5113495bSYour Name 			mlme_peer_object_destroyed_notification,
83*5113495bSYour Name 			NULL);
84*5113495bSYour Name 	if (QDF_IS_STATUS_ERROR(status))
85*5113495bSYour Name 		mlme_legacy_err("unable to unregister peer destroy handle");
86*5113495bSYour Name 
87*5113495bSYour Name 	status = wlan_objmgr_unregister_peer_create_handler(
88*5113495bSYour Name 			WLAN_UMAC_COMP_MLME,
89*5113495bSYour Name 			mlme_peer_object_created_notification,
90*5113495bSYour Name 			NULL);
91*5113495bSYour Name 	if (QDF_IS_STATUS_ERROR(status))
92*5113495bSYour Name 		mlme_legacy_err("unable to unregister peer create handle");
93*5113495bSYour Name 
94*5113495bSYour Name 	return status;
95*5113495bSYour Name }
96*5113495bSYour Name 
ucfg_mlme_psoc_open(struct wlan_objmgr_psoc * psoc)97*5113495bSYour Name QDF_STATUS ucfg_mlme_psoc_open(struct wlan_objmgr_psoc *psoc)
98*5113495bSYour Name {
99*5113495bSYour Name 	QDF_STATUS status;
100*5113495bSYour Name 
101*5113495bSYour Name 	status = mlme_cfg_on_psoc_enable(psoc);
102*5113495bSYour Name 	if (!QDF_IS_STATUS_SUCCESS(status))
103*5113495bSYour Name 		mlme_legacy_err("Failed to initialize MLME CFG");
104*5113495bSYour Name 
105*5113495bSYour Name 	return status;
106*5113495bSYour Name }
107*5113495bSYour Name 
ucfg_mlme_psoc_close(struct wlan_objmgr_psoc * psoc)108*5113495bSYour Name void ucfg_mlme_psoc_close(struct wlan_objmgr_psoc *psoc)
109*5113495bSYour Name {
110*5113495bSYour Name 	/* Clear the MLME CFG Structure */
111*5113495bSYour Name 	wlan_mlme_psoc_flush_peer_trans_history(psoc);
112*5113495bSYour Name }
113*5113495bSYour Name 
ucfg_mlme_pdev_open(struct wlan_objmgr_pdev * pdev)114*5113495bSYour Name QDF_STATUS ucfg_mlme_pdev_open(struct wlan_objmgr_pdev *pdev)
115*5113495bSYour Name {
116*5113495bSYour Name 	struct pdev_mlme_obj *pdev_mlme;
117*5113495bSYour Name 
118*5113495bSYour Name 	pdev_mlme = wlan_pdev_mlme_get_cmpt_obj(pdev);
119*5113495bSYour Name 	if (!pdev_mlme) {
120*5113495bSYour Name 		mlme_legacy_err(" PDEV MLME is NULL");
121*5113495bSYour Name 		return QDF_STATUS_E_FAILURE;
122*5113495bSYour Name 	}
123*5113495bSYour Name 	pdev_mlme->mlme_register_ops = mlme_register_vdev_mgr_ops;
124*5113495bSYour Name 
125*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
126*5113495bSYour Name }
127*5113495bSYour Name 
ucfg_mlme_pdev_close(struct wlan_objmgr_pdev * pdev)128*5113495bSYour Name QDF_STATUS ucfg_mlme_pdev_close(struct wlan_objmgr_pdev *pdev)
129*5113495bSYour Name {
130*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
131*5113495bSYour Name }
132*5113495bSYour Name 
ucfg_mlme_set_ml_link_control_mode(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,uint8_t value)133*5113495bSYour Name void ucfg_mlme_set_ml_link_control_mode(struct wlan_objmgr_psoc *psoc,
134*5113495bSYour Name 					uint8_t vdev_id, uint8_t value)
135*5113495bSYour Name {
136*5113495bSYour Name 	wlan_mlme_set_ml_link_control_mode(psoc, vdev_id, value);
137*5113495bSYour Name }
138*5113495bSYour Name 
ucfg_mlme_set_bt_profile_con(struct wlan_objmgr_psoc * psoc,bool bt_profile_con)139*5113495bSYour Name void ucfg_mlme_set_bt_profile_con(struct wlan_objmgr_psoc *psoc,
140*5113495bSYour Name 				  bool bt_profile_con)
141*5113495bSYour Name {
142*5113495bSYour Name 	wlan_mlme_set_bt_profile_con(psoc, bt_profile_con);
143*5113495bSYour Name }
144*5113495bSYour Name 
ucfg_mlme_get_ml_link_control_mode(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id)145*5113495bSYour Name uint8_t ucfg_mlme_get_ml_link_control_mode(struct wlan_objmgr_psoc *psoc,
146*5113495bSYour Name 					   uint8_t vdev_id)
147*5113495bSYour Name {
148*5113495bSYour Name 	return wlan_mlme_get_ml_link_control_mode(psoc, vdev_id);
149*5113495bSYour Name }
150*5113495bSYour Name 
151*5113495bSYour Name 
152*5113495bSYour Name /**
153*5113495bSYour Name  * ucfg_mlme_convert_power_cfg_chan_to_freq() - converts channel numbers to
154*5113495bSYour Name  * frequencies and copies the triplets to power_freq_data array
155*5113495bSYour Name  * @pdev: pointer to pdev object
156*5113495bSYour Name  * @max_length: Max length of the power chan data array
157*5113495bSYour Name  * @length: length of the data present in power_chan_data array
158*5113495bSYour Name  * @power_chan_data: Power data array from which channel numbers needs to be
159*5113495bSYour Name  * converted to frequencies
160*5113495bSYour Name  * @power_freq_data: Power data array in which the power data needs to be copied
161*5113495bSYour Name  * after conversion of channel numbers to frequencies
162*5113495bSYour Name  *
163*5113495bSYour Name  * power_data is received in the form of (first_channel_number,
164*5113495bSYour Name  * number_of_channels, max_tx_power) triplet, convert the channel numbers from
165*5113495bSYour Name  * the power_chan_data array to frequencies and copy the triplets
166*5113495bSYour Name  * (first_frequency, number_of_channels, max_tx_power) values to
167*5113495bSYour Name  * the power_freq_data array
168*5113495bSYour Name  *
169*5113495bSYour Name  * Return: Number of bytes filled in power_freq_data
170*5113495bSYour Name  */
171*5113495bSYour Name 
ucfg_mlme_convert_power_cfg_chan_to_freq(struct wlan_objmgr_pdev * pdev,uint32_t max_length,qdf_size_t length,uint8_t * power_chan_data,uint8_t * power_freq_data)172*5113495bSYour Name static uint32_t ucfg_mlme_convert_power_cfg_chan_to_freq(
173*5113495bSYour Name 						struct wlan_objmgr_pdev *pdev,
174*5113495bSYour Name 						uint32_t max_length,
175*5113495bSYour Name 						qdf_size_t length,
176*5113495bSYour Name 						uint8_t *power_chan_data,
177*5113495bSYour Name 						uint8_t *power_freq_data)
178*5113495bSYour Name {
179*5113495bSYour Name 	uint32_t count = 0, rem_length = length, copied_length = 0, i = 0;
180*5113495bSYour Name 	struct pwr_channel_info *pwr_cfg_data;
181*5113495bSYour Name 
182*5113495bSYour Name 	pwr_cfg_data = qdf_mem_malloc(max_length);
183*5113495bSYour Name 	if (!pwr_cfg_data)
184*5113495bSYour Name 		return 0;
185*5113495bSYour Name 
186*5113495bSYour Name 	mlme_legacy_debug("max_length %d length %zu", max_length, length);
187*5113495bSYour Name 	while ((rem_length >= 3) &&
188*5113495bSYour Name 	       (copied_length <= (max_length - (sizeof(struct pwr_channel_info))))) {
189*5113495bSYour Name 		pwr_cfg_data[i].first_freq = wlan_reg_legacy_chan_to_freq(
190*5113495bSYour Name 						pdev,
191*5113495bSYour Name 						power_chan_data[count++]);
192*5113495bSYour Name 		pwr_cfg_data[i].num_chan = power_chan_data[count++];
193*5113495bSYour Name 		pwr_cfg_data[i].max_tx_pwr = power_chan_data[count++];
194*5113495bSYour Name 		copied_length += sizeof(struct pwr_channel_info);
195*5113495bSYour Name 		rem_length -= 3;
196*5113495bSYour Name 		mlme_legacy_debug("First freq %d num channels %d max tx power %d",
197*5113495bSYour Name 				  pwr_cfg_data[i].first_freq,
198*5113495bSYour Name 				  pwr_cfg_data[i].num_chan,
199*5113495bSYour Name 				  pwr_cfg_data[i].max_tx_pwr);
200*5113495bSYour Name 		i++;
201*5113495bSYour Name 	}
202*5113495bSYour Name 
203*5113495bSYour Name 	qdf_mem_zero(power_freq_data, max_length);
204*5113495bSYour Name 	qdf_mem_copy(power_freq_data, pwr_cfg_data, copied_length);
205*5113495bSYour Name 	qdf_mem_free(pwr_cfg_data);
206*5113495bSYour Name 	return copied_length;
207*5113495bSYour Name }
208*5113495bSYour Name 
ucfg_mlme_cfg_chan_to_freq(struct wlan_objmgr_pdev * pdev)209*5113495bSYour Name void ucfg_mlme_cfg_chan_to_freq(struct wlan_objmgr_pdev *pdev)
210*5113495bSYour Name {
211*5113495bSYour Name 	struct wlan_objmgr_psoc *psoc = wlan_pdev_get_psoc(pdev);
212*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
213*5113495bSYour Name 	struct wlan_mlme_cfg *mlme_cfg;
214*5113495bSYour Name 	uint32_t converted_data_len = 0;
215*5113495bSYour Name 
216*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
217*5113495bSYour Name 	if (!mlme_obj)
218*5113495bSYour Name 		return;
219*5113495bSYour Name 
220*5113495bSYour Name 	mlme_cfg = &mlme_obj->cfg;
221*5113495bSYour Name 
222*5113495bSYour Name 	mlme_cfg->power.max_tx_power_24.max_len = CFG_MAX_TX_POWER_2_4_LEN;
223*5113495bSYour Name 	converted_data_len = ucfg_mlme_convert_power_cfg_chan_to_freq(
224*5113495bSYour Name 				pdev,
225*5113495bSYour Name 				mlme_cfg->power.max_tx_power_24_chan.max_len,
226*5113495bSYour Name 				mlme_cfg->power.max_tx_power_24_chan.len,
227*5113495bSYour Name 				mlme_cfg->power.max_tx_power_24_chan.data,
228*5113495bSYour Name 				mlme_cfg->power.max_tx_power_24.data);
229*5113495bSYour Name 	if (!converted_data_len) {
230*5113495bSYour Name 		mlme_legacy_err("mlme cfg power 2_4 data chan number to freq failed");
231*5113495bSYour Name 		return;
232*5113495bSYour Name 	}
233*5113495bSYour Name 
234*5113495bSYour Name 	mlme_cfg->power.max_tx_power_24.len = converted_data_len;
235*5113495bSYour Name 
236*5113495bSYour Name 	mlme_cfg->power.max_tx_power_5.max_len = CFG_MAX_TX_POWER_5_LEN;
237*5113495bSYour Name 	converted_data_len = ucfg_mlme_convert_power_cfg_chan_to_freq(
238*5113495bSYour Name 				pdev,
239*5113495bSYour Name 				mlme_cfg->power.max_tx_power_5_chan.max_len,
240*5113495bSYour Name 				mlme_cfg->power.max_tx_power_5_chan.len,
241*5113495bSYour Name 				mlme_cfg->power.max_tx_power_5_chan.data,
242*5113495bSYour Name 				mlme_cfg->power.max_tx_power_5.data);
243*5113495bSYour Name 	if (!converted_data_len) {
244*5113495bSYour Name 		mlme_legacy_err("mlme cfg power 5 data chan number to freq failed");
245*5113495bSYour Name 		return;
246*5113495bSYour Name 	}
247*5113495bSYour Name 	mlme_cfg->power.max_tx_power_5.len = converted_data_len;
248*5113495bSYour Name }
249*5113495bSYour Name 
250*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_sta_keep_alive_period(struct wlan_objmgr_psoc * psoc,uint32_t * val)251*5113495bSYour Name ucfg_mlme_get_sta_keep_alive_period(struct wlan_objmgr_psoc *psoc,
252*5113495bSYour Name 				    uint32_t *val)
253*5113495bSYour Name {
254*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
255*5113495bSYour Name 
256*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
257*5113495bSYour Name 	if (!mlme_obj) {
258*5113495bSYour Name 		*val = cfg_default(CFG_INFRA_STA_KEEP_ALIVE_PERIOD);
259*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
260*5113495bSYour Name 	}
261*5113495bSYour Name 
262*5113495bSYour Name 	*val = mlme_obj->cfg.sta.sta_keep_alive_period;
263*5113495bSYour Name 
264*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
265*5113495bSYour Name }
266*5113495bSYour Name 
267*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_dfs_master_capability(struct wlan_objmgr_psoc * psoc,bool * val)268*5113495bSYour Name ucfg_mlme_get_dfs_master_capability(struct wlan_objmgr_psoc *psoc,
269*5113495bSYour Name 				    bool *val)
270*5113495bSYour Name {
271*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
272*5113495bSYour Name 
273*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
274*5113495bSYour Name 	if (!mlme_obj) {
275*5113495bSYour Name 		*val = cfg_default(CFG_ENABLE_DFS_MASTER_CAPABILITY);
276*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
277*5113495bSYour Name 	}
278*5113495bSYour Name 
279*5113495bSYour Name 	*val = mlme_obj->cfg.dfs_cfg.dfs_master_capable;
280*5113495bSYour Name 
281*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
282*5113495bSYour Name }
283*5113495bSYour Name 
284*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_oem_6g_supported(struct wlan_objmgr_psoc * psoc,bool * oem_6g_disable)285*5113495bSYour Name ucfg_mlme_get_oem_6g_supported(struct wlan_objmgr_psoc *psoc,
286*5113495bSYour Name 			       bool *oem_6g_disable)
287*5113495bSYour Name {
288*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
289*5113495bSYour Name 
290*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
291*5113495bSYour Name 	if (!mlme_obj) {
292*5113495bSYour Name 		*oem_6g_disable =
293*5113495bSYour Name 			cfg_default(CFG_OEM_SIXG_SUPPORT_DISABLE);
294*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
295*5113495bSYour Name 	}
296*5113495bSYour Name 
297*5113495bSYour Name 	*oem_6g_disable = mlme_obj->cfg.wifi_pos_cfg.oem_6g_support_disable;
298*5113495bSYour Name 
299*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
300*5113495bSYour Name }
301*5113495bSYour Name 
302*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_fine_time_meas_cap(struct wlan_objmgr_psoc * psoc,uint32_t * fine_time_meas_cap)303*5113495bSYour Name ucfg_mlme_get_fine_time_meas_cap(struct wlan_objmgr_psoc *psoc,
304*5113495bSYour Name 				 uint32_t *fine_time_meas_cap)
305*5113495bSYour Name {
306*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
307*5113495bSYour Name 
308*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
309*5113495bSYour Name 	if (!mlme_obj) {
310*5113495bSYour Name 		*fine_time_meas_cap =
311*5113495bSYour Name 			cfg_default(CFG_FINE_TIME_MEAS_CAPABILITY);
312*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
313*5113495bSYour Name 	}
314*5113495bSYour Name 
315*5113495bSYour Name 	*fine_time_meas_cap = mlme_obj->cfg.wifi_pos_cfg.fine_time_meas_cap;
316*5113495bSYour Name 
317*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
318*5113495bSYour Name }
319*5113495bSYour Name 
320*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_fine_time_meas_cap(struct wlan_objmgr_psoc * psoc,uint32_t fine_time_meas_cap)321*5113495bSYour Name ucfg_mlme_set_fine_time_meas_cap(struct wlan_objmgr_psoc *psoc,
322*5113495bSYour Name 				 uint32_t fine_time_meas_cap)
323*5113495bSYour Name {
324*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
325*5113495bSYour Name 
326*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
327*5113495bSYour Name 	if (!mlme_obj)
328*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
329*5113495bSYour Name 
330*5113495bSYour Name 	mlme_obj->cfg.wifi_pos_cfg.fine_time_meas_cap = fine_time_meas_cap;
331*5113495bSYour Name 
332*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
333*5113495bSYour Name }
334*5113495bSYour Name 
335*5113495bSYour Name static QDF_STATUS
ucfg_mlme_set_vdev_traffic_type(struct wlan_objmgr_psoc * psoc,struct wlan_objmgr_vdev * vdev,bool set,uint8_t bit_mask)336*5113495bSYour Name ucfg_mlme_set_vdev_traffic_type(struct wlan_objmgr_psoc *psoc,
337*5113495bSYour Name 				struct wlan_objmgr_vdev *vdev, bool set,
338*5113495bSYour Name 				uint8_t bit_mask)
339*5113495bSYour Name {
340*5113495bSYour Name 	struct mlme_legacy_priv *mlme_priv;
341*5113495bSYour Name 	struct vdev_mlme_obj *vdev_mlme;
342*5113495bSYour Name 	struct vdev_set_params param = {0};
343*5113495bSYour Name 	enum QDF_OPMODE mode;
344*5113495bSYour Name 	QDF_STATUS status;
345*5113495bSYour Name 	uint8_t vdev_id = wlan_vdev_get_id(vdev);
346*5113495bSYour Name 	uint8_t prev_traffic_type;
347*5113495bSYour Name 
348*5113495bSYour Name 	mode = wlan_vdev_mlme_get_opmode(vdev);
349*5113495bSYour Name 	if (mode != QDF_SAP_MODE && mode != QDF_P2P_CLIENT_MODE &&
350*5113495bSYour Name 	    mode != QDF_P2P_GO_MODE) {
351*5113495bSYour Name 		mlme_legacy_debug("vdev %d: not supported for opmode %d",
352*5113495bSYour Name 				  vdev_id, mode);
353*5113495bSYour Name 		return QDF_STATUS_E_NOSUPPORT;
354*5113495bSYour Name 	}
355*5113495bSYour Name 
356*5113495bSYour Name 	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
357*5113495bSYour Name 	if (!vdev_mlme) {
358*5113495bSYour Name 		mlme_legacy_err("vdev %d: bit_mask 0x%x, set %d, vdev mlme is null",
359*5113495bSYour Name 				vdev_id, bit_mask, set);
360*5113495bSYour Name 		return QDF_STATUS_E_FAILURE;
361*5113495bSYour Name 	}
362*5113495bSYour Name 	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
363*5113495bSYour Name 	if (!mlme_priv) {
364*5113495bSYour Name 		mlme_legacy_err("vdev %d: bit_mask 0x%x, set %d, vmlme_priv is null",
365*5113495bSYour Name 				vdev_id, bit_mask, set);
366*5113495bSYour Name 		return QDF_STATUS_E_FAILURE;
367*5113495bSYour Name 	}
368*5113495bSYour Name 	prev_traffic_type = mlme_priv->vdev_traffic_type;
369*5113495bSYour Name 	if (set)
370*5113495bSYour Name 		mlme_priv->vdev_traffic_type |= bit_mask;
371*5113495bSYour Name 	else
372*5113495bSYour Name 		mlme_priv->vdev_traffic_type &= ~bit_mask;
373*5113495bSYour Name 
374*5113495bSYour Name 	if (prev_traffic_type == mlme_priv->vdev_traffic_type) {
375*5113495bSYour Name 		mlme_legacy_debug("vdev %d: No change in value 0x%x, set %d mask 0x%x",
376*5113495bSYour Name 				  vdev_id, mlme_priv->vdev_traffic_type, set,
377*5113495bSYour Name 				  bit_mask);
378*5113495bSYour Name 		return QDF_STATUS_SUCCESS;
379*5113495bSYour Name 	}
380*5113495bSYour Name 	mlme_legacy_debug("vdev %d: vdev_traffic_type 0x%x (set %d with bit_mask 0x%x)",
381*5113495bSYour Name 			  vdev_id, mlme_priv->vdev_traffic_type, set, bit_mask);
382*5113495bSYour Name 	param.param_id = wmi_vdev_param_set_traffic_config;
383*5113495bSYour Name 	param.vdev_id = vdev_id;
384*5113495bSYour Name 	param.param_value = mlme_priv->vdev_traffic_type;
385*5113495bSYour Name 	status = tgt_vdev_mgr_set_param_send(vdev_mlme, &param);
386*5113495bSYour Name 	policy_mgr_handle_ml_sta_link_on_traffic_type_change(psoc, vdev);
387*5113495bSYour Name 
388*5113495bSYour Name 	return status;
389*5113495bSYour Name }
390*5113495bSYour Name 
ucfg_mlme_connected_chan_stats_request(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id)391*5113495bSYour Name QDF_STATUS ucfg_mlme_connected_chan_stats_request(struct wlan_objmgr_psoc *psoc,
392*5113495bSYour Name 						  uint8_t vdev_id)
393*5113495bSYour Name {
394*5113495bSYour Name 	return mlme_connected_chan_stats_request(psoc, vdev_id);
395*5113495bSYour Name }
396*5113495bSYour Name 
397*5113495bSYour Name bool
ucfg_mlme_is_chwidth_with_notify_supported(struct wlan_objmgr_psoc * psoc)398*5113495bSYour Name ucfg_mlme_is_chwidth_with_notify_supported(struct wlan_objmgr_psoc *psoc)
399*5113495bSYour Name {
400*5113495bSYour Name 	return wlan_psoc_nif_fw_ext2_cap_get(psoc,
401*5113495bSYour Name 				WLAN_VDEV_PARAM_CHWIDTH_WITH_NOTIFY_SUPPORT);
402*5113495bSYour Name }
403*5113495bSYour Name 
ucfg_mlme_update_bss_rate_flags(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,enum phy_ch_width ch_width,uint8_t eht_present,uint8_t he_present,uint8_t vht_present,uint8_t ht_present)404*5113495bSYour Name QDF_STATUS ucfg_mlme_update_bss_rate_flags(struct wlan_objmgr_psoc *psoc,
405*5113495bSYour Name 					   uint8_t vdev_id,
406*5113495bSYour Name 					   enum phy_ch_width ch_width,
407*5113495bSYour Name 					   uint8_t eht_present,
408*5113495bSYour Name 					   uint8_t he_present,
409*5113495bSYour Name 					   uint8_t vht_present,
410*5113495bSYour Name 					   uint8_t ht_present)
411*5113495bSYour Name {
412*5113495bSYour Name 	return wlan_mlme_update_bss_rate_flags(psoc, vdev_id, ch_width,
413*5113495bSYour Name 					       eht_present, he_present,
414*5113495bSYour Name 					       vht_present, ht_present);
415*5113495bSYour Name }
416*5113495bSYour Name 
417*5113495bSYour Name QDF_STATUS
ucfg_mlme_send_ch_width_update_with_notify(struct wlan_objmgr_psoc * psoc,struct wlan_objmgr_vdev * link_vdev,enum phy_ch_width ch_width,uint8_t link_vdev_id)418*5113495bSYour Name ucfg_mlme_send_ch_width_update_with_notify(struct wlan_objmgr_psoc *psoc,
419*5113495bSYour Name 					   struct wlan_objmgr_vdev *link_vdev,
420*5113495bSYour Name 					   enum phy_ch_width ch_width,
421*5113495bSYour Name 					   uint8_t link_vdev_id)
422*5113495bSYour Name {
423*5113495bSYour Name 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
424*5113495bSYour Name 
425*5113495bSYour Name 	status = wlan_mlme_send_ch_width_update_with_notify(psoc, link_vdev,
426*5113495bSYour Name 							    link_vdev_id,
427*5113495bSYour Name 							    ch_width);
428*5113495bSYour Name 
429*5113495bSYour Name 	return status;
430*5113495bSYour Name }
431*5113495bSYour Name 
432*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_vdev_wifi_std(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,WMI_HOST_WIFI_STANDARD wifi_std)433*5113495bSYour Name ucfg_mlme_set_vdev_wifi_std(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
434*5113495bSYour Name 			    WMI_HOST_WIFI_STANDARD wifi_std)
435*5113495bSYour Name {
436*5113495bSYour Name 	struct wlan_objmgr_vdev *vdev;
437*5113495bSYour Name 	struct mlme_legacy_priv *mlme_priv;
438*5113495bSYour Name 
439*5113495bSYour Name 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
440*5113495bSYour Name 						    WLAN_MLME_OBJMGR_ID);
441*5113495bSYour Name 	if (!vdev) {
442*5113495bSYour Name 		mlme_legacy_err("vdev %d: vdev not found",
443*5113495bSYour Name 				vdev_id);
444*5113495bSYour Name 		return QDF_STATUS_E_FAILURE;
445*5113495bSYour Name 	}
446*5113495bSYour Name 
447*5113495bSYour Name 	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
448*5113495bSYour Name 	if (!mlme_priv) {
449*5113495bSYour Name 		mlme_legacy_err("vdev %d: vmlme_priv is null", vdev_id);
450*5113495bSYour Name 		wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_OBJMGR_ID);
451*5113495bSYour Name 		return QDF_STATUS_E_FAILURE;
452*5113495bSYour Name 	}
453*5113495bSYour Name 
454*5113495bSYour Name 	mlme_priv->wifi_std = wifi_std;
455*5113495bSYour Name 	mlme_priv->is_user_std_set = true;
456*5113495bSYour Name 
457*5113495bSYour Name 	if (wifi_std < WMI_HOST_WIFI_STANDARD_7)
458*5113495bSYour Name 		wlan_vdev_mlme_set_user_dis_eht_flag(vdev, true);
459*5113495bSYour Name 	else
460*5113495bSYour Name 		wlan_vdev_mlme_set_user_dis_eht_flag(vdev, false);
461*5113495bSYour Name 
462*5113495bSYour Name 	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_OBJMGR_ID);
463*5113495bSYour Name 
464*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
465*5113495bSYour Name }
466*5113495bSYour Name 
467*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_vdev_traffic_low_latency(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,bool set)468*5113495bSYour Name ucfg_mlme_set_vdev_traffic_low_latency(struct wlan_objmgr_psoc *psoc,
469*5113495bSYour Name 				       uint8_t vdev_id, bool set)
470*5113495bSYour Name {
471*5113495bSYour Name 	struct wlan_objmgr_vdev *vdev;
472*5113495bSYour Name 	QDF_STATUS status;
473*5113495bSYour Name 
474*5113495bSYour Name 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
475*5113495bSYour Name 						    WLAN_MLME_OBJMGR_ID);
476*5113495bSYour Name 	if (!vdev) {
477*5113495bSYour Name 		mlme_legacy_err("vdev %d: vdev not found",
478*5113495bSYour Name 				vdev_id);
479*5113495bSYour Name 		return QDF_STATUS_E_FAILURE;
480*5113495bSYour Name 	}
481*5113495bSYour Name 	status = ucfg_mlme_set_vdev_traffic_type(psoc, vdev, set,
482*5113495bSYour Name 						 PM_VDEV_TRAFFIC_LOW_LATENCY);
483*5113495bSYour Name 	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_OBJMGR_ID);
484*5113495bSYour Name 
485*5113495bSYour Name 	return status;
486*5113495bSYour Name }
487*5113495bSYour Name 
488*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_vdev_traffic_high_throughput(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,bool set)489*5113495bSYour Name ucfg_mlme_set_vdev_traffic_high_throughput(struct wlan_objmgr_psoc *psoc,
490*5113495bSYour Name 					   uint8_t vdev_id, bool set)
491*5113495bSYour Name {
492*5113495bSYour Name 	struct wlan_objmgr_vdev *vdev;
493*5113495bSYour Name 	QDF_STATUS status;
494*5113495bSYour Name 
495*5113495bSYour Name 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
496*5113495bSYour Name 						    WLAN_MLME_OBJMGR_ID);
497*5113495bSYour Name 	if (!vdev) {
498*5113495bSYour Name 		mlme_legacy_err("vdev %d: vdev not found",
499*5113495bSYour Name 				vdev_id);
500*5113495bSYour Name 		return QDF_STATUS_E_FAILURE;
501*5113495bSYour Name 	}
502*5113495bSYour Name 	status = ucfg_mlme_set_vdev_traffic_type(psoc, vdev, set,
503*5113495bSYour Name 						 PM_VDEV_TRAFFIC_HIGH_TPUT);
504*5113495bSYour Name 	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_OBJMGR_ID);
505*5113495bSYour Name 
506*5113495bSYour Name 	return status;
507*5113495bSYour Name }
508*5113495bSYour Name 
509*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_dfs_disable_channel_switch(struct wlan_objmgr_psoc * psoc,bool * dfs_disable_channel_switch)510*5113495bSYour Name ucfg_mlme_get_dfs_disable_channel_switch(struct wlan_objmgr_psoc *psoc,
511*5113495bSYour Name 					 bool *dfs_disable_channel_switch)
512*5113495bSYour Name {
513*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
514*5113495bSYour Name 
515*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
516*5113495bSYour Name 	if (!mlme_obj) {
517*5113495bSYour Name 		*dfs_disable_channel_switch =
518*5113495bSYour Name 			cfg_default(CFG_DISABLE_DFS_CH_SWITCH);
519*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
520*5113495bSYour Name 	}
521*5113495bSYour Name 
522*5113495bSYour Name 	*dfs_disable_channel_switch =
523*5113495bSYour Name 		mlme_obj->cfg.dfs_cfg.dfs_disable_channel_switch;
524*5113495bSYour Name 
525*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
526*5113495bSYour Name }
527*5113495bSYour Name 
528*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_dfs_disable_channel_switch(struct wlan_objmgr_psoc * psoc,bool dfs_disable_channel_switch)529*5113495bSYour Name ucfg_mlme_set_dfs_disable_channel_switch(struct wlan_objmgr_psoc *psoc,
530*5113495bSYour Name 					 bool dfs_disable_channel_switch)
531*5113495bSYour Name {
532*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
533*5113495bSYour Name 
534*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
535*5113495bSYour Name 	if (!mlme_obj) {
536*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
537*5113495bSYour Name 	}
538*5113495bSYour Name 
539*5113495bSYour Name 	mlme_obj->cfg.dfs_cfg.dfs_disable_channel_switch =
540*5113495bSYour Name 		dfs_disable_channel_switch;
541*5113495bSYour Name 
542*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
543*5113495bSYour Name }
544*5113495bSYour Name 
545*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_dfs_ignore_cac(struct wlan_objmgr_psoc * psoc,bool * dfs_ignore_cac)546*5113495bSYour Name ucfg_mlme_get_dfs_ignore_cac(struct wlan_objmgr_psoc *psoc,
547*5113495bSYour Name 			     bool *dfs_ignore_cac)
548*5113495bSYour Name {
549*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
550*5113495bSYour Name 
551*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
552*5113495bSYour Name 	if (!mlme_obj) {
553*5113495bSYour Name 		*dfs_ignore_cac = cfg_default(CFG_IGNORE_CAC);
554*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
555*5113495bSYour Name 	}
556*5113495bSYour Name 
557*5113495bSYour Name 	*dfs_ignore_cac = mlme_obj->cfg.dfs_cfg.dfs_ignore_cac;
558*5113495bSYour Name 
559*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
560*5113495bSYour Name }
561*5113495bSYour Name 
562*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_dfs_ignore_cac(struct wlan_objmgr_psoc * psoc,bool dfs_ignore_cac)563*5113495bSYour Name ucfg_mlme_set_dfs_ignore_cac(struct wlan_objmgr_psoc *psoc,
564*5113495bSYour Name 			     bool dfs_ignore_cac)
565*5113495bSYour Name {
566*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
567*5113495bSYour Name 
568*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
569*5113495bSYour Name 	if (!mlme_obj)
570*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
571*5113495bSYour Name 
572*5113495bSYour Name 	mlme_obj->cfg.dfs_cfg.dfs_ignore_cac = dfs_ignore_cac;
573*5113495bSYour Name 
574*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
575*5113495bSYour Name }
576*5113495bSYour Name 
577*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_sap_tx_leakage_threshold(struct wlan_objmgr_psoc * psoc,uint32_t * sap_tx_leakage_threshold)578*5113495bSYour Name ucfg_mlme_get_sap_tx_leakage_threshold(struct wlan_objmgr_psoc *psoc,
579*5113495bSYour Name 				       uint32_t *sap_tx_leakage_threshold)
580*5113495bSYour Name {
581*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
582*5113495bSYour Name 
583*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
584*5113495bSYour Name 	if (!mlme_obj) {
585*5113495bSYour Name 		*sap_tx_leakage_threshold =
586*5113495bSYour Name 			cfg_default(CFG_SAP_TX_LEAKAGE_THRESHOLD);
587*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
588*5113495bSYour Name 	}
589*5113495bSYour Name 
590*5113495bSYour Name 	*sap_tx_leakage_threshold =
591*5113495bSYour Name 		mlme_obj->cfg.dfs_cfg.sap_tx_leakage_threshold;
592*5113495bSYour Name 
593*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
594*5113495bSYour Name }
595*5113495bSYour Name 
596*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_sap_tx_leakage_threshold(struct wlan_objmgr_psoc * psoc,uint32_t sap_tx_leakage_threshold)597*5113495bSYour Name ucfg_mlme_set_sap_tx_leakage_threshold(struct wlan_objmgr_psoc *psoc,
598*5113495bSYour Name 				       uint32_t sap_tx_leakage_threshold)
599*5113495bSYour Name {
600*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
601*5113495bSYour Name 
602*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
603*5113495bSYour Name 	if (!mlme_obj)
604*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
605*5113495bSYour Name 
606*5113495bSYour Name 	mlme_obj->cfg.dfs_cfg.sap_tx_leakage_threshold =
607*5113495bSYour Name 		sap_tx_leakage_threshold;
608*5113495bSYour Name 
609*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
610*5113495bSYour Name }
611*5113495bSYour Name 
612*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_dfs_pri_multiplier(struct wlan_objmgr_psoc * psoc,uint32_t * dfs_pri_multiplier)613*5113495bSYour Name ucfg_mlme_get_dfs_pri_multiplier(struct wlan_objmgr_psoc *psoc,
614*5113495bSYour Name 				 uint32_t *dfs_pri_multiplier)
615*5113495bSYour Name {
616*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
617*5113495bSYour Name 
618*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
619*5113495bSYour Name 	if (!mlme_obj) {
620*5113495bSYour Name 		*dfs_pri_multiplier =
621*5113495bSYour Name 			cfg_default(CFG_DFS_RADAR_PRI_MULTIPLIER);
622*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
623*5113495bSYour Name 	}
624*5113495bSYour Name 
625*5113495bSYour Name 	*dfs_pri_multiplier =
626*5113495bSYour Name 		mlme_obj->cfg.dfs_cfg.dfs_pri_multiplier;
627*5113495bSYour Name 
628*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
629*5113495bSYour Name }
630*5113495bSYour Name 
631*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_dfs_pri_multiplier(struct wlan_objmgr_psoc * psoc,uint32_t dfs_pri_multiplier)632*5113495bSYour Name ucfg_mlme_set_dfs_pri_multiplier(struct wlan_objmgr_psoc *psoc,
633*5113495bSYour Name 				 uint32_t dfs_pri_multiplier)
634*5113495bSYour Name {
635*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
636*5113495bSYour Name 
637*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
638*5113495bSYour Name 	if (!mlme_obj)
639*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
640*5113495bSYour Name 
641*5113495bSYour Name 	mlme_obj->cfg.dfs_cfg.dfs_pri_multiplier =
642*5113495bSYour Name 		dfs_pri_multiplier;
643*5113495bSYour Name 
644*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
645*5113495bSYour Name }
646*5113495bSYour Name 
647*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_dfs_filter_offload(struct wlan_objmgr_psoc * psoc,bool * dfs_filter_offload)648*5113495bSYour Name ucfg_mlme_get_dfs_filter_offload(struct wlan_objmgr_psoc *psoc,
649*5113495bSYour Name 				 bool *dfs_filter_offload)
650*5113495bSYour Name {
651*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
652*5113495bSYour Name 
653*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
654*5113495bSYour Name 	if (!mlme_obj) {
655*5113495bSYour Name 		*dfs_filter_offload =
656*5113495bSYour Name 			cfg_default(CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD);
657*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
658*5113495bSYour Name 	}
659*5113495bSYour Name 
660*5113495bSYour Name 	*dfs_filter_offload = mlme_obj->cfg.dfs_cfg.dfs_filter_offload;
661*5113495bSYour Name 
662*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
663*5113495bSYour Name }
664*5113495bSYour Name 
665*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_dfs_filter_offload(struct wlan_objmgr_psoc * psoc,bool dfs_filter_offload)666*5113495bSYour Name ucfg_mlme_set_dfs_filter_offload(struct wlan_objmgr_psoc *psoc,
667*5113495bSYour Name 				 bool dfs_filter_offload)
668*5113495bSYour Name {
669*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
670*5113495bSYour Name 
671*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
672*5113495bSYour Name 	if (!mlme_obj)
673*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
674*5113495bSYour Name 
675*5113495bSYour Name 	mlme_obj->cfg.dfs_cfg.dfs_filter_offload = dfs_filter_offload;
676*5113495bSYour Name 
677*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
678*5113495bSYour Name }
679*5113495bSYour Name 
680*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_pmkid_modes(struct wlan_objmgr_psoc * psoc,uint32_t * val)681*5113495bSYour Name ucfg_mlme_get_pmkid_modes(struct wlan_objmgr_psoc *psoc,
682*5113495bSYour Name 			  uint32_t *val)
683*5113495bSYour Name {
684*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
685*5113495bSYour Name 
686*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
687*5113495bSYour Name 	if (!mlme_obj) {
688*5113495bSYour Name 		*val = cfg_default(CFG_PMKID_MODES);
689*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
690*5113495bSYour Name 	}
691*5113495bSYour Name 
692*5113495bSYour Name 	*val = mlme_obj->cfg.sta.pmkid_modes;
693*5113495bSYour Name 
694*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
695*5113495bSYour Name }
696*5113495bSYour Name 
697*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_pmkid_modes(struct wlan_objmgr_psoc * psoc,uint32_t val)698*5113495bSYour Name ucfg_mlme_set_pmkid_modes(struct wlan_objmgr_psoc *psoc,
699*5113495bSYour Name 			  uint32_t val)
700*5113495bSYour Name {
701*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
702*5113495bSYour Name 
703*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
704*5113495bSYour Name 	if (!mlme_obj)
705*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
706*5113495bSYour Name 
707*5113495bSYour Name 	mlme_obj->cfg.sta.pmkid_modes = val;
708*5113495bSYour Name 
709*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
710*5113495bSYour Name }
711*5113495bSYour Name 
712*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_dot11p_mode(struct wlan_objmgr_psoc * psoc,enum dot11p_mode * out_mode)713*5113495bSYour Name ucfg_mlme_get_dot11p_mode(struct wlan_objmgr_psoc *psoc,
714*5113495bSYour Name 			  enum dot11p_mode *out_mode)
715*5113495bSYour Name {
716*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
717*5113495bSYour Name 
718*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
719*5113495bSYour Name 	if (!mlme_obj) {
720*5113495bSYour Name 		*out_mode = cfg_default(CFG_DOT11P_MODE);
721*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
722*5113495bSYour Name 	}
723*5113495bSYour Name 
724*5113495bSYour Name 	*out_mode = mlme_obj->cfg.sta.dot11p_mode;
725*5113495bSYour Name 
726*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
727*5113495bSYour Name }
728*5113495bSYour Name 
729*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_go_cts2self_for_sta(struct wlan_objmgr_psoc * psoc,bool * val)730*5113495bSYour Name ucfg_mlme_get_go_cts2self_for_sta(struct wlan_objmgr_psoc *psoc,
731*5113495bSYour Name 				  bool *val)
732*5113495bSYour Name {
733*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
734*5113495bSYour Name 
735*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
736*5113495bSYour Name 	if (!mlme_obj) {
737*5113495bSYour Name 		*val = cfg_default(CFG_ENABLE_GO_CTS2SELF_FOR_STA);
738*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
739*5113495bSYour Name 	}
740*5113495bSYour Name 
741*5113495bSYour Name 	*val = mlme_obj->cfg.sta.enable_go_cts2self_for_sta;
742*5113495bSYour Name 
743*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
744*5113495bSYour Name }
745*5113495bSYour Name 
746*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_qcn_ie_support(struct wlan_objmgr_psoc * psoc,bool * val)747*5113495bSYour Name ucfg_mlme_get_qcn_ie_support(struct wlan_objmgr_psoc *psoc,
748*5113495bSYour Name 			     bool *val)
749*5113495bSYour Name {
750*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
751*5113495bSYour Name 
752*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
753*5113495bSYour Name 	if (!mlme_obj) {
754*5113495bSYour Name 		*val = cfg_default(CFG_QCN_IE_SUPPORT);
755*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
756*5113495bSYour Name 	}
757*5113495bSYour Name 
758*5113495bSYour Name 	*val = mlme_obj->cfg.sta.qcn_ie_support;
759*5113495bSYour Name 
760*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
761*5113495bSYour Name }
762*5113495bSYour Name 
763*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_tgt_gtx_usr_cfg(struct wlan_objmgr_psoc * psoc,uint32_t * val)764*5113495bSYour Name ucfg_mlme_get_tgt_gtx_usr_cfg(struct wlan_objmgr_psoc *psoc,
765*5113495bSYour Name 			      uint32_t *val)
766*5113495bSYour Name {
767*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
768*5113495bSYour Name 
769*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
770*5113495bSYour Name 	if (!mlme_obj) {
771*5113495bSYour Name 		*val = cfg_default(CFG_TGT_GTX_USR_CFG);
772*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
773*5113495bSYour Name 	}
774*5113495bSYour Name 
775*5113495bSYour Name 	*val = mlme_obj->cfg.sta.tgt_gtx_usr_cfg;
776*5113495bSYour Name 
777*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
778*5113495bSYour Name }
779*5113495bSYour Name 
780*5113495bSYour Name QDF_STATUS
ucfg_mlme_is_override_ht20_40_24g(struct wlan_objmgr_psoc * psoc,bool * val)781*5113495bSYour Name ucfg_mlme_is_override_ht20_40_24g(struct wlan_objmgr_psoc *psoc, bool *val)
782*5113495bSYour Name {
783*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
784*5113495bSYour Name 
785*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
786*5113495bSYour Name 	if (!mlme_obj) {
787*5113495bSYour Name 		*val = cfg_default(CFG_OBSS_HT40_OVERRIDE_HT40_20_24GHZ);
788*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
789*5113495bSYour Name 	}
790*5113495bSYour Name 	*val = mlme_obj->cfg.obss_ht40.is_override_ht20_40_24g;
791*5113495bSYour Name 
792*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
793*5113495bSYour Name }
794*5113495bSYour Name 
795*5113495bSYour Name #ifdef WLAN_FEATURE_ROAM_OFFLOAD
796*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_roam_disable_config(struct wlan_objmgr_psoc * psoc,uint32_t * val)797*5113495bSYour Name ucfg_mlme_get_roam_disable_config(struct wlan_objmgr_psoc *psoc,
798*5113495bSYour Name 				  uint32_t *val)
799*5113495bSYour Name {
800*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
801*5113495bSYour Name 
802*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
803*5113495bSYour Name 	if (!mlme_obj) {
804*5113495bSYour Name 		*val = cfg_default(CFG_STA_DISABLE_ROAM);
805*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
806*5113495bSYour Name 	}
807*5113495bSYour Name 
808*5113495bSYour Name 	*val = mlme_obj->cfg.lfr.sta_roam_disable;
809*5113495bSYour Name 
810*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
811*5113495bSYour Name }
812*5113495bSYour Name 
813*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_roaming_offload(struct wlan_objmgr_psoc * psoc,bool * val)814*5113495bSYour Name ucfg_mlme_get_roaming_offload(struct wlan_objmgr_psoc *psoc,
815*5113495bSYour Name 			      bool *val)
816*5113495bSYour Name {
817*5113495bSYour Name 	return wlan_mlme_get_roaming_offload(psoc, val);
818*5113495bSYour Name }
819*5113495bSYour Name 
820*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_roaming_offload(struct wlan_objmgr_psoc * psoc,bool val)821*5113495bSYour Name ucfg_mlme_set_roaming_offload(struct wlan_objmgr_psoc *psoc,
822*5113495bSYour Name 			      bool val)
823*5113495bSYour Name {
824*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
825*5113495bSYour Name 
826*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
827*5113495bSYour Name 	if (!mlme_obj)
828*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
829*5113495bSYour Name 
830*5113495bSYour Name 	mlme_obj->cfg.lfr.lfr3_roaming_offload = val;
831*5113495bSYour Name 
832*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
833*5113495bSYour Name }
834*5113495bSYour Name #endif
835*5113495bSYour Name 
836*5113495bSYour Name QDF_STATUS
ucfg_mlme_is_mawc_enabled(struct wlan_objmgr_psoc * psoc,bool * val)837*5113495bSYour Name ucfg_mlme_is_mawc_enabled(struct wlan_objmgr_psoc *psoc, bool *val)
838*5113495bSYour Name {
839*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
840*5113495bSYour Name 
841*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
842*5113495bSYour Name 	if (!mlme_obj) {
843*5113495bSYour Name 		*val = cfg_default(CFG_LFR_MAWC_FEATURE_ENABLED);
844*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
845*5113495bSYour Name 	}
846*5113495bSYour Name 	*val = mlme_obj->cfg.lfr.mawc_enabled;
847*5113495bSYour Name 
848*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
849*5113495bSYour Name }
850*5113495bSYour Name 
851*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_mawc_enabled(struct wlan_objmgr_psoc * psoc,bool val)852*5113495bSYour Name ucfg_mlme_set_mawc_enabled(struct wlan_objmgr_psoc *psoc, bool val)
853*5113495bSYour Name {
854*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
855*5113495bSYour Name 
856*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
857*5113495bSYour Name 	if (!mlme_obj)
858*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
859*5113495bSYour Name 
860*5113495bSYour Name 	mlme_obj->cfg.lfr.mawc_enabled = val;
861*5113495bSYour Name 
862*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
863*5113495bSYour Name }
864*5113495bSYour Name 
865*5113495bSYour Name QDF_STATUS
ucfg_mlme_is_fast_transition_enabled(struct wlan_objmgr_psoc * psoc,bool * val)866*5113495bSYour Name ucfg_mlme_is_fast_transition_enabled(struct wlan_objmgr_psoc *psoc,
867*5113495bSYour Name 				     bool *val)
868*5113495bSYour Name {
869*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
870*5113495bSYour Name 
871*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
872*5113495bSYour Name 	if (!mlme_obj) {
873*5113495bSYour Name 		*val = cfg_default(CFG_LFR_FAST_TRANSITION_ENABLED);
874*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
875*5113495bSYour Name 	}
876*5113495bSYour Name 
877*5113495bSYour Name 	*val = mlme_obj->cfg.lfr.fast_transition_enabled;
878*5113495bSYour Name 
879*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
880*5113495bSYour Name }
881*5113495bSYour Name 
882*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_fast_transition_enabled(struct wlan_objmgr_psoc * psoc,bool val)883*5113495bSYour Name ucfg_mlme_set_fast_transition_enabled(struct wlan_objmgr_psoc *psoc,
884*5113495bSYour Name 				      bool val)
885*5113495bSYour Name {
886*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
887*5113495bSYour Name 
888*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
889*5113495bSYour Name 	if (!mlme_obj)
890*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
891*5113495bSYour Name 
892*5113495bSYour Name 	mlme_obj->cfg.lfr.fast_transition_enabled = val;
893*5113495bSYour Name 
894*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
895*5113495bSYour Name }
896*5113495bSYour Name 
897*5113495bSYour Name #ifdef WLAN_ADAPTIVE_11R
898*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_tgt_adaptive_11r_cap(struct wlan_objmgr_psoc * psoc,bool val)899*5113495bSYour Name ucfg_mlme_set_tgt_adaptive_11r_cap(struct wlan_objmgr_psoc *psoc,
900*5113495bSYour Name 				   bool val)
901*5113495bSYour Name {
902*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
903*5113495bSYour Name 
904*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
905*5113495bSYour Name 	if (!mlme_obj)
906*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
907*5113495bSYour Name 
908*5113495bSYour Name 	mlme_obj->cfg.lfr.tgt_adaptive_11r_cap = val;
909*5113495bSYour Name 
910*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
911*5113495bSYour Name }
912*5113495bSYour Name 
913*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_adaptive11r_enabled(struct wlan_objmgr_psoc * psoc,bool * val)914*5113495bSYour Name ucfg_mlme_get_adaptive11r_enabled(struct wlan_objmgr_psoc *psoc, bool *val)
915*5113495bSYour Name {
916*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
917*5113495bSYour Name 
918*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
919*5113495bSYour Name 	if (!mlme_obj) {
920*5113495bSYour Name 		*val = cfg_default(CFG_ADAPTIVE_11R);
921*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
922*5113495bSYour Name 	}
923*5113495bSYour Name 
924*5113495bSYour Name 	*val = mlme_obj->cfg.lfr.enable_adaptive_11r;
925*5113495bSYour Name 
926*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
927*5113495bSYour Name }
928*5113495bSYour Name #endif
929*5113495bSYour Name 
930*5113495bSYour Name QDF_STATUS
ucfg_mlme_is_roam_scan_offload_enabled(struct wlan_objmgr_psoc * psoc,bool * val)931*5113495bSYour Name ucfg_mlme_is_roam_scan_offload_enabled(struct wlan_objmgr_psoc *psoc,
932*5113495bSYour Name 				       bool *val)
933*5113495bSYour Name {
934*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
935*5113495bSYour Name 
936*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
937*5113495bSYour Name 	if (!mlme_obj) {
938*5113495bSYour Name 		*val = cfg_default(CFG_LFR_ROAM_SCAN_OFFLOAD_ENABLED);
939*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
940*5113495bSYour Name 	}
941*5113495bSYour Name 
942*5113495bSYour Name 	*val = mlme_obj->cfg.lfr.roam_scan_offload_enabled;
943*5113495bSYour Name 
944*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
945*5113495bSYour Name }
946*5113495bSYour Name 
947*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_roam_scan_offload_enabled(struct wlan_objmgr_psoc * psoc,bool val)948*5113495bSYour Name ucfg_mlme_set_roam_scan_offload_enabled(struct wlan_objmgr_psoc *psoc,
949*5113495bSYour Name 					bool val)
950*5113495bSYour Name {
951*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
952*5113495bSYour Name 
953*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
954*5113495bSYour Name 	if (!mlme_obj)
955*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
956*5113495bSYour Name 
957*5113495bSYour Name 	mlme_obj->cfg.lfr.roam_scan_offload_enabled = val;
958*5113495bSYour Name 
959*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
960*5113495bSYour Name }
961*5113495bSYour Name 
962*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_neighbor_scan_max_chan_time(struct wlan_objmgr_psoc * psoc,uint16_t * val)963*5113495bSYour Name ucfg_mlme_get_neighbor_scan_max_chan_time(struct wlan_objmgr_psoc *psoc,
964*5113495bSYour Name 					  uint16_t *val)
965*5113495bSYour Name {
966*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
967*5113495bSYour Name 
968*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
969*5113495bSYour Name 	if (!mlme_obj) {
970*5113495bSYour Name 		*val = cfg_default(CFG_LFR_NEIGHBOR_SCAN_MAX_CHAN_TIME);
971*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
972*5113495bSYour Name 	}
973*5113495bSYour Name 
974*5113495bSYour Name 	*val = mlme_obj->cfg.lfr.neighbor_scan_max_chan_time;
975*5113495bSYour Name 
976*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
977*5113495bSYour Name }
978*5113495bSYour Name 
979*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_neighbor_scan_min_chan_time(struct wlan_objmgr_psoc * psoc,uint16_t * val)980*5113495bSYour Name ucfg_mlme_get_neighbor_scan_min_chan_time(struct wlan_objmgr_psoc *psoc,
981*5113495bSYour Name 					  uint16_t *val)
982*5113495bSYour Name {
983*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
984*5113495bSYour Name 
985*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
986*5113495bSYour Name 	if (!mlme_obj) {
987*5113495bSYour Name 		*val = cfg_default(CFG_LFR_NEIGHBOR_SCAN_MIN_CHAN_TIME);
988*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
989*5113495bSYour Name 	}
990*5113495bSYour Name 
991*5113495bSYour Name 	*val = mlme_obj->cfg.lfr.neighbor_scan_min_chan_time;
992*5113495bSYour Name 
993*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
994*5113495bSYour Name }
995*5113495bSYour Name 
996*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_delay_before_vdev_stop(struct wlan_objmgr_psoc * psoc,uint8_t * val)997*5113495bSYour Name ucfg_mlme_get_delay_before_vdev_stop(struct wlan_objmgr_psoc *psoc,
998*5113495bSYour Name 				     uint8_t *val)
999*5113495bSYour Name {
1000*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1001*5113495bSYour Name 
1002*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1003*5113495bSYour Name 	if (!mlme_obj) {
1004*5113495bSYour Name 		*val = cfg_default(CFG_LFR_DELAY_BEFORE_VDEV_STOP);
1005*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1006*5113495bSYour Name 	}
1007*5113495bSYour Name 
1008*5113495bSYour Name 	*val = mlme_obj->cfg.lfr.delay_before_vdev_stop;
1009*5113495bSYour Name 
1010*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1011*5113495bSYour Name }
1012*5113495bSYour Name 
1013*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_roam_bmiss_final_bcnt(struct wlan_objmgr_psoc * psoc,uint8_t * val)1014*5113495bSYour Name ucfg_mlme_get_roam_bmiss_final_bcnt(struct wlan_objmgr_psoc *psoc,
1015*5113495bSYour Name 				    uint8_t *val)
1016*5113495bSYour Name {
1017*5113495bSYour Name 	return wlan_mlme_get_roam_bmiss_final_bcnt(psoc, val);
1018*5113495bSYour Name }
1019*5113495bSYour Name 
1020*5113495bSYour Name bool
ucfg_mlme_validate_roam_bmiss_final_bcnt(uint32_t bmiss_final_bcnt)1021*5113495bSYour Name ucfg_mlme_validate_roam_bmiss_final_bcnt(uint32_t bmiss_final_bcnt)
1022*5113495bSYour Name {
1023*5113495bSYour Name 	bool is_valid = true;
1024*5113495bSYour Name 	uint32_t min, max;
1025*5113495bSYour Name 
1026*5113495bSYour Name 	if (!cfg_in_range(CFG_LFR_ROAM_BMISS_FINAL_BCNT,
1027*5113495bSYour Name 			  bmiss_final_bcnt)) {
1028*5113495bSYour Name 		min = (cfg_min(CFG_LFR_ROAM_BMISS_FINAL_BCNT));
1029*5113495bSYour Name 		max = (cfg_max(CFG_LFR_ROAM_BMISS_FINAL_BCNT));
1030*5113495bSYour Name 		mlme_legacy_err("bmiss final bcnt %d is out of range "
1031*5113495bSYour Name 				"(Min: %d Max: %d)",
1032*5113495bSYour Name 				bmiss_final_bcnt, min, max);
1033*5113495bSYour Name 		is_valid = false;
1034*5113495bSYour Name 	}
1035*5113495bSYour Name 
1036*5113495bSYour Name 	return is_valid;
1037*5113495bSYour Name }
1038*5113495bSYour Name 
ucfg_mlme_get_dual_sta_roaming_enabled(struct wlan_objmgr_psoc * psoc)1039*5113495bSYour Name bool ucfg_mlme_get_dual_sta_roaming_enabled(struct wlan_objmgr_psoc *psoc)
1040*5113495bSYour Name {
1041*5113495bSYour Name 	return wlan_mlme_get_dual_sta_roaming_enabled(psoc);
1042*5113495bSYour Name }
1043*5113495bSYour Name 
1044*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_roam_bmiss_first_bcnt(struct wlan_objmgr_psoc * psoc,uint8_t * val)1045*5113495bSYour Name ucfg_mlme_get_roam_bmiss_first_bcnt(struct wlan_objmgr_psoc *psoc,
1046*5113495bSYour Name 				    uint8_t *val)
1047*5113495bSYour Name {
1048*5113495bSYour Name 	return wlan_mlme_get_roam_bmiss_first_bcnt(psoc, val);
1049*5113495bSYour Name }
1050*5113495bSYour Name 
1051*5113495bSYour Name QDF_STATUS
ucfg_mlme_is_lfr_enabled(struct wlan_objmgr_psoc * psoc,bool * val)1052*5113495bSYour Name ucfg_mlme_is_lfr_enabled(struct wlan_objmgr_psoc *psoc, bool *val)
1053*5113495bSYour Name {
1054*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1055*5113495bSYour Name 
1056*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1057*5113495bSYour Name 	if (!mlme_obj) {
1058*5113495bSYour Name 		*val = cfg_default(CFG_LFR_FEATURE_ENABLED);
1059*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1060*5113495bSYour Name 	}
1061*5113495bSYour Name 
1062*5113495bSYour Name 	*val = mlme_obj->cfg.lfr.lfr_enabled;
1063*5113495bSYour Name 
1064*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1065*5113495bSYour Name }
1066*5113495bSYour Name 
1067*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_lfr_enabled(struct wlan_objmgr_psoc * psoc,bool val)1068*5113495bSYour Name ucfg_mlme_set_lfr_enabled(struct wlan_objmgr_psoc *psoc, bool val)
1069*5113495bSYour Name {
1070*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1071*5113495bSYour Name 
1072*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1073*5113495bSYour Name 	if (!mlme_obj)
1074*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1075*5113495bSYour Name 
1076*5113495bSYour Name 	mlme_obj->cfg.lfr.lfr_enabled = val;
1077*5113495bSYour Name 
1078*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1079*5113495bSYour Name }
1080*5113495bSYour Name 
1081*5113495bSYour Name QDF_STATUS
ucfg_mlme_is_roam_prefer_5ghz(struct wlan_objmgr_psoc * psoc,bool * val)1082*5113495bSYour Name ucfg_mlme_is_roam_prefer_5ghz(struct wlan_objmgr_psoc *psoc, bool *val)
1083*5113495bSYour Name {
1084*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1085*5113495bSYour Name 
1086*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1087*5113495bSYour Name 	if (!mlme_obj) {
1088*5113495bSYour Name 		*val = cfg_default(CFG_LFR_ROAM_PREFER_5GHZ);
1089*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1090*5113495bSYour Name 	}
1091*5113495bSYour Name 
1092*5113495bSYour Name 	*val = mlme_obj->cfg.lfr.roam_prefer_5ghz;
1093*5113495bSYour Name 
1094*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1095*5113495bSYour Name }
1096*5113495bSYour Name 
ucfg_mlme_is_roam_intra_band(struct wlan_objmgr_psoc * psoc)1097*5113495bSYour Name bool ucfg_mlme_is_roam_intra_band(struct wlan_objmgr_psoc *psoc)
1098*5113495bSYour Name {
1099*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1100*5113495bSYour Name 
1101*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1102*5113495bSYour Name 	if (!mlme_obj)
1103*5113495bSYour Name 		return true;
1104*5113495bSYour Name 
1105*5113495bSYour Name 	return mlme_obj->cfg.lfr.roam_intra_band;
1106*5113495bSYour Name }
1107*5113495bSYour Name 
1108*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_roam_intra_band(struct wlan_objmgr_psoc * psoc,bool val)1109*5113495bSYour Name ucfg_mlme_set_roam_intra_band(struct wlan_objmgr_psoc *psoc, bool val)
1110*5113495bSYour Name {
1111*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1112*5113495bSYour Name 
1113*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1114*5113495bSYour Name 	if (!mlme_obj)
1115*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1116*5113495bSYour Name 
1117*5113495bSYour Name 	mlme_obj->cfg.lfr.roam_intra_band = val;
1118*5113495bSYour Name 
1119*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1120*5113495bSYour Name }
1121*5113495bSYour Name 
1122*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_home_away_time(struct wlan_objmgr_psoc * psoc,uint16_t * val)1123*5113495bSYour Name ucfg_mlme_get_home_away_time(struct wlan_objmgr_psoc *psoc, uint16_t *val)
1124*5113495bSYour Name {
1125*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1126*5113495bSYour Name 
1127*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1128*5113495bSYour Name 	if (!mlme_obj) {
1129*5113495bSYour Name 		*val = cfg_default(CFG_LFR_ROAM_SCAN_HOME_AWAY_TIME);
1130*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1131*5113495bSYour Name 	}
1132*5113495bSYour Name 
1133*5113495bSYour Name 	*val = mlme_obj->cfg.lfr.roam_scan_home_away_time;
1134*5113495bSYour Name 
1135*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1136*5113495bSYour Name }
1137*5113495bSYour Name 
1138*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_fast_roam_in_concurrency_enabled(struct wlan_objmgr_psoc * psoc,bool val)1139*5113495bSYour Name ucfg_mlme_set_fast_roam_in_concurrency_enabled(struct wlan_objmgr_psoc *psoc,
1140*5113495bSYour Name 					       bool val)
1141*5113495bSYour Name {
1142*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1143*5113495bSYour Name 
1144*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1145*5113495bSYour Name 	if (!mlme_obj)
1146*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1147*5113495bSYour Name 
1148*5113495bSYour Name 	mlme_obj->cfg.lfr.enable_fast_roam_in_concurrency = val;
1149*5113495bSYour Name 
1150*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1151*5113495bSYour Name }
1152*5113495bSYour Name 
1153*5113495bSYour Name #ifdef MULTI_CLIENT_LL_SUPPORT
ucfg_mlme_get_wlm_multi_client_ll_caps(struct wlan_objmgr_psoc * psoc)1154*5113495bSYour Name bool ucfg_mlme_get_wlm_multi_client_ll_caps(struct wlan_objmgr_psoc *psoc)
1155*5113495bSYour Name {
1156*5113495bSYour Name 	return wlan_mlme_get_wlm_multi_client_ll_caps(psoc);
1157*5113495bSYour Name }
1158*5113495bSYour Name 
1159*5113495bSYour Name QDF_STATUS
ucfg_mlme_cfg_get_multi_client_ll_ini_support(struct wlan_objmgr_psoc * psoc,bool * multi_client_ll_support)1160*5113495bSYour Name ucfg_mlme_cfg_get_multi_client_ll_ini_support(struct wlan_objmgr_psoc *psoc,
1161*5113495bSYour Name 					      bool *multi_client_ll_support)
1162*5113495bSYour Name {
1163*5113495bSYour Name 	return mlme_get_cfg_multi_client_ll_ini_support(psoc,
1164*5113495bSYour Name 						multi_client_ll_support);
1165*5113495bSYour Name }
1166*5113495bSYour Name #endif
1167*5113495bSYour Name 
1168*5113495bSYour Name #ifdef WLAN_VENDOR_HANDOFF_CONTROL
ucfg_mlme_get_vendor_handoff_control_caps(struct wlan_objmgr_psoc * psoc)1169*5113495bSYour Name bool ucfg_mlme_get_vendor_handoff_control_caps(struct wlan_objmgr_psoc *psoc)
1170*5113495bSYour Name {
1171*5113495bSYour Name 	return wlan_mlme_get_vendor_handoff_control_caps(psoc);
1172*5113495bSYour Name }
1173*5113495bSYour Name #endif
1174*5113495bSYour Name 
1175*5113495bSYour Name #ifdef FEATURE_WLAN_ESE
1176*5113495bSYour Name QDF_STATUS
ucfg_mlme_is_ese_enabled(struct wlan_objmgr_psoc * psoc,bool * val)1177*5113495bSYour Name ucfg_mlme_is_ese_enabled(struct wlan_objmgr_psoc *psoc, bool *val)
1178*5113495bSYour Name {
1179*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1180*5113495bSYour Name 
1181*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1182*5113495bSYour Name 	if (!mlme_obj) {
1183*5113495bSYour Name 		*val = cfg_default(CFG_LFR_ESE_FEATURE_ENABLED);
1184*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1185*5113495bSYour Name 	}
1186*5113495bSYour Name 
1187*5113495bSYour Name 	*val = mlme_obj->cfg.lfr.ese_enabled;
1188*5113495bSYour Name 
1189*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1190*5113495bSYour Name }
1191*5113495bSYour Name #endif /* FEATURE_WLAN_ESE */
1192*5113495bSYour Name 
1193*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_supported_mcs_set(struct wlan_objmgr_psoc * psoc,uint8_t * buf,qdf_size_t * len)1194*5113495bSYour Name ucfg_mlme_get_supported_mcs_set(struct wlan_objmgr_psoc *psoc,
1195*5113495bSYour Name 				uint8_t *buf, qdf_size_t *len)
1196*5113495bSYour Name {
1197*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1198*5113495bSYour Name 
1199*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1200*5113495bSYour Name 	if (!mlme_obj)
1201*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1202*5113495bSYour Name 
1203*5113495bSYour Name 	return wlan_mlme_get_cfg_str(buf,
1204*5113495bSYour Name 				     &mlme_obj->cfg.rates.supported_mcs_set,
1205*5113495bSYour Name 				     len);
1206*5113495bSYour Name }
1207*5113495bSYour Name 
1208*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_supported_mcs_set(struct wlan_objmgr_psoc * psoc,uint8_t * buf,qdf_size_t len)1209*5113495bSYour Name ucfg_mlme_set_supported_mcs_set(struct wlan_objmgr_psoc *psoc,
1210*5113495bSYour Name 				uint8_t *buf, qdf_size_t len)
1211*5113495bSYour Name {
1212*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1213*5113495bSYour Name 
1214*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1215*5113495bSYour Name 	if (!mlme_obj)
1216*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1217*5113495bSYour Name 
1218*5113495bSYour Name 	return wlan_mlme_set_cfg_str(buf,
1219*5113495bSYour Name 				     &mlme_obj->cfg.rates.supported_mcs_set,
1220*5113495bSYour Name 				     len);
1221*5113495bSYour Name }
1222*5113495bSYour Name 
1223*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_current_mcs_set(struct wlan_objmgr_psoc * psoc,uint8_t * buf,qdf_size_t * len)1224*5113495bSYour Name ucfg_mlme_get_current_mcs_set(struct wlan_objmgr_psoc *psoc,
1225*5113495bSYour Name 			      uint8_t *buf, qdf_size_t *len)
1226*5113495bSYour Name {
1227*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1228*5113495bSYour Name 
1229*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1230*5113495bSYour Name 	if (!mlme_obj)
1231*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1232*5113495bSYour Name 
1233*5113495bSYour Name 	return wlan_mlme_get_cfg_str(buf,
1234*5113495bSYour Name 				     &mlme_obj->cfg.rates.current_mcs_set,
1235*5113495bSYour Name 				     len);
1236*5113495bSYour Name }
1237*5113495bSYour Name 
1238*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_wmi_wq_watchdog_timeout(struct wlan_objmgr_psoc * psoc,uint32_t * wmi_wq_watchdog_timeout)1239*5113495bSYour Name ucfg_mlme_get_wmi_wq_watchdog_timeout(struct wlan_objmgr_psoc *psoc,
1240*5113495bSYour Name 				      uint32_t *wmi_wq_watchdog_timeout)
1241*5113495bSYour Name {
1242*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1243*5113495bSYour Name 
1244*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1245*5113495bSYour Name 	if (!mlme_obj) {
1246*5113495bSYour Name 		*wmi_wq_watchdog_timeout = cfg_default(CFG_WMI_WQ_WATCHDOG);
1247*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1248*5113495bSYour Name 	}
1249*5113495bSYour Name 
1250*5113495bSYour Name 	*wmi_wq_watchdog_timeout =
1251*5113495bSYour Name 		mlme_obj->cfg.timeouts.wmi_wq_watchdog_timeout;
1252*5113495bSYour Name 
1253*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1254*5113495bSYour Name }
1255*5113495bSYour Name 
1256*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_wmi_wq_watchdog_timeout(struct wlan_objmgr_psoc * psoc,uint32_t wmi_wq_watchdog_timeout)1257*5113495bSYour Name ucfg_mlme_set_wmi_wq_watchdog_timeout(struct wlan_objmgr_psoc *psoc,
1258*5113495bSYour Name 				      uint32_t wmi_wq_watchdog_timeout)
1259*5113495bSYour Name {
1260*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1261*5113495bSYour Name 
1262*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1263*5113495bSYour Name 	if (!mlme_obj)
1264*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1265*5113495bSYour Name 
1266*5113495bSYour Name 	if (!cfg_in_range(CFG_WMI_WQ_WATCHDOG, wmi_wq_watchdog_timeout)) {
1267*5113495bSYour Name 		mlme_legacy_err("wmi watchdog bite timeout is invalid %d",
1268*5113495bSYour Name 				wmi_wq_watchdog_timeout);
1269*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1270*5113495bSYour Name 	}
1271*5113495bSYour Name 
1272*5113495bSYour Name 	mlme_obj->cfg.timeouts.wmi_wq_watchdog_timeout =
1273*5113495bSYour Name 		wmi_wq_watchdog_timeout;
1274*5113495bSYour Name 
1275*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1276*5113495bSYour Name }
1277*5113495bSYour Name 
1278*5113495bSYour Name QDF_STATUS
ucfg_mlme_stats_get_periodic_display_time(struct wlan_objmgr_psoc * psoc,uint32_t * periodic_display_time)1279*5113495bSYour Name ucfg_mlme_stats_get_periodic_display_time(struct wlan_objmgr_psoc *psoc,
1280*5113495bSYour Name 					  uint32_t *periodic_display_time)
1281*5113495bSYour Name {
1282*5113495bSYour Name 	return wlan_mlme_stats_get_periodic_display_time(psoc,
1283*5113495bSYour Name 							 periodic_display_time);
1284*5113495bSYour Name }
1285*5113495bSYour Name 
1286*5113495bSYour Name QDF_STATUS
ucfg_mlme_stats_get_cfg_values(struct wlan_objmgr_psoc * psoc,int * link_speed_rssi_high,int * link_speed_rssi_mid,int * link_speed_rssi_low,uint32_t * link_speed_rssi_report)1287*5113495bSYour Name ucfg_mlme_stats_get_cfg_values(struct wlan_objmgr_psoc *psoc,
1288*5113495bSYour Name 			       int *link_speed_rssi_high,
1289*5113495bSYour Name 			       int *link_speed_rssi_mid,
1290*5113495bSYour Name 			       int *link_speed_rssi_low,
1291*5113495bSYour Name 			       uint32_t *link_speed_rssi_report)
1292*5113495bSYour Name {
1293*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1294*5113495bSYour Name 
1295*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1296*5113495bSYour Name 	if (!mlme_obj) {
1297*5113495bSYour Name 		*link_speed_rssi_high =
1298*5113495bSYour Name 			cfg_default(CFG_LINK_SPEED_RSSI_HIGH);
1299*5113495bSYour Name 		*link_speed_rssi_mid =
1300*5113495bSYour Name 			cfg_default(CFG_LINK_SPEED_RSSI_MID);
1301*5113495bSYour Name 		*link_speed_rssi_low =
1302*5113495bSYour Name 			cfg_default(CFG_LINK_SPEED_RSSI_LOW);
1303*5113495bSYour Name 		*link_speed_rssi_report =
1304*5113495bSYour Name 			cfg_default(CFG_REPORT_MAX_LINK_SPEED);
1305*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1306*5113495bSYour Name 	}
1307*5113495bSYour Name 
1308*5113495bSYour Name 	*link_speed_rssi_high =
1309*5113495bSYour Name 		mlme_obj->cfg.stats.stats_link_speed_rssi_high;
1310*5113495bSYour Name 	*link_speed_rssi_mid =
1311*5113495bSYour Name 		mlme_obj->cfg.stats.stats_link_speed_rssi_med;
1312*5113495bSYour Name 	*link_speed_rssi_low =
1313*5113495bSYour Name 		mlme_obj->cfg.stats.stats_link_speed_rssi_low;
1314*5113495bSYour Name 	*link_speed_rssi_report =
1315*5113495bSYour Name 		mlme_obj->cfg.stats.stats_report_max_link_speed_rssi;
1316*5113495bSYour Name 
1317*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1318*5113495bSYour Name }
1319*5113495bSYour Name 
ucfg_mlme_stats_is_link_speed_report_actual(struct wlan_objmgr_psoc * psoc)1320*5113495bSYour Name bool ucfg_mlme_stats_is_link_speed_report_actual(struct wlan_objmgr_psoc *psoc)
1321*5113495bSYour Name {
1322*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1323*5113495bSYour Name 	int report_link_speed = 0;
1324*5113495bSYour Name 
1325*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1326*5113495bSYour Name 	if (!mlme_obj)
1327*5113495bSYour Name 		report_link_speed = cfg_default(CFG_REPORT_MAX_LINK_SPEED);
1328*5113495bSYour Name 	else
1329*5113495bSYour Name 		report_link_speed =
1330*5113495bSYour Name 			mlme_obj->cfg.stats.stats_report_max_link_speed_rssi;
1331*5113495bSYour Name 
1332*5113495bSYour Name 	return (report_link_speed == CFG_STATS_LINK_SPEED_REPORT_ACTUAL);
1333*5113495bSYour Name }
1334*5113495bSYour Name 
ucfg_mlme_stats_is_link_speed_report_max(struct wlan_objmgr_psoc * psoc)1335*5113495bSYour Name bool ucfg_mlme_stats_is_link_speed_report_max(struct wlan_objmgr_psoc *psoc)
1336*5113495bSYour Name {
1337*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1338*5113495bSYour Name 	int report_link_speed = 0;
1339*5113495bSYour Name 
1340*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1341*5113495bSYour Name 	if (!mlme_obj)
1342*5113495bSYour Name 		report_link_speed = cfg_default(CFG_REPORT_MAX_LINK_SPEED);
1343*5113495bSYour Name 	else
1344*5113495bSYour Name 		report_link_speed =
1345*5113495bSYour Name 			mlme_obj->cfg.stats.stats_report_max_link_speed_rssi;
1346*5113495bSYour Name 
1347*5113495bSYour Name 	return (report_link_speed == CFG_STATS_LINK_SPEED_REPORT_MAX);
1348*5113495bSYour Name }
1349*5113495bSYour Name 
1350*5113495bSYour Name bool
ucfg_mlme_stats_is_link_speed_report_max_scaled(struct wlan_objmgr_psoc * psoc)1351*5113495bSYour Name ucfg_mlme_stats_is_link_speed_report_max_scaled(struct wlan_objmgr_psoc *psoc)
1352*5113495bSYour Name {
1353*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1354*5113495bSYour Name 	int report_link_speed = 0;
1355*5113495bSYour Name 
1356*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1357*5113495bSYour Name 	if (!mlme_obj)
1358*5113495bSYour Name 		report_link_speed = cfg_default(CFG_REPORT_MAX_LINK_SPEED);
1359*5113495bSYour Name 	else
1360*5113495bSYour Name 		report_link_speed =
1361*5113495bSYour Name 			mlme_obj->cfg.stats.stats_report_max_link_speed_rssi;
1362*5113495bSYour Name 
1363*5113495bSYour Name 	return (report_link_speed == CFG_STATS_LINK_SPEED_REPORT_MAX_SCALED);
1364*5113495bSYour Name }
1365*5113495bSYour Name 
1366*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_sta_keepalive_method(struct wlan_objmgr_psoc * psoc,enum station_keepalive_method * val)1367*5113495bSYour Name ucfg_mlme_get_sta_keepalive_method(struct wlan_objmgr_psoc *psoc,
1368*5113495bSYour Name 				   enum station_keepalive_method *val)
1369*5113495bSYour Name {
1370*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1371*5113495bSYour Name 
1372*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1373*5113495bSYour Name 	if (!mlme_obj)
1374*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1375*5113495bSYour Name 
1376*5113495bSYour Name 	*val = mlme_obj->cfg.sta.sta_keepalive_method;
1377*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1378*5113495bSYour Name }
1379*5113495bSYour Name 
1380*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_enable_deauth_to_disassoc_map(struct wlan_objmgr_psoc * psoc,bool * value)1381*5113495bSYour Name ucfg_mlme_get_enable_deauth_to_disassoc_map(struct wlan_objmgr_psoc *psoc,
1382*5113495bSYour Name 					    bool *value)
1383*5113495bSYour Name {
1384*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1385*5113495bSYour Name 
1386*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1387*5113495bSYour Name 	if (!mlme_obj)
1388*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1389*5113495bSYour Name 
1390*5113495bSYour Name 	*value = mlme_obj->cfg.gen.enable_deauth_to_disassoc_map;
1391*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1392*5113495bSYour Name }
1393*5113495bSYour Name 
1394*5113495bSYour Name 
1395*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_ap_random_bssid_enable(struct wlan_objmgr_psoc * psoc,bool * value)1396*5113495bSYour Name ucfg_mlme_get_ap_random_bssid_enable(struct wlan_objmgr_psoc *psoc,
1397*5113495bSYour Name 				     bool *value)
1398*5113495bSYour Name {
1399*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1400*5113495bSYour Name 
1401*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1402*5113495bSYour Name 	if (!mlme_obj)
1403*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1404*5113495bSYour Name 
1405*5113495bSYour Name 	*value = mlme_obj->cfg.sap_cfg.ap_random_bssid_enable;
1406*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1407*5113495bSYour Name }
1408*5113495bSYour Name 
1409*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_latency_enable(struct wlan_objmgr_psoc * psoc,bool * value)1410*5113495bSYour Name ucfg_mlme_get_latency_enable(struct wlan_objmgr_psoc *psoc, bool *value)
1411*5113495bSYour Name {
1412*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1413*5113495bSYour Name 
1414*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1415*5113495bSYour Name 	if (!mlme_obj) {
1416*5113495bSYour Name 		mlme_legacy_err("mlme obj null");
1417*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1418*5113495bSYour Name 	}
1419*5113495bSYour Name 
1420*5113495bSYour Name 	*value = mlme_obj->cfg.wlm_config.latency_enable;
1421*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1422*5113495bSYour Name }
1423*5113495bSYour Name 
1424*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_latency_level(struct wlan_objmgr_psoc * psoc,uint8_t * value)1425*5113495bSYour Name ucfg_mlme_get_latency_level(struct wlan_objmgr_psoc *psoc, uint8_t *value)
1426*5113495bSYour Name {
1427*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1428*5113495bSYour Name 
1429*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1430*5113495bSYour Name 	if (!mlme_obj) {
1431*5113495bSYour Name 		mlme_legacy_err("mlme obj null");
1432*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1433*5113495bSYour Name 	}
1434*5113495bSYour Name 
1435*5113495bSYour Name 	*value = mlme_obj->cfg.wlm_config.latency_level;
1436*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1437*5113495bSYour Name }
1438*5113495bSYour Name 
1439*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_latency_host_flags(struct wlan_objmgr_psoc * psoc,uint8_t latency_level,uint32_t * value)1440*5113495bSYour Name ucfg_mlme_get_latency_host_flags(struct wlan_objmgr_psoc *psoc,
1441*5113495bSYour Name 				 uint8_t latency_level, uint32_t *value)
1442*5113495bSYour Name {
1443*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1444*5113495bSYour Name 
1445*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1446*5113495bSYour Name 	if (!mlme_obj) {
1447*5113495bSYour Name 		mlme_legacy_err("mlme obj null");
1448*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1449*5113495bSYour Name 	}
1450*5113495bSYour Name 
1451*5113495bSYour Name 	*value = mlme_obj->cfg.wlm_config.latency_host_flags[latency_level];
1452*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1453*5113495bSYour Name }
1454*5113495bSYour Name 
1455*5113495bSYour Name #ifdef MWS_COEX
1456*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_mws_coex_4g_quick_tdm(struct wlan_objmgr_psoc * psoc,uint32_t * val)1457*5113495bSYour Name ucfg_mlme_get_mws_coex_4g_quick_tdm(struct wlan_objmgr_psoc *psoc,
1458*5113495bSYour Name 				    uint32_t *val)
1459*5113495bSYour Name {
1460*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1461*5113495bSYour Name 
1462*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1463*5113495bSYour Name 	if (!mlme_obj) {
1464*5113495bSYour Name 		*val = cfg_default(CFG_MWS_COEX_4G_QUICK_FTDM);
1465*5113495bSYour Name 		mlme_legacy_err("mlme obj null");
1466*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1467*5113495bSYour Name 	}
1468*5113495bSYour Name 
1469*5113495bSYour Name 	*val = mlme_obj->cfg.mwc.mws_coex_4g_quick_tdm;
1470*5113495bSYour Name 
1471*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1472*5113495bSYour Name }
1473*5113495bSYour Name 
1474*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_mws_coex_5g_nr_pwr_limit(struct wlan_objmgr_psoc * psoc,uint32_t * val)1475*5113495bSYour Name ucfg_mlme_get_mws_coex_5g_nr_pwr_limit(struct wlan_objmgr_psoc *psoc,
1476*5113495bSYour Name 				       uint32_t *val)
1477*5113495bSYour Name {
1478*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1479*5113495bSYour Name 
1480*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1481*5113495bSYour Name 	if (!mlme_obj) {
1482*5113495bSYour Name 		*val = cfg_default(CFG_MWS_COEX_5G_NR_PWR_LIMIT);
1483*5113495bSYour Name 		mlme_legacy_err("mlme obj null");
1484*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1485*5113495bSYour Name 	}
1486*5113495bSYour Name 
1487*5113495bSYour Name 	*val = mlme_obj->cfg.mwc.mws_coex_5g_nr_pwr_limit;
1488*5113495bSYour Name 
1489*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1490*5113495bSYour Name }
1491*5113495bSYour Name 
1492*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_mws_coex_pcc_channel_avoid_delay(struct wlan_objmgr_psoc * psoc,uint32_t * val)1493*5113495bSYour Name ucfg_mlme_get_mws_coex_pcc_channel_avoid_delay(struct wlan_objmgr_psoc *psoc,
1494*5113495bSYour Name 					       uint32_t *val)
1495*5113495bSYour Name {
1496*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1497*5113495bSYour Name 
1498*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1499*5113495bSYour Name 	if (!mlme_obj) {
1500*5113495bSYour Name 		*val = cfg_default(CFG_MWS_COEX_PCC_CHANNEL_AVOID_DELAY);
1501*5113495bSYour Name 		mlme_legacy_err("mlme obj null");
1502*5113495bSYour Name 		return QDF_STATUS_SUCCESS;
1503*5113495bSYour Name 	}
1504*5113495bSYour Name 
1505*5113495bSYour Name 	*val = mlme_obj->cfg.mwc.mws_coex_pcc_channel_avoid_delay;
1506*5113495bSYour Name 
1507*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1508*5113495bSYour Name }
1509*5113495bSYour Name 
1510*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_mws_coex_scc_channel_avoid_delay(struct wlan_objmgr_psoc * psoc,uint32_t * val)1511*5113495bSYour Name ucfg_mlme_get_mws_coex_scc_channel_avoid_delay(struct wlan_objmgr_psoc *psoc,
1512*5113495bSYour Name 					       uint32_t *val)
1513*5113495bSYour Name {
1514*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1515*5113495bSYour Name 
1516*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1517*5113495bSYour Name 	if (!mlme_obj) {
1518*5113495bSYour Name 		*val = cfg_default(CFG_MWS_COEX_SCC_CHANNEL_AVOID_DELAY);
1519*5113495bSYour Name 		mlme_legacy_err("mlme obj null");
1520*5113495bSYour Name 		return QDF_STATUS_SUCCESS;
1521*5113495bSYour Name 	}
1522*5113495bSYour Name 
1523*5113495bSYour Name 	*val = mlme_obj->cfg.mwc.mws_coex_scc_channel_avoid_delay;
1524*5113495bSYour Name 
1525*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1526*5113495bSYour Name }
1527*5113495bSYour Name #endif
1528*5113495bSYour Name 
1529*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_etsi_srd_chan_in_master_mode(struct wlan_objmgr_psoc * psoc,uint8_t * value)1530*5113495bSYour Name ucfg_mlme_get_etsi_srd_chan_in_master_mode(struct wlan_objmgr_psoc *psoc,
1531*5113495bSYour Name 					   uint8_t *value)
1532*5113495bSYour Name {
1533*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1534*5113495bSYour Name 
1535*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1536*5113495bSYour Name 	if (!mlme_obj) {
1537*5113495bSYour Name 		*value = cfg_default(CFG_ETSI_SRD_CHAN_IN_MASTER_MODE);
1538*5113495bSYour Name 		mlme_legacy_err("Failed to get MLME Obj");
1539*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1540*5113495bSYour Name 	}
1541*5113495bSYour Name 
1542*5113495bSYour Name 	*value = mlme_obj->cfg.reg.etsi_srd_chan_in_master_mode;
1543*5113495bSYour Name 
1544*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1545*5113495bSYour Name }
1546*5113495bSYour Name 
1547*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_5dot9_ghz_chan_in_master_mode(struct wlan_objmgr_psoc * psoc,bool * value)1548*5113495bSYour Name ucfg_mlme_get_5dot9_ghz_chan_in_master_mode(struct wlan_objmgr_psoc *psoc,
1549*5113495bSYour Name 					    bool *value)
1550*5113495bSYour Name {
1551*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1552*5113495bSYour Name 
1553*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1554*5113495bSYour Name 	if (!mlme_obj) {
1555*5113495bSYour Name 		*value = cfg_default(CFG_FCC_5DOT9_GHZ_CHAN_IN_MASTER_MODE);
1556*5113495bSYour Name 		mlme_legacy_err("Failed to get MLME Obj");
1557*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1558*5113495bSYour Name 	}
1559*5113495bSYour Name 
1560*5113495bSYour Name 	*value = mlme_obj->cfg.reg.fcc_5dot9_ghz_chan_in_master_mode;
1561*5113495bSYour Name 
1562*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1563*5113495bSYour Name }
1564*5113495bSYour Name 
1565*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_srd_master_mode_for_vdev(struct wlan_objmgr_psoc * psoc,enum QDF_OPMODE vdev_opmode,bool * value)1566*5113495bSYour Name ucfg_mlme_get_srd_master_mode_for_vdev(struct wlan_objmgr_psoc *psoc,
1567*5113495bSYour Name 				       enum QDF_OPMODE vdev_opmode,
1568*5113495bSYour Name 				       bool *value)
1569*5113495bSYour Name {
1570*5113495bSYour Name 	return wlan_mlme_get_srd_master_mode_for_vdev(psoc, vdev_opmode, value);
1571*5113495bSYour Name }
1572*5113495bSYour Name 
1573*5113495bSYour Name #ifdef SAP_AVOID_ACS_FREQ_LIST
1574*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_acs_avoid_freq_list(struct wlan_objmgr_psoc * psoc,uint16_t * freq_list,uint8_t * freq_list_num)1575*5113495bSYour Name ucfg_mlme_get_acs_avoid_freq_list(struct wlan_objmgr_psoc *psoc,
1576*5113495bSYour Name 				  uint16_t *freq_list, uint8_t *freq_list_num)
1577*5113495bSYour Name {
1578*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1579*5113495bSYour Name 	qdf_size_t avoid_acs_freq_list_num;
1580*5113495bSYour Name 
1581*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1582*5113495bSYour Name 	if (!mlme_obj) {
1583*5113495bSYour Name 		qdf_uint16_array_parse(
1584*5113495bSYour Name 				cfg_default(CFG_SAP_AVOID_ACS_FREQ_LIST),
1585*5113495bSYour Name 				freq_list, CFG_VALID_CHANNEL_LIST_LEN,
1586*5113495bSYour Name 				&avoid_acs_freq_list_num);
1587*5113495bSYour Name 		*freq_list_num = avoid_acs_freq_list_num;
1588*5113495bSYour Name 
1589*5113495bSYour Name 		mlme_legacy_err("Failed to get MLME Obj");
1590*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1591*5113495bSYour Name 	}
1592*5113495bSYour Name 
1593*5113495bSYour Name 	*freq_list_num = mlme_obj->cfg.reg.avoid_acs_freq_list_num;
1594*5113495bSYour Name 	qdf_mem_copy(freq_list, mlme_obj->cfg.reg.avoid_acs_freq_list,
1595*5113495bSYour Name 		     *freq_list_num * sizeof(uint16_t));
1596*5113495bSYour Name 
1597*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1598*5113495bSYour Name }
1599*5113495bSYour Name #endif
1600*5113495bSYour Name 
1601*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_11d_in_world_mode(struct wlan_objmgr_psoc * psoc,bool * value)1602*5113495bSYour Name ucfg_mlme_get_11d_in_world_mode(struct wlan_objmgr_psoc *psoc,
1603*5113495bSYour Name 				bool *value)
1604*5113495bSYour Name {
1605*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1606*5113495bSYour Name 
1607*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1608*5113495bSYour Name 	if (!mlme_obj) {
1609*5113495bSYour Name 		*value = cfg_default(CFG_ENABLE_11D_IN_WORLD_MODE);
1610*5113495bSYour Name 		mlme_legacy_err("Failed to get MLME Obj");
1611*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1612*5113495bSYour Name 	}
1613*5113495bSYour Name 
1614*5113495bSYour Name 	*value = mlme_obj->cfg.reg.enable_11d_in_world_mode;
1615*5113495bSYour Name 
1616*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1617*5113495bSYour Name }
1618*5113495bSYour Name 
1619*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_restart_beaconing_on_ch_avoid(struct wlan_objmgr_psoc * psoc,uint32_t * value)1620*5113495bSYour Name ucfg_mlme_get_restart_beaconing_on_ch_avoid(struct wlan_objmgr_psoc *psoc,
1621*5113495bSYour Name 					    uint32_t *value)
1622*5113495bSYour Name {
1623*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1624*5113495bSYour Name 
1625*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1626*5113495bSYour Name 	if (!mlme_obj) {
1627*5113495bSYour Name 		*value = cfg_default(CFG_RESTART_BEACONING_ON_CH_AVOID);
1628*5113495bSYour Name 		mlme_legacy_err("Failed to get MLME Obj");
1629*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1630*5113495bSYour Name 	}
1631*5113495bSYour Name 
1632*5113495bSYour Name 	*value = mlme_obj->cfg.reg.restart_beaconing_on_ch_avoid;
1633*5113495bSYour Name 
1634*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1635*5113495bSYour Name }
1636*5113495bSYour Name 
1637*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_indoor_channel_support(struct wlan_objmgr_psoc * psoc,bool * value)1638*5113495bSYour Name ucfg_mlme_get_indoor_channel_support(struct wlan_objmgr_psoc *psoc,
1639*5113495bSYour Name 				     bool *value)
1640*5113495bSYour Name {
1641*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1642*5113495bSYour Name 
1643*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1644*5113495bSYour Name 	if (!mlme_obj) {
1645*5113495bSYour Name 		*value = cfg_default(CFG_INDOOR_CHANNEL_SUPPORT);
1646*5113495bSYour Name 		mlme_legacy_err("Failed to get MLME Obj");
1647*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1648*5113495bSYour Name 	}
1649*5113495bSYour Name 
1650*5113495bSYour Name 	*value = mlme_obj->cfg.reg.indoor_channel_support;
1651*5113495bSYour Name 
1652*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1653*5113495bSYour Name }
1654*5113495bSYour Name 
1655*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_scan_11d_interval(struct wlan_objmgr_psoc * psoc,uint32_t * value)1656*5113495bSYour Name ucfg_mlme_get_scan_11d_interval(struct wlan_objmgr_psoc *psoc,
1657*5113495bSYour Name 				uint32_t *value)
1658*5113495bSYour Name {
1659*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1660*5113495bSYour Name 
1661*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1662*5113495bSYour Name 	if (!mlme_obj) {
1663*5113495bSYour Name 		*value = cfg_default(CFG_SCAN_11D_INTERVAL);
1664*5113495bSYour Name 		mlme_legacy_err("Failed to get MLME Obj");
1665*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1666*5113495bSYour Name 	}
1667*5113495bSYour Name 
1668*5113495bSYour Name 	*value = mlme_obj->cfg.reg.scan_11d_interval;
1669*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1670*5113495bSYour Name }
1671*5113495bSYour Name 
1672*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_nol_across_regdmn(struct wlan_objmgr_psoc * psoc,bool * value)1673*5113495bSYour Name ucfg_mlme_get_nol_across_regdmn(struct wlan_objmgr_psoc *psoc, bool *value)
1674*5113495bSYour Name {
1675*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1676*5113495bSYour Name 
1677*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1678*5113495bSYour Name 	if (!mlme_obj) {
1679*5113495bSYour Name 		*value = cfg_default(CFG_RETAIN_NOL_ACROSS_REG_DOMAIN);
1680*5113495bSYour Name 		mlme_legacy_err("Failed to get MLME Obj");
1681*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1682*5113495bSYour Name 	}
1683*5113495bSYour Name 
1684*5113495bSYour Name 	*value = mlme_obj->cfg.reg.retain_nol_across_regdmn_update;
1685*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1686*5113495bSYour Name }
1687*5113495bSYour Name 
1688*5113495bSYour Name #ifdef FEATURE_LFR_SUBNET_DETECTION
1689*5113495bSYour Name QDF_STATUS
ucfg_mlme_is_subnet_detection_enabled(struct wlan_objmgr_psoc * psoc,bool * val)1690*5113495bSYour Name ucfg_mlme_is_subnet_detection_enabled(struct wlan_objmgr_psoc *psoc, bool *val)
1691*5113495bSYour Name {
1692*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1693*5113495bSYour Name 
1694*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1695*5113495bSYour Name 	if (!mlme_obj) {
1696*5113495bSYour Name 		*val = cfg_default(CFG_LFR3_ENABLE_SUBNET_DETECTION);
1697*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1698*5113495bSYour Name 	}
1699*5113495bSYour Name 	*val = mlme_obj->cfg.lfr.enable_lfr_subnet_detection;
1700*5113495bSYour Name 
1701*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1702*5113495bSYour Name }
1703*5113495bSYour Name #endif
1704*5113495bSYour Name 
1705*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_current_tx_power_level(struct wlan_objmgr_psoc * psoc,uint8_t value)1706*5113495bSYour Name ucfg_mlme_set_current_tx_power_level(struct wlan_objmgr_psoc *psoc,
1707*5113495bSYour Name 				     uint8_t value)
1708*5113495bSYour Name {
1709*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1710*5113495bSYour Name 
1711*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1712*5113495bSYour Name 	if (!mlme_obj)
1713*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1714*5113495bSYour Name 
1715*5113495bSYour Name 	mlme_obj->cfg.power.current_tx_power_level = value;
1716*5113495bSYour Name 
1717*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1718*5113495bSYour Name }
1719*5113495bSYour Name 
1720*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_current_tx_power_level(struct wlan_objmgr_psoc * psoc,uint8_t * value)1721*5113495bSYour Name ucfg_mlme_get_current_tx_power_level(struct wlan_objmgr_psoc *psoc,
1722*5113495bSYour Name 				     uint8_t *value)
1723*5113495bSYour Name {
1724*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1725*5113495bSYour Name 
1726*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1727*5113495bSYour Name 	if (!mlme_obj) {
1728*5113495bSYour Name 		*value = cfg_default(CFG_CURRENT_TX_POWER_LEVEL);
1729*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1730*5113495bSYour Name 	}
1731*5113495bSYour Name 
1732*5113495bSYour Name 	*value = mlme_obj->cfg.power.current_tx_power_level;
1733*5113495bSYour Name 
1734*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1735*5113495bSYour Name }
1736*5113495bSYour Name 
ucfg_wlan_mlme_get_reg_tpc_info(struct wlan_objmgr_vdev * vdev,struct reg_tpc_power_info * tpc_info)1737*5113495bSYour Name QDF_STATUS ucfg_wlan_mlme_get_reg_tpc_info(struct wlan_objmgr_vdev *vdev,
1738*5113495bSYour Name 					   struct reg_tpc_power_info *tpc_info)
1739*5113495bSYour Name {
1740*5113495bSYour Name 	struct vdev_mlme_obj *mlme_obj;
1741*5113495bSYour Name 
1742*5113495bSYour Name 	mlme_obj = wlan_vdev_mlme_get_cmpt_obj(vdev);
1743*5113495bSYour Name 
1744*5113495bSYour Name 	if (!mlme_obj) {
1745*5113495bSYour Name 		mlme_legacy_err("vdev component object is NULL");
1746*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1747*5113495bSYour Name 	}
1748*5113495bSYour Name 
1749*5113495bSYour Name 	qdf_mem_copy(tpc_info, &mlme_obj->reg_tpc_obj,
1750*5113495bSYour Name 		     sizeof(struct reg_tpc_power_info));
1751*5113495bSYour Name 
1752*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1753*5113495bSYour Name }
1754*5113495bSYour Name 
1755*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_obss_detection_offload_enabled(struct wlan_objmgr_psoc * psoc,uint8_t value)1756*5113495bSYour Name ucfg_mlme_set_obss_detection_offload_enabled(struct wlan_objmgr_psoc *psoc,
1757*5113495bSYour Name 					     uint8_t value)
1758*5113495bSYour Name {
1759*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1760*5113495bSYour Name 
1761*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1762*5113495bSYour Name 	if (!mlme_obj)
1763*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1764*5113495bSYour Name 
1765*5113495bSYour Name 	mlme_obj->cfg.obss_ht40.obss_detection_offload_enabled = value;
1766*5113495bSYour Name 
1767*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1768*5113495bSYour Name }
1769*5113495bSYour Name 
1770*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_bss_color_collision_det_sta(struct wlan_objmgr_psoc * psoc,bool value)1771*5113495bSYour Name ucfg_mlme_set_bss_color_collision_det_sta(struct wlan_objmgr_psoc *psoc,
1772*5113495bSYour Name 					  bool value)
1773*5113495bSYour Name {
1774*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1775*5113495bSYour Name 
1776*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1777*5113495bSYour Name 	if (!mlme_obj)
1778*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1779*5113495bSYour Name 
1780*5113495bSYour Name 	mlme_obj->cfg.obss_ht40.bss_color_collision_det_sta = value;
1781*5113495bSYour Name 
1782*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1783*5113495bSYour Name }
1784*5113495bSYour Name 
1785*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_bss_color_collision_det_support(struct wlan_objmgr_psoc * psoc,bool val)1786*5113495bSYour Name ucfg_mlme_set_bss_color_collision_det_support(struct wlan_objmgr_psoc *psoc,
1787*5113495bSYour Name 					      bool val)
1788*5113495bSYour Name {
1789*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1790*5113495bSYour Name 
1791*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1792*5113495bSYour Name 	if (!mlme_obj)
1793*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1794*5113495bSYour Name 
1795*5113495bSYour Name 	mlme_obj->cfg.obss_ht40.bss_color_collision_det_tgt_support = val;
1796*5113495bSYour Name 
1797*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1798*5113495bSYour Name }
1799*5113495bSYour Name 
1800*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_bss_color_collision_det_support(struct wlan_objmgr_psoc * psoc,bool * val)1801*5113495bSYour Name ucfg_mlme_get_bss_color_collision_det_support(struct wlan_objmgr_psoc *psoc,
1802*5113495bSYour Name 					      bool *val)
1803*5113495bSYour Name {
1804*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1805*5113495bSYour Name 
1806*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1807*5113495bSYour Name 	if (!mlme_obj)
1808*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1809*5113495bSYour Name 
1810*5113495bSYour Name 	*val = mlme_obj->cfg.obss_ht40.bss_color_collision_det_tgt_support;
1811*5113495bSYour Name 
1812*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1813*5113495bSYour Name }
1814*5113495bSYour Name 
1815*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_obss_color_collision_offload_enabled(struct wlan_objmgr_psoc * psoc,uint8_t value)1816*5113495bSYour Name ucfg_mlme_set_obss_color_collision_offload_enabled(
1817*5113495bSYour Name 		struct wlan_objmgr_psoc *psoc, uint8_t value)
1818*5113495bSYour Name {
1819*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1820*5113495bSYour Name 
1821*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1822*5113495bSYour Name 	if (!mlme_obj)
1823*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1824*5113495bSYour Name 
1825*5113495bSYour Name 	mlme_obj->cfg.obss_ht40.obss_color_collision_offload_enabled = value;
1826*5113495bSYour Name 
1827*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1828*5113495bSYour Name }
1829*5113495bSYour Name 
ucfg_mlme_set_restricted_80p80_bw_supp(struct wlan_objmgr_psoc * psoc,bool restricted_80p80_supp)1830*5113495bSYour Name QDF_STATUS ucfg_mlme_set_restricted_80p80_bw_supp(struct wlan_objmgr_psoc *psoc,
1831*5113495bSYour Name 						  bool restricted_80p80_supp)
1832*5113495bSYour Name {
1833*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1834*5113495bSYour Name 
1835*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1836*5113495bSYour Name 	if (!mlme_obj)
1837*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1838*5113495bSYour Name 
1839*5113495bSYour Name 	mlme_obj->cfg.vht_caps.vht_cap_info.restricted_80p80_bw_supp =
1840*5113495bSYour Name 					restricted_80p80_supp;
1841*5113495bSYour Name 
1842*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1843*5113495bSYour Name }
1844*5113495bSYour Name 
ucfg_mlme_get_restricted_80p80_bw_supp(struct wlan_objmgr_psoc * psoc)1845*5113495bSYour Name bool ucfg_mlme_get_restricted_80p80_bw_supp(struct wlan_objmgr_psoc *psoc)
1846*5113495bSYour Name {
1847*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1848*5113495bSYour Name 
1849*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1850*5113495bSYour Name 
1851*5113495bSYour Name 	if (!mlme_obj)
1852*5113495bSYour Name 		return true;
1853*5113495bSYour Name 
1854*5113495bSYour Name 	return mlme_obj->cfg.vht_caps.vht_cap_info.restricted_80p80_bw_supp;
1855*5113495bSYour Name }
1856*5113495bSYour Name 
1857*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_channel_bonding_24ghz(struct wlan_objmgr_psoc * psoc,uint32_t * val)1858*5113495bSYour Name ucfg_mlme_get_channel_bonding_24ghz(struct wlan_objmgr_psoc *psoc,
1859*5113495bSYour Name 				    uint32_t *val)
1860*5113495bSYour Name {
1861*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1862*5113495bSYour Name 
1863*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1864*5113495bSYour Name 	if (!mlme_obj) {
1865*5113495bSYour Name 		*val = cfg_default(CFG_CHANNEL_BONDING_MODE_24GHZ);
1866*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1867*5113495bSYour Name 	}
1868*5113495bSYour Name 	*val = mlme_obj->cfg.feature_flags.channel_bonding_mode_24ghz;
1869*5113495bSYour Name 
1870*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1871*5113495bSYour Name }
1872*5113495bSYour Name 
1873*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_channel_bonding_24ghz(struct wlan_objmgr_psoc * psoc,uint32_t value)1874*5113495bSYour Name ucfg_mlme_set_channel_bonding_24ghz(struct wlan_objmgr_psoc *psoc,
1875*5113495bSYour Name 				    uint32_t value)
1876*5113495bSYour Name {
1877*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1878*5113495bSYour Name 
1879*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1880*5113495bSYour Name 	if (!mlme_obj)
1881*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1882*5113495bSYour Name 
1883*5113495bSYour Name 	mlme_obj->cfg.feature_flags.channel_bonding_mode_24ghz = value;
1884*5113495bSYour Name 
1885*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1886*5113495bSYour Name }
1887*5113495bSYour Name 
1888*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_update_chan_width_allowed(struct wlan_objmgr_psoc * psoc,bool * value)1889*5113495bSYour Name ucfg_mlme_get_update_chan_width_allowed(struct wlan_objmgr_psoc *psoc,
1890*5113495bSYour Name 					   bool *value)
1891*5113495bSYour Name {
1892*5113495bSYour Name 	return wlan_mlme_get_update_chan_width_allowed(psoc, value);
1893*5113495bSYour Name }
1894*5113495bSYour Name 
1895*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_channel_bonding_5ghz(struct wlan_objmgr_psoc * psoc,uint32_t * value)1896*5113495bSYour Name ucfg_mlme_get_channel_bonding_5ghz(struct wlan_objmgr_psoc *psoc,
1897*5113495bSYour Name 				   uint32_t *value)
1898*5113495bSYour Name {
1899*5113495bSYour Name 	return wlan_mlme_get_channel_bonding_5ghz(psoc, value);
1900*5113495bSYour Name }
1901*5113495bSYour Name 
1902*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_channel_bonding_5ghz(struct wlan_objmgr_psoc * psoc,uint32_t value)1903*5113495bSYour Name ucfg_mlme_set_channel_bonding_5ghz(struct wlan_objmgr_psoc *psoc,
1904*5113495bSYour Name 				   uint32_t value)
1905*5113495bSYour Name {
1906*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1907*5113495bSYour Name 
1908*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1909*5113495bSYour Name 	if (!mlme_obj)
1910*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1911*5113495bSYour Name 
1912*5113495bSYour Name 	mlme_obj->cfg.feature_flags.channel_bonding_mode_5ghz = value;
1913*5113495bSYour Name 
1914*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1915*5113495bSYour Name }
1916*5113495bSYour Name 
ucfg_mlme_validate_full_roam_scan_period(uint32_t full_roam_scan_period)1917*5113495bSYour Name bool ucfg_mlme_validate_full_roam_scan_period(uint32_t full_roam_scan_period)
1918*5113495bSYour Name {
1919*5113495bSYour Name 	bool is_valid = true;
1920*5113495bSYour Name 	uint32_t min, max;
1921*5113495bSYour Name 
1922*5113495bSYour Name 	if (!cfg_in_range(CFG_LFR_FULL_ROAM_SCAN_REFRESH_PERIOD,
1923*5113495bSYour Name 			  full_roam_scan_period)) {
1924*5113495bSYour Name 		min = (cfg_min(CFG_LFR_FULL_ROAM_SCAN_REFRESH_PERIOD));
1925*5113495bSYour Name 		max = (cfg_max(CFG_LFR_FULL_ROAM_SCAN_REFRESH_PERIOD));
1926*5113495bSYour Name 		mlme_legacy_err("Full roam scan period value %d is out of range (Min: %d Max: %d)",
1927*5113495bSYour Name 				full_roam_scan_period, min, max);
1928*5113495bSYour Name 		is_valid = false;
1929*5113495bSYour Name 	}
1930*5113495bSYour Name 
1931*5113495bSYour Name 	return is_valid;
1932*5113495bSYour Name }
1933*5113495bSYour Name 
ucfg_mlme_validate_scan_period(struct wlan_objmgr_psoc * psoc,uint32_t roam_scan_period)1934*5113495bSYour Name bool ucfg_mlme_validate_scan_period(struct wlan_objmgr_psoc *psoc,
1935*5113495bSYour Name 				    uint32_t roam_scan_period)
1936*5113495bSYour Name {
1937*5113495bSYour Name 	bool is_valid = true, val = false;
1938*5113495bSYour Name 
1939*5113495bSYour Name 	if (!cfg_in_range(CFG_LFR_EMPTY_SCAN_REFRESH_PERIOD,
1940*5113495bSYour Name 			  roam_scan_period)) {
1941*5113495bSYour Name 		ucfg_mlme_get_connection_roaming_ini_present(psoc, &val);
1942*5113495bSYour Name 		if (val)
1943*5113495bSYour Name 			mlme_legacy_err("Roam scan period value %d msec is out of range (Min: %d msec Max: %d msec)",
1944*5113495bSYour Name 					roam_scan_period,
1945*5113495bSYour Name 					cfg_min(CFG_ROAM_SCAN_FIRST_TIMER) * 1000,
1946*5113495bSYour Name 					cfg_max(CFG_ROAM_SCAN_FIRST_TIMER) * 1000);
1947*5113495bSYour Name 		else
1948*5113495bSYour Name 			mlme_legacy_err("Roam scan period value %d msec is out of range (Min: %d msec Max: %d msec)",
1949*5113495bSYour Name 					roam_scan_period,
1950*5113495bSYour Name 					cfg_min(CFG_LFR_EMPTY_SCAN_REFRESH_PERIOD),
1951*5113495bSYour Name 					cfg_max(CFG_LFR_EMPTY_SCAN_REFRESH_PERIOD));
1952*5113495bSYour Name 		is_valid = false;
1953*5113495bSYour Name 	}
1954*5113495bSYour Name 
1955*5113495bSYour Name 	return is_valid;
1956*5113495bSYour Name }
1957*5113495bSYour Name 
1958*5113495bSYour Name #ifdef FEATURE_WLAN_CH_AVOID_EXT
ucfg_mlme_get_coex_unsafe_chan_nb_user_prefer(struct wlan_objmgr_psoc * psoc)1959*5113495bSYour Name bool ucfg_mlme_get_coex_unsafe_chan_nb_user_prefer(
1960*5113495bSYour Name 		struct wlan_objmgr_psoc *psoc)
1961*5113495bSYour Name {
1962*5113495bSYour Name 	return wlan_mlme_get_coex_unsafe_chan_nb_user_prefer_for_sap(psoc);
1963*5113495bSYour Name }
1964*5113495bSYour Name 
ucfg_mlme_get_coex_unsafe_chan_nb_user_prefer_for_sap(struct wlan_objmgr_psoc * psoc)1965*5113495bSYour Name bool ucfg_mlme_get_coex_unsafe_chan_nb_user_prefer_for_sap(
1966*5113495bSYour Name 		struct wlan_objmgr_psoc *psoc)
1967*5113495bSYour Name {
1968*5113495bSYour Name 	return wlan_mlme_get_coex_unsafe_chan_nb_user_prefer_for_sap(psoc);
1969*5113495bSYour Name }
1970*5113495bSYour Name 
ucfg_mlme_get_coex_unsafe_chan_reg_disable(struct wlan_objmgr_psoc * psoc)1971*5113495bSYour Name bool ucfg_mlme_get_coex_unsafe_chan_reg_disable(
1972*5113495bSYour Name 		struct wlan_objmgr_psoc *psoc)
1973*5113495bSYour Name {
1974*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1975*5113495bSYour Name 
1976*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1977*5113495bSYour Name 	if (!mlme_obj) {
1978*5113495bSYour Name 		mlme_legacy_err("Failed to get MLME Obj");
1979*5113495bSYour Name 		return cfg_default(CFG_COEX_UNSAFE_CHAN_REG_DISABLE);
1980*5113495bSYour Name 	}
1981*5113495bSYour Name 	return mlme_obj->cfg.reg.coex_unsafe_chan_reg_disable;
1982*5113495bSYour Name }
1983*5113495bSYour Name #endif
1984*5113495bSYour Name 
1985*5113495bSYour Name #if defined(CONFIG_AFC_SUPPORT) && defined(CONFIG_BAND_6GHZ)
1986*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_enable_6ghz_sp_mode_support(struct wlan_objmgr_psoc * psoc,bool * value)1987*5113495bSYour Name ucfg_mlme_get_enable_6ghz_sp_mode_support(struct wlan_objmgr_psoc *psoc,
1988*5113495bSYour Name 					  bool *value)
1989*5113495bSYour Name {
1990*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
1991*5113495bSYour Name 
1992*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
1993*5113495bSYour Name 	if (!mlme_obj)
1994*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
1995*5113495bSYour Name 
1996*5113495bSYour Name 	*value = mlme_obj->cfg.reg.enable_6ghz_sp_pwrmode_supp;
1997*5113495bSYour Name 
1998*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
1999*5113495bSYour Name }
2000*5113495bSYour Name 
2001*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_afc_disable_timer_check(struct wlan_objmgr_psoc * psoc,bool * value)2002*5113495bSYour Name ucfg_mlme_get_afc_disable_timer_check(struct wlan_objmgr_psoc *psoc,
2003*5113495bSYour Name 				      bool *value)
2004*5113495bSYour Name {
2005*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
2006*5113495bSYour Name 
2007*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
2008*5113495bSYour Name 	if (!mlme_obj)
2009*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
2010*5113495bSYour Name 
2011*5113495bSYour Name 	*value = mlme_obj->cfg.reg.afc_disable_timer_check;
2012*5113495bSYour Name 
2013*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
2014*5113495bSYour Name }
2015*5113495bSYour Name 
2016*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_afc_disable_request_id_check(struct wlan_objmgr_psoc * psoc,bool * value)2017*5113495bSYour Name ucfg_mlme_get_afc_disable_request_id_check(struct wlan_objmgr_psoc *psoc,
2018*5113495bSYour Name 					   bool *value)
2019*5113495bSYour Name {
2020*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
2021*5113495bSYour Name 
2022*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
2023*5113495bSYour Name 	if (!mlme_obj)
2024*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
2025*5113495bSYour Name 
2026*5113495bSYour Name 	*value = mlme_obj->cfg.reg.afc_disable_request_id_check;
2027*5113495bSYour Name 
2028*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
2029*5113495bSYour Name }
2030*5113495bSYour Name 
2031*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_afc_reg_noaction(struct wlan_objmgr_psoc * psoc,bool * value)2032*5113495bSYour Name ucfg_mlme_get_afc_reg_noaction(struct wlan_objmgr_psoc *psoc, bool *value)
2033*5113495bSYour Name {
2034*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
2035*5113495bSYour Name 
2036*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
2037*5113495bSYour Name 	if (!mlme_obj)
2038*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
2039*5113495bSYour Name 
2040*5113495bSYour Name 	*value = mlme_obj->cfg.reg.is_afc_reg_noaction;
2041*5113495bSYour Name 
2042*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
2043*5113495bSYour Name }
2044*5113495bSYour Name #endif
2045*5113495bSYour Name 
2046*5113495bSYour Name #ifdef CONNECTION_ROAMING_CFG
2047*5113495bSYour Name QDF_STATUS
ucfg_mlme_set_connection_roaming_ini_present(struct wlan_objmgr_psoc * psoc,bool value)2048*5113495bSYour Name ucfg_mlme_set_connection_roaming_ini_present(struct wlan_objmgr_psoc *psoc,
2049*5113495bSYour Name 					     bool value)
2050*5113495bSYour Name {
2051*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
2052*5113495bSYour Name 
2053*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
2054*5113495bSYour Name 	if (!mlme_obj)
2055*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
2056*5113495bSYour Name 
2057*5113495bSYour Name 	mlme_obj->cfg.connection_roaming_ini_flag = value;
2058*5113495bSYour Name 
2059*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
2060*5113495bSYour Name }
2061*5113495bSYour Name 
2062*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_connection_roaming_ini_present(struct wlan_objmgr_psoc * psoc,bool * value)2063*5113495bSYour Name ucfg_mlme_get_connection_roaming_ini_present(struct wlan_objmgr_psoc *psoc,
2064*5113495bSYour Name 					     bool *value)
2065*5113495bSYour Name {
2066*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
2067*5113495bSYour Name 
2068*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
2069*5113495bSYour Name 
2070*5113495bSYour Name 	if (!mlme_obj)
2071*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
2072*5113495bSYour Name 
2073*5113495bSYour Name 	*value = mlme_obj->cfg.connection_roaming_ini_flag;
2074*5113495bSYour Name 
2075*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
2076*5113495bSYour Name }
2077*5113495bSYour Name #endif
2078*5113495bSYour Name 
2079*5113495bSYour Name enum wlan_phymode
ucfg_mlme_get_vdev_phy_mode(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id)2080*5113495bSYour Name ucfg_mlme_get_vdev_phy_mode(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id)
2081*5113495bSYour Name {
2082*5113495bSYour Name 	struct wlan_objmgr_vdev *vdev;
2083*5113495bSYour Name 	struct vdev_mlme_obj *mlme_obj;
2084*5113495bSYour Name 	enum wlan_phymode phymode;
2085*5113495bSYour Name 
2086*5113495bSYour Name 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
2087*5113495bSYour Name 						    WLAN_MLME_OBJMGR_ID);
2088*5113495bSYour Name 	if (!vdev) {
2089*5113495bSYour Name 		mlme_err("get vdev failed for vdev_id: %d", vdev_id);
2090*5113495bSYour Name 		return WLAN_PHYMODE_AUTO;
2091*5113495bSYour Name 	}
2092*5113495bSYour Name 
2093*5113495bSYour Name 	mlme_obj = wlan_vdev_mlme_get_cmpt_obj(vdev);
2094*5113495bSYour Name 	if (!mlme_obj) {
2095*5113495bSYour Name 		mlme_err("failed to get mlme_obj vdev_id: %d", vdev_id);
2096*5113495bSYour Name 		phymode = WLAN_PHYMODE_AUTO;
2097*5113495bSYour Name 		goto done;
2098*5113495bSYour Name 	}
2099*5113495bSYour Name 	phymode = mlme_obj->mgmt.generic.phy_mode;
2100*5113495bSYour Name 
2101*5113495bSYour Name done:
2102*5113495bSYour Name 	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_OBJMGR_ID);
2103*5113495bSYour Name 
2104*5113495bSYour Name 	return phymode;
2105*5113495bSYour Name }
2106*5113495bSYour Name 
2107*5113495bSYour Name QDF_STATUS
ucfg_mlme_get_valid_channels(struct wlan_objmgr_psoc * psoc,uint32_t * ch_freq_list,uint32_t * list_len)2108*5113495bSYour Name ucfg_mlme_get_valid_channels(struct wlan_objmgr_psoc *psoc,
2109*5113495bSYour Name 			     uint32_t *ch_freq_list, uint32_t *list_len)
2110*5113495bSYour Name {
2111*5113495bSYour Name 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
2112*5113495bSYour Name 	uint32_t num_valid_chan;
2113*5113495bSYour Name 	uint8_t i;
2114*5113495bSYour Name 
2115*5113495bSYour Name 	mlme_obj = mlme_get_psoc_ext_obj(psoc);
2116*5113495bSYour Name 	if (!mlme_obj) {
2117*5113495bSYour Name 		*list_len = 0;
2118*5113495bSYour Name 		mlme_legacy_err("Failed to get MLME Obj");
2119*5113495bSYour Name 		return QDF_STATUS_E_FAILURE;
2120*5113495bSYour Name 	}
2121*5113495bSYour Name 
2122*5113495bSYour Name 	num_valid_chan =  mlme_obj->cfg.reg.valid_channel_list_num;
2123*5113495bSYour Name 	if (num_valid_chan > *list_len) {
2124*5113495bSYour Name 		mlme_err("list len size %d less than expected %d", *list_len,
2125*5113495bSYour Name 			 num_valid_chan);
2126*5113495bSYour Name 		num_valid_chan = *list_len;
2127*5113495bSYour Name 	}
2128*5113495bSYour Name 	*list_len = num_valid_chan;
2129*5113495bSYour Name 	for (i = 0; i < *list_len; i++)
2130*5113495bSYour Name 		ch_freq_list[i] = mlme_obj->cfg.reg.valid_channel_freq_list[i];
2131*5113495bSYour Name 
2132*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
2133*5113495bSYour Name }
2134