xref: /wlan-driver/qcacld-3.0/core/sme/inc/sme_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #if !defined(__SME_API_H)
21 #define __SME_API_H
22 
23 /*
24  * file  smeApi.h
25  *
26  * brief prototype for SME APIs
27  */
28 
29 /*--------------------------------------------------------------------------
30   Include Files
31   ------------------------------------------------------------------------*/
32 #include "csr_api.h"
33 #include "qdf_lock.h"
34 #include "qdf_types.h"
35 #include "sir_api.h"
36 #include "cds_regdomain.h"
37 #include "sme_internal.h"
38 #include "wma_tgt_cfg.h"
39 #include "wma_fips_public_structs.h"
40 #include "wma_sar_public_structs.h"
41 #include "wma_if.h"
42 #include "wlan_mlme_public_struct.h"
43 #include "sme_rrm_internal.h"
44 #include "sir_types.h"
45 #include "scheduler_api.h"
46 #include "wlan_serialization_legacy_api.h"
47 #include <qca_vendor.h>
48 #include "wmi_unified.h"
49 #include "wmi_unified_param.h"
50 #include "wlan_cm_roam_public_struct.h"
51 
52 /*--------------------------------------------------------------------------
53   Preprocessor definitions and constants
54   ------------------------------------------------------------------------*/
55 
56 #define sme_alert(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_SME, params)
57 #define sme_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_SME, params)
58 #define sme_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_SME, params)
59 #define sme_info(params...) QDF_TRACE_INFO(QDF_MODULE_ID_SME, params)
60 #define sme_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_SME, params)
61 
62 #define sme_nofl_alert(params...) \
63 	QDF_TRACE_FATAL_NO_FL(QDF_MODULE_ID_SME, params)
64 #define sme_nofl_err(params...) \
65 	QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_SME, params)
66 #define sme_nofl_warn(params...) \
67 	QDF_TRACE_WARN_NO_FL(QDF_MODULE_ID_SME, params)
68 #define sme_nofl_info(params...) \
69 	QDF_TRACE_INFO_NO_FL(QDF_MODULE_ID_SME, params)
70 #define sme_nofl_debug(params...) \
71 	QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_SME, params)
72 
73 #define sme_alert_rl(params...) QDF_TRACE_FATAL_RL(QDF_MODULE_ID_SME, params)
74 #define sme_err_rl(params...) QDF_TRACE_ERROR_RL(QDF_MODULE_ID_SME, params)
75 #define sme_warn_rl(params...) QDF_TRACE_WARN_RL(QDF_MODULE_ID_SME, params)
76 #define sme_info_rl(params...) QDF_TRACE_INFO_RL(QDF_MODULE_ID_SME, params)
77 #define sme_debug_rl(params...) QDF_TRACE_DEBUG_RL(QDF_MODULE_ID_SME, params)
78 
79 #define SME_ENTER() QDF_TRACE_ENTER(QDF_MODULE_ID_SME, "enter")
80 #define SME_EXIT() QDF_TRACE_EXIT(QDF_MODULE_ID_SME, "exit")
81 
82 #define SME_SESSION_ID_ANY        50
83 #define SME_SESSION_ID_BROADCAST  0xFF
84 
85 #define SME_INVALID_COUNTRY_CODE "XX"
86 #define INVALID_ROAM_ID 0
87 
88 #define SME_SET_CHANNEL_REG_POWER(reg_info_1, val) do {	\
89 	reg_info_1 &= 0xff00ffff;	      \
90 	reg_info_1 |= ((val & 0xff) << 16);   \
91 } while (0)
92 
93 #define SME_SET_CHANNEL_MAX_TX_POWER(reg_info_2, val) do { \
94 	reg_info_2 &= 0xffff00ff;	      \
95 	reg_info_2 |= ((val & 0xff) << 8);   \
96 } while (0)
97 
98 #define SME_CONFIG_TO_ROAM_CONFIG 1
99 #define ROAM_CONFIG_TO_SME_CONFIG 2
100 
101 #define NUM_OF_BANDS 2
102 
103 #define SUPPORTED_CRYPTO_CAPS 0x3FFFF
104 
105 #define SME_ACTIVE_LIST_CMD_TIMEOUT_VALUE (30*1000)
106 #define SME_CMD_TIMEOUT_VALUE (SME_ACTIVE_LIST_CMD_TIMEOUT_VALUE + 1000)
107 
108 /* AP start timeout = vdev start + 2 sec */
109 #define SME_CMD_VDEV_START_BSS_TIMEOUT (START_RESPONSE_TIMER + 2000)
110 #define SME_CMD_START_BSS_TIMEOUT (SME_CMD_VDEV_START_BSS_TIMEOUT + 1000)
111 
112 /* AP stop timeout = vdev stop + self peer delete + 1 sec */
113 #define SME_CMD_STOP_BSS_CMD_TIMEOUT (STOP_RESPONSE_TIMER + \
114 				      SIR_DELETE_STA_TIMEOUT + 1000)
115 #define SME_CMD_STOP_BSS_TIMEOUT (SME_CMD_STOP_BSS_CMD_TIMEOUT + 1000)
116 
117 /* Peer disconnect timeout = peer delete + 1 sec */
118 #define SME_CMD_PEER_DISCONNECT_TIMEOUT (SIR_DELETE_STA_TIMEOUT + 1000)
119 #define SME_PEER_DISCONNECT_TIMEOUT (SME_CMD_PEER_DISCONNECT_TIMEOUT + 1000)
120 
121 #define SME_CMD_GET_DISCONNECT_STATS_TIMEOUT 200
122 #define SME_CMD_ADD_DEL_TS_TIMEOUT (4 * 1000)
123 
124 /*
125  * POLICY_MGR_SER_CMD_TIMEOUT should be same as SME_CMD_POLICY_MGR_CMD_TIMEOUT
126  * if SME_CMD_POLICY_MGR_CMD_TIMEOUT is changed change
127  * POLICY_MGR_SER_CMD_TIMEOUT as well.
128  */
129 #define SME_CMD_POLICY_MGR_CMD_TIMEOUT (SIR_VDEV_PLCY_MGR_TIMEOUT + 1000)
130 #define SME_POLICY_MGR_CMD_TIMEOUT (SME_CMD_POLICY_MGR_CMD_TIMEOUT + 1000)
131 
132 #define SME_VDEV_DELETE_CMD_TIMEOUT (DELETE_RESPONSE_TIMER + \
133 				     PEER_DELETE_ALL_RESPONSE_TIMER + 2000)
134 #define SME_CMD_VDEV_CREATE_DELETE_TIMEOUT QDF_MAX(13000, \
135 						SME_VDEV_DELETE_CMD_TIMEOUT + 1)
136 
137 /*--------------------------------------------------------------------------
138   Type declarations
139   ------------------------------------------------------------------------*/
140 struct sme_config_params {
141 	struct csr_config_params csr_config;
142 };
143 
144 #ifdef FEATURE_WLAN_TDLS
145 #define BW_20_OFFSET_BIT   0
146 #define BW_40_OFFSET_BIT   1
147 #define BW_80_OFFSET_BIT   2
148 #define BW_160_OFFSET_BIT  3
149 #endif /* FEATURE_WLAN_TDLS */
150 
151 struct wmi_twt_add_dialog_param;
152 struct wmi_twt_del_dialog_param;
153 
154 /* Thermal Mitigation*/
155 typedef struct {
156 	uint16_t smeMinTempThreshold;
157 	uint16_t smeMaxTempThreshold;
158 } tSmeThermalLevelInfo;
159 
160 typedef enum {
161 	SME_AC_BK = 0,
162 	SME_AC_BE = 1,
163 	SME_AC_VI = 2,
164 	SME_AC_VO = 3
165 } sme_ac_enum_type;
166 
167 /*
168  * Enumeration of the various TSPEC directions
169  * From 802.11e/WMM specifications
170  */
171 enum sme_qos_wmm_dir_type {
172 	SME_QOS_WMM_TS_DIR_UPLINK = 0,
173 	SME_QOS_WMM_TS_DIR_DOWNLINK = 1,
174 	SME_QOS_WMM_TS_DIR_RESV = 2,    /* Reserved */
175 	SME_QOS_WMM_TS_DIR_BOTH = 3,
176 };
177 
178 /**
179  * struct sme_oem_capability - OEM capability to be exchanged between host
180  *                             and userspace
181  * @ftm_rr: FTM range report capability bit
182  * @lci_capability: LCI capability bit
183  * @reserved1: reserved
184  * @reserved2: reserved
185  */
186 struct sme_oem_capability {
187 	uint32_t ftm_rr:1;
188 	uint32_t lci_capability:1;
189 	uint32_t reserved1:30;
190 	uint32_t reserved2;
191 };
192 
193 /**
194  * struct sme_5g_pref_params : 5G preference params to be read from ini
195  * @rssi_boost_threshold_5g: RSSI threshold above which 5 GHz is favored
196  * @rssi_boost_factor_5g: Factor by which 5GHz RSSI is boosted
197  * @max_rssi_boost_5g: Maximum boost that can be applied to 5GHz RSSI
198  * @rssi_penalize_threshold_5g: RSSI threshold below which 5G is not favored
199  * @rssi_penalize_factor_5g: Factor by which 5GHz RSSI is penalized
200  * @max_rssi_penalize_5g: Maximum penalty that can be applied to 5G RSSI
201  */
202 struct sme_5g_band_pref_params {
203 	int8_t      rssi_boost_threshold_5g;
204 	uint8_t     rssi_boost_factor_5g;
205 	uint8_t     max_rssi_boost_5g;
206 	int8_t      rssi_penalize_threshold_5g;
207 	uint8_t     rssi_penalize_factor_5g;
208 	uint8_t     max_rssi_penalize_5g;
209 };
210 
211 #define MAX_CANDIDATE_INFO 10
212 
213 /**
214  * struct bss_candidate_info - Candidate bss information
215  *
216  * @bssid : BSSID of candidate bss
217  * @status : status code for candidate bss
218  */
219 struct bss_candidate_info {
220 	struct qdf_mac_addr bssid;
221 	uint32_t status;
222 };
223 
224 /*
225  * MBO transition reason codes
226  */
227 enum {
228 	MBO_TRANSITION_REASON_UNSPECIFIED,
229 	MBO_TRANSITION_REASON_EXCESSIVE_FRAME_LOSS_RATE,
230 	MBO_TRANSITION_REASON_EXCESSIVE_DELAY_FOR_CURRENT_TRAFFIC,
231 	MBO_TRANSITION_REASON_INSUFFICIENT_BANDWIDTH_FOR_CURRENT_TRAFFIC,
232 	MBO_TRANSITION_REASON_LOAD_BALANCING,
233 	MBO_TRANSITION_REASON_LOW_RSSI,
234 	MBO_TRANSITION_REASON_RECEIVED_EXCESSIVE_RETRANSMISSIONS,
235 	MBO_TRANSITION_REASON_HIGH_INTERFERENCE,
236 	MBO_TRANSITION_REASON_GRAY_ZONE,
237 	MBO_TRANSITION_REASON_TRANSITIONING_TO_PREMIUM_AP,
238 };
239 
240 /*-------------------------------------------------------------------------
241   Function declarations and documentation
242   ------------------------------------------------------------------------*/
243 QDF_STATUS sme_open(mac_handle_t mac_handle);
244 QDF_STATUS sme_init_chan_list(mac_handle_t mac_handle, enum country_src cc_src);
245 QDF_STATUS sme_close(mac_handle_t mac_handle);
246 QDF_STATUS sme_start(mac_handle_t mac_handle);
247 
248 /**
249  * sme_stop() - Stop all SME modules and put them at idle state
250  * @mac_handle: Opaque handle to the MAC context
251  *
252  * The function stops each module in SME. Upon return, all modules are
253  * at idle state ready to start.
254  *
255  * This is a synchronous call
256  *
257  * Return: QDF_STATUS_SUCCESS if SME is stopped.  Other status means
258  *         SME failed to stop one or more modules but caller should
259  *         still consider SME is stopped.
260  */
261 QDF_STATUS sme_stop(mac_handle_t mac_handle);
262 
263 /**
264  * sme_populate_nss_chain_params() - fill vdev nss chain params from ini
265  * @mac_handle: The handle returned by mac_open.
266  * @vdev_ini_cfg: pointer to the structure to be filled
267  * @device_mode: device mode (eg STA, SAP etc.)
268  * @rf_chains_supported: number of chains supported by fw(updated during
269  *                       service ready event)
270  *
271  * This API will fill the nss chain params for the particular vdev from ini
272  * configuration for the respective vdev.
273  *
274  * Return: none
275  */
276 void sme_populate_nss_chain_params(mac_handle_t mac_handle,
277 			     struct wlan_mlme_nss_chains *vdev_ini_cfg,
278 			     enum QDF_OPMODE device_mode,
279 			     uint8_t rf_chains_supported);
280 
281 /**
282  * sme_store_nss_chains_cfg_in_vdev() - fill vdev nss chain params from ini
283  * @vdev: Pointer to vdev obj
284  * @vdev_ini_cfg: pointer to the structure the values are to be filled from
285  *
286  * This API will copy the nss chain params for the particular vdev from ini
287  * configuration to the respective vdev's dynamic, and ini config.
288  *
289  * Return: none
290  */
291 void
292 sme_store_nss_chains_cfg_in_vdev(struct wlan_objmgr_vdev *vdev,
293 				 struct wlan_mlme_nss_chains *vdev_ini_cfg);
294 
295 /**
296  * sme_modify_nss_chains_tgt_cfg() - Change the nss in ini for
297  * particular opmode, and band, according to the chain config supported by FW.
298  * @mac_handle: The handle returned by mac_open.
299  * @vdev_op_mode: vdev operation mode.
300  * @band:- band for which user wants to change nss.
301  *
302  * This API will change the nss in ini (for eg. rx_nss_2g) in the mlme cfg i.e
303  * the global config structure kept in mac context, according to the max
304  * supported chains per band which is got as part of ext service ready event.
305  *
306  * Return: none
307  */
308 void
309 sme_modify_nss_chains_tgt_cfg(mac_handle_t mac_handle,
310 			      enum QDF_OPMODE vdev_op_mode,
311 			      enum nss_chains_band_info band);
312 
313 /**
314  * sme_update_nss_in_mlme_cfg() - Change the nss in ini(rx_nss_(band)) for
315  * particular opmode, and band.
316  * @mac_handle: The handle returned by mac_open.
317  * @rx_nss: new value of rx nss that user wants to change.
318  * @tx_nss: new value of tx nss that user wants to change.
319  * @vdev_op_mode: vdev operation mode.
320  * @band:- band for which user wants to change nss.
321  *
322  * This API will change the nss in ini (for eg. rx_nss_2g) in the mlme cfg i.e
323  * the global config structure kept in mac context.
324  *
325  * Return: none
326  */
327 void
328 sme_update_nss_in_mlme_cfg(mac_handle_t mac_handle,
329 			   uint8_t rx_nss, uint8_t tx_nss,
330 			   enum QDF_OPMODE vdev_op_mode,
331 			   enum nss_chains_band_info band);
332 
333 /**
334  * sme_nss_chains_update() - validate and send the user params to fw
335  * @mac_handle: The handle returned by mac_open.
336  * @user_cfg: pointer to the structure to be validated and sent to fw
337  * @vdev_id: vdev id
338  *
339  *
340  * This API will validate the config, and if found correct will update the
341  * config in dynamic config, and send to the fw.
342  *
343  * Return: QDF_STATUS
344  */
345 QDF_STATUS
346 sme_nss_chains_update(mac_handle_t mac_handle,
347 		      struct wlan_mlme_nss_chains *user_cfg,
348 		      uint8_t vdev_id);
349 
350 /**
351  * sme_update_bfer_caps_as_per_nss_chains() - Update beamformer caps as per nss
352  * chains.
353  * @mac_handle: The handle returned by mac_open
354  * @cfg: wma target config
355  *
356  * This API will update beamformer capability as per nss chains
357  *
358  * Return: None
359  */
360 void
361 sme_update_bfer_caps_as_per_nss_chains(mac_handle_t mac_handle,
362 				       struct wma_tgt_cfg *cfg);
363 
364 /**
365  * sme_vdev_create() - Create vdev for given persona
366  * @mac_handle: The handle returned by mac_open
367  * @vdev_params: params required for vdev creation
368  *
369  * This API will create the object manager vdev and in the same
370  * context vdev mlme object manager notification is invoked, which
371  * will send the vdev create to the firmware.
372  *
373  * If the vdev creation is successful the following object is referenced
374  * by below modules:
375  * 1) WLAN_OBJMGR_ID
376  * 2) WLAN_LEGACY_SME_ID
377  *
378  * Return: Newly created Vdev object or NULL incase in any error
379  */
380 struct wlan_objmgr_vdev *sme_vdev_create(mac_handle_t mac_handle,
381 				  struct wlan_vdev_create_params *vdev_params);
382 
383 
384 /**
385  * sme_vdev_post_vdev_create_setup() - setup the lower layers for the new vdev
386  * @mac_handle: The handle returned by mac_open
387  * @vdev: Object manager vdev
388  *
389  * This api will setup the csr/mlme/wma layer for the newly created vdev.
390  *
391  * If the post vdev setup is successful, we will have following vdev refs
392  * 1) WLAN_OBJMGR_ID  for self peer
393  * 2) WLAN_LEGACY_WMA_ID for vdev
394  *
395  * Return: QDF_STATUS
396  */
397 QDF_STATUS sme_vdev_post_vdev_create_setup(mac_handle_t mac_handle,
398 					   struct wlan_objmgr_vdev *vdev);
399 
400 /**
401  * sme_send_multi_pdev_vdev_set_params() - setup lower layers for the new vdev
402  * @param_type: enum of type mlme_dev_setparam
403  * @dev_id: stores device(pdev/vdev) id
404  * @param: points to an array of @n_params
405  * @n_params: stores number params that we are sending together with @param
406  * Return: QDF_STATUS
407  */
408 QDF_STATUS
409 sme_send_multi_pdev_vdev_set_params(enum mlme_dev_setparam param_type,
410 				    uint8_t dev_id,
411 				    struct dev_set_param *param,
412 				    uint8_t n_params);
413 
414 /**
415  * sme_validate_txrx_chain_mask() - validates txrx chain mask
416  * @paramid: Rx/Tx chain mask param id
417  * @paramvalue: param value
418  *
419  * Return: QDF_STATUS
420  */
421 QDF_STATUS
422 sme_validate_txrx_chain_mask(uint32_t paramid, uint32_t paramvalue);
423 
424 /**
425  * sme_vdev_set_data_tx_callback() - Set dp vdev tx callback
426  * @vdev: Object manager vdev
427  *
428  * This api will setup the dp vdev tx data callbaack.
429  *
430  * Return: QDF_STATUS
431  */
432 QDF_STATUS sme_vdev_set_data_tx_callback(struct wlan_objmgr_vdev *vdev);
433 
434 /**
435  * sme_vdev_delete() - Delete vdev for given id
436  * @mac_handle: The handle returned by mac_open.
437  * @vdev: VDEV Object
438  *
439  * This is a synchronous API. This API needs to be called to delete vdev
440  * in SME module before terminating the session completely.
441  *
442  * The following modules releases their reference to the vdev object:
443  * 1) WLAN_LEGACY_WMA_ID
444  * 2) WLAN_LEGACY_SME_ID
445  *
446  * Return: QDF_STATUS_SUCCESS - vdev is deleted.
447  *         QDF_STATUS_E_INVAL when failed to delete vdev.
448  */
449 QDF_STATUS sme_vdev_delete(mac_handle_t mac_handle,
450 			   struct wlan_objmgr_vdev *vdev);
451 
452 /**
453  * sme_cleanup_session() -  clean up sme session info for vdev
454  * @mac_handle: mac handle
455  * @vdev_id: vdev id
456  *
457  * Return: none
458  */
459 void sme_cleanup_session(mac_handle_t mac_handle, uint8_t vdev_id);
460 
461 /**
462  * sme_update_roam_params() - Store/Update the roaming params
463  * @mac_handle: Opaque handle to the global MAC context
464  * @vdev_id:                  vdev ID
465  * @src_rso_config:           The source to copy
466  * @src_rso_usr_cfg:          The source to copy
467  * @update_param:             Type of parameter to be updated
468  *
469  * Return: Return the status of the updation.
470  */
471 QDF_STATUS sme_update_roam_params(mac_handle_t mac_handle,
472 				  uint8_t vdev_id,
473 				  struct rso_config_params *src_rso_config,
474 				  struct rso_user_config *src_rso_usr_cfg,
475 				  int update_param);
476 QDF_STATUS sme_update_config(mac_handle_t mac_handle,
477 			     struct sme_config_params *pSmeConfigParams);
478 
479 QDF_STATUS sme_set11dinfo(mac_handle_t mac_handle,
480 			  struct sme_config_params *pSmeConfigParams);
481 QDF_STATUS sme_hdd_ready_ind(mac_handle_t mac_handle);
482 
483 #ifdef WLAN_BCN_RECV_FEATURE
484 /*
485  * sme_register_bcn_report_pe_cb() - Register SME callback
486  * @mac_handle: The handle returned by mac_open.
487  * @cb: cb of type beacon_report_cb
488  *
489  * This function Register SME callback in order to send
490  * beacon report to upper layer
491  *
492  * Return QDF_STATUS_SUCCESS -
493  */
494 QDF_STATUS
495 sme_register_bcn_report_pe_cb(mac_handle_t mac_handle, beacon_report_cb cb);
496 #else
497 static inline QDF_STATUS
sme_register_bcn_report_pe_cb(mac_handle_t mac_handle,beacon_report_cb cb)498 sme_register_bcn_report_pe_cb(mac_handle_t mac_handle, beacon_report_cb cb)
499 {
500 	return QDF_STATUS_SUCCESS;
501 }
502 #endif
503 
504 /**
505  * sme_ser_cmd_callback() - callback from serialization module
506  * @cmd: serialization command
507  * @reason: reason why serialization module has given this callback
508  *
509  * Serialization module will give callback to SME for why it triggered
510  * the callback
511  *
512  * Return: QDF_STATUS_SUCCESS
513  */
514 QDF_STATUS sme_ser_cmd_callback(struct wlan_serialization_command *cmd,
515 				enum wlan_serialization_cb_reason reason);
516 
517 /*
518  * sme_process_msg() - The main message processor for SME.
519  * @mac: The global mac context
520  * @msg: The message to be processed.
521  *
522  * This function is called by a message dispatcher when to process a message
523  * targeted for SME.
524  * This is a synchronous call
525  *
526  * Return: QDF_STATUS_SUCCESS - SME successfully processed the message.
527  * Other status means SME failed to process the message to HAL.
528  */
529 QDF_STATUS sme_process_msg(struct mac_context *mac, struct scheduler_msg *pMsg);
530 
531 QDF_STATUS sme_mc_process_handler(struct scheduler_msg *msg);
532 
533 /**
534  * sme_roam_ndi_stop() - API to request stop ndi
535  * @mac_handle: Opaque handle to the global MAC context
536  * @vdev_id: vdev id
537  *
538  * Return: QDF Status success or failure
539  */
540 QDF_STATUS sme_roam_ndi_stop(mac_handle_t mac_handle, uint8_t vdev_id);
541 
542 void sme_dhcp_done_ind(mac_handle_t mac_handle, uint8_t session_id);
543 
544 /*
545  * sme_roam_stop_bss() - To stop BSS for Soft AP. This is an asynchronous API.
546  * @mac_handle - Global structure
547  * @vdev_id - vdev id of SoftAP
548  *
549  * Return: QDF Status success or failure
550  */
551 QDF_STATUS sme_roam_stop_bss(mac_handle_t mac_handle, uint8_t vdev_id);
552 QDF_STATUS sme_roam_disconnect_sta(mac_handle_t mac_handle, uint8_t sessionId,
553 		struct csr_del_sta_params *p_del_sta_params);
554 QDF_STATUS sme_roam_deauth_sta(mac_handle_t mac_handle, uint8_t sessionId,
555 		struct csr_del_sta_params *pDelStaParams);
556 
557 #ifdef MULTI_CLIENT_LL_SUPPORT
558 /**
559  * sme_multi_client_ll_rsp_register_callback() - Register multi client low
560  * latency callback
561  * @mac_handle: Opaque handle to the MAC context
562  * @latency_level_event_handler_cb: Function to be invoked for low latency
563  * event
564  *
565  * Return: QDF_STATUS
566  */
567 QDF_STATUS sme_multi_client_ll_rsp_register_callback(mac_handle_t mac_handle,
568 				void (*latency_level_event_handler_cb)
569 				(const struct latency_level_data *event_data,
570 				 uint8_t vdev_id));
571 
572 /**
573  * sme_multi_client_ll_rsp_deregister_callback() - De Register multi client
574  * low latency callback
575  * @mac_handle: Opaque handle to the MAC context
576  *
577  * Return: void
578  */
579 void sme_multi_client_ll_rsp_deregister_callback(mac_handle_t mac_handle);
580 #else
581 static inline QDF_STATUS
sme_multi_client_ll_rsp_register_callback(mac_handle_t mac_handle,void (* latency_level_event_handler_cb)(const void * event_data,uint8_t vdev_id))582 sme_multi_client_ll_rsp_register_callback(mac_handle_t mac_handle,
583 				void (*latency_level_event_handler_cb)
584 				(const void *event_data,
585 				 uint8_t vdev_id))
586 {
587 	return QDF_STATUS_E_FAILURE;
588 }
589 
590 static inline
sme_multi_client_ll_rsp_deregister_callback(mac_handle_t mac_handle)591 void sme_multi_client_ll_rsp_deregister_callback(mac_handle_t mac_handle)
592 {}
593 #endif
594 
595 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
596 /**
597  * sme_set_roam_scan_ch_event_cb() - Register roam scan ch callback
598  * @mac_handle: Opaque handle to the MAC context
599  * @cb: callback to be registered
600  *
601  * Return: QDF_STATUS
602  */
603 QDF_STATUS
604 sme_set_roam_scan_ch_event_cb(mac_handle_t mac_handle,
605 			      sme_get_raom_scan_ch_callback cb);
606 
607 /**
608  * sme_get_roam_scan_ch() -API to get roam scan channels
609  * @mac_handle: Pointer to mac handle
610  * @sta_id: vdev id
611  * @pcontext: pointer to the context
612  *
613  * Extract number of frequencies and frequency list from chan_info and print
614  * to the logs.
615  *
616  * Return: None
617  */
618 QDF_STATUS
619 sme_get_roam_scan_ch(mac_handle_t mac_handle,
620 		     uint8_t vdev_id, void *pcontext);
621 
622 /**
623  * sme_get_pmk_info(): A wrapper function to request CSR to save PMK
624  * @mac_handle: Global structure
625  * @session_id: SME session_id
626  * @pmk_cache: pointer to a structure of pmk
627  *
628  * Return: none
629  */
630 void sme_get_pmk_info(mac_handle_t mac_handle, uint8_t session_id,
631 		      struct wlan_crypto_pmksa *pmk_cache);
632 
633 /**
634  * sme_roam_set_psk_pmk  - Set the PMK to vdev cache
635  * @mac_handle: Opaque Mac handle
636  * @pmksa:   Pointer to pmksa cache
637  * @vdev_id: Vdev id
638  * @update_to_fw: Send RSO update config command to firmware to update
639  *
640  * Return: QDF_STATUS
641  */
642 QDF_STATUS sme_roam_set_psk_pmk(mac_handle_t mac_handle,
643 				struct wlan_crypto_pmksa *pmksa,
644 				uint8_t vdev_id, bool update_to_fw);
645 
646 /**
647  * sme_set_pmk_cache_ft() - a wrapper function to request CSR to save MDID
648  * This is a synchronous call.
649  * @mac_handle:  Global structure
650  * @session_id:   SME session id
651  * @pmk_cache:    pointer to pmk cache structure wlan_crypto_pmksa
652  *
653  * Return: QDF_STATUS -status whether MDID is set or not
654  */
655 QDF_STATUS sme_set_pmk_cache_ft(mac_handle_t mac_handle, uint8_t vdev_id,
656 				struct wlan_crypto_pmksa *pmk_cache);
657 #else
658 static inline
sme_get_pmk_info(mac_handle_t mac_handle,uint8_t session_id,struct wlan_crypto_pmksa * pmk_cache)659 void sme_get_pmk_info(mac_handle_t mac_handle, uint8_t session_id,
660 		      struct wlan_crypto_pmksa *pmk_cache)
661 {}
662 
663 static inline QDF_STATUS
sme_get_roam_scan_ch(mac_handle_t mac_handle,uint8_t vdev_id,void * pcontext)664 sme_get_roam_scan_ch(mac_handle_t mac_handle,
665 		     uint8_t vdev_id, void *pcontext)
666 {
667 	return QDF_STATUS_E_FAILURE;
668 }
669 
670 static inline QDF_STATUS
sme_set_roam_scan_ch_event_cb(mac_handle_t mac_handle,void * cb)671 sme_set_roam_scan_ch_event_cb(mac_handle_t mac_handle,
672 			      void *cb)
673 {
674 	return QDF_STATUS_E_FAILURE;
675 }
676 
677 static inline
sme_roam_set_psk_pmk(mac_handle_t mac_handle,struct wlan_crypto_pmksa * pmksa,uint8_t vdev_id,bool update_to_fw)678 QDF_STATUS sme_roam_set_psk_pmk(mac_handle_t mac_handle,
679 				struct wlan_crypto_pmksa *pmksa,
680 				uint8_t vdev_id, bool update_to_fw)
681 {
682 	return QDF_STATUS_SUCCESS;
683 }
684 
685 static inline
sme_set_pmk_cache_ft(mac_handle_t mac_handle,uint8_t vdev_id,struct wlan_crypto_pmksa * pmk_cache)686 QDF_STATUS sme_set_pmk_cache_ft(mac_handle_t mac_handle, uint8_t vdev_id,
687 				struct wlan_crypto_pmksa *pmk_cache)
688 {
689 	return QDF_STATUS_SUCCESS;
690 }
691 
692 #endif
693 
694 QDF_STATUS sme_get_config_param(mac_handle_t mac_handle,
695 				struct sme_config_params *pParam);
696 QDF_STATUS sme_get_snr(mac_handle_t mac_handle,
697 		       tCsrSnrCallback callback,
698 		       struct qdf_mac_addr bssId, void *pContext);
699 #ifdef FEATURE_WLAN_ESE
700 QDF_STATUS sme_get_tsm_stats(mac_handle_t mac_handle,
701 		tCsrTsmStatsCallback callback,
702 		struct qdf_mac_addr bssId,
703 		void *pContext, uint8_t tid);
704 QDF_STATUS sme_set_ese_beacon_request(mac_handle_t mac_handle,
705 				      const uint8_t sessionId,
706 				      const tCsrEseBeaconReq *in_req);
707 
708 /**
709  * sme_set_plm_request() - set plm request
710  * @mac_handle: Opaque handle to the global MAC context
711  * @req: Pointer to input plm request
712  *
713  * Return: QDF_STATUS enumeration
714  */
715 QDF_STATUS sme_set_plm_request(mac_handle_t mac_handle,
716 			       struct plm_req_params *req);
717 #endif /*FEATURE_WLAN_ESE */
718 
719 #ifdef FEATURE_OEM_DATA_SUPPORT
720 QDF_STATUS sme_register_oem_data_rsp_callback(mac_handle_t mac_handle,
721 		sme_send_oem_data_rsp_msg callback);
722 void sme_deregister_oem_data_rsp_callback(mac_handle_t mac_handle);
723 
724 #else
725 static inline
sme_register_oem_data_rsp_callback(mac_handle_t mac_handle,void * callback)726 QDF_STATUS sme_register_oem_data_rsp_callback(mac_handle_t mac_handle,
727 					      void *callback)
728 {
729 	return QDF_STATUS_SUCCESS;
730 }
731 
732 static inline
sme_deregister_oem_data_rsp_callback(mac_handle_t mac_handle)733 void sme_deregister_oem_data_rsp_callback(mac_handle_t mac_handle)
734 {
735 }
736 
737 #endif
738 
739 QDF_STATUS sme_generic_change_country_code(mac_handle_t mac_handle,
740 					   uint8_t *pCountry);
741 
742 
743 /**
744  * sme_update_channel_list() - Update configured channel list to fwr
745  * This is a synchronous API.
746  * @mac_handle: Opaque handle to the global MAC context.
747  *
748  * Return: QDF_STATUS  SUCCESS.
749  * FAILURE or RESOURCES  The API finished and failed.
750  */
751 QDF_STATUS sme_update_channel_list(mac_handle_t mac_handle);
752 
753 QDF_STATUS sme_dhcp_start_ind(mac_handle_t mac_handle,
754 		uint8_t device_mode,
755 		uint8_t *macAddr, uint8_t sessionId);
756 QDF_STATUS sme_dhcp_stop_ind(mac_handle_t mac_handle,
757 		uint8_t device_mode,
758 		uint8_t *macAddr, uint8_t sessionId);
759 QDF_STATUS sme_neighbor_report_request(mac_handle_t mac_handle,
760 		 uint8_t sessionId,
761 		tpRrmNeighborReq pRrmNeighborReq,
762 		tpRrmNeighborRspCallbackInfo callbackInfo);
763 
764 /**
765  * sme_register_pagefault_cb() - Register cb to handle host action on pagefault
766  * @mac_handle: Opaque handle to the global MAC context.
767  * @hdd_pagefault_action_cb: Callback which needs to be registered
768  *
769  * Return: None
770  */
771 void
772 sme_register_pagefault_cb(mac_handle_t mac_handle,
773 			  QDF_STATUS (*hdd_pagefault_action_cb)(void *buf,
774 								uint32_t buf_len));
775 
776 /**
777  * sme_deregister_ssr_on_pagefault_cb() - Deregister cb to trigger SSR on
778  * pagefault
779  * @mac_handle: Opaque handle to the global MAC context.
780  *
781  * Return: None
782  */
783 void sme_deregister_ssr_on_pagefault_cb(mac_handle_t mac_handle);
784 
785 #ifdef FEATURE_OEM_DATA
786 /**
787  * sme_oem_data_cmd() - the wrapper to send oem data cmd to wma
788  * @mac_handle: Opaque handle to the global MAC context.
789  * @@oem_data_event_handler_cb: callback to be registered
790  * @oem_data: the pointer of oem data
791  * @vdev id: vdev id to fetch adapter
792  *
793  * Return: QDF_STATUS
794  */
795 QDF_STATUS sme_oem_data_cmd(mac_handle_t mac_handle,
796 			    void (*oem_data_event_handler_cb)
797 			    (const struct oem_data *oem_event_data,
798 			     uint8_t vdev_id),
799 			     struct oem_data *oem_data,
800 			     uint8_t vdev_id);
801 
802 /**
803  * sme_oem_event_deinit() - function to deregister cb for oem event
804  * @mac_handle: Opaque handle to the global MAC context
805  *
806  * Return: None
807  */
808 void sme_oem_event_deinit(mac_handle_t mac_handle);
809 
810 /**
811  * sme_async_oem_event_init() - function to register cb for async oem event
812  * @mac_handle: Opaque handle to the global MAC context
813  * @@oem_data_async_event_handler_cb: callback to be registered
814  *
815  * Return: None
816  */
817 void sme_async_oem_event_init(mac_handle_t mac_handle,
818 			      void (*oem_data_async_event_handler_cb)
819 			      (const struct oem_data *oem_event_data));
820 /**
821  * sme_async_oem_event_deinit() - function to deregister cb for async oem event
822  * @mac_handle: Opaque handle to the global MAC context
823  *
824  * Return: None
825  */
826 void sme_async_oem_event_deinit(mac_handle_t mac_handle);
827 #else
sme_async_oem_event_init(mac_handle_t mac_handle,void (* oem_data_async_event_handler_cb)(void * oem_event_data))828 static inline void sme_async_oem_event_init(
829 				mac_handle_t mac_handle,
830 				void (*oem_data_async_event_handler_cb)
831 				(void *oem_event_data))
832 {
833 }
834 
sme_async_oem_event_deinit(mac_handle_t mac_handle)835 static inline void sme_async_oem_event_deinit(mac_handle_t mac_handle)
836 {
837 }
838 #endif
839 
840 #ifdef FEATURE_OEM_DATA_SUPPORT
841 /**
842  * sme_oem_req_cmd() - send oem request cmd to WMA
843  * @mac_handle: Opaque handle to the global MAC context
844  * @oem_req: OEM data request
845  *
846  * Return: QDF_STATUS
847  */
848 QDF_STATUS sme_oem_req_cmd(mac_handle_t mac_handle,
849 			   struct oem_data_req *oem_req);
850 QDF_STATUS sme_oem_update_capability(mac_handle_t mac_handle,
851 				     struct sme_oem_capability *cap);
852 QDF_STATUS sme_oem_get_capability(mac_handle_t mac_handle,
853 				  struct sme_oem_capability *cap);
854 #endif /*FEATURE_OEM_DATA_SUPPORT */
855 QDF_STATUS sme_change_mcc_beacon_interval(uint8_t sessionId);
856 QDF_STATUS sme_set_host_offload(mac_handle_t mac_handle, uint8_t sessionId,
857 		struct sir_host_offload_req *pRequest);
858 QDF_STATUS sme_set_keep_alive(mac_handle_t mac_handle, uint8_t sessionId,
859 		struct keep_alive_req *pRequest);
860 QDF_STATUS sme_get_operation_channel(mac_handle_t mac_handle,
861 				     uint32_t *chan_freq,
862 				     uint8_t sessionId);
863 QDF_STATUS sme_register_mgmt_frame(mac_handle_t mac_handle, uint8_t sessionId,
864 		uint16_t frameType, uint8_t *matchData,
865 		uint16_t matchLen);
866 QDF_STATUS sme_deregister_mgmt_frame(mac_handle_t mac_handle,
867 				     uint8_t sessionId,
868 				     uint16_t frameType, uint8_t *matchData,
869 				     uint16_t matchLen);
870 /**
871  * sme_change_sap_csa_count() - Set CSA count
872  * @count: CSA count to be set
873  *
874  * Routine sets CSA count in CSA IE when channel switch
875  * is triggered
876  *
877  * Return: QDF_STATUS
878  */
879 QDF_STATUS sme_change_sap_csa_count(uint8_t count);
880 #ifdef WLAN_FEATURE_EXTWOW_SUPPORT
881 QDF_STATUS sme_configure_ext_wow(mac_handle_t mac_handle,
882 		tpSirExtWoWParams wlanExtParams,
883 		csr_readyToSuspendCallback callback,
884 		void *callbackContext);
885 QDF_STATUS sme_configure_app_type1_params(mac_handle_t mac_handle,
886 		tpSirAppType1Params wlanAppType1Params);
887 QDF_STATUS sme_configure_app_type2_params(mac_handle_t mac_handle,
888 		tpSirAppType2Params wlanAppType2Params);
889 #endif
890 /**
891  * sme_get_beaconing_concurrent_operation_channel() - To get concurrent
892  * operating channel frequency of beaconing interface
893  * @mac_handle: Pointer to mac context
894  * @vdev_id_to_skip: channel of which vdev id to skip
895  *
896  * This routine will return operating channel of active AP/GO channel
897  * and will skip the channel of vdev_id_to_skip.
898  * If other no requested mode is active it will return 0
899  *
900  * Return: uint32_t
901  */
902 uint32_t sme_get_beaconing_concurrent_operation_channel(mac_handle_t mac_handle,
903 						       uint8_t vdev_id_to_skip);
904 #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
905 /**
906  * sme_check_concurrent_channel_overlap() - Get interfering concurrent channel
907  * @mac_handle: SAP context pointer
908  * @sap_ch_freq: SAP home channel frequency
909  * @sapPhyMode: sap phymode
910  * @cc_switch_mode: force scc channel switch mode
911  * @vdev_id: vdev id
912  *
913  * Determine if a concurrent channel is interfering.
914  *
915  * Return: Channel freq (Mhz) of the interfering channel, or 0 if none.
916  */
917 uint16_t sme_check_concurrent_channel_overlap(mac_handle_t mac_handle,
918 					      uint16_t sap_ch_freq,
919 					      eCsrPhyMode sapPhyMode,
920 					      uint8_t cc_switch_mode,
921 					      uint8_t vdev_id);
922 #endif
923 
924 /**
925  * sme_get_cfg_valid_channels() - To get valid channel list
926  * @valid_ch_freq: pointer to array which save the valid channel list
927  * @len: the length of the valid channel list
928  *
929  * Return: QDF status
930  */
931 QDF_STATUS sme_get_cfg_valid_channels(uint32_t *valid_ch_freq, uint32_t *len);
932 
933 #ifdef WLAN_FEATURE_PACKET_FILTERING
934 QDF_STATUS sme_8023_multicast_list(mac_handle_t mac_handle, uint8_t sessionId,
935 		tpSirRcvFltMcAddrList pMulticastAddrs);
936 #endif /* WLAN_FEATURE_PACKET_FILTERING */
937 uint16_t sme_chn_to_freq(uint8_t chanNum);
938 
939 /*
940  * sme_is_channel_valid() - validate a channel against current regdmn
941  * To check if the channel is valid for currently established domain
942  *   This is a synchronous API.
943  *
944  * mac_handle - The handle returned by mac_open.
945  * chan_freq - channel to verify
946  *
947  * Return: true/false, true if channel is valid
948  */
949 bool sme_is_channel_valid(mac_handle_t mac_handle, uint32_t chan_freq);
950 
951 QDF_STATUS sme_set_max_tx_power(mac_handle_t mac_handle,
952 				struct qdf_mac_addr pBssid,
953 				struct qdf_mac_addr pSelfMacAddress, int8_t dB);
954 QDF_STATUS sme_set_max_tx_power_per_band(enum band_info band, int8_t db);
955 QDF_STATUS sme_set_tx_power(mac_handle_t mac_handle, uint8_t sessionId,
956 		struct qdf_mac_addr bssid,
957 		enum QDF_OPMODE dev_mode, int power);
958 QDF_STATUS sme_set_custom_mac_addr(tSirMacAddr customMacAddr);
959 QDF_STATUS sme_hide_ssid(mac_handle_t mac_handle, uint8_t sessionId,
960 		uint8_t ssidHidden);
961 
962 /**
963  * sme_set_listen_interval() - Set the listen interval
964  * @mac_handle: The handle returned by mac_open
965  * @vdev_id: vdev identifier
966  *
967  * Return: None
968  */
969 void sme_set_listen_interval(mac_handle_t mac_handle, uint8_t vdev_id);
970 
971 /**
972  * sme_update_roam_scan_n_probes() - Update no.of roam scan probes
973  * @mac_handle: The handle returned by mac_open
974  * @vdev_id: vdev identifier
975  * @probes: number of probe requests to be sent out
976  *
977  * Return: QDF_STATUS
978  */
979 QDF_STATUS sme_update_roam_scan_n_probes(mac_handle_t mac_handle,
980 					 uint8_t vdev_id,
981 					 const uint8_t probes);
982 
983 /**
984  * sme_update_roam_scan_home_away_time() - Update roam scan Home away time
985  * @mac_handle: Opaque handle to the global MAC context
986  * @vdev_id: vdev identifier
987  * @roam_scan_home_away_time: Scan home away time
988  * @send_offload_cmd: If it's true, the command is sent to firmware,
989  *		      otherwise the command is not sent to firmware
990  *
991  * Return: QDF_STATUS
992  */
993 QDF_STATUS
994 sme_update_roam_scan_home_away_time(mac_handle_t mac_handle, uint8_t vdev_id,
995 				    const uint16_t roam_scan_home_away_time,
996 				    const bool send_offload_cmd);
997 
998 /**
999  * sme_get_roam_scan_n_probes() - get Roam scan number of probes
1000  * @mac_handle: The handle returned by mac_open
1001  * @vdev_id: vdev identifier
1002  * @roam_scan_n_probes: Buffer to fill the number of probes.
1003  *			Valid only if the return status is success.
1004  *
1005  * Return: QDF_STATUS
1006  */
1007 QDF_STATUS sme_get_roam_scan_n_probes(mac_handle_t mac_handle, uint8_t vdev_id,
1008 				      uint8_t *roam_scan_n_probes);
1009 
1010 /**
1011  * sme_update_roam_rssi_diff() - Update RoamRssiDiff
1012  * @mac_handle: Opaque handle to the global MAC context
1013  * @vdev_id: vdev identifier
1014  * @roam_rssi_diff: Minimum rssi difference between potential candidate and
1015  *		    current AP.
1016  *
1017  * Return: QDF_STATUS
1018  */
1019 QDF_STATUS sme_update_roam_rssi_diff(mac_handle_t mac_handle, uint8_t vdev_id,
1020 				     uint8_t roam_rssi_diff);
1021 
1022 QDF_STATUS sme_update_wes_mode(mac_handle_t mac_handle, bool isWESModeEnabled,
1023 		uint8_t sessionId);
1024 
1025 QDF_STATUS sme_update_is_fast_roam_ini_feature_enabled(mac_handle_t mac_handle,
1026 		uint8_t sessionId,
1027 		const bool
1028 		isFastRoamIniFeatureEnabled);
1029 
1030 QDF_STATUS sme_stop_roaming(mac_handle_t mac_handle, uint8_t sessionId,
1031 			    uint8_t reason,
1032 			    enum wlan_cm_rso_control_requestor requestor);
1033 
1034 QDF_STATUS sme_start_roaming(mac_handle_t mac_handle, uint8_t sessionId,
1035 			     uint8_t reason,
1036 			     enum wlan_cm_rso_control_requestor requestor);
1037 
1038 /**
1039  * sme_roaming_in_progress() - check if roaming is in progress
1040  * @mac_handle - The handle returned by mac_open
1041  * @vdev_id: vdev id
1042  *
1043  * Return: true or false
1044  */
1045 bool sme_roaming_in_progress(mac_handle_t mac_handle, uint8_t vdev_id);
1046 
1047 #ifdef FEATURE_WLAN_ESE
1048 QDF_STATUS sme_update_is_ese_feature_enabled(mac_handle_t mac_handle,
1049 					     uint8_t sessionId,
1050 					     const bool isEseIniFeatureEnabled);
1051 #endif /* FEATURE_WLAN_ESE */
1052 QDF_STATUS sme_set_roam_rescan_rssi_diff(mac_handle_t mac_handle,
1053 		uint8_t sessionId,
1054 		const uint8_t nRoamRescanRssiDiff);
1055 
1056 QDF_STATUS sme_set_roam_opportunistic_scan_threshold_diff(
1057 		mac_handle_t mac_handle,
1058 		uint8_t sessionId,
1059 		const uint8_t nOpportunisticThresholdDiff);
1060 
1061 /**
1062  * sme_set_neighbor_lookup_rssi_threshold() - update neighbor lookup rssi thr
1063  * @mac_handle: The handle returned by mac_open
1064  * @vdev_id: vdev identifier
1065  * @neighbor_lookup_rssi_threshold: Neighbor lookup rssi threshold
1066  *
1067  * Return: QDF_STATUS
1068  */
1069 QDF_STATUS
1070 sme_set_neighbor_lookup_rssi_threshold(mac_handle_t mac_handle,
1071 				       uint8_t vdev_id,
1072 				       uint8_t neighbor_lookup_rssi_threshold);
1073 
1074 QDF_STATUS sme_set_neighbor_scan_refresh_period(mac_handle_t mac_handle,
1075 		uint8_t sessionId, uint16_t neighborScanResultsRefreshPeriod);
1076 
1077 QDF_STATUS sme_update_empty_scan_refresh_period(mac_handle_t mac_handle,
1078 		uint8_t sessionId, uint16_t empty_scan_refresh_period);
1079 /**
1080  * sme_update_full_roam_scan_period() - Send full roam scan period to SME
1081  * @mac_handle: Opaque handle to the MAC context
1082  * @vdev_id: vdev id
1083  * @full_roam_scan_period: Idle period in seconds between two successive
1084  * full channel roam scans
1085  *
1086  * Updated full scan period in roam info and a roam_offload_scan request.
1087  *
1088  * Return: QDF_STATUS
1089  */
1090 QDF_STATUS sme_update_full_roam_scan_period(mac_handle_t mac_handle,
1091 					    uint8_t vdev_id,
1092 					    uint32_t full_roam_scan_period);
1093 
1094 /**
1095  * sme_modify_roam_cand_sel_criteria() - Modify candidate selection criteria
1096  * @mac_handle: Opaque handle to the global MAC context
1097  * @vdev_id: vdev Identifier
1098  * @enable_scoring_for_roam: Carries enable/disable indication
1099  *
1100  * Enable/disable scoring for roam candidate selection based on the value of
1101  * enable_scoring_for_roam. Below is the description of enable/disable,
1102  * Disable-0: Disable scoring for roam candidate selection. Roaming
1103  *	      shall fallback to legacy selection criteria, only RSSI.
1104  * Enable-1 : Enable scoring for roam candidate selection.
1105  *
1106  * Return: Success or failure
1107  */
1108 QDF_STATUS
1109 sme_modify_roam_cand_sel_criteria(mac_handle_t mac_handle,
1110 				  uint8_t vdev_id,
1111 				  bool enable_scoring_for_roam);
1112 
1113 /**
1114  * sme_roam_control_restore_default_config - Restore roam config to default
1115  * @mac_handle: Opaque handle to the global MAC context
1116  * @vdev_id: vdev Identifier
1117  *
1118  * Restore enable_scoring_for_roam, emptyScanRefreshPeriod,
1119  * full_roam_scan_period to their default values and send RSO command to
1120  * firmware with the updated values.
1121  *
1122  * Return: Success or failure
1123  */
1124 QDF_STATUS sme_roam_control_restore_default_config(mac_handle_t mac_handle,
1125 						   uint8_t vdev_id);
1126 
1127 QDF_STATUS sme_set_neighbor_scan_min_chan_time(mac_handle_t mac_handle,
1128 		const uint16_t nNeighborScanMinChanTime,
1129 		uint8_t sessionId);
1130 QDF_STATUS sme_set_neighbor_scan_max_chan_time(mac_handle_t mac_handle,
1131 				uint8_t sessionId,
1132 				const uint16_t nNeighborScanMaxChanTime);
1133 uint32_t sme_get_current_roam_state(mac_handle_t mac_handle, uint8_t sessionId);
1134 uint32_t sme_get_current_roam_sub_state(mac_handle_t mac_handle,
1135 					uint8_t sessionId);
1136 uint32_t sme_get_lim_sme_state(mac_handle_t mac_handle);
1137 uint32_t sme_get_lim_mlm_state(mac_handle_t mac_handle);
1138 bool sme_is_lim_session_valid(mac_handle_t mac_handle, uint8_t sessionId);
1139 uint32_t sme_get_lim_sme_session_state(mac_handle_t mac_handle,
1140 				       uint8_t sessionId);
1141 uint32_t sme_get_lim_mlm_session_state(mac_handle_t mac_handle,
1142 				       uint8_t sessionId);
1143 QDF_STATUS sme_set_neighbor_scan_period(mac_handle_t mac_handle,
1144 		uint8_t sessionId,
1145 		const uint16_t nNeighborScanPeriod);
1146 QDF_STATUS sme_set_roam_bmiss_first_bcnt(mac_handle_t mac_handle,
1147 		uint8_t sessionId, const uint8_t nRoamBmissFirstBcnt);
1148 QDF_STATUS sme_set_roam_bmiss_final_bcnt(mac_handle_t mac_handle,
1149 					 uint8_t sessionId,
1150 					 const uint8_t nRoamBmissFinalBcnt);
1151 QDF_STATUS sme_change_roam_scan_channel_list(mac_handle_t mac_handle,
1152 					     uint8_t sessionId,
1153 					     uint32_t *channel_freq_list,
1154 					     uint8_t numChannels);
1155 
1156 /**
1157  * sme_update_roam_scan_freq_list() - Update roam scan freq list
1158  * @mac_handle: Opaque handle to the global MAC context
1159  * @vdev_id: vdev identifier
1160  * @freq_list: List of frequencies to be configured
1161  * @num_channels: Number of frequencies to be configured
1162  * @freq_list_type: Type of frequency list to be configured to
1163  *
1164  * Update the frequencies from freq_list to the corresponding channel list
1165  * in neighborRoamInfo
1166  *
1167  * Return: QDF_STATUS
1168  */
1169 QDF_STATUS
1170 sme_update_roam_scan_freq_list(mac_handle_t mac_handle, uint8_t vdev_id,
1171 			       uint32_t *freq_list, uint8_t num_chan,
1172 			       uint32_t freq_list_type);
1173 QDF_STATUS sme_get_roam_scan_channel_list(mac_handle_t mac_handle,
1174 					  uint32_t *freq_list,
1175 					  uint8_t *pNumChannels,
1176 					  uint8_t sessionId);
1177 
1178 bool sme_is_feature_supported_by_fw(enum cap_bitmap feature);
1179 
1180 QDF_STATUS sme_set_phy_mode(mac_handle_t mac_handle, eCsrPhyMode phyMode);
1181 eCsrPhyMode sme_get_phy_mode(mac_handle_t mac_handle);
1182 uint32_t sme_get_11b_data_duration(mac_handle_t mac_handle,
1183 				   uint32_t chan_freq);
1184 
1185 QDF_STATUS sme_add_periodic_tx_ptrn(mac_handle_t mac_handle,
1186 		tSirAddPeriodicTxPtrn *addPeriodicTxPtrnParams);
1187 QDF_STATUS sme_del_periodic_tx_ptrn(mac_handle_t mac_handle,
1188 		tSirDelPeriodicTxPtrn *delPeriodicTxPtrnParams);
1189 QDF_STATUS sme_send_rate_update_ind(mac_handle_t mac_handle,
1190 		tSirRateUpdateInd *rateUpdateParams);
1191 void sme_get_command_q_status(mac_handle_t mac_handle);
1192 
1193 /**
1194  * sme_set_wlm_latency_level() - Used to set the latency level to fw
1195  * @mac_handle: mac handle
1196  * @vdev_id: vdev id
1197  * @latency_level: latency level to be set in FW
1198  * @client_id_bitmap: client id bitmap
1199  * @force_reset: flag to reset latency level
1200  *
1201  * Return QDF_STATUS
1202  */
1203 QDF_STATUS sme_set_wlm_latency_level(mac_handle_t mac_handle,
1204 				uint16_t vdev_id, uint16_t latency_level,
1205 				uint32_t client_id_bitmap,
1206 				bool force_reset);
1207 
1208 /*
1209  * SME API to enable/disable idle mode powersave
1210  * This should be called only if powersave offload
1211  * is enabled
1212  */
1213 QDF_STATUS sme_set_idle_powersave_config(bool value);
1214 QDF_STATUS sme_notify_modem_power_state(mac_handle_t mac_handle,
1215 					uint32_t value);
1216 
1217 /**
1218  * sme_set_peer_ampdu() - API to set peer A-MPDU count to target
1219  * @mac_handle: mac handle
1220  * @vdev_id: vdev id
1221  * @peer_mac: peer mac address
1222  * @cfg: A-MPDU count to configure
1223  *
1224  * Return: 0 if success, otherwise error code
1225  */
1226 int sme_set_peer_ampdu(mac_handle_t mac_handle, uint8_t vdev_id,
1227 		       struct qdf_mac_addr *peer_mac, uint16_t cfg);
1228 
1229 /*SME API to convert convert the ini value to the ENUM used in csr and MAC*/
1230 ePhyChanBondState sme_get_cb_phy_state_from_cb_ini_value(uint32_t cb_ini_value);
1231 int sme_update_ht_config(mac_handle_t mac_handle, uint8_t sessionId,
1232 			 uint16_t htCapab,
1233 			 int value);
1234 int16_t sme_get_ht_config(mac_handle_t mac_handle, uint8_t session_id,
1235 			  uint16_t ht_capab);
1236 #ifdef QCA_HT_2040_COEX
1237 QDF_STATUS sme_notify_ht2040_mode(mac_handle_t mac_handle,
1238 				  struct qdf_mac_addr macAddrSTA,
1239 				  uint8_t sessionId,
1240 				  uint8_t channel_type);
1241 QDF_STATUS sme_set_ht2040_mode(mac_handle_t mac_handle, uint8_t sessionId,
1242 			       uint8_t channel_type, bool obssEnabled);
1243 
1244 /**
1245  * sme_get_ht2040_mode() - get ht operation mode
1246  * @mac_handle: pointer to mac context
1247  * @vdev_id: vdev id
1248  * @channel_type: channel type to provide
1249  *
1250  * Return QDF_STATUS
1251  */
1252 QDF_STATUS sme_get_ht2040_mode(mac_handle_t mac_handle, uint8_t vdev_id,
1253 			       enum eSirMacHTChannelType *channel_type);
1254 #endif
1255 
1256 /**
1257  * sme_get_reg_info() - To get tx power information
1258  * @mac_handle: Opaque handle to the global MAC context
1259  * @chan_freq: channel freq
1260  * @regInfo1: first reg info to fill
1261  * @regInfo2: second reg info to fill
1262  *
1263  * This routine will give you tx power information
1264  *
1265  * Return: QDF_STATUS
1266  */
1267 QDF_STATUS sme_get_reg_info(mac_handle_t mac_handle, uint32_t chan_freq,
1268 			    uint32_t *regInfo1, uint32_t *regInfo2);
1269 
1270 #ifdef FEATURE_WLAN_CH_AVOID
1271 QDF_STATUS sme_ch_avoid_update_req(mac_handle_t mac_handle);
1272 #else
1273 static inline
sme_ch_avoid_update_req(mac_handle_t mac_handle)1274 QDF_STATUS sme_ch_avoid_update_req(mac_handle_t mac_handle)
1275 {
1276 	return QDF_STATUS_SUCCESS;
1277 }
1278 #endif
1279 #ifdef FEATURE_WLAN_AUTO_SHUTDOWN
1280 /**
1281  * sme_set_auto_shutdown_cb() - Register auto shutdown evt handler
1282  * @mac_handle: Handle to the global MAC context
1283  * @callback_fn: callback function to be invoked when an auto shutdown
1284  *               event is received
1285  *
1286  * Return: QDF_STATUS
1287  */
1288 QDF_STATUS sme_set_auto_shutdown_cb(mac_handle_t mac_handle,
1289 				    void (*callback_fn)(void));
1290 
1291 QDF_STATUS sme_set_auto_shutdown_timer(mac_handle_t mac_handle,
1292 				       uint32_t timer_value);
1293 #endif
1294 
1295 QDF_STATUS sme_roam_start_beacon_req(mac_handle_t mac_handle,
1296 				     struct qdf_mac_addr bssid,
1297 				     uint8_t dfsCacWaitStatus);
1298 
1299 QDF_STATUS sme_csa_restart(struct mac_context *mac_ctx, uint8_t session_id);
1300 
1301 /**
1302  * sme_roam_csa_ie_request() - request CSA IE transmission from PE
1303  * @mac_handle: handle returned by mac_open
1304  * @bssid: SAP bssid
1305  * @target_chan_freq: target channel frequency information
1306  * @csaIeReqd: CSA IE Request
1307  * @ch_params: channel information
1308  * @new_cac_ms: cac duration of new channel
1309  *
1310  * Return: QDF_STATUS
1311  */
1312 QDF_STATUS sme_roam_csa_ie_request(mac_handle_t mac_handle,
1313 				   struct qdf_mac_addr bssid,
1314 				   uint32_t target_chan_freq, uint8_t csaIeReqd,
1315 				   struct ch_params *ch_params,
1316 				   uint32_t new_cac_ms);
1317 
1318 /**
1319  * sme_set_addba_accept() - Allow/Reject the ADDBA req session
1320  * @mac_handle: handle returned by mac_open
1321  * @session_id: sme session id
1322  * @value: Allow/Reject AddBA session
1323  *
1324  * Allows/Rejects the ADDBA req session
1325  *
1326  * Return: 0 on success else errno
1327  */
1328 int sme_set_addba_accept(mac_handle_t mac_handle, uint8_t session_id,
1329 			 int value);
1330 
1331 QDF_STATUS sme_init_thermal_info(mac_handle_t mac_handle);
1332 
1333 QDF_STATUS sme_set_thermal_level(mac_handle_t mac_handle, uint8_t level);
1334 QDF_STATUS sme_txpower_limit(mac_handle_t mac_handle,
1335 			     struct tx_power_limit *psmetx);
1336 
1337 /**
1338  * sme_get_link_speed() - Retrieve current link speed
1339  * @mac_handle: Global MAC handle
1340  * @req: Link speed request structure
1341  * @context: User context to be passed back when invoking @cb
1342  * @cb: Callback function to be invoked with link speed results
1343  *
1344  * Return: QDF_STATUS_SUCCESS if the request was accepted, otherwise
1345  * an appropriate error status.
1346  */
1347 QDF_STATUS sme_get_link_speed(mac_handle_t mac_handle,
1348 			      struct link_speed_info *req,
1349 			      void *context,
1350 			      sme_link_speed_cb cb);
1351 
1352 QDF_STATUS sme_modify_add_ie(mac_handle_t mac_handle,
1353 		tSirModifyIE *pModifyIE, eUpdateIEsType updateType);
1354 QDF_STATUS sme_update_add_ie(mac_handle_t mac_handle,
1355 		tSirUpdateIE *pUpdateIE, eUpdateIEsType updateType);
1356 QDF_STATUS sme_update_connect_debug(mac_handle_t mac_handle,
1357 				    uint32_t set_value);
1358 
1359 /**
1360  * sme_bss_type_to_string() - converts bss type to string.
1361  * @bss_type: bss type enum
1362  *
1363  * Return: printable string for bss type
1364  */
1365 const char *sme_bss_type_to_string(const uint8_t bss_type);
1366 QDF_STATUS sme_ap_disable_intra_bss_fwd(mac_handle_t mac_handle,
1367 					uint8_t sessionId,
1368 					bool disablefwd);
1369 
1370 /**
1371  * sme_send_unit_test_cmd() - send unit test command to lower layer
1372  * @session_id: sme session id to be filled while forming the command
1373  * @module_id: module id given by user to be filled in the command
1374  * @arg_count: number of argument count
1375  * @arg: pointer to argument list
1376  *
1377  * This API exposed to HDD layer which takes the argument from user and sends
1378  * down to lower layer for further processing
1379  *
1380  * Return: QDF_STATUS based on overall success
1381  */
1382 QDF_STATUS sme_send_unit_test_cmd(uint32_t vdev_id, uint32_t module_id,
1383 				  uint32_t arg_count, uint32_t *arg);
1384 
1385 typedef struct sStatsExtRequestReq {
1386 	uint32_t request_data_len;
1387 	uint8_t *request_data;
1388 } tStatsExtRequestReq, *tpStatsExtRequestReq;
1389 
1390 #ifdef WLAN_FEATURE_STATS_EXT
1391 /**
1392  * sme_stats_ext_register_callback() - Register stats ext callback
1393  * @mac_handle: Opaque handle to the MAC context
1394  * @callback: Function to be invoked for stats ext events
1395  *
1396  * This function is called to register the callback that send vendor
1397  * event for stats ext
1398  */
1399 void sme_stats_ext_register_callback(mac_handle_t mac_handle,
1400 				     stats_ext_cb callback);
1401 
1402 /**
1403  * sme_stats_ext_deregister_callback() - Deregister stats ext callback
1404  * @mac_handle: Opaque handle to the MAC context
1405  *
1406  * This function is called to deregister the callback that send vendor
1407  * event for stats ext
1408  */
1409 void sme_stats_ext_deregister_callback(mac_handle_t mac_handle);
1410 
1411 /**
1412  * sme_stats_ext2_register_callback() - Register stats ext2 callback
1413  * @mac_handle: Opaque handle to the MAC context
1414  * @callback: Function to be invoked for stats ext2 events
1415  *
1416  * This function will register a callback for frame aggregation failure
1417  * indications processing.
1418  *
1419  * Return: void
1420  */
1421 void sme_stats_ext2_register_callback(mac_handle_t mac_handle,
1422 				      stats_ext2_cb callback);
1423 
1424 QDF_STATUS sme_stats_ext_request(uint8_t session_id,
1425 				 tpStatsExtRequestReq input);
1426 #else
1427 static inline void
sme_stats_ext_register_callback(mac_handle_t mac_handle,stats_ext_cb callback)1428 sme_stats_ext_register_callback(mac_handle_t mac_handle,
1429 				stats_ext_cb callback)
1430 {
1431 }
1432 
1433 static inline void
sme_stats_ext_deregister_callback(mac_handle_t mac_handle)1434 sme_stats_ext_deregister_callback(mac_handle_t mac_handle)
1435 {
1436 }
1437 
1438 static inline void
sme_stats_ext2_register_callback(mac_handle_t mac_handle,stats_ext2_cb callback)1439 sme_stats_ext2_register_callback(mac_handle_t mac_handle,
1440 				 stats_ext2_cb callback)
1441 {
1442 }
1443 #endif /* WLAN_FEATURE_STATS_EXT */
1444 QDF_STATUS sme_update_dfs_scan_mode(mac_handle_t mac_handle,
1445 		uint8_t sessionId,
1446 		uint8_t allowDFSChannelRoam);
1447 uint8_t sme_get_dfs_scan_mode(mac_handle_t mac_handle);
1448 
1449 /**
1450  * sme_get_valid_channels_by_band() - to fetch valid channels filtered by band
1451  * @mac_handle: Opaque handle to the global MAC context
1452  * @wifi_band: RF band information
1453  * @valid_chan_list: output array to store channel info
1454  * @valid_chan_len: output number of channels
1455  *
1456  *  SME API to fetch all valid channels filtered by band
1457  *
1458  *  Return: QDF_STATUS
1459  */
1460 QDF_STATUS sme_get_valid_channels_by_band(mac_handle_t mac_handle,
1461 					  uint8_t wifi_band,
1462 					  uint32_t *valid_chan_list,
1463 					  uint8_t *valid_chan_len);
1464 
1465 #ifdef FEATURE_WLAN_EXTSCAN
1466 /**
1467  * sme_ext_scan_get_capabilities() - SME API to fetch extscan capabilities
1468  * @mac_handle: Opaque handle to the MAC context
1469  * @params: extscan capabilities request structure
1470  *
1471  * Return: QDF_STATUS
1472  */
1473 QDF_STATUS
1474 sme_ext_scan_get_capabilities(mac_handle_t mac_handle,
1475 			      struct extscan_capabilities_params *params);
1476 
1477 /**
1478  * sme_ext_scan_start() - SME API to issue extscan start
1479  * @mac_handle: Opaque handle to the MAC context
1480  * @params: extscan start structure
1481  *
1482  * Return: QDF_STATUS
1483  */
1484 QDF_STATUS
1485 sme_ext_scan_start(mac_handle_t mac_handle,
1486 		   struct wifi_scan_cmd_req_params *params);
1487 
1488 /**
1489  * sme_ext_scan_stop() - SME API to issue extscan stop
1490  * @mac_handle: Opaque handle to the MAC context
1491  * @params: extscan stop structure
1492  *
1493  * Return: QDF_STATUS
1494  */
1495 QDF_STATUS sme_ext_scan_stop(mac_handle_t mac_handle,
1496 			     struct extscan_stop_req_params *params);
1497 
1498 /**
1499  * sme_set_bss_hotlist() - SME API to set BSSID hotlist
1500  * @mac_handle: Opaque handle to the MAC context
1501  * @params: extscan set hotlist structure
1502  *
1503  * Handles the request to set the BSSID hotlist in firmware.
1504  *
1505  * Return: QDF_STATUS
1506  */
1507 QDF_STATUS
1508 sme_set_bss_hotlist(mac_handle_t mac_handle,
1509 		    struct extscan_bssid_hotlist_set_params *params);
1510 
1511 /**
1512  * sme_reset_bss_hotlist() - SME API to reset BSSID hotlist
1513  * @mac_handle: Opaque handle to the MAC context
1514  * @params: extscan reset hotlist structure
1515  *
1516  * Handles the request to reset the BSSID hotlist in firmware.
1517  *
1518  * Return: QDF_STATUS
1519  */
1520 QDF_STATUS
1521 sme_reset_bss_hotlist(mac_handle_t mac_handle,
1522 		      struct extscan_bssid_hotlist_reset_params *params);
1523 
1524 /**
1525  * sme_set_significant_change() - SME API to set significant change
1526  * @mac_handle: Opaque handle to the MAC context
1527  * @params: extscan set significant change structure
1528  *
1529  * Return: QDF_STATUS
1530  */
1531 QDF_STATUS
1532 sme_set_significant_change(mac_handle_t mac_handle,
1533 			   struct extscan_set_sig_changereq_params *params);
1534 
1535 /**
1536  * sme_reset_significant_change() -  SME API to reset significant change
1537  * @mac_handle: Opaque handle to the MAC context
1538  * @params: extscan reset significant change structure
1539  *
1540  * Return: QDF_STATUS
1541  */
1542 QDF_STATUS
1543 sme_reset_significant_change(mac_handle_t mac_handle,
1544 			     struct extscan_capabilities_reset_params *params);
1545 
1546 /**
1547  * sme_get_cached_results() - SME API to get cached results
1548  * @mac_handle: Opaque handle to the MAC context
1549  * @params: extscan get cached results structure
1550  *
1551  * Return: QDF_STATUS
1552  */
1553 QDF_STATUS
1554 sme_get_cached_results(mac_handle_t mac_handle,
1555 		       struct extscan_cached_result_params *params);
1556 
1557 /**
1558  * sme_set_epno_list() - set epno network list
1559  * @mac_handle: Opaque handle to the MAC context
1560  * @params: request message
1561  *
1562  * This function sends an Enhanced PNO configuration to firmware.
1563  *
1564  * Return: QDF_STATUS enumeration
1565  */
1566 QDF_STATUS sme_set_epno_list(mac_handle_t mac_handle,
1567 			     struct wifi_enhanced_pno_params *params);
1568 
1569 /**
1570  * sme_set_passpoint_list() - set passpoint network list
1571  * @mac_handle: Opaque handle to the MAC context
1572  * @params: set passpoint list request parameters
1573  *
1574  * This function constructs the cds message and fill in message type,
1575  * bodyptr with @params and posts it to WDA queue.
1576  *
1577  * Return: QDF_STATUS enumeration
1578  */
1579 QDF_STATUS sme_set_passpoint_list(mac_handle_t mac_handle,
1580 				  struct wifi_passpoint_req_param *params);
1581 
1582 /**
1583  * sme_reset_passpoint_list() - reset passpoint network list
1584  * @mac_handle: Opaque handle to the MAC context
1585  * @params: reset passpoint list request parameters
1586  *
1587  * Return: QDF_STATUS enumeration
1588  */
1589 QDF_STATUS sme_reset_passpoint_list(mac_handle_t mac_handle,
1590 				    struct wifi_passpoint_req_param *params);
1591 
1592 QDF_STATUS sme_ext_scan_register_callback(mac_handle_t mac_handle,
1593 					  ext_scan_ind_cb ext_scan_ind_cb);
1594 #else
1595 static inline
sme_ext_scan_register_callback(mac_handle_t mac_handle,ext_scan_ind_cb ext_scan_ind_cb)1596 QDF_STATUS sme_ext_scan_register_callback(mac_handle_t mac_handle,
1597 					  ext_scan_ind_cb ext_scan_ind_cb)
1598 {
1599 	return QDF_STATUS_SUCCESS;
1600 }
1601 #endif /* FEATURE_WLAN_EXTSCAN */
1602 
1603 /**
1604  * sme_get_vht_ch_width() - SME API to get the max supported FW chan width
1605  *
1606  * Return: Max channel width supported by FW (eg. 20, 40, 80, 160, 80+80)
1607  */
1608 uint32_t sme_get_vht_ch_width(void);
1609 
1610 #ifdef WLAN_FEATURE_LINK_LAYER_STATS
1611 QDF_STATUS sme_ll_stats_clear_req(mac_handle_t mac_handle,
1612 		tSirLLStatsClearReq * pclearStatsReq);
1613 QDF_STATUS sme_ll_stats_set_req(mac_handle_t mac_handle,
1614 		tSirLLStatsSetReq *psetStatsReq);
1615 
1616 /**
1617  * sme_ll_stats_get_req() - SME API to get the Link Layer Statistics
1618  * @mac_handle: Global MAC handle
1619  * @get_stats_req: Link Layer get stats request params structure
1620  * @context: Callback context
1621  *
1622  * Return: QDF_STATUS
1623  */
1624 QDF_STATUS sme_ll_stats_get_req(mac_handle_t mac_handle,
1625 				tSirLLStatsGetReq *get_stats_req,
1626 				void *context);
1627 
1628 /**
1629  * sme_radio_tx_mem_free() - SME API to free the ll_stats memory
1630  *
1631  * Return: None
1632  */
1633 void sme_radio_tx_mem_free(void);
1634 
1635 /**
1636  * sme_set_link_layer_stats_ind_cb() -
1637  * SME API to trigger the stats are available after get request
1638  * @mac_handle: MAC handle
1639  * @callback: HDD callback which needs to be invoked after
1640  *    getting status notification from FW
1641  *
1642  * Return: QDF_STATUS
1643  */
1644 QDF_STATUS sme_set_link_layer_stats_ind_cb(mac_handle_t mac_handle,
1645 					   link_layer_stats_cb callback);
1646 
1647 QDF_STATUS sme_set_link_layer_ext_cb(mac_handle_t mac_handle,
1648 		     void (*ll_stats_ext_cb)(hdd_handle_t callback_ctx,
1649 					     tSirLLStatsResults * rsp));
1650 QDF_STATUS sme_reset_link_layer_stats_ind_cb(mac_handle_t mac_handle);
1651 QDF_STATUS sme_ll_stats_set_thresh(mac_handle_t mac_handle,
1652 				struct sir_ll_ext_stats_threshold *threshold);
1653 #else /* WLAN_FEATURE_LINK_LAYER_STATS */
1654 static inline QDF_STATUS
sme_set_link_layer_ext_cb(mac_handle_t mac_handle,void (* ll_stats_ext_cb)(hdd_handle_t callback_ctx,tSirLLStatsResults * rsp))1655 sme_set_link_layer_ext_cb(mac_handle_t mac_handle, void (*ll_stats_ext_cb)
1656 			  (hdd_handle_t callback_ctx, tSirLLStatsResults
1657 			  *rsp))
1658 {
1659 	return QDF_STATUS_SUCCESS;
1660 }
1661 
1662 static inline QDF_STATUS
sme_set_link_layer_stats_ind_cb(mac_handle_t mac_handle,link_layer_stats_cb callback)1663 sme_set_link_layer_stats_ind_cb(mac_handle_t mac_handle,
1664 				link_layer_stats_cb callback)
1665 {
1666 	return QDF_STATUS_SUCCESS;
1667 }
1668 
1669 static inline QDF_STATUS
sme_reset_link_layer_stats_ind_cb(mac_handle_t mac_handle)1670 sme_reset_link_layer_stats_ind_cb(mac_handle_t mac_handle)
1671 {
1672 	return QDF_STATUS_SUCCESS;
1673 }
1674 #endif /* WLAN_FEATURE_LINK_LAYER_STATS */
1675 
1676 QDF_STATUS sme_set_wisa_params(mac_handle_t mac_handle,
1677 			       struct sir_wisa_params *wisa_params);
1678 QDF_STATUS sme_get_link_status(mac_handle_t mac_handle,
1679 			       csr_link_status_callback callback,
1680 			       void *context, uint8_t session_id);
1681 QDF_STATUS sme_get_temperature(mac_handle_t mac_handle,
1682 		void *tempContext,
1683 		void (*pCallbackfn)(int temperature,
1684 			void *pContext));
1685 
1686 /**
1687  * sme_set_scanning_mac_oui() - SME API to set scanning mac oui
1688  * @mac_handle: MAC Handle
1689  * @scan_mac_oui: Scanning Mac Oui
1690  *
1691  * Return: QDF_STATUS
1692  */
1693 QDF_STATUS sme_set_scanning_mac_oui(mac_handle_t mac_handle,
1694 				    struct scan_mac_oui *scan_mac_oui);
1695 
1696 #ifdef DHCP_SERVER_OFFLOAD
1697 /**
1698  * sme_set_dhcp_srv_offload() - Set DHCP server offload
1699  * @mac_handle: Handle to the global MAC context
1700  * @dhcp_srv_info : DHCP server offload info struct
1701  *
1702  * Return: QDF_STATUS
1703  */
1704 QDF_STATUS
1705 sme_set_dhcp_srv_offload(mac_handle_t mac_handle,
1706 			 struct dhcp_offload_info_params *dhcp_srv_info);
1707 #endif /* DHCP_SERVER_OFFLOAD */
1708 #ifdef WLAN_FEATURE_GPIO_LED_FLASHING
1709 QDF_STATUS sme_set_led_flashing(mac_handle_t mac_handle, uint8_t type,
1710 		uint32_t x0, uint32_t x1);
1711 #endif
1712 QDF_STATUS sme_enable_dfs_chan_scan(mac_handle_t mac_handle, uint8_t dfs_flag);
1713 QDF_STATUS sme_set_mas(uint32_t val);
1714 QDF_STATUS sme_set_miracast(mac_handle_t mac_handle, uint8_t filter_type);
1715 QDF_STATUS sme_ext_change_freq(mac_handle_t mac_handle, qdf_freq_t freq,
1716 			       uint8_t session_id);
1717 
1718 QDF_STATUS sme_configure_stats_avg_factor(mac_handle_t mac_handle,
1719 					  uint8_t session_id,
1720 					  uint16_t stats_avg_factor);
1721 
1722 QDF_STATUS sme_configure_guard_time(mac_handle_t mac_handle, uint8_t session_id,
1723 				    uint32_t guard_time);
1724 
1725 QDF_STATUS sme_wifi_start_logger(mac_handle_t mac_handle,
1726 				 struct sir_wifi_start_log start_log);
1727 
1728 /**
1729  * sme_is_any_session_in_middle_of_roaming() - check if roaming is in progress
1730  * @mac_handle: MAC Handle
1731  *
1732  * Checks if any SME session is in middle of roaming
1733  *
1734  * Return: true if roaming is in progress else false
1735  */
1736 bool sme_is_any_session_in_middle_of_roaming(mac_handle_t mac_handle);
1737 
1738 /**
1739  * sme_send_flush_logs_cmd_to_fw() - Initiate command to FW to flush logs
1740  *
1741  * This function will initiate a command to firmware to flush their logs.
1742  * This should normally be done in response to an anomaly detected by the
1743  * host.
1744  *
1745  * Return: QDF_STATUS_SUCCESS if the command was sent, otherwise an
1746  *         appropriate QDF_STATUS error
1747  */
1748 QDF_STATUS sme_send_flush_logs_cmd_to_fw(void);
1749 
1750 /**
1751  * sme_enable_uapsd_for_ac() - enable uapsd for access category request to WMA
1752  * @ac: access category
1753  * @tid: tid value
1754  * @pri: user priority
1755  * @srvc_int: service interval
1756  * @sus_int: suspend interval
1757  * @dir: tspec direction
1758  * @psb: PSB value
1759  * @sessionId: session id
1760  * @delay_interval: delay interval
1761  *
1762  * Return: QDF status
1763  */
1764 QDF_STATUS sme_enable_uapsd_for_ac(sme_ac_enum_type ac, uint8_t tid,
1765 				   uint8_t pri, uint32_t srvc_int,
1766 				   uint32_t sus_int,
1767 				   enum sme_qos_wmm_dir_type dir,
1768 				   uint8_t psb, uint32_t sessionId,
1769 				   uint32_t delay_interval);
1770 
1771 /**
1772  * sme_disable_uapsd_for_ac() - disable uapsd access category request to WMA
1773  * @ac: access category
1774  * @sessionId: session id
1775  *
1776  * Return: QDF status
1777  */
1778 QDF_STATUS sme_disable_uapsd_for_ac(sme_ac_enum_type ac, uint32_t sessionId);
1779 
1780 #ifdef FEATURE_RSSI_MONITOR
1781 QDF_STATUS sme_set_rssi_monitoring(mac_handle_t mac_handle,
1782 				   struct rssi_monitor_param *input);
1783 
1784 /**
1785  * sme_set_rssi_threshold_breached_cb() - Set RSSI threshold breached callback
1786  * @mac_handle: global MAC handle
1787  * @cb: callback function pointer
1788  *
1789  * This function registers the RSSI threshold breached callback function.
1790  *
1791  * Return: QDF_STATUS enumeration.
1792  */
1793 QDF_STATUS sme_set_rssi_threshold_breached_cb(mac_handle_t mac_handle,
1794 					      rssi_threshold_breached_cb cb);
1795 #else /* FEATURE_RSSI_MONITOR */
1796 static inline
sme_set_rssi_threshold_breached_cb(mac_handle_t mac_handle,rssi_threshold_breached_cb cb)1797 QDF_STATUS sme_set_rssi_threshold_breached_cb(mac_handle_t mac_handle,
1798 					      rssi_threshold_breached_cb cb)
1799 {
1800 	return QDF_STATUS_SUCCESS;
1801 }
1802 #endif
1803 /**
1804  * sme_reset_rssi_threshold_breached_cb() - Reset RSSI threshold breached
1805  *                                          callback
1806  * @mac_handle: global MAC handle
1807  *
1808  * This function de-registers the RSSI threshold breached callback function.
1809  *
1810  * Return: QDF_STATUS enumeration.
1811  */
1812 QDF_STATUS sme_reset_rssi_threshold_breached_cb(mac_handle_t mac_handle);
1813 
1814 QDF_STATUS sme_register_mgmt_frame_ind_callback(mac_handle_t mac_handle,
1815 			sir_mgmt_frame_ind_callback callback);
1816 
1817 QDF_STATUS sme_update_nss(mac_handle_t mac_handle, uint8_t nss);
1818 void sme_update_user_configured_nss(mac_handle_t mac_handle, uint8_t nss);
1819 
1820 bool sme_is_any_session_in_connected_state(mac_handle_t mac_handle);
1821 
1822 QDF_STATUS sme_pdev_set_hw_mode(struct policy_mgr_hw_mode msg);
1823 
1824 /**
1825  * sme_nss_update_request() - Send beacon template update to FW with new
1826  * nss value
1827  * @mac_handle: Handle returned by macOpen
1828  * @vdev_id: the session id
1829  * @new_nss: the new nss value
1830  * @ch_width: channel width, optional value
1831  * @cback: hdd callback
1832  * @next_action: next action to happen at policy mgr after beacon update
1833  * @original_vdev_id: original request hwmode change vdev id
1834  * @request_id: request id
1835  *
1836  * Sends the command to CSR to send to PE
1837  * Return: QDF_STATUS_SUCCESS on successful posting
1838  */
1839 QDF_STATUS sme_nss_update_request(uint32_t vdev_id,
1840 				  uint8_t  new_nss, uint8_t ch_width,
1841 				  policy_mgr_nss_update_cback cback,
1842 				  uint8_t next_action,
1843 				  struct wlan_objmgr_psoc *psoc,
1844 				  enum policy_mgr_conn_update_reason reason,
1845 				  uint32_t original_vdev_id,
1846 				  uint32_t request_id);
1847 
1848 /**
1849  * sme_sap_update_ch_width() - Update SAP ch_width
1850  * @psoc: Psoc object
1851  * @vdev_id: the session id
1852  * @ch_width: channel width to be updated
1853  * @reason: Reason for ch_width update
1854  * @conc_vdev_id: Concurrent connection vdev_id that is causing ch_width update
1855  * @request_id: request id
1856  *
1857  * Return: QDF_STATUS_SUCCESS on successful posting
1858  */
1859 QDF_STATUS
1860 sme_sap_update_ch_width(struct wlan_objmgr_psoc *psoc,
1861 			uint8_t vdev_id,
1862 			enum phy_ch_width ch_width,
1863 			enum policy_mgr_conn_update_reason reason,
1864 			uint8_t conc_vdev_id, uint32_t request_id);
1865 
1866 QDF_STATUS sme_set_peer_authorized(uint8_t *peer_addr,
1867 				   uint32_t vdev_id);
1868 QDF_STATUS sme_soc_set_dual_mac_config(struct policy_mgr_dual_mac_config msg);
1869 QDF_STATUS sme_soc_set_antenna_mode(mac_handle_t mac_handle,
1870 				    struct sir_antenna_mode_param *msg);
1871 
1872 void sme_setdef_dot11mode(mac_handle_t mac_handle);
1873 
1874 /**
1875  * sme_update_tx_bfee_supp() - sets the Tx Bfee support
1876  * @mac_handle: Opaque handle to the global MAC context
1877  * @session_id: SME session id
1878  * @cfg_val: Tx Bfee config value
1879  *
1880  * Return: 0 on success else err code
1881  */
1882 int sme_update_tx_bfee_supp(mac_handle_t mac_handle, uint8_t session_id,
1883 			    uint8_t cfg_val);
1884 
1885 /**
1886  * sme_update_tx_bfee_nsts() - sets the Tx Bfee nsts
1887  * @mac_handle: MAC handle
1888  * @session_id: SME session id
1889  * @usr_cfg_val: user config value
1890  * @nsts_val: Tx Bfee nsts config value
1891  *
1892  * Return: 0 on success else err code
1893  */
1894 int sme_update_tx_bfee_nsts(mac_handle_t mac_handle, uint8_t session_id,
1895 			    uint8_t usr_cfg_val, uint8_t nsts_val);
1896 
1897 void wlan_sap_enable_phy_error_logs(mac_handle_t mac_handle,
1898 				    uint32_t enable_log);
1899 #ifdef WLAN_FEATURE_DSRC
1900 int sme_ocb_gen_timing_advert_frame(mac_handle_t mac_handle,
1901 				    tSirMacAddr self_addr,
1902 				    uint8_t **buf, uint32_t *timestamp_offset,
1903 				    uint32_t *time_value_offset);
1904 
1905 #else
1906 static inline
sme_ocb_gen_timing_advert_frame(mac_handle_t mac_handle,tSirMacAddr self_addr,uint8_t ** buf,uint32_t * timestamp_offset,uint32_t * time_value_offset)1907 int sme_ocb_gen_timing_advert_frame(mac_handle_t mac_handle,
1908 				    tSirMacAddr self_addr, uint8_t **buf,
1909 				    uint32_t *timestamp_offset,
1910 				    uint32_t *time_value_offset)
1911 {
1912 	return 0;
1913 }
1914 
1915 #endif
1916 
1917 void sme_add_set_thermal_level_callback(mac_handle_t mac_handle,
1918 		sme_set_thermal_level_callback callback);
1919 
1920 void sme_update_tgt_services(mac_handle_t mac_handle,
1921 			     struct wma_tgt_services *cfg);
1922 
1923 bool sme_validate_sap_channel_switch(mac_handle_t mac_handle,
1924 				     uint32_t sap_ch_freq, eCsrPhyMode sap_phy_mode,
1925 				     uint8_t cc_switch_mode,
1926 				     uint8_t vdev_id);
1927 
1928 bool sme_is_session_id_valid(mac_handle_t mac_handle, uint32_t session_id);
1929 
1930 #ifdef FEATURE_WLAN_TDLS
1931 void sme_get_opclass(mac_handle_t mac_handle, uint8_t channel,
1932 		     uint8_t bw_offset, uint8_t *opclass);
1933 #else
1934 static inline void
sme_get_opclass(mac_handle_t mac_handle,uint8_t channel,uint8_t bw_offset,uint8_t * opclass)1935 sme_get_opclass(mac_handle_t mac_handle, uint8_t channel, uint8_t bw_offset,
1936 		uint8_t *opclass)
1937 {
1938 }
1939 #endif
1940 
1941 #ifdef FEATURE_LFR_SUBNET_DETECTION
1942 QDF_STATUS sme_gateway_param_update(mac_handle_t mac_handle,
1943 				struct gateway_update_req_param *request);
1944 #endif
1945 
1946 void sme_update_fine_time_measurement_capab(mac_handle_t mac_handle,
1947 					    uint8_t session_id,
1948 					    uint32_t val);
1949 QDF_STATUS sme_ht40_stop_obss_scan(mac_handle_t mac_handle, uint32_t vdev_id);
1950 QDF_STATUS sme_set_fw_test(struct set_fwtest_params *fw_test);
1951 QDF_STATUS sme_set_tsfcb(mac_handle_t mac_handle,
1952 	int (*cb_fn)(void *cb_ctx, struct stsf *ptsf), void *cb_ctx);
1953 
1954 QDF_STATUS sme_reset_tsfcb(mac_handle_t mac_handle);
1955 
1956 #if defined(WLAN_FEATURE_TSF) && !defined(WLAN_FEATURE_TSF_PLUS_NOIRQ)
1957 QDF_STATUS sme_set_tsf_gpio(mac_handle_t mac_handle, uint32_t pinvalue);
1958 #endif
1959 
1960 #ifdef WLAN_BCN_RECV_FEATURE
1961 /**
1962  * sme_handle_bcn_recv_start() - Enable fw to start sending
1963  * beacons of the current connected AP
1964  * @mac_handle: Opaque handle to the global MAC context
1965  * @vdev_id: SME session id
1966  * @nth_value: Beacon report period
1967  * @do_not_resume: beacon reporting resume after a pause is completed
1968  *
1969  * This function remove beacon filter. It allow fw to send
1970  * all beacons from connected peer to driver.
1971  *
1972  * Return: QDF_STATUS enumeration
1973  */
1974 QDF_STATUS sme_handle_bcn_recv_start(mac_handle_t mac_handle,
1975 				     uint32_t vdev_id,
1976 				     uint32_t nth_value,
1977 				     bool do_not_resume);
1978 
1979 /**
1980  * sme_is_beacon_report_started() - Check bcn recv started
1981  * @mac_handle: Opaque handle to the global MAC context
1982  * @session_id: SME session id
1983  *
1984  * This function is to check beacon report started or not.
1985  *
1986  * Return: true on success
1987  */
1988 bool sme_is_beacon_report_started(mac_handle_t mac_handle,
1989 				  uint32_t session_id);
1990 
1991 /**
1992  * sme_is_beacon_reporting_do_not_resume() - Check auto resume allowed or not
1993  * @mac_handle: Opaque handle to the global MAC context
1994  * @session_id: SME session id
1995  *
1996  * This function is to check auto resume of beacon reporting is allowed or not.
1997  *
1998  * Return: true on success
1999  */
2000 bool sme_is_beacon_reporting_do_not_resume(mac_handle_t mac_handle,
2001 					   uint32_t session_id);
2002 
2003 /**
2004  * stop_beacon_report() - To stop beacon report
2005  * @mac_handle: Opaque handle to the global MAC context
2006  * @session_id: SME session id
2007  *
2008  * Return: None
2009  */
2010 void sme_stop_beacon_report(mac_handle_t mac_handle,
2011 			    uint32_t session_id);
2012 
2013 #else
2014 static inline
sme_is_beacon_report_started(mac_handle_t mac_handle,uint32_t session_id)2015 bool sme_is_beacon_report_started(mac_handle_t mac_handle,
2016 				  uint32_t session_id)
2017 {
2018 	return true;
2019 }
2020 
2021 static inline
sme_is_beacon_reporting_do_not_resume(mac_handle_t mac_handle,uint32_t session_id)2022 bool sme_is_beacon_reporting_do_not_resume(mac_handle_t mac_handle,
2023 					   uint32_t session_id)
2024 {
2025 	return false;
2026 }
2027 
2028 static inline
sme_stop_beacon_report(mac_handle_t mac_handle,uint32_t session_id)2029 void sme_stop_beacon_report(mac_handle_t mac_handle,
2030 			    uint32_t session_id)
2031 {
2032 }
2033 
2034 #endif
2035 
2036 QDF_STATUS sme_add_beacon_filter(mac_handle_t mac_handle,
2037 				 uint32_t session_id, uint32_t *ie_map);
2038 QDF_STATUS sme_remove_beacon_filter(mac_handle_t mac_handle,
2039 				    uint32_t session_id);
2040 
2041 #ifdef FEATURE_WLAN_APF
2042 /**
2043  * sme_get_apf_capabilities() - Get APF capabilities
2044  * @mac_handle: Opaque handle to the global MAC context
2045  * @callback: Callback function to be called with the result
2046  * @context: Opaque context to be used by the caller to associate the
2047  *   request with the response
2048  *
2049  * This function constructs the cds message and fill in message type,
2050  * post the same to WDA.
2051  *
2052  * Return: QDF_STATUS enumeration
2053  */
2054 QDF_STATUS sme_get_apf_capabilities(mac_handle_t mac_handle,
2055 				    apf_get_offload_cb callback,
2056 				    void *context);
2057 
2058 /**
2059  * sme_set_apf_instructions() - Set APF apf filter instructions.
2060  * @mac_handle: Opaque handle to the global MAC context
2061  * @apf_set_offload: struct to set apf filter instructions.
2062  *
2063  * APFv2 (Legacy APF) API to set the APF packet filter.
2064  *
2065  * Return: QDF_STATUS enumeration.
2066  */
2067 QDF_STATUS sme_set_apf_instructions(mac_handle_t mac_handle,
2068 				    struct sir_apf_set_offload
2069 							*apf_set_offload);
2070 
2071 /**
2072  * sme_set_apf_enable_disable - Send apf enable/disable cmd
2073  * @mac_handle: Opaque handle to the global MAC context
2074  * @vdev_id: vdev id
2075  * @apf_enable: true: Enable APF Int., false: Disable APF Int.
2076  *
2077  * API to either enable or disable the APF interpreter.
2078  *
2079  * Return: QDF_STATUS enumeration.
2080  */
2081 QDF_STATUS sme_set_apf_enable_disable(mac_handle_t mac_handle, uint8_t vdev_id,
2082 				      bool apf_enable);
2083 
2084 /**
2085  * sme_apf_write_work_memory - Write into the apf work memory
2086  * @mac_handle: Opaque handle to the global MAC context
2087  * @write_params: APF parameters for the write operation
2088  *
2089  * API for writing into the APF work memory.
2090  *
2091  * Return: QDF_STATUS enumeration.
2092  */
2093 QDF_STATUS sme_apf_write_work_memory(mac_handle_t mac_handle,
2094 				    struct wmi_apf_write_memory_params
2095 								*write_params);
2096 
2097 /**
2098  * sme_apf_read_work_memory - Read part of apf work memory
2099  * @mac_handle: Opaque handle to the global MAC context
2100  * @read_params: APF parameters for the get operation
2101  * @callback: callback to handle the the read response
2102  *
2103  * API for issuing a APF read memory request.
2104  *
2105  * Return: QDF_STATUS enumeration.
2106  */
2107 QDF_STATUS
2108 sme_apf_read_work_memory(mac_handle_t mac_handle,
2109 			 struct wmi_apf_read_memory_params *read_params,
2110 			 apf_read_mem_cb callback);
2111 
2112 #endif /* FEATURE_WLAN_APF */
2113 
2114 uint32_t sme_get_wni_dot11_mode(mac_handle_t mac_handle);
2115 QDF_STATUS sme_create_mon_session(mac_handle_t mac_handle, uint8_t *bssid,
2116 				  uint8_t vdev_id);
2117 
2118 /**
2119  * sme_delete_mon_session() - post message to delete PE session for mon_mode
2120  * operation
2121  * @mac_handle: Opaque handle to the global MAC context
2122  * @vdev_id: sme session id
2123  *
2124  * Return: QDF_STATUS_SUCCESS on success, non-zero error code on failure.
2125  */
2126 QDF_STATUS sme_delete_mon_session(mac_handle_t mac_handle, uint8_t vdev_id);
2127 
2128 /**
2129  * sme_set_vdev_ies_per_band() - sends the per band IEs to vdev
2130  * @mac_handle: Opaque handle to the global MAC context
2131  * @vdev_id: vdev_id for which IE is targeted
2132  * @device_mode: vdev mode
2133  *
2134  * Return: None
2135  */
2136 void sme_set_vdev_ies_per_band(mac_handle_t mac_handle, uint8_t vdev_id,
2137 			       enum QDF_OPMODE device_mode);
2138 
2139 void sme_set_pdev_ht_vht_ies(mac_handle_t mac_handle, bool enable2x2);
2140 
2141 /**
2142  * sme_get_sap_vdev_type_nss() - get the sap nss per vdev type
2143  * @mac_handle: Opaque handle to the global MAC context
2144  * @vdev_nss: Pointer to vdev_nss
2145  * @band: 5G or 2.4G band
2146  *
2147  * Get SAP vdev nss
2148  *
2149  * Return: None
2150  */
2151 void sme_get_sap_vdev_type_nss(mac_handle_t mac_handle, uint8_t *vdev_nss,
2152 			       enum band_info band);
2153 
2154 /**
2155  * sme_update_vdev_type_nss() - sets the nss per vdev type
2156  * @mac_handle: Opaque handle to the global MAC context
2157  * @max_supp_nss: max_supported Nss
2158  * @band: 5G or 2.4G band
2159  *
2160  * Sets the per band Nss for each vdev type based on INI and configured
2161  * chain mask value.
2162  *
2163  * Return: None
2164  */
2165 void sme_update_vdev_type_nss(mac_handle_t mac_handle, uint8_t max_supp_nss,
2166 			      enum nss_chains_band_info band);
2167 
2168 #ifdef FEATURE_P2P_LISTEN_OFFLOAD
2169 void sme_register_p2p_lo_event(mac_handle_t mac_handle, void *context,
2170 					p2p_lo_callback callback);
2171 #else
sme_register_p2p_lo_event(mac_handle_t mac_handle,void * context,p2p_lo_callback callback)2172 static inline void sme_register_p2p_lo_event(mac_handle_t mac_handle,
2173 					     void *context,
2174 					     p2p_lo_callback callback)
2175 {
2176 }
2177 #endif
2178 
2179 QDF_STATUS sme_process_mac_pwr_dbg_cmd(mac_handle_t mac_handle,
2180 				       uint32_t session_id,
2181 				       struct sir_mac_pwr_dbg_cmd*
2182 				       dbg_args);
2183 
2184 void sme_get_vdev_type_nss(enum QDF_OPMODE dev_mode,
2185 			   uint8_t *nss_2g, uint8_t *nss_5g);
2186 void sme_send_disassoc_req_frame(mac_handle_t mac_handle,
2187 				 uint8_t session_id, uint8_t *peer_mac,
2188 				 uint16_t reason, uint8_t wait_for_ack);
2189 QDF_STATUS sme_update_access_policy_vendor_ie(mac_handle_t mac_handle,
2190 					      uint8_t session_id,
2191 					      uint8_t *vendor_ie,
2192 					      int access_policy);
2193 
2194 /**
2195  * sme_set_peer_param() - set peer param
2196  * @vdev_id: vdev ID
2197  * @peer_addr: peer MAC address
2198  * @param_id: param ID to be updated
2199  * @param_Value: paraam value
2200  *
2201  * This SME API is used to send the peer param to WMA to be sent to FW.
2202  *
2203  * Return: QDF_STATUS
2204  */
2205 QDF_STATUS sme_set_peer_param(uint8_t *peer_addr, uint32_t param_id,
2206 			      uint32_t param_value, uint32_t vdev_id);
2207 
2208 QDF_STATUS sme_update_sta_roam_policy(mac_handle_t mac_handle,
2209 		enum sta_roam_policy_dfs_mode dfs_mode,
2210 		bool skip_unsafe_channels,
2211 		uint8_t session_id, uint8_t sap_operating_band);
2212 QDF_STATUS sme_enable_disable_chanavoidind_event(mac_handle_t mac_handle,
2213 					uint8_t set_value);
2214 QDF_STATUS sme_set_default_scan_ie(mac_handle_t mac_handle, uint16_t session_id,
2215 				uint8_t *ie_data, uint16_t ie_len);
2216 /**
2217  * sme_set_check_assoc_disallowed() - API to update assoc disallowed
2218  * @mac_handle: Opaque handle to the global MAC context
2219  * @check_assoc_disallowed: assoc disallowed check value
2220  *
2221  * Return: QDF_STATUS
2222  */
2223 QDF_STATUS sme_set_check_assoc_disallowed(mac_handle_t mac_handle,
2224 					  bool check_assoc_disallowed);
2225 
2226 /**
2227  * sme_update_session_param() - API to update PE session param
2228  * @mac_handle: Opaque handle to the global MAC context
2229  * @session_id: Session ID
2230  * @param_type: Param type to be updated
2231  * @param_val: Param value to be update
2232  *
2233  * Note: this setting will not persist over reboots.
2234  *
2235  * Return: QDF_STATUS
2236  */
2237 QDF_STATUS sme_update_session_param(mac_handle_t mac_handle, uint8_t session_id,
2238 		uint32_t param_type, uint32_t param_val);
2239 #ifdef WLAN_FEATURE_FIPS
2240 /**
2241  * sme_fips_request() - Perform a FIPS certification operation
2242  * @mac_handle: Opaque handle to the global MAC context
2243  * @param: The FIPS certification parameters
2244  * @callback: Callback function to invoke with the results
2245  * @context: Opaque context to pass back to caller in the callback
2246  *
2247  * Return: QDF_STATUS_SUCCESS if the request is successfully sent
2248  * to firmware for processing, otherwise an error status.
2249  */
2250 QDF_STATUS sme_fips_request(mac_handle_t mac_handle, struct fips_params *param,
2251 			    wma_fips_cb callback, void *context);
2252 #else
2253 static inline
sme_fips_request(mac_handle_t mac_handle,struct fips_params * param,wma_fips_cb callback,void * context)2254 QDF_STATUS sme_fips_request(mac_handle_t mac_handle, struct fips_params *param,
2255 			    wma_fips_cb callback, void *context)
2256 {
2257 	return QDF_STATUS_E_NOSUPPORT;
2258 }
2259 #endif /* WLAN_FEATURE_FIPS */
2260 
2261 /**
2262  * sme_set_cts2self_for_p2p_go() - sme function to set ini params to FW.
2263  * @mac_handle: Opaque handle to the global MAC context
2264  *
2265  * Return: QDF_STATUS
2266  */
2267 QDF_STATUS sme_set_cts2self_for_p2p_go(mac_handle_t mac_handle);
2268 
2269 QDF_STATUS sme_update_tx_fail_cnt_threshold(mac_handle_t mac_handle,
2270 		uint8_t session_id, uint32_t tx_fail_count);
2271 
2272 /**
2273  * sme_neighbor_roam_is11r_assoc() - Check if association type is 11R
2274  * @mac_handle: MAC_HANDLE handle
2275  * @session_id: session id
2276  *
2277  * Return: true if 11r Association, false otherwise.
2278  */
2279 bool sme_neighbor_roam_is11r_assoc(mac_handle_t mac_handle, uint8_t session_id);
2280 
2281 /**
2282  * sme_update_sta_inactivity_timeout(): Update sta_inactivity_timeout to FW
2283  * @mac_handle: Handle returned by mac_open
2284  * @sta_inactivity_timer:  struct for sta inactivity timer
2285  *
2286  * If a station does not send anything in sta_inactivity_timeout seconds, an
2287  * empty data frame is sent to it in order to verify whether it is
2288  * still in range. If this frame is not ACKed, the station will be
2289  * disassociated and then deauthenticated.
2290  *
2291  * Return: QDF_STATUS_SUCCESS or non-zero on failure.
2292 */
2293 QDF_STATUS sme_update_sta_inactivity_timeout(mac_handle_t mac_handle,
2294 		struct sme_sta_inactivity_timeout  *sta_inactivity_timer);
2295 
2296 /**
2297  * sme_set_lost_link_info_cb() - plug in callback function for receiving
2298  * @mac_handle: Opaque handle to the MAC context
2299  * @cb: callback function
2300  *
2301  * Return: HAL status
2302  */
2303 QDF_STATUS sme_set_lost_link_info_cb(mac_handle_t mac_handle,
2304 				     lost_link_info_cb cb);
2305 
2306 /**
2307  * sme_update_new_channel_event() - update new channel event for sapFsm
2308  * @mac_handle: Opaque handle to the global MAC context
2309  * @session_id: session id
2310  *
2311  * Return: QDF_STATUS_SUCCESS or non-zero on failure.
2312  */
2313 QDF_STATUS sme_update_new_channel_event(mac_handle_t mac_handle,
2314 					uint8_t session_id);
2315 #ifdef WLAN_POWER_DEBUG
2316 /**
2317  * sme_reset_power_debug_stats_cb() - SME API to reset Power debug stats cb
2318  * @mac_handle: Opaque handle to the global MAC context
2319  *
2320  * Resets the power stats callback and context to NULL
2321  *
2322  * Return: None
2323  */
2324 void sme_reset_power_debug_stats_cb(mac_handle_t mac_handle);
2325 
2326 /**
2327  * sme_power_debug_stats_req() - SME API to collect Power debug stats
2328  * @mac_handle: Opaque handle to the global MAC context
2329  * @callback_fn: Pointer to the callback function for Power stats event
2330  * @power_stats_context: Pointer to context
2331  *
2332  * Return: QDF_STATUS
2333  */
2334 QDF_STATUS sme_power_debug_stats_req(
2335 		mac_handle_t mac_handle,
2336 		void (*callback_fn)(struct power_stats_response *response,
2337 				    void *context),
2338 		void *power_stats_context);
2339 #endif
2340 
2341 #ifdef WLAN_FEATURE_BEACON_RECEPTION_STATS
2342 /**
2343  * sme_beacon_debug_stats_req() - SME API to collect beacon debug stats
2344  * @vdev_id: Vdev id on which stats is being requested
2345  * @callback_fn: Pointer to the callback function for beacon stats event
2346  * @beacon_stats_context: Pointer to context
2347  *
2348  * Return: QDF_STATUS
2349  */
2350 QDF_STATUS sme_beacon_debug_stats_req(
2351 		mac_handle_t mac_handle, uint32_t vdev_id,
2352 		void (*callback_fn)(struct bcn_reception_stats_rsp
2353 				    *response, void *context),
2354 		void *beacon_stats_context);
2355 #endif
2356 
2357 /**
2358  * sme_get_sar_power_limits() - get SAR limits
2359  * @mac_handle: Opaque handle to the global MAC context
2360  * @callback: Callback function to invoke with the results
2361  * @context: Opaque context to pass back to caller in the callback
2362  *
2363  * Return: QDF_STATUS_SUCCESS if the request is successfully sent
2364  * to firmware for processing, otherwise an error status.
2365  */
2366 QDF_STATUS sme_get_sar_power_limits(mac_handle_t mac_handle,
2367 				    wma_sar_cb callback, void *context);
2368 
2369 /**
2370  * sme_set_sar_power_limits() - set sar limits
2371  * @mac_handle: Opaque handle to the global MAC context
2372  * @sar_limit_cmd: struct to send sar limit cmd.
2373  *
2374  * Return: QDF_STATUS enumeration.
2375  */
2376 QDF_STATUS sme_set_sar_power_limits(mac_handle_t mac_handle,
2377 		struct sar_limit_cmd_params *sar_limit_cmd);
2378 
2379 /**
2380  * sme_send_coex_config_cmd() - Send COEX config params
2381  * @coex_cfg_params: struct to coex config params
2382  *
2383  * Return: QDF_STATUS
2384  */
2385 QDF_STATUS sme_send_coex_config_cmd(struct coex_config_params *coex_cfg_params);
2386 
2387 #ifdef WLAN_FEATURE_WOW_PULSE
2388 QDF_STATUS sme_set_wow_pulse(struct wow_pulse_mode *wow_pulse_set_info);
2389 #endif
2390 
2391 /* ARP DEBUG STATS */
2392 QDF_STATUS sme_set_nud_debug_stats(mac_handle_t mac_handle,
2393 				   struct set_arp_stats_params
2394 				   *set_stats_param);
2395 QDF_STATUS sme_get_nud_debug_stats(mac_handle_t mac_handle,
2396 				   struct get_arp_stats_params
2397 				   *get_stats_param);
2398 QDF_STATUS sme_set_nud_debug_stats_cb(mac_handle_t mac_handle,
2399 			void (*cb)(void *, struct rsp_stats *, void *context),
2400 			void *context);
2401 
2402 /**
2403  * sme_set_del_peers_ind_callback() - Register del peers ind callback
2404  * @mac_handle - MAC global handle
2405  * @callback_routine - callback routine from HDD
2406  *
2407  * This API is invoked by HDD to register its callback to mac
2408  *
2409  * Return: QDF_STATUS
2410  */
2411 void
2412 sme_set_del_peers_ind_callback(mac_handle_t mac_handle,
2413 			       void (*callback)(struct wlan_objmgr_psoc *psoc,
2414 						uint8_t vdev_id));
2415 
2416 /**
2417  * sme_set_chan_info_callback() - Register chan info callback
2418  * @mac_handle - MAC global handle
2419  * @callback_routine - callback routine from HDD
2420  *
2421  * This API is invoked by HDD to register its callback to mac
2422  *
2423  * Return: QDF_STATUS
2424  */
2425 void sme_set_chan_info_callback(mac_handle_t mac_handle,
2426 			void (*callback)(struct scan_chan_info *chan_info));
2427 
2428 #ifdef WLAN_FEATURE_CAL_FAILURE_TRIGGER
2429 /**
2430  * sme_set_cal_failure_event_cb() - Register calibration failure event callback
2431  * @mac_handle - MAC global handle
2432  * @callback   - calibration failure event callback from HDD
2433  *
2434  * This API is invoked by HDD to register its callback to mac
2435  *
2436  * Return: None
2437  */
2438 void sme_set_cal_failure_event_cb(
2439 			mac_handle_t mac_handle,
2440 			void (*callback)(uint8_t cal_type, uint8_t reason));
2441 #else
2442 static inline void
sme_set_cal_failure_event_cb(mac_handle_t mac_handle,void (* callback)(uint8_t cal_type,uint8_t reason))2443 sme_set_cal_failure_event_cb(mac_handle_t mac_handle,
2444 			     void (*callback)(uint8_t cal_type, uint8_t reason))
2445 {
2446 }
2447 #endif
2448 
2449 /**
2450  * sme_get_rssi_snr_by_bssid() - gets the rssi and snr by bssid from scan cache
2451  * @mac_handle: handle returned by mac_open
2452  * @bssid: bssid to look for in scan cache
2453  * @rssi: rssi value found
2454  * @snr: snr value found
2455  *
2456  * Return: QDF_STATUS
2457  */
2458 QDF_STATUS sme_get_rssi_snr_by_bssid(mac_handle_t mac_handle,
2459 				     const uint8_t *bssid, int8_t *rssi,
2460 				     int8_t *snr);
2461 
2462 /**
2463  * sme_register_tx_queue_cb(): Register tx queue callback
2464  * @mac_handle: Opaque handle for MAC context
2465  * @tx_queue_cb: Transmit Queues callback
2466  *
2467  * Return: QDF_STATUS
2468  */
2469 QDF_STATUS sme_register_tx_queue_cb(mac_handle_t mac_handle,
2470 				    tx_queue_cb tx_queue_cb);
2471 
2472 /**
2473  * sme_deregister_tx_queue_cb() - Deregister the tx queue callback
2474  * @mac_handle: Opaque handle for MAC context
2475  *
2476  * Return: QDF status
2477  */
2478 QDF_STATUS sme_deregister_tx_queue_cb(mac_handle_t mac_handle);
2479 
2480 /**
2481  * sme_rso_cmd_status_cb() - Set RSO cmd status callback
2482  * @mac_handle: Opaque handle for the MAC context
2483  * @cb: HDD Callback to rso command status read
2484  *
2485  * This function is used to save HDD RSO Command status callback in MAC
2486  *
2487  * Return: QDF_STATUS
2488  */
2489 QDF_STATUS sme_rso_cmd_status_cb(mac_handle_t mac_handle,
2490 				 rso_cmd_status_cb cb);
2491 
2492 /**
2493  * sme_register_set_connection_info_cb() - Register connection
2494  * info callback
2495  * @mac_handle - MAC global handle
2496  * @set_connection_info_cb - callback routine from HDD to set
2497  *                   connection info flag
2498  * @get_connection_info_cb - callback routine from HDD to get
2499  *                         connection info
2500  *
2501  * This API is invoked by HDD to register its callback to mac
2502  *
2503  * Return: QDF_STATUS
2504  */
2505 QDF_STATUS sme_register_set_connection_info_cb(mac_handle_t mac_handle,
2506 				bool (*set_connection_info_cb)(bool),
2507 				bool (*get_connection_info_cb)(uint8_t *session_id,
2508 				enum scan_reject_states *reason));
2509 
2510 /**
2511  * sme_set_dbs_scan_selection_config() - Update DBS scan selection
2512  * configuration
2513  * @mac_handle: The handle returned by macOpen
2514  * @params: wmi_dbs_scan_sel_params config
2515  *
2516  * Return: QDF_STATUS if DBS scan selection update
2517  * configuration success else failure status
2518  */
2519 QDF_STATUS sme_set_dbs_scan_selection_config(mac_handle_t mac_handle,
2520 		struct wmi_dbs_scan_sel_params *params);
2521 
2522 /**
2523  * sme_store_pdev() - store pdev
2524  * @mac_handle - MAC global handle
2525  * @pdev - pdev ptr
2526  *
2527  * Return: QDF_STATUS
2528  */
2529 void sme_store_pdev(mac_handle_t mac_handle, struct wlan_objmgr_pdev *pdev);
2530 
2531 /**
2532  * sme_set_reorder_timeout() - set reorder timeout value
2533  * including Voice,Video,Besteffort,Background parameters
2534  * @mac_handle: Opaque handle to the global MAC context
2535  * @reg: struct sir_set_rx_reorder_timeout_val
2536  *
2537  * Return: QDF_STATUS_SUCCESS or non-zero on failure.
2538  */
2539 QDF_STATUS sme_set_reorder_timeout(mac_handle_t mac_handle,
2540 		struct sir_set_rx_reorder_timeout_val *req);
2541 
2542 /**
2543  * sme_set_rx_set_blocksize() - set blocksize value
2544  * including mac_addr and win_limit parameters
2545  * @mac_handle: Opaque handle to the global MAC context
2546  * @reg: struct sir_peer_set_rx_blocksize
2547  *
2548  * Return: QDF_STATUS_SUCCESS or non-zero on failure.
2549  */
2550 
2551 QDF_STATUS sme_set_rx_set_blocksize(mac_handle_t mac_handle,
2552 				    struct sir_peer_set_rx_blocksize *req);
2553 
2554 /**
2555  * sme_get_rcpi() - gets the rcpi value for peer mac addr
2556  * @mac_handle: handle returned by mac_open
2557  * @rcpi: rcpi request containing peer mac addr, callback and related info
2558  *
2559  * This function posts the rcpi measurement request message to wma queue
2560  *
2561  * Return: QDF_STATUS
2562  */
2563 QDF_STATUS sme_get_rcpi(mac_handle_t mac_handle, struct sme_rcpi_req *rcpi);
2564 
2565 /**
2566  * sme_set_chip_pwr_save_fail_cb() - set chip power save failure callback
2567  * @mac_handle: opaque handle to the MAC context
2568  * @cb: callback function pointer
2569  *
2570  * This function stores the chip power save failure callback function.
2571  *
2572  * Return: QDF_STATUS enumeration.
2573  */
2574 
2575 QDF_STATUS sme_set_chip_pwr_save_fail_cb(mac_handle_t mac_handle,
2576 					 pwr_save_fail_cb cb);
2577 /**
2578  * sme_cli_set_command() - SME wrapper API over WMA "set" command
2579  * processor cmd
2580  * @vdev_id: virtual device for the command
2581  * @param_id: parameter id
2582  * @sval: parameter value
2583  * @vpdev: parameter category
2584  *
2585  * Command handler for set operations
2586  *
2587  * Return: 0 on success, errno on failure
2588  */
2589 int sme_cli_set_command(int vdev_id, int param_id, int sval, int vpdev);
2590 
2591 /**
2592  * sme_set_bt_activity_info_cb - set the callback handler for bt events
2593  * @mac_handle: handle returned by mac_open
2594  * @cb: callback handler
2595  *
2596  * Return: QDF_STATUS
2597  */
2598 QDF_STATUS sme_set_bt_activity_info_cb(mac_handle_t mac_handle,
2599 				       bt_activity_info_cb cb);
2600 
2601 /**
2602  * sme_set_enable_mem_deep_sleep - set the mem deep sleep config to FW
2603  * @mac_handle: handle returned by mac_open
2604  * @vdev_id: vdev id
2605  *
2606  * Return: 0 for success else failure code
2607  */
2608 int sme_set_enable_mem_deep_sleep(mac_handle_t mac_handle, int vdev_id);
2609 
2610 /**
2611  * sme_set_cck_tx_fir_override - set the CCK TX FIR Override to FW
2612  * @mac_handle: handle returned by mac_open
2613  * @vdev_id: vdev id
2614  *
2615  * Return: 0 for success else failure code
2616  */
2617 int sme_set_cck_tx_fir_override(mac_handle_t mac_handle, int vdev_id);
2618 
2619 /**
2620  * sme_set_smps_cfg() - set SMPS config params
2621  * @vdev_id: virtual device for the command
2622  * @param_id: parameter id
2623  * @param_val: parameter value
2624  *
2625  * Return: QDF_STATUS_SUCCESS or non-zero on failure
2626  */
2627 
2628 QDF_STATUS sme_set_smps_cfg(uint32_t vdev_id, uint32_t param_id,
2629 				uint32_t param_val);
2630 
2631 /**
2632  * sme_get_chain_rssi() - Get chain rssi
2633  * @mac_handle: Opaque handle to the global MAC context
2634  * @input: get chain rssi req params
2635  * @callback: Callback function to be called with the result
2636  * @context: Opaque context to be used by the caller to associate the
2637  *   request with the response
2638  *
2639  * This function constructs the cds message and fill in message type,
2640  * post the same to WDA.
2641  *
2642  * Return: QDF_STATUS enumeration
2643  */
2644 QDF_STATUS sme_get_chain_rssi(mac_handle_t mac_handle,
2645 			      struct get_chain_rssi_req_params *input,
2646 			      get_chain_rssi_callback callback,
2647 			      void *context);
2648 
2649 /**
2650  * sme_get_isolation() - sme api to get antenna isolation
2651  * @mac_handle: hal handle for getting global mac struct
2652  * @context: context of callback function
2653  * @callbackfn: hdd callback function when receive response
2654  *
2655  * This function will send WMA_GET_ISOLATION to WMA
2656  *
2657  * Return: QDF_STATUS_SUCCESS or non-zero on failure
2658  */
2659 QDF_STATUS sme_get_isolation(mac_handle_t mac_handle,
2660 			     void *context,
2661 			     sme_get_isolation_cb callbackfn);
2662 
2663 #ifdef FEATURE_FW_STATE
2664 /**
2665  * sme_get_fw_state() - Get fw state
2666  * @mac_handle: Opaque handle to the global MAC context
2667  * @callback: Callback function to be called with the result
2668  * @context: Opaque context to be used by the caller to associate the
2669  *   request with the response
2670  *
2671  * This function constructs the cds message and fill in message type,
2672  * post the same to WDA.
2673  *
2674  * Return: QDF_STATUS enumeration
2675  */
2676 QDF_STATUS sme_get_fw_state(mac_handle_t mac_handle,
2677 			    fw_state_callback callback,
2678 			    void *context);
2679 #endif /* FEATURE_FW_STATE */
2680 
2681 /**
2682  * sme_get_mac_context() - sme api to get the pmac context
2683  *
2684  * This function will return the pmac context
2685  *
2686  * Return: pointer to pmac context
2687  */
2688 struct mac_context *sme_get_mac_context(void);
2689 
2690 /**
2691  * sme_display_disconnect_stats() - Display per session Disconnect stats
2692  * @mac_handle: Opaque handle to the global MAC context
2693  * session_id: SME session id
2694  *
2695  * Return: None
2696  */
2697 void sme_display_disconnect_stats(mac_handle_t mac_handle, uint8_t session_id);
2698 
2699 #ifdef WLAN_FEATURE_MSCS
2700 /**
2701  * sme_send_mscs_action_frame() - Send MSCS action frame
2702  * @vdev_id: sme vdev_id
2703  *
2704  * This function is used to send down the mscs request to PE
2705  *
2706  * Return: None
2707  */
2708 void sme_send_mscs_action_frame(uint8_t vdev_id);
2709 #endif
2710 
2711 /**
2712  * sme_process_msg_callback() - process callback message from LIM
2713  * @mac: global mac context
2714  * @msg: scheduler message
2715  *
2716  * This function process the callback messages from LIM.
2717  *
2718  * Return: QDF_STATUS enumeration.
2719  */
2720 QDF_STATUS sme_process_msg_callback(struct mac_context *mac,
2721 				    struct scheduler_msg *msg);
2722 
2723 /**
2724  * sme_set_bmiss_bcnt() - set bmiss config parameters
2725  * @vdev_id: virtual device for the command
2726  * @first_cnt: bmiss first value
2727  * @final_cnt: bmiss final value
2728  *
2729  * Return: QDF_STATUS_SUCCESS or non-zero on failure
2730  */
2731 QDF_STATUS sme_set_bmiss_bcnt(uint32_t vdev_id, uint32_t first_cnt,
2732 		uint32_t final_cnt);
2733 
2734 /**
2735  * sme_send_limit_off_channel_params() - send limit off channel parameters
2736  * @mac_handle: Opaque handle to the global MAC context
2737  * @vdev_id: vdev id
2738  * @is_tos_active: tos active or inactive
2739  * @max_off_chan_time: max off channel time
2740  * @rest_time: rest time
2741  * @skip_dfs_chan: skip dfs channel
2742  *
2743  * This function sends command to WMA for setting limit off channel command
2744  * parameters.
2745  *
2746  * Return: QDF_STATUS enumeration.
2747  */
2748 QDF_STATUS sme_send_limit_off_channel_params(mac_handle_t mac_handle,
2749 					     uint8_t vdev_id,
2750 					     bool is_tos_active,
2751 					     uint32_t max_off_chan_time,
2752 					     uint32_t rest_time,
2753 					     bool skip_dfs_chan);
2754 
2755 #ifdef FEATURE_WLAN_DYNAMIC_CVM
2756 /**
2757  * sme_set_vc_mode_config() - Set voltage corner config to FW.
2758  * @bitmap:	Bitmap that refers to voltage corner config with
2759  * different phymode and bw configuration
2760  *
2761  * Return: QDF_STATUS
2762  */
2763 QDF_STATUS sme_set_vc_mode_config(uint32_t vc_bitmap);
2764 #endif
2765 
2766 /**
2767  * sme_set_del_pmkid_cache() - API to update PMKID cache
2768  * @psoc: psoc common object
2769  * @session_id: Session id
2770  * @pmk_cache_info: Pointer to PMK cache info
2771  * @is_add: boolean that implies whether to add or delete PMKID entry
2772  *
2773  * Return: QDF_STATUS
2774  */
2775 QDF_STATUS sme_set_del_pmkid_cache(struct wlan_objmgr_psoc *psoc,
2776 				   uint8_t session_id,
2777 				   struct wlan_crypto_pmksa *pmk_cache_info,
2778 				   bool is_add);
2779 
2780 /**
2781  * sme_clear_sae_single_pmk_info() - Clear sae_single_pmk onfo
2782  * @psoc: Psoc object
2783  * @session_id: session id
2784  * @pmk_cache_info: pmk cache info
2785  *
2786  * This function will clear sae_single_pmk info while processing delete pmk
2787  * command from userspace.
2788  *
2789  * Return: None
2790  */
2791 void sme_clear_sae_single_pmk_info(struct wlan_objmgr_psoc *psoc,
2792 				   uint8_t session_id,
2793 				   struct wlan_crypto_pmksa *pmk_cache_info);
2794 
2795 /**
2796  * sme_send_hlp_ie_info() - API to send HLP IE info to fw
2797  * @mac_handle: Opaque handle to the global MAC context
2798  * @vdev_id: vdev id
2799  * @if_addr: IP address
2800  *
2801  * This API is used to send HLP IE info along with IP address
2802  * to fw if LFR3 is enabled.
2803  *
2804  * Return: None
2805  */
2806 void sme_send_hlp_ie_info(mac_handle_t mac_handle, uint8_t vdev_id,
2807 			  uint32_t if_addr);
2808 
2809 /**
2810  * sme_send_rso_connect_params() - Updates the assoc IEs to csr_roam_session
2811  * @mac_handle: Opaque handle to the global MAC context
2812  * @vdev_id: vdev id
2813  *
2814  * When the user space updates the assoc IEs or FILS auth type or FILS ERP info,
2815  * host driver needs to send these updated parameters to firmware via
2816  * RSO update command.
2817  *
2818  * Return: None
2819  */
2820 QDF_STATUS sme_send_rso_connect_params(mac_handle_t mac_handle,
2821 				       uint8_t vdev_id);
2822 
2823 #ifdef WLAN_FEATURE_11AX_BSS_COLOR
2824 /**
2825  * sme_set_he_bss_color() - Sets the HE BSS color
2826  *
2827  * @mac_handle: The handle returned by mac_open
2828  * @session_id: session_id of the request
2829  * @bss_color: HE BSS color value to set
2830  *
2831  * Return: QDF_STATUS
2832  */
2833 QDF_STATUS sme_set_he_bss_color(mac_handle_t mac_handle, uint8_t session_id,
2834 				uint8_t bss_color);
2835 /**
2836  * sme_reconfig_obss_scan_param() - reconfig obss scan param
2837  *
2838  * @mac_handle: The handle returned by mac_open
2839  * @session_id: session_id of the request
2840  * @is_scan_reconfig: true if modify OBSS scan periodicity, otherwise false
2841  *
2842  * Return: QDF_STATUS
2843  */
2844 QDF_STATUS sme_reconfig_obss_scan_param(mac_handle_t mac_handle,
2845 					uint8_t session_id,
2846 					bool is_scan_reconfig);
2847 #else
2848 static inline
sme_set_he_bss_color(mac_handle_t mac_handle,uint8_t session_id,uint8_t bss_color)2849 QDF_STATUS sme_set_he_bss_color(mac_handle_t mac_handle, uint8_t session_id,
2850 				uint8_t bss_color)
2851 {
2852 	return QDF_STATUS_SUCCESS;
2853 }
2854 
2855 static inline
sme_reconfig_obss_scan_param(mac_handle_t mac_handle,uint8_t session_id,bool is_scan_reconfig)2856 QDF_STATUS sme_reconfig_obss_scan_param(mac_handle_t mac_handle,
2857 					uint8_t session_id,
2858 					bool is_scan_reconfig)
2859 {
2860 	return QDF_STATUS_SUCCESS;
2861 }
2862 #endif
2863 
2864 /**
2865  * sme_is_conn_state_connected() -- check if SME connection state is connected
2866  * @mac_handle: Opaque handle to the global MAC context
2867  * @session_id: current Session Id
2868  *
2869  * This API checks if the current SME connection state is connected for the
2870  * given session id.
2871  *
2872  * Return: True if connected, false if any other state.
2873  */
2874 bool sme_is_conn_state_connected(mac_handle_t mac_handle, uint8_t session_id);
2875 
2876 /**
2877  * sme_get_bss_transition_status() - get bss transition status all candidates
2878  * @mac_handle: handle returned by mac_open
2879  * @transition_reason : Transition reason
2880  * @bssid: bssid to get BSS transition status
2881  * @info : bss candidate information
2882  * @n_candidates : number of candidates
2883  * @is_bt_in_progress: bt activity indicator
2884  *
2885  * Return: QDF_STATUS_SUCCESS on success otherwise a QDF_STATUS error
2886  */
2887 QDF_STATUS sme_get_bss_transition_status(mac_handle_t mac_handle,
2888 					 uint8_t transition_reason,
2889 					 struct qdf_mac_addr *bssid,
2890 					 struct bss_candidate_info *info,
2891 					 uint16_t n_candidates,
2892 					 bool is_bt_in_progress);
2893 
2894 /**
2895  * sme_unpack_rsn_ie: wrapper to unpack RSN IE and update def RSN params
2896  * if optional fields are not present.
2897  * @mac_handle: handle returned by mac_open
2898  * @buf: rsn ie buffer pointer
2899  * @buf_len: rsn ie buffer length
2900  * @rsn_ie: outframe rsn ie structure
2901  * @append_ie: flag to indicate if the rsn_ie need to be appended from buf
2902  *
2903  * Return: parse status
2904  */
2905 uint32_t sme_unpack_rsn_ie(mac_handle_t mac_handle, uint8_t *buf,
2906 			   uint8_t buf_len, tDot11fIERSN *rsn_ie,
2907 			   bool append_ie);
2908 
2909 /**
2910  * sme_unpack_assoc_rsp() - wrapper to unpack assoc response
2911  * @mac_handle: handle returned by mac_open
2912  * @rsp: Pointer to connect rsp
2913  * @assoc_resp: output assoc response structure
2914  *
2915  * Return: parse status
2916  */
2917 QDF_STATUS sme_unpack_assoc_rsp(mac_handle_t mac_handle,
2918 				struct wlan_cm_connect_resp *rsp,
2919 				struct sDot11fAssocResponse *assoc_resp);
2920 
2921 /**
2922  * sme_get_hs20vendor_ie() - wrapper to unpack beacon/probe response
2923  * @mac_handle: handle returned by mac_open
2924  * @frame: beacon/probe response response buffer pointer
2925  * @frame_len: beacone probe/ response buffer length
2926  * @hs20vendor_ie: output hs20vendor_ie structure
2927  *
2928  * Return: None
2929  */
2930 void sme_get_hs20vendor_ie(mac_handle_t mac_handle, uint8_t *frame,
2931 			   uint32_t frame_len,
2932 			   tDot11fIEhs20vendor_ie *hs20vendor_ie);
2933 
2934 /**
2935  * sme_add_qcn_ie: Adds QCN IE data to IE buffer
2936  * @mac_handle: handle returned by mac_open
2937  * @ie_data: ie buffer pointer
2938  * @ie_len: ie length pointer
2939  *
2940  * Return: none
2941  */
2942 void sme_add_qcn_ie(mac_handle_t mac_handle, uint8_t *ie_data,
2943 		    uint16_t *ie_len);
2944 
2945 /**
2946  * sme_get_oper_chan_freq - gets the operating channel freq
2947  * @vdev: vdev handle
2948  *
2949  * Return: operating channel frequency
2950  */
2951 int16_t sme_get_oper_chan_freq(struct wlan_objmgr_vdev *vdev);
2952 
2953 /**
2954  * sme_get_oper_ch_width - gets the operating channel width
2955  * @vdev: vdev handle
2956  *
2957  * Return: operating channel width
2958  */
2959 enum phy_ch_width sme_get_oper_ch_width(struct wlan_objmgr_vdev *vdev);
2960 
2961 /**
2962  * sme_get_oper_ch_width - gets the secondary channel frequency
2963  * @vdev: vdev handle
2964  * @sec20chan_freq: secondary channel frequency
2965  *
2966  * Return: secondary channel frequency
2967  */
2968 int sme_get_sec20chan_freq_mhz(struct wlan_objmgr_vdev *vdev,
2969 						uint16_t *sec20chan_freq);
2970 
2971 /**
2972  * sme_send_mgmt_tx() - Sends mgmt frame from CSR to LIM
2973  * @mac_handle: The handle returned by mac_open
2974  * @session_id: session id
2975  * @buf: pointer to frame
2976  * @len: frame length
2977  *
2978  * Return: QDF_STATUS
2979  */
2980 QDF_STATUS sme_send_mgmt_tx(mac_handle_t mac_handle, uint8_t session_id,
2981 			    const uint8_t *buf, uint32_t len);
2982 
2983 #ifdef WLAN_FEATURE_SAE
2984 /**
2985  * sme_handle_sae_msg() - Sends SAE message received from supplicant
2986  * @mac_handle: The handle returned by mac_open
2987  * @session_id: session id
2988  * @sae_status: status of SAE authentication
2989  * @peer_mac_addr: mac address of the peer to be authenticated
2990  * @pmkid: PMKID derived at the end of SAE authentication
2991  *
2992  * Return: QDF_STATUS
2993  */
2994 QDF_STATUS sme_handle_sae_msg(mac_handle_t mac_handle,
2995 			      uint8_t session_id,
2996 			      uint8_t sae_status,
2997 			      struct qdf_mac_addr peer_mac_addr,
2998 			      const uint8_t *pmkid);
2999 #else
3000 static inline
sme_handle_sae_msg(mac_handle_t mac_handle,uint8_t session_id,uint8_t sae_status,struct qdf_mac_addr peer_mac_addr,const uint8_t * pmkid)3001 QDF_STATUS sme_handle_sae_msg(mac_handle_t mac_handle,
3002 			      uint8_t session_id,
3003 			      uint8_t sae_status,
3004 			      struct qdf_mac_addr peer_mac_addr,
3005 			      const uint8_t *pmkid)
3006 {
3007 	return QDF_STATUS_SUCCESS;
3008 }
3009 #endif
3010 
3011 /**
3012  * sme_set_ba_buff_size() - sets BA buffer size
3013  * @mac_handle: Opaque handle to the global MAC context
3014  * @session_id: SME session id
3015  * @buff_size: BA buffer size
3016  *
3017  * Return: 0 on success else err code
3018  */
3019 int sme_set_ba_buff_size(mac_handle_t mac_handle, uint8_t session_id,
3020 			 uint16_t buff_size);
3021 
3022 /**
3023  * sme_send_addba_req() - send ADDBA request with user config
3024  * @mac_handle: Opaque handle to the global MAC context
3025  * @session_id: SME session id
3026  * @tid: tid val for BA session
3027  * @buff_size: BA buffer size
3028  *
3029  * Return: 0 on success else err code
3030  */
3031 int sme_send_addba_req(mac_handle_t mac_handle, uint8_t session_id, uint8_t tid,
3032 		       uint16_t buff_size);
3033 
3034 /**
3035  * sme_set_no_ack_policy() - Sets no ack policy for AC
3036  * @mac_handle: Opaque handle to the global MAC context
3037  * @session_id: SME session id
3038  * @val: no ack policy value
3039  * @ac: access category
3040  *
3041  * Return: 0 on success else err code
3042  */
3043 int sme_set_no_ack_policy(mac_handle_t mac_handle, uint8_t session_id,
3044 			  uint8_t val, uint8_t ac);
3045 
3046 /**
3047  * sme_set_auto_rate_he_sgi() - Sets SGI for auto rate
3048  * @mac_handle: Opaque handle to the global MAC context
3049  * @session_id: SME session id
3050  * @cfg_val: SGI configuration value
3051  *
3052  * Return: 0 on success else err code
3053  */
3054 int sme_set_auto_rate_he_sgi(mac_handle_t mac_handle, uint8_t session_id,
3055 			     uint8_t cfg_val);
3056 
3057 /**
3058  * sme_set_auto_rate_ldpc() - Sets LDPC for auto rate
3059  * @mac_handle: Opaque handle to the global MAC context
3060  * @session_id: SME session id
3061  * @ldpc_disable: LDPC configuration value
3062  *
3063  * Return: 0 on success else err code
3064  */
3065 int sme_set_auto_rate_ldpc(mac_handle_t mac_handle, uint8_t session_id,
3066 			   uint8_t ldpc_disable);
3067 
3068 /**
3069  * sme_set_auto_rate_he_ltf() - Sets HE LTF for auto rate
3070  * @mac_handle: Opaque handle to the global MAC context
3071  * @session_id: SME session id
3072  * @cfg_val: LTF configuration value
3073  *
3074  * Return: 0 on success else err code
3075  */
3076 int sme_set_auto_rate_he_ltf(mac_handle_t mac_handle, uint8_t session_id,
3077 			     uint8_t cfg_val);
3078 
3079 #ifdef WLAN_FEATURE_11BE
3080 /**
3081  * sme_update_tgt_eht_cap() - sets the EHT caps to pmac
3082  * @mac_handle: Pointer to MAC handle
3083  * @cfg: Pointer to WMA target CFG
3084  * @eht_cap_ini: Pointer to EHT CAP configured by INI
3085  *
3086  * Return: None
3087  */
3088 void sme_update_tgt_eht_cap(mac_handle_t mac_handle,
3089 			    struct wma_tgt_cfg *cfg,
3090 			    tDot11fIEeht_cap *eht_cap_ini);
3091 
3092 /**
3093  * sme_update_eht_cap_nss() - sets the nss based on user request
3094  * @mac_handle: Opaque handle to the global MAC context
3095  * @session_id: SME session id
3096  * @nss: no.of spatial streams value
3097  *
3098  * Return: None
3099  */
3100 void sme_update_eht_cap_nss(mac_handle_t mac_handle, uint8_t session_id,
3101 			    uint8_t nss);
3102 
3103 /**
3104  * sme_set_eht_bw_cap() - sets the EHT 320 MHz bandwidth capability
3105  * @mac_handle: Opaque handle to the global MAC context
3106  * @vdev_id: vdev id
3107  * @chwidth: channel width
3108  *
3109  * Return: None
3110  */
3111 void sme_set_eht_bw_cap(mac_handle_t mac_handle, uint8_t vdev_id,
3112 			enum eSirMacHTChannelWidth chwidth);
3113 
3114 /**
3115  * sme_update_eht_cap_mcs() - updates EHT MCS capability based on user request
3116  * @mac_handle: Opaque handle to the global MAC context
3117  * @session_id: SME session id
3118  * @mcs: MCS value
3119  *
3120  * Return: None
3121  */
3122 void sme_update_eht_cap_mcs(mac_handle_t mac_handle, uint8_t session_id,
3123 			    uint8_t mcs);
3124 
3125 /**
3126  * sme_update_eht_om_ctrl_supp() - sets the EHT OM control capability
3127  * @mac_handle: Opaque handle to the global MAC context
3128  * @session_id: SME session id
3129  * @cfg_val: EHT OM control config
3130  *
3131  * Return: 0 on success else err code
3132  */
3133 int sme_update_eht_om_ctrl_supp(mac_handle_t mac_handle, uint8_t session_id,
3134 				uint8_t cfg_val);
3135 #else
sme_update_tgt_eht_cap(mac_handle_t mac_handle,struct wma_tgt_cfg * cfg,tDot11fIEeht_cap * eht_cap_ini)3136 static inline void sme_update_tgt_eht_cap(mac_handle_t mac_handle,
3137 					  struct wma_tgt_cfg *cfg,
3138 					  tDot11fIEeht_cap *eht_cap_ini)
3139 {}
3140 
sme_update_eht_cap_nss(mac_handle_t mac_handle,uint8_t session_id,uint8_t nss)3141 static inline void sme_update_eht_cap_nss(mac_handle_t mac_handle,
3142 					  uint8_t session_id,
3143 					  uint8_t nss)
3144 {}
3145 
sme_set_eht_bw_cap(mac_handle_t mac_handle,uint8_t vdev_id,enum eSirMacHTChannelWidth chwidth)3146 static inline void sme_set_eht_bw_cap(mac_handle_t mac_handle, uint8_t vdev_id,
3147 				      enum eSirMacHTChannelWidth chwidth)
3148 {}
sme_update_eht_cap_mcs(mac_handle_t mac_handle,uint8_t session_id,uint8_t mcs)3149 static inline void sme_update_eht_cap_mcs(mac_handle_t mac_handle,
3150 					  uint8_t session_id,
3151 					  uint8_t mcs)
3152 {}
3153 
3154 static inline
sme_update_eht_om_ctrl_supp(mac_handle_t mac_handle,uint8_t session_id,uint8_t cfg_val)3155 int sme_update_eht_om_ctrl_supp(mac_handle_t mac_handle, uint8_t session_id,
3156 				uint8_t cfg_val)
3157 {
3158 	return 0;
3159 }
3160 #endif
3161 
3162 struct omi_ctrl_tx {
3163 	uint32_t omi_in_vht:1;
3164 	uint32_t omi_in_he:1;
3165 	uint32_t a_ctrl_id:4;
3166 	uint32_t rx_nss:3;
3167 	uint32_t ch_bw:2;
3168 	uint32_t ul_mu_dis:1;
3169 	uint32_t tx_nsts:3;
3170 	uint32_t er_su_dis:1;
3171 	uint32_t dl_mu_mimo_resound:1;
3172 	uint32_t ul_mu_data_dis:1;
3173 	uint32_t eht_rx_nss_ext:1;
3174 	uint32_t eht_ch_bw_ext:1;
3175 	uint32_t eht_tx_nss_ext:1;
3176 	uint32_t reserved:11;
3177 };
3178 
3179 #ifdef WLAN_FEATURE_11AX
3180 /**
3181  * sme_update_tgt_he_cap() - sets the HE caps to pmac
3182  * @mac_handle: Pointer to MAC handle
3183  * @cfg: Pointer to WMA target CFG
3184  * @he_cap_ini: Pointer to HE CAP configured by INI
3185  *
3186  * Return: None
3187  */
3188 void sme_update_tgt_he_cap(mac_handle_t mac_handle,
3189 			   struct wma_tgt_cfg *cfg,
3190 			   tDot11fIEhe_cap *he_cap_ini);
3191 
3192 /**
3193  * sme_update_he_cap_nss() - sets the nss based on user request
3194  * @mac_handle: Opaque handle to the global MAC context
3195  * @session_id: SME session id
3196  * @nss: no.of spatial streams value
3197  *
3198  * Return: None
3199  */
3200 void sme_update_he_cap_nss(mac_handle_t mac_handle, uint8_t session_id,
3201 			   uint8_t nss);
3202 
3203 /**
3204  * sme_update_he_tx_bfee_supp() - sets the HE Tx Bfee support
3205  * @mac_handle: Opaque handle to the global MAC context
3206  * @session_id: SME session id
3207  * @cfg_val: Tx Bfee config value
3208  *
3209  * Return: 0 on success else err code
3210  */
3211 int sme_update_he_tx_bfee_supp(mac_handle_t mac_handle, uint8_t session_id,
3212 			       uint8_t cfg_val);
3213 
3214 /**
3215  * sme_update_he_tx_bfee_nsts() - sets the HE Tx Bfee NSTS
3216  * @mac_handle: MAC handle
3217  * @session_id: SME session id
3218  * @cfg_val: Tx Bfee NSTS value
3219  *
3220  * Return: 0 on success else err code
3221  */
3222 int sme_update_he_tx_bfee_nsts(mac_handle_t mac_handle, uint8_t session_id,
3223 			       uint8_t cfg_val);
3224 
3225 /**
3226  * sme_set_he_tx_bf_cbf_rates() - sets the HE Tx Bfee CBF frame rates to FW
3227  * @session_id: SME session id
3228  *
3229  * Return: None
3230  */
3231 void sme_set_he_tx_bf_cbf_rates(uint8_t session_id);
3232 
3233 /**
3234  * sme_config_su_ppdu_queue() - Configures SU PPDU queue enable/disable in FW
3235  * @session_id: SME session id
3236  * @enable: Enable/Disable config
3237  *
3238  * Return: None
3239  */
3240 void sme_config_su_ppdu_queue(uint8_t session_id, bool enable);
3241 
3242 /**
3243  * sme_update_he_mcs() - sets the HE MCS based on user request
3244  * @mac_handle: Opaque handle to the global MAC context
3245  * @session_id: SME session id
3246  * @he_mcs: HE MCS value
3247  *
3248  * Return: 0 on success else err code
3249  */
3250 int sme_update_he_mcs(mac_handle_t mac_handle, uint8_t session_id,
3251 		      uint16_t he_mcs);
3252 
3253 /**
3254  * sme_update_he_trigger_frm_mac_pad() - sets the HE MAC padding capability
3255  * @mac_handle: Opaque handle to the global MAC context
3256  * @session_id: SME session id
3257  * @cfg_val: HE MAC padding duration value
3258  *
3259  * Return: 0 on success else err code
3260  */
3261 int sme_update_he_trigger_frm_mac_pad(mac_handle_t mac_handle,
3262 				      uint8_t session_id,
3263 				      uint8_t cfg_val);
3264 
3265 /**
3266  * sme_update_he_om_ctrl_supp() - sets the HE OM control capability
3267  * @mac_handle: Opaque handle to the global MAC context
3268  * @session_id: SME session id
3269  * @cfg_val: HE OM control config
3270  *
3271  * Return: 0 on success else err code
3272  */
3273 int sme_update_he_om_ctrl_supp(mac_handle_t mac_handle, uint8_t session_id,
3274 			       uint8_t cfg_val);
3275 
3276 #define A_CTRL_ID_OMI 0x1
3277 
3278 void sme_reset_he_om_ctrl(mac_handle_t mac_handle);
3279 
3280 /**
3281  * sme_config_action_tx_in_tb_ppdu() - Sends action frame in TB PPDU cfg to FW
3282  * @mac_handle: Pointer to MAC handle
3283  * @session_id: SME session id
3284  * @cfg_val: configuration setting value
3285  *
3286  * Return: 0 on success else err code
3287  */
3288 int sme_config_action_tx_in_tb_ppdu(mac_handle_t mac_handle, uint8_t session_id,
3289 				    uint8_t cfg_val);
3290 
3291 /**
3292  * sme_send_he_om_ctrl_update() - Send HE OM ctrl Tx cmd to FW
3293  * @mac_handle: Pointer to mac handle
3294  * @session_id: SME session id
3295  * @omi_data: OMI control data
3296  *
3297  * Return: 0 on success else err code
3298  */
3299 int sme_send_he_om_ctrl_update(mac_handle_t mac_handle, uint8_t session_id,
3300 			       struct omi_ctrl_tx *omi_data);
3301 
3302 /**
3303  * sme_set_he_om_ctrl_param() - Update HE OM control params for OMI Tx
3304  * @mac_handle: Pointer to mac handle
3305  * @session_id: SME session id
3306  * @param: HE om control parameter
3307  * @cfg_val: HE OM control parameter config value
3308  *
3309  * Return: 0 on success else err code
3310  */
3311 int sme_set_he_om_ctrl_param(mac_handle_t mac_handle, uint8_t session_id,
3312 			     enum qca_wlan_vendor_attr_he_omi_tx param,
3313 			     uint8_t cfg_val);
3314 
3315 /**
3316  * sme_set_usr_cfg_mu_edca() - sets the user cfg MU EDCA params flag
3317  * @mac_handle: Opaque handle to the global MAC context
3318  * @val: value to be set
3319  *
3320  * Return: none
3321  */
3322 void sme_set_usr_cfg_mu_edca(mac_handle_t mac_handle, bool val);
3323 
3324 /**
3325  * sme_set_he_mu_edca_def_cfg() - sets the default MU EDCA params values
3326  * @mac_handle: Opaque handle to the global MAC context
3327  *
3328  * Return: none
3329  */
3330 void sme_set_he_mu_edca_def_cfg(mac_handle_t mac_handle);
3331 
3332 /**
3333  * sme_update_he_htc_he_supp() - Update +HTC-HE support in HE capabilities
3334  * @mac_handle: Pointer to mac handle
3335  * @session_id: SME session id
3336  * @cfg_val: config setting
3337  *
3338  * Return: 0 on success else err code
3339  */
3340 int sme_update_he_htc_he_supp(mac_handle_t mac_handle, uint8_t session_id,
3341 			      bool cfg_val);
3342 
3343 /**
3344  * sme_update_mu_edca_params() - updates MU EDCA params values
3345  * @mac_handle: Opaque handle to the global MAC context
3346  * @session_id: SME session id
3347  *
3348  * Return: 0 on success else err code
3349  */
3350 int sme_update_mu_edca_params(mac_handle_t mac_handle, uint8_t session_id);
3351 
3352 /**
3353  * sme_update_he_tx_stbc_cap() - Sets the HE Tx STBC capability
3354  * @mac_handle: Opaque handle to the global MAC context
3355  * @session_id: SME session id
3356  * @value: set value
3357  *
3358  * Return: 0 on success else err code
3359  */
3360 int sme_update_he_tx_stbc_cap(mac_handle_t mac_handle, uint8_t session_id,
3361 			      int value);
3362 
3363 /**
3364  * sme_update_he_rx_stbc_cap() - Sets the HE Rx STBC capability
3365  * @mac_handle: Opaque handle to the global MAC context
3366  * @session_id: SME session id
3367  * @value: set value
3368  *
3369  * Return: 0 on success else err code
3370  */
3371 int sme_update_he_rx_stbc_cap(mac_handle_t mac_handle, uint8_t session_id,
3372 			      int value);
3373 
3374 /**
3375  * sme_update_he_frag_supp() - sets the HE fragmentation support
3376  * @mac_handle: Opaque handle to the global MAC context
3377  * @session_id: SME session id
3378  * @he_frag: HE fragmention support value
3379  *
3380  * Return: 0 on success else err code
3381  */
3382 int sme_update_he_frag_supp(mac_handle_t mac_handle, uint8_t session_id,
3383 			    uint16_t he_frag);
3384 
3385 /**
3386  * sme_update_he_ldpc_supp() - sets the HE LDPC support
3387  * @mac_handle: Opaque handle to the global MAC context
3388  * @session_id: SME session id
3389  * @he_ldpc: HE LDPC support value
3390  *
3391  * Return: 0 on success else err code
3392  */
3393 int sme_update_he_ldpc_supp(mac_handle_t mac_handle, uint8_t session_id,
3394 			    uint16_t he_ldpc);
3395 
3396 /**
3397  * sme_update_he_capabilities() - Update the session HE capability
3398  * @mac_handle: Opaque handle to the global MAC context
3399  * @session_id: SME session id
3400  * @cfg_val: set value
3401  * @cfg_id: HE cap cfg id
3402  *
3403  * Return: 0 on success else err code
3404  */
3405 int sme_update_he_capabilities(mac_handle_t mac_handle, uint8_t session_id,
3406 			       uint8_t cfg_val, uint8_t cfg_id);
3407 
3408 /**
3409  * sme_update_he_twt_req_support() - Sets twt request capability
3410  * @mac_handle: Opaque handle to the global MAC context
3411  * @session_id: SME session id
3412  * @cfg_val: set value
3413  *
3414  * Return: 0 on success else err code
3415  */
3416 int sme_update_he_twt_req_support(mac_handle_t mac_handle, uint8_t session_id,
3417 				  uint8_t cfg_val);
3418 
3419 /**
3420  * sme_update_he_full_ul_mumimo() - Configure full bandwidth of ul mu-mimo
3421  * @mac_handle: Opaque handle to the global MAC context
3422  * @session_id: SME session id
3423  * @value: set value
3424  *
3425  * Return: 0 on success else err code
3426  */
3427 int sme_update_he_full_ul_mumimo(mac_handle_t mac_handle, uint8_t session_id,
3428 				 uint8_t cfg_val);
3429 #else
sme_update_tgt_he_cap(mac_handle_t mac_handle,struct wma_tgt_cfg * cfg,tDot11fIEhe_cap * he_cap_ini)3430 static inline void sme_update_tgt_he_cap(mac_handle_t mac_handle,
3431 					 struct wma_tgt_cfg *cfg,
3432 					 tDot11fIEhe_cap *he_cap_ini)
3433 {}
sme_update_he_cap_nss(mac_handle_t mac_handle,uint8_t session_id,uint8_t nss)3434 static inline void sme_update_he_cap_nss(mac_handle_t mac_handle,
3435 					 uint8_t session_id,
3436 					 uint8_t nss)
3437 {}
sme_update_he_mcs(mac_handle_t mac_handle,uint8_t session_id,uint16_t he_mcs)3438 static inline int sme_update_he_mcs(mac_handle_t mac_handle, uint8_t session_id,
3439 				    uint16_t he_mcs)
3440 {
3441 	return 0;
3442 }
3443 
sme_set_he_mu_edca_def_cfg(mac_handle_t mac_handle)3444 static inline void sme_set_he_mu_edca_def_cfg(mac_handle_t mac_handle)
3445 {
3446 }
3447 
sme_update_mu_edca_params(mac_handle_t mac_handle,uint8_t session_id)3448 static inline int sme_update_mu_edca_params(mac_handle_t mac_handle,
3449 					    uint8_t session_id)
3450 {
3451 	return 0;
3452 }
3453 
sme_update_he_trigger_frm_mac_pad(mac_handle_t mac_handle,uint8_t session_id,uint8_t cfg_val)3454 static inline int sme_update_he_trigger_frm_mac_pad(mac_handle_t mac_handle,
3455 						    uint8_t session_id,
3456 						    uint8_t cfg_val)
3457 {
3458 	return 0;
3459 }
3460 
sme_update_he_om_ctrl_supp(mac_handle_t mac_handle,uint8_t session_id,uint8_t cfg_val)3461 static inline int sme_update_he_om_ctrl_supp(mac_handle_t mac_handle,
3462 					     uint8_t session_id,
3463 					     uint8_t cfg_val)
3464 {
3465 	return 0;
3466 }
3467 
3468 
3469 static inline int
sme_set_he_om_ctrl_param(mac_handle_t mac_handle,uint8_t session_id,enum qca_wlan_vendor_attr_he_omi_tx param,uint8_t cfg_val)3470 sme_set_he_om_ctrl_param(mac_handle_t mac_handle, uint8_t session_id,
3471 			 enum qca_wlan_vendor_attr_he_omi_tx param,
3472 			 uint8_t cfg_val)
3473 {
3474 	return 0;
3475 }
3476 
sme_reset_he_om_ctrl(mac_handle_t mac_handle)3477 static inline void sme_reset_he_om_ctrl(mac_handle_t mac_handle)
3478 {
3479 }
3480 
sme_config_action_tx_in_tb_ppdu(mac_handle_t mac_handle,uint8_t session_id,uint8_t cfg_val)3481 static inline int sme_config_action_tx_in_tb_ppdu(mac_handle_t mac_handle,
3482 						  uint8_t session_id,
3483 						  uint8_t cfg_val)
3484 {
3485 	return 0;
3486 }
3487 
sme_update_he_htc_he_supp(mac_handle_t mac_handle,uint8_t session_id,bool cfg_val)3488 static inline int sme_update_he_htc_he_supp(mac_handle_t mac_handle,
3489 					    uint8_t session_id,
3490 					    bool cfg_val)
3491 {
3492 	return 0;
3493 }
3494 
3495 static inline int
sme_send_he_om_ctrl_update(mac_handle_t mac_handle,uint8_t session_id,struct omi_ctrl_tx * omi_data)3496 sme_send_he_om_ctrl_update(mac_handle_t mac_handle, uint8_t session_id,
3497 			   struct omi_ctrl_tx *omi_data)
3498 {
3499 	return 0;
3500 }
sme_set_usr_cfg_mu_edca(mac_handle_t mac_handle,bool val)3501 static inline void sme_set_usr_cfg_mu_edca(mac_handle_t mac_handle, bool val)
3502 {
3503 }
3504 
sme_update_he_tx_stbc_cap(mac_handle_t mac_handle,uint8_t session_id,int value)3505 static inline int sme_update_he_tx_stbc_cap(mac_handle_t mac_handle,
3506 					    uint8_t session_id,
3507 					    int value)
3508 {
3509 	return 0;
3510 }
3511 
sme_update_he_rx_stbc_cap(mac_handle_t mac_handle,uint8_t session_id,int value)3512 static inline int sme_update_he_rx_stbc_cap(mac_handle_t mac_handle,
3513 					    uint8_t session_id,
3514 					    int value)
3515 {
3516 	return 0;
3517 }
3518 
sme_update_he_frag_supp(mac_handle_t mac_handle,uint8_t session_id,uint16_t he_frag)3519 static inline int sme_update_he_frag_supp(mac_handle_t mac_handle,
3520 					  uint8_t session_id,
3521 					  uint16_t he_frag)
3522 {
3523 	return 0;
3524 }
3525 
sme_update_he_ldpc_supp(mac_handle_t mac_handle,uint8_t session_id,uint16_t he_ldpc)3526 static inline int sme_update_he_ldpc_supp(mac_handle_t mac_handle,
3527 					  uint8_t session_id,
3528 					  uint16_t he_ldpc)
3529 {
3530 	return 0;
3531 }
3532 
sme_update_he_tx_bfee_supp(mac_handle_t mac_handle,uint8_t session_id,uint8_t cfg_val)3533 static inline int sme_update_he_tx_bfee_supp(mac_handle_t mac_handle,
3534 					     uint8_t session_id,
3535 					     uint8_t cfg_val)
3536 {
3537 	return 0;
3538 }
sme_update_he_tx_bfee_nsts(mac_handle_t mac_handle,uint8_t session_id,uint8_t cfg_val)3539 static inline int sme_update_he_tx_bfee_nsts(mac_handle_t mac_handle,
3540 					     uint8_t session_id,
3541 					     uint8_t cfg_val)
3542 {
3543 	return 0;
3544 }
3545 
sme_set_he_tx_bf_cbf_rates(uint8_t session_id)3546 static inline void sme_set_he_tx_bf_cbf_rates(uint8_t session_id)
3547 {
3548 }
3549 
sme_config_su_ppdu_queue(uint8_t session_id,bool enable)3550 static inline void sme_config_su_ppdu_queue(uint8_t session_id, bool enable)
3551 {
3552 }
3553 
sme_update_he_twt_req_support(mac_handle_t mac_handle,uint8_t session_id,uint8_t cfg_val)3554 static inline int sme_update_he_twt_req_support(mac_handle_t mac_handle,
3555 						uint8_t session_id,
3556 						uint8_t cfg_val)
3557 {
3558 	return 0;
3559 }
3560 
sme_update_he_capabilities(mac_handle_t mac_handle,uint8_t session_id,uint8_t cfg_val,uint8_t cfg_id)3561 static inline int sme_update_he_capabilities(mac_handle_t mac_handle,
3562 					      uint8_t session_id,
3563 					      uint8_t cfg_val,
3564 					      uint8_t cfg_id)
3565 {
3566 	return 0;
3567 }
3568 
sme_update_he_full_ul_mumimo(mac_handle_t mac_handle,uint8_t session_id,uint8_t cfg_val)3569 static inline int sme_update_he_full_ul_mumimo(mac_handle_t mac_handle,
3570 					       uint8_t session_id,
3571 					       uint8_t cfg_val)
3572 {
3573 	return 0;
3574 }
3575 
3576 #endif
3577 
3578 /**
3579  * sme_update_session_txq_edca_params() - sets the configured
3580  * internal EDCA params values
3581  *
3582  * @mac_handle: Opaque handle to the global MAC context
3583  * @session_id: session id
3584  * @txq_edca_params: edca parameters
3585  *
3586  * Return: QDF_STATUS
3587  */
3588 QDF_STATUS
3589 sme_update_session_txq_edca_params(mac_handle_t mac_handle, uint8_t session_id,
3590 				   tSirMacEdcaParamRecord *txq_edca_params);
3591 
3592 /**
3593  * sme_is_sta_key_exchange_in_progress() - checks whether the STA/P2P client
3594  * session has key exchange in progress
3595  *
3596  * @mac_handle: Opaque handle to the global MAC context
3597  * @session_id: session id
3598  *
3599  * Return: true - if key exchange in progress
3600  *         false - if not in progress
3601  */
3602 bool sme_is_sta_key_exchange_in_progress(mac_handle_t mac_handle,
3603 					 uint8_t session_id);
3604 
3605 /*
3606  * sme_validate_channel_list() - Validate the given channel list
3607  * @mac_handle: Opaque handle to the global MAC context
3608  * @chan_freq_list: Pointer to the channel list
3609  * @num_channels: number of channels present in the chan_list
3610  *
3611  * Validates the given channel list with base channels in mac context
3612  *
3613  * Return: True if all channels in the list are valid, false otherwise
3614  */
3615 bool sme_validate_channel_list(mac_handle_t mac_handle,
3616 			       uint32_t *chan_freq_list,
3617 			       uint8_t num_channels);
3618 
3619 /**
3620  * sme_set_amsdu() - set amsdu enable/disable based on user cfg
3621  * @mac_handle: Opaque handle to the global MAC context
3622  * @enable: enable or disable
3623  *
3624  * Return: None
3625  */
3626 void sme_set_amsdu(mac_handle_t mac_handle, bool enable);
3627 
3628 /**
3629  * sme_set_pmf_wep_cfg() - set user cfg for PMF setting
3630  * @mac_handle: Opaque handle to the global MAC context
3631  * @pmf_wep_cfg: PMF configuration
3632  *
3633  * Return: None
3634  */
3635 void sme_set_pmf_wep_cfg(mac_handle_t mac_handle, uint8_t pmf_wep_cfg);
3636 
3637 /**
3638  * sme_set_cfg_disable_tx() - set user cfg to disable data and mgmt tx
3639  * @mac_handle: Opaque handle to the global MAC context
3640  * @vdev_id: vdev id
3641  * @val: configuration value
3642  *
3643  * Return: None
3644  */
3645 void sme_set_cfg_disable_tx(mac_handle_t mac_handle, uint8_t vdev_id,
3646 			    uint8_t val);
3647 /**
3648  * sme_set_bss_max_idle_period() - Configure the bss max idle period
3649  * @mac_handle: Opaque handle to the global MAC context
3650  * @cfg_val: bss max idle period
3651  *
3652  * Return: None
3653  */
3654 void sme_set_bss_max_idle_period(mac_handle_t mac_handle, uint16_t cfg_val);
3655 
3656 #ifdef WLAN_FEATURE_11AX
3657 void sme_set_he_testbed_def(mac_handle_t mac_handle, uint8_t vdev_id);
3658 void sme_reset_he_caps(mac_handle_t mac_handle, uint8_t vdev_id);
3659 void sme_set_he_bw_cap(mac_handle_t mac_handle, uint8_t vdev_id,
3660 		       enum eSirMacHTChannelWidth chwidth);
3661 /**
3662  * sme_set_ru_242_tone_tx_cfg() - set ru 242 tone tx user cfg
3663  * @mac_handle: Opaque handle to the global MAC context
3664  * @cfg_val: enable or disable
3665  *
3666  * Return: None
3667  */
3668 void sme_set_ru_242_tone_tx_cfg(mac_handle_t mac_handle, uint8_t cfg_val);
3669 
3670 /**
3671  * sme_check_enable_ru_242_tx() - check usr cfg and enable ru 242 tone tx
3672  * @mac_handle: Opaque handle to the global MAC context
3673  * @vdev_id: VDEV id
3674  *
3675  * Return: None
3676  */
3677 void sme_check_enable_ru_242_tx(mac_handle_t mac_handle, uint8_t vdev_id);
3678 
3679 #else
sme_set_he_testbed_def(mac_handle_t mac_handle,uint8_t vdev_id)3680 static inline void sme_set_he_testbed_def(mac_handle_t mac_handle,
3681 					  uint8_t vdev_id)
3682 {
3683 }
sme_reset_he_caps(mac_handle_t mac_handle,uint8_t vdev_id)3684 static inline void sme_reset_he_caps(mac_handle_t mac_handle, uint8_t vdev_id)
3685 {
3686 }
3687 
sme_set_he_bw_cap(mac_handle_t mac_handle,uint8_t vdev_id,enum eSirMacHTChannelWidth chwidth)3688 static inline void sme_set_he_bw_cap(mac_handle_t mac_handle, uint8_t vdev_id,
3689 				     enum eSirMacHTChannelWidth chwidth)
3690 {
3691 }
sme_check_enable_ru_242_tx(mac_handle_t mac_handle,uint8_t vdev_id)3692 static inline void sme_check_enable_ru_242_tx(mac_handle_t mac_handle,
3693 					      uint8_t vdev_id)
3694 {
3695 }
3696 
sme_set_ru_242_tone_tx_cfg(mac_handle_t mac_handle,uint8_t cfg_val)3697 static inline void sme_set_ru_242_tone_tx_cfg(mac_handle_t mac_handle,
3698 					      uint8_t cfg_val)
3699 {
3700 }
3701 #endif
3702 
3703 /**
3704  * sme_set_nss_capability() - sets HE, EHT NSS capability based on user request
3705  * @mac_handle: Opaque handle to the global MAC context
3706  * @vdev_id: VDEV id
3707  * @nss: Number of spatial streams value
3708  * @op_mode: Operation mode of the vdev
3709  *
3710  * Return: None
3711  */
3712 void sme_set_nss_capability(mac_handle_t mac_handle, uint8_t vdev_id,
3713 			    uint8_t nss, enum QDF_OPMODE op_mode);
3714 
3715 /**
3716  * enum sme_eht_tx_bfee_cap_type - EHT TX Beamformee capability type
3717  * @EHT_TX_BFEE_ENABLE: TX beamformee enable
3718  * @EHT_TX_BFEE_SS_80MHZ: TX beamformee for 80 MHz
3719  * @EHT_TX_BFEE_SS_160MHZ: TX beamformee for 160 MHz
3720  * @EHT_TX_BFEE_SS_320MHZ: TX beamformee for 320 MHz
3721  * @EHT_TX_BFEE_SOUNDING_FEEDBACK_RATELIMIT: TX beamformee sounding feedback
3722  * ratelimit
3723  */
3724 enum sme_eht_tx_bfee_cap_type {
3725 	EHT_TX_BFEE_ENABLE = 1,
3726 	EHT_TX_BFEE_SS_80MHZ = 2,
3727 	EHT_TX_BFEE_SS_160MHZ = 3,
3728 	EHT_TX_BFEE_SS_320MHZ = 4,
3729 	EHT_TX_BFEE_SOUNDING_FEEDBACK_RATELIMIT = 5,
3730 };
3731 
3732 #ifdef WLAN_FEATURE_11BE
3733 /**
3734  * sme_set_eht_testbed_def() - set eht testbed default
3735  * @mac_handle: Opaque handle to the global MAC context
3736  * @vdev_id: VDEV id
3737  *
3738  * Return: None
3739  */
3740 void sme_set_eht_testbed_def(mac_handle_t mac_handle, uint8_t vdev_id);
3741 
3742 /**
3743  * sme_reset_eht_caps() - reset eht capabilities
3744  * @mac_handle: Opaque handle to the global MAC context
3745  * @vdev_id: VDEV id
3746  *
3747  * Return: None
3748  */
3749 void sme_reset_eht_caps(mac_handle_t mac_handle, uint8_t vdev_id);
3750 
3751 /**
3752  * sme_set_mlo_max_links() - set mlo max links
3753  * @mac_handle: Opaque handle to the global MAC context
3754  * @vdev_id: VDEV id
3755  * @val: value to be set
3756  *
3757  * Return: None
3758  */
3759 void sme_set_mlo_max_links(mac_handle_t mac_handle, uint8_t vdev_id,
3760 			   uint8_t val);
3761 
3762 /**
3763  * sme_set_mlo_max_simultaneous_links() - set mlo max simultaneous links
3764  * @mac_handle: Opaque handle to the global MAC context
3765  * @vdev_id: VDEV id
3766  * @val: value to set
3767  *
3768  * Return: None
3769  */
3770 void sme_set_mlo_max_simultaneous_links(mac_handle_t mac_handle,
3771 					uint8_t vdev_id, uint8_t val);
3772 
3773 /**
3774  * sme_set_mlo_assoc_link_band() - set mlo assoc link band
3775  * @mac_handle: Opaque handle to the global MAC context
3776  * @vdev_id: VDEV id
3777  * @val: value to be set
3778  *
3779  * Return: None
3780  */
3781 void sme_set_mlo_assoc_link_band(mac_handle_t mac_handle, uint8_t vdev_id,
3782 				 uint8_t val);
3783 
3784 /**
3785  * sme_activate_mlo_links() - Force active ML links based on user
3786  * requested link mac address
3787  *
3788  * @mac_handle: Opaque handle to the global MAC context
3789  * @session_id: session id
3790  * @num_links: number of links to be forced active
3791  * @active_link_addr: link mac address of (up to 2) links to be forced active
3792  *
3793  * Return: void
3794  */
3795 void sme_activate_mlo_links(mac_handle_t mac_handle, uint8_t session_id,
3796 			    uint8_t num_links,
3797 			    struct qdf_mac_addr active_link_addr[2]);
3798 
3799 /**
3800  * sme_update_eht_caps() - Update the session EHT caps
3801  * @mac_handle: Opaque handle to the global MAC context
3802  * @session_id: SME session id
3803  * @cfg_val: Set value
3804  * @cap_type: EHT TX beamformee capability type
3805  * @op_mode: Operation mode of the vdev
3806  *
3807  * Return: 0 on success otherwise error code
3808  */
3809 int sme_update_eht_caps(mac_handle_t mac_handle, uint8_t session_id,
3810 			uint8_t cfg_val, enum sme_eht_tx_bfee_cap_type cap_type,
3811 			enum QDF_OPMODE op_mode);
3812 /**
3813  * sme_send_vdev_pause_for_bcn_period() - Send vdev pause indication to FW
3814  * @mac_handle: Opaque handle to the global MAC context
3815  * @session_id: SME session id
3816  * @cfg_val: Set vdev pause duration
3817  *
3818  * Return: 0 on success otherwise error code
3819  */
3820 int sme_send_vdev_pause_for_bcn_period(mac_handle_t mac_handle,
3821 				       uint8_t session_id,
3822 				       uint8_t cfg_val);
3823 
3824 /**
3825  * sme_set_per_link_ba_mode() - sets BA mode for each STA MLD link
3826  * @mac_handle: Opaque handle to the global MAC context
3827  * @val: BA mode
3828  *
3829  * Return: None
3830  */
3831 void sme_set_per_link_ba_mode(mac_handle_t mac_handle, uint8_t val);
3832 #else
sme_set_eht_testbed_def(mac_handle_t mac_handle,uint8_t vdev_id)3833 static inline void sme_set_eht_testbed_def(mac_handle_t mac_handle,
3834 					   uint8_t vdev_id)
3835 {
3836 }
3837 
3838 static inline
sme_reset_eht_caps(mac_handle_t mac_handle,uint8_t vdev_id)3839 void sme_reset_eht_caps(mac_handle_t mac_handle, uint8_t vdev_id)
3840 {
3841 }
3842 
3843 static inline
sme_set_mlo_max_links(mac_handle_t mac_handle,uint8_t vdev_id,uint8_t val)3844 void sme_set_mlo_max_links(mac_handle_t mac_handle, uint8_t vdev_id,
3845 			   uint8_t val)
3846 {
3847 }
3848 
3849 static inline
sme_set_mlo_assoc_link_band(mac_handle_t mac_handle,uint8_t vdev_id,uint8_t val)3850 void sme_set_mlo_assoc_link_band(mac_handle_t mac_handle, uint8_t vdev_id,
3851 				 uint8_t val)
3852 {
3853 }
3854 
3855 static inline
sme_set_mlo_max_simultaneous_links(mac_handle_t mac_handle,uint8_t vdev_id,uint8_t val)3856 void sme_set_mlo_max_simultaneous_links(mac_handle_t mac_handle,
3857 					uint8_t vdev_id, uint8_t val)
3858 {
3859 }
3860 
3861 static inline
sme_update_eht_caps(mac_handle_t mac_handle,uint8_t session_id,uint8_t cfg_val,enum sme_eht_tx_bfee_cap_type cap_type,enum QDF_OPMODE op_mode)3862 int sme_update_eht_caps(mac_handle_t mac_handle, uint8_t session_id,
3863 			uint8_t cfg_val, enum sme_eht_tx_bfee_cap_type cap_type,
3864 			enum QDF_OPMODE op_mode)
3865 {
3866 	return 0;
3867 }
3868 
3869 static inline
sme_send_vdev_pause_for_bcn_period(mac_handle_t mac_handle,uint8_t session_id,uint8_t cfg_val)3870 int sme_send_vdev_pause_for_bcn_period(mac_handle_t mac_handle,
3871 				       uint8_t session_id,
3872 				       uint8_t cfg_val)
3873 {
3874 	return 0;
3875 }
3876 
3877 static inline
sme_activate_mlo_links(mac_handle_t mac_handle,uint8_t session_id,uint8_t num_links,struct qdf_mac_addr active_link_addr[2])3878 void sme_activate_mlo_links(mac_handle_t mac_handle, uint8_t session_id,
3879 			    uint8_t num_links,
3880 			    struct qdf_mac_addr active_link_addr[2])
3881 {
3882 }
3883 
3884 static inline
sme_set_per_link_ba_mode(mac_handle_t mac_handle,uint8_t val)3885 void sme_set_per_link_ba_mode(mac_handle_t mac_handle, uint8_t val)
3886 {}
3887 #endif
3888 
3889 /**
3890  * sme_get_mcs_idx() - gets mcs index
3891  * @raw_rate: raw rate from fw
3892  * @rate_flags: rate flags
3893  * @is_he_mcs_12_13_supported: is he mcs12/13 supported
3894  * @nss: number of nss
3895  * @dcm: dcm will be calculated from rate
3896  * @guard_interval: guard interval info from rate
3897  * @mcs_rate_flags: mcs rate flag
3898  *
3899  * Return: return mcs index
3900  */
3901 uint8_t sme_get_mcs_idx(uint16_t raw_rate, enum tx_rate_info rate_flags,
3902 			bool is_he_mcs_12_13_supported,
3903 			uint8_t *nss, uint8_t *dcm,
3904 			enum txrate_gi *guard_interval,
3905 			enum tx_rate_info *mcs_rate_flags);
3906 
3907 #ifdef WLAN_SUPPORT_TWT
3908 
3909 /**
3910  * sme_test_config_twt_terminate() - send TWT del dialog wmi command
3911  * to firmware
3912  * @params: TWT del dialog parameters
3913  *
3914  * Return: QDF_STATUS_SUCCESS on Success, other QDF_STATUS error codes
3915  * on failure
3916  */
3917 QDF_STATUS
3918 sme_test_config_twt_terminate(struct wmi_twt_del_dialog_param *params);
3919 
3920 /**
3921  * sme_test_config_twt_setup() - send TWT add dialog wmi command
3922  * to firmware
3923  * @params: TWT add dialog parameters
3924  *
3925  * Return: QDF_STATUS_SUCCESS on Success, other QDF_STATUS error codes
3926  * on failure
3927  */
3928 QDF_STATUS sme_test_config_twt_setup(struct wmi_twt_add_dialog_param *params);
3929 
3930 /**
3931  * sme_clear_twt_complete_cb() - Initialize TWT callbacks
3932  * @mac_handle: MAC handle
3933  *
3934  * Return: QDF_STATUS_SUCCESS on Success, other QDF_STATUS error codes
3935  * on failure
3936  */
3937 QDF_STATUS sme_clear_twt_complete_cb(mac_handle_t mac_handle);
3938 
3939 /**
3940  * sme_register_twt_callbacks() - TWT enable registrar
3941  * @mac_handle: MAC handle
3942  * @twt_cb: TWT callbacks
3943  *
3944  * Return: QDF_STATUS_SUCCESS on Success, other QDF_STATUS error codes
3945  * on failure
3946  */
3947 QDF_STATUS sme_register_twt_callbacks(mac_handle_t mac_handle,
3948 				      struct twt_callbacks *twt_cb);
3949 
3950 /**
3951  * sme_add_dialog_cmd() - Register callback and send TWT add dialog
3952  * command to firmware
3953  * @mac_handle: MAC handle
3954  * @twt_add_dialog_cb: Function callback to handle add_dialog event
3955  * @twt_params: TWT add dialog parameters
3956  * @context: TWT context
3957  *
3958  * Return: QDF Status
3959  */
3960 QDF_STATUS sme_add_dialog_cmd(mac_handle_t mac_handle,
3961 			      twt_add_dialog_cb twt_add_dialog_cb,
3962 			      struct wmi_twt_add_dialog_param *twt_params,
3963 			      void *context);
3964 
3965 /**
3966  * sme_del_dialog_cmd() - Register callback and send TWT del dialog
3967  * command to firmware
3968  * @mac_handle: MAC handle
3969  * @twt_del_dialog_cb: Function callback to handle del_dialog event
3970  * @twt_params: TWT del dialog parameters
3971  * @context: TWT context
3972  *
3973  * Return: QDF Status
3974  */
3975 QDF_STATUS sme_del_dialog_cmd(mac_handle_t mac_handle,
3976 			      twt_del_dialog_cb del_dialog_cb,
3977 			      struct wmi_twt_del_dialog_param *twt_params,
3978 			      void *context);
3979 
3980 /**
3981  * sme_sap_del_dialog_cmd() - Register callback and send TWT del dialog
3982  * command to firmware
3983  * @mac_handle: MAC handle
3984  * @twt_del_dialog_cb: Function callback to handle del_dialog event
3985  * @twt_params: TWT del dialog parameters
3986  *
3987  * Return: QDF Status
3988  */
3989 QDF_STATUS sme_sap_del_dialog_cmd(mac_handle_t mac_handle,
3990 				  twt_del_dialog_cb del_dialog_cb,
3991 				  struct wmi_twt_del_dialog_param *twt_params);
3992 
3993 /**
3994  * sme_pause_dialog_cmd() - Register callback and send TWT pause dialog
3995  * command to firmware
3996  * @mac_handle: MAC handle
3997  * @twt_params: TWT pause dialog parameters
3998  * @context: TWT context
3999  *
4000  * Return: QDF_STATUS_SUCCESS on Success, other QDF_STATUS error codes
4001  * on failure
4002  */
4003 QDF_STATUS
4004 sme_pause_dialog_cmd(mac_handle_t mac_handle,
4005 		     struct wmi_twt_pause_dialog_cmd_param *twt_params,
4006 		     void *context);
4007 
4008 /**
4009  * sme_nudge_dialog_cmd() - Register callback and send TWT nudge dialog
4010  * command to firmware
4011  * @mac_handle: MAC handle
4012  * @twt_params: TWT nudge dialog parameters
4013  * @context: TWT context
4014  *
4015  * Return: QDF_STATUS_SUCCESS on Success, other QDF_STATUS error codes
4016  * on failure
4017  */
4018 QDF_STATUS
4019 sme_nudge_dialog_cmd(mac_handle_t mac_handle,
4020 		     struct wmi_twt_nudge_dialog_cmd_param *twt_params,
4021 		     void *context);
4022 
4023 /**
4024  * sme_resume_dialog_cmd() - Register callback and send TWT resume dialog
4025  * command to firmware
4026  * @mac_handle: MAC handle
4027  * @twt_params: TWT resume dialog parameters
4028  * @context: TWT context
4029  *
4030  * Return: QDF_STATUS_SUCCESS on Success, other QDF_STATUS error codes
4031  * on failure
4032  */
4033 QDF_STATUS
4034 sme_resume_dialog_cmd(mac_handle_t mac_handle,
4035 		      struct wmi_twt_resume_dialog_cmd_param *twt_params,
4036 		      void *context);
4037 
4038 /**
4039  * sme_twt_update_beacon_template() - API to send beacon update to fw
4040  * @mac_handle: MAC handle
4041  *
4042  * Return: None
4043  */
4044 void sme_twt_update_beacon_template(mac_handle_t mac_handle);
4045 
4046 #else
4047 
4048 static inline
sme_test_config_twt_setup(struct wmi_twt_add_dialog_param * params)4049 QDF_STATUS sme_test_config_twt_setup(struct wmi_twt_add_dialog_param *params)
4050 {
4051 	return QDF_STATUS_E_FAILURE;
4052 }
4053 
4054 static inline QDF_STATUS
sme_test_config_twt_terminate(struct wmi_twt_del_dialog_param * params)4055 sme_test_config_twt_terminate(struct wmi_twt_del_dialog_param *params)
4056 {
4057 	return QDF_STATUS_E_FAILURE;
4058 }
4059 
4060 static inline
sme_twt_update_beacon_template(mac_handle_t mac_handle)4061 void sme_twt_update_beacon_template(mac_handle_t mac_handle)
4062 {
4063 }
4064 
4065 #endif
4066 
4067 #ifdef WLAN_UNIT_TEST
4068 /**
4069  * sme_get_sta_cxn_info() - This function populates all the connection
4070  *			    information which is formed by DUT-STA to AP
4071  *			    by calling CSR helper API.
4072  * @mac_ctx: pointer to mac context
4073  * @session: pointer to sta session
4074  * @conn_profile: pointer to connected DUTSTA-REFAP profile
4075  * @buf: pointer to char buffer to write all the connection information.
4076  * @buf_size: maximum size of the provided buffer
4077  *
4078  * Returns: QDF_STATUS
4079  */
4080 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
4081 QDF_STATUS sme_get_sta_cxn_info(mac_handle_t mac_handle, uint32_t session_id,
4082 				char *buf, uint32_t buf_sz);
4083 #else
4084 static inline QDF_STATUS
sme_get_sta_cxn_info(mac_handle_t mac_handle,uint32_t session_id,char * buf,uint32_t buf_sz)4085 sme_get_sta_cxn_info(mac_handle_t mac_handle, uint32_t session_id,
4086 		     char *buf, uint32_t buf_sz)
4087 {
4088 	qdf_scnprintf(buf, buf_sz,
4089 		      "\nDiag macro disable, ask vendor to enable");
4090 	return QDF_STATUS_SUCCESS;
4091 }
4092 #endif
4093 #endif
4094 
4095 #if defined(FEATURE_WLAN_ESE) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
4096 /**
4097  * sme_add_key_btk() - Add BTK key
4098  * @mac_handle: MAC handle
4099  * @session_id: SME session identifier
4100  * @key: key material
4101  * @key_len: length of the key
4102  *
4103  * Return: 0 on success and negative value for failure
4104  */
4105 int sme_add_key_btk(mac_handle_t mac_handle, uint8_t session_id,
4106 		    const uint8_t *key, const int key_len);
4107 
4108 #else
sme_add_key_btk(mac_handle_t mac_handle,uint8_t session_id,const uint8_t * key,const int key_len)4109 static inline int sme_add_key_btk(mac_handle_t mac_handle, uint8_t session_id,
4110 				  const uint8_t *key, const int key_len)
4111 {
4112 	return 0;
4113 }
4114 #endif
4115 
4116 #ifdef FEATURE_WLAN_ESE
4117 /**
4118  * sme_add_key_krk() - Add KRK key
4119  * @mac_handle: MAC handle
4120  * @session_id: SME session identifier
4121  * @key: key material
4122  * @key_len: length of the key
4123  *
4124  * Return: 0 on success and negative value for failure
4125  */
4126 int sme_add_key_krk(mac_handle_t mac_handle, uint8_t session_id,
4127 		    const uint8_t *key, const int key_len);
4128 
4129 #else
4130 
sme_add_key_krk(mac_handle_t mac_handle,uint8_t session_id,const uint8_t * key,const int key_len)4131 static inline int sme_add_key_krk(mac_handle_t mac_handle, uint8_t session_id,
4132 				  const uint8_t *key, const int key_len)
4133 {
4134 	return 0;
4135 }
4136 #endif
4137 
4138 /**
4139  * sme_get_roam_scan_stats() - Send roam scan stats cmd to wma
4140  * @mac_handle: handle returned by mac_open
4141  * @cb: call-back invoked for roam scan stats response
4142  * @context: context of callback
4143  * @vdev_id: vdev id
4144  *
4145  * Return: QDF_STATUS
4146  */
4147 QDF_STATUS
4148 sme_get_roam_scan_stats(mac_handle_t mac_handle, roam_scan_stats_cb cb,
4149 			void *context, uint32_t vdev_id);
4150 
4151 /**
4152  * sme_update_score_config() - Update the Scoring Config from MLME
4153  * @mac_handle: Mac Handle
4154  * @phy_mode: Phymode to be used
4155  * @num_rf_chains: num of RF chains supported by HW
4156  *
4157  * Return: None
4158  */
4159 void sme_update_score_config(mac_handle_t mac_handle, eCsrPhyMode phy_mode,
4160 			     uint8_t num_rf_chains);
4161 
4162 /**
4163  * sme_enable_fw_module_log_level() - enable fw module log level
4164  * @mac_handle: handle returned by mac_open
4165  * @vdev_id: vdev id
4166  *
4167  * Return: None
4168  */
4169 void sme_enable_fw_module_log_level(mac_handle_t mac_handle, int vdev_id);
4170 
4171 #ifdef WLAN_FEATURE_MOTION_DETECTION
4172 /**
4173  * sme_motion_det_cfg - motion detection configuration
4174  * @vdev_id: vdev id
4175  * @time_t1: Time T1 for motion detection in msecs
4176  * @time_t2: Time T2 for motion detection in msecs
4177  * @n1: number of packets for coarse detection
4178  * @n2: number of packets for fine detection
4179  * @time_t1_gap: gap between packets in coarse detection in msecs
4180  * @time_t2_gap: gap between packets in fine detection in msecs
4181  * @coarse_k: number of times fine motion detection has to be performed for
4182  *	      coarse detection
4183  * @fine_k: number of times fine motion detection has to be performed for
4184  *	    fine detection
4185  * @coarse_q: number of times motion is expected to be detected for success
4186  *	      case in coarse detection
4187  * @fine_q: number of times motion is expected to be detected for success
4188  *	    case in fine detection
4189  * @md_coarse_thr_high: higher threshold value (in percent) from host to FW,
4190  *			which will be used in coarse detection phase of motion
4191  *			detection. This is the threshold for the correlation of
4192  *			the old RF local-scattering environment with current RF
4193  *			local-scattering environment. Value of 100(%) indicates
4194  *			that neither the transceiver nor any nearby objects
4195  *			have changed position
4196  * @md_fine_thr_high: higher threshold value (in percent) from host to FW, which
4197  *		      will be used in fine detection phase of motion detection.
4198  *		      This is the threshold for correlation between the old and
4199  *		      current RF environments, as explained above
4200  * @md_coarse_thr_low: lower threshold value (in percent) for immediate
4201  *		       detection of motion in coarse detection phase. This is
4202  *		       the threshold for correlation between the old and current
4203  *		       RF environments, as explained above
4204  * @md_fine_thr_low: lower threshold value (in percent) for immediate detection
4205  *		     of motion in fine detection phase. This is the threshold
4206  *		     for correlation between the old and current RF
4207  *		     environments, as explained above
4208  * @eSME_TDLS_PEER_REMOVE_MAC_ADDR: remove peer mac from connection table
4209  */
4210 
4211 struct sme_motion_det_cfg {
4212 	uint8_t vdev_id;
4213 	uint32_t time_t1;
4214 	uint32_t time_t2;
4215 	uint32_t n1;
4216 	uint32_t n2;
4217 	uint32_t time_t1_gap;
4218 	uint32_t time_t2_gap;
4219 	uint32_t coarse_K;
4220 	uint32_t fine_K;
4221 	uint32_t coarse_Q;
4222 	uint32_t fine_Q;
4223 	uint8_t md_coarse_thr_high;
4224 	uint8_t md_fine_thr_high;
4225 	uint8_t md_coarse_thr_low;
4226 	uint8_t md_fine_thr_low;
4227 };
4228 
4229 /**
4230  * sme_motion_det_base_line_cfg - motion detection base line configuration
4231  * @vdev_id : vdev id
4232  * @bl_time_t: time T for baseline (in ms), every bl_time_t, bl_n pkts are sent
4233  * @bl_packet_gap: gap between packets for baseline  in msecs
4234  * bl_n: number of packets to be sent during one baseline
4235  * bl_num_meas: number of times the baseline measurement to be done
4236  */
4237 struct sme_motion_det_base_line_cfg {
4238 	uint8_t vdev_id;
4239 	uint32_t bl_time_t;
4240 	uint32_t bl_packet_gap;
4241 	uint32_t bl_n;
4242 	uint32_t bl_num_meas;
4243 };
4244 
4245 /**
4246  * sme_motion_det_en - Start/Stop motion detection
4247  * @vdev_id: vdev_id
4248  * @enable: start = 1, stop =0
4249  */
4250 struct sme_motion_det_en {
4251 	uint8_t vdev_id;
4252 	bool enable;
4253 };
4254 
4255 /**
4256  * sme_motion_det_base_line_en - Start/Stop motion detection base line
4257  * @vdev_id: vdev_id
4258  * @enable: start = 1, stop =0
4259  */
4260 struct sme_motion_det_base_line_en {
4261 	uint8_t vdev_id;
4262 	bool enable;
4263 };
4264 
4265 /**
4266  * sme_motion_det_config - Post motion detection configuration msg to scheduler
4267  * @mac_handle: mac handle
4268  * @motion_det_cfg: motion detection configuration
4269  *
4270  * Return: QDF_STATUS_SUCCESS or non-zero on failure
4271  */
4272 QDF_STATUS sme_motion_det_config(mac_handle_t mac_handle,
4273 				 struct sme_motion_det_cfg *motion_det_cfg);
4274 
4275 /**
4276  * sme_motion_det_enable - Post motion detection start/stop msg to scheduler
4277  * @mac_handle: mac handle
4278  * @motion_det_en: motion detection start/stop
4279  *
4280  * Return: QDF_STATUS_SUCCESS or non-zero on failure
4281  */
4282 QDF_STATUS sme_motion_det_enable(mac_handle_t mac_handle,
4283 				 struct sme_motion_det_en *motion_det_en);
4284 
4285 /**
4286  * sme_motion_det_base_line_config - Post md baselining cfg msg to scheduler
4287  * @mac_handle: mac handle
4288  * @motion_det_base_line_cfg: motion detection baselining configuration
4289  *
4290  * Return: QDF_STATUS_SUCCESS or non-zero on failure
4291  */
4292 QDF_STATUS sme_motion_det_base_line_config(
4293 		mac_handle_t mac_handle,
4294 		struct sme_motion_det_base_line_cfg *motion_det_base_line_cfg);
4295 
4296 /**
4297  * sme_motion_det_base_line_enable - Post md baselining enable msg to scheduler
4298  * @mac_handle: mac handle
4299  * @motion_det_base_line_en: motion detection baselining start/stop
4300  *
4301  * Return: QDF_STATUS_SUCCESS or non-zero on failure
4302  */
4303 QDF_STATUS sme_motion_det_base_line_enable(
4304 		mac_handle_t mac_handle,
4305 		struct sme_motion_det_base_line_en *motion_det_base_line_en);
4306 
4307 /**
4308  * sme_set_md_host_evt_cb - Register/set motion detection callback
4309  * @mac_handle: mac handle
4310  * @callback_fn: motion detection callback function pointer
4311  * @hdd_ctx: hdd context
4312  *
4313  * Return: QDF_STATUS_SUCCESS or non-zero on failure
4314  */
4315 QDF_STATUS sme_set_md_host_evt_cb
4316 (
4317 	mac_handle_t mac_handle,
4318 	QDF_STATUS (*callback_fn)(void *ctx, struct sir_md_evt *event),
4319 	void *hdd_ctx
4320 );
4321 
4322 /**
4323  * sme_set_md_bl_evt_cb - Register/set motion detection baseline callback
4324  * @mac_handle: mac handle
4325  * @callback_fn: callback function pointer
4326  * @hdd_ctx: hdd context
4327  *
4328  * Return: QDF_STATUS_SUCCESS or non-zero on failure
4329  */
4330 QDF_STATUS sme_set_md_bl_evt_cb
4331 (
4332 	mac_handle_t mac_handle,
4333 	QDF_STATUS (*callback_fn)(void *ctx, struct sir_md_bl_evt *event),
4334 	void *hdd_ctx
4335 );
4336 #endif /* WLAN_FEATURE_MOTION_DETECTION */
4337 
4338 #ifdef FW_THERMAL_THROTTLE_SUPPORT
4339 /**
4340  * sme_set_thermal_throttle_cfg() - SME API to set the thermal throttle
4341  * configuration parameters
4342  * @mac_handle: Opaque handle to the global MAC context
4343  * @therm_params: Thermal_params
4344  *
4345  * Return: QDF_STATUS
4346  */
4347 QDF_STATUS sme_set_thermal_throttle_cfg(mac_handle_t mac_handle,
4348 			    struct thermal_mitigation_params *therm_params);
4349 
4350 /**
4351  * sme_set_thermal_mgmt() - SME API to set the thermal management params
4352  * @mac_handle: Opaque handle to the global MAC context
4353  * @lower_thresh_deg: Lower threshold value of Temperature
4354  * @higher_thresh_deg: Higher threshold value of Temperature
4355  *
4356  * Return: QDF_STATUS
4357  */
4358 QDF_STATUS sme_set_thermal_mgmt(mac_handle_t mac_handle,
4359 				uint16_t lower_thresh_deg,
4360 				uint16_t higher_thresh_deg);
4361 #endif /* FW_THERMAL_THROTTLE_SUPPORT */
4362 
4363 /**
4364  * sme_update_hidden_ssid_status_cb() - cb fun to update hidden ssid stats
4365  * @mac_handle: mac handler
4366  * @cb: cb of type hidden_ssid_cb
4367  */
4368 QDF_STATUS sme_update_hidden_ssid_status_cb(mac_handle_t mac_handle,
4369 					    hidden_ssid_cb cb);
4370 
4371 /**
4372  * sme_update_owe_info() - Update OWE info
4373  * @mac: mac context
4374  * @assoc_ind: assoc ind
4375  *
4376  * Return: QDF_STATUS
4377  */
4378 QDF_STATUS sme_update_owe_info(struct mac_context *mac,
4379 			       struct assoc_ind *assoc_ind);
4380 
4381 /**
4382  * sme_update_ft_info() - Update FT info
4383  * @mac: mac context
4384  * @assoc_ind: assoc ind
4385  *
4386  * Return: QDF_STATUS
4387  */
4388 
4389 QDF_STATUS sme_update_ft_info(struct mac_context *mac,
4390 			      struct assoc_ind *assoc_ind);
4391 
4392 #ifdef WLAN_MWS_INFO_DEBUGFS
4393 /**
4394  * sme_get_mws_coex_info() - SME API to get the coex information
4395  * @mac_handle: mac handler
4396  * @vdev_id: Vdev_id
4397  * @cmd_id: enum mws_coex_cmdid which information is needed.
4398  * @callback_fn: Callback function
4399  * @context: callback context
4400  *
4401  * Return: QDF_STATUS
4402  */
4403 QDF_STATUS
4404 sme_get_mws_coex_info(mac_handle_t mac_handle, uint32_t vdev_id,
4405 		      uint32_t cmd_id, void (*callback_fn)(void *coex_info_data,
4406 							   void *context,
4407 							   wmi_mws_coex_cmd_id
4408 							   cmd_id),
4409 		      void *context);
4410 #endif /* WLAN_MWS_INFO_DEBUGFS */
4411 
4412 #ifdef WLAN_BCN_RECV_FEATURE
4413 /**
4414  * sme_register_bcn_recv_pause_ind_cb() - Register pause ind cb
4415  * mac_handle: man handler
4416  * cb: callback function to HDD
4417  *
4418  * This function register HDD callback in order to indicate beacon
4419  * receive pause indication to userspace.
4420  *
4421  * return QDF_STATUS of cb registration
4422  */
4423 QDF_STATUS sme_register_bcn_recv_pause_ind_cb(mac_handle_t mac_handle,
4424 					      beacon_pause_cb cb);
4425 
4426 #else
4427 static inline
sme_register_bcn_recv_pause_ind_cb(mac_handle_t mac_handle,beacon_pause_cb cb)4428 QDF_STATUS sme_register_bcn_recv_pause_ind_cb(mac_handle_t mac_handle,
4429 					      beacon_pause_cb cb)
4430 {
4431 	return QDF_STATUS_SUCCESS;
4432 }
4433 #endif
4434 
4435 /**
4436  * sme_set_disconnect_ies() - set disconnect IEs
4437  * @mac_handle: handle returned by mac_open
4438  * @vdev_id: vdev id
4439  * @ie_data: Disconnect IE data
4440  * @ie_len: Disconnect IE length
4441  *
4442  * Return: QDF_STATUS
4443  */
4444 QDF_STATUS sme_set_disconnect_ies(mac_handle_t mac_handle, uint8_t vdev_id,
4445 				  uint8_t *ie_data, uint16_t ie_len);
4446 
4447 /**
4448  * sme_set_vdev_sw_retry() - set sw retry threshold per vdev
4449  * @vdev_id: vdev id
4450  * @sw_retry_count: sw retry number
4451  * @retry_type: SW vdev retry type
4452  *
4453  * This function calls WMA api to send the sw retry threshold per vdev.
4454  *
4455  * Return: QDF_STATUS.
4456  */
4457 QDF_STATUS sme_set_vdev_sw_retry(uint8_t vdev_id, uint8_t sw_retry_count,
4458 				 wmi_vdev_custom_sw_retry_type_t sw_retry_type);
4459 
4460 /**
4461  * sme_set_roam_config_enable() - Cache roam config status in SME
4462  * @mac_handle: Opaque handle to the MAC context
4463  * @vdev_id: vdev id
4464  * @roam_control_enable: Carries a non-zero value if the current set request is
4465  *			 for enable, otherwise carries a 0.
4466  *
4467  * Cache control roam config enable/disable status in SME so that the
4468  * userspace can query for the status based on a vdev/session at any time.
4469  *
4470  * Return: QDF_STATUS
4471  */
4472 QDF_STATUS sme_set_roam_config_enable(mac_handle_t mac_handle,
4473 				      uint8_t vdev_id,
4474 				      uint8_t roam_control_enable);
4475 
4476 /**
4477  * sme_send_vendor_btm_params - Send vendor btm params to FW
4478  * @hdd_ctx: HDD context
4479  * @vdev_id: vdev id
4480  *
4481  * Send roam trigger param to firmware if valid.
4482  *
4483  * Return: QDF_STATUS
4484  */
4485 QDF_STATUS
4486 sme_send_vendor_btm_params(mac_handle_t mac_handle, uint8_t vdev_id);
4487 
4488 /**
4489  * sme_get_roam_config_status() - Get roam config status from SME
4490  * @mac_handle: Opaque handle to the MAC context
4491  * @vdev_id: vdev id
4492  * @config_status: Pointer of a buffer to fill the status
4493  *
4494  * Get the cached control roam config status in SME and copy to status.
4495  *
4496  * Return: QDF_STATUS
4497  */
4498 QDF_STATUS sme_get_roam_config_status(mac_handle_t mac_handle, uint8_t vdev_id,
4499 				      uint8_t *config_status);
4500 
4501 /**
4502  * sme_get_full_roam_scan_period_global() - get global full scan refresh period
4503  * @mac_handle: The handle returned by mac_open
4504  *
4505  * Return: Full roam scan period configured through ini
4506  */
4507 uint16_t sme_get_full_roam_scan_period_global(mac_handle_t mac_handle);
4508 
4509 /**
4510  * sme_get_full_roam_scan_period() - Get full roam scan period
4511  * @mac_handle: Opaque handle to the MAC context
4512  * @vdev_id: vdev id
4513  * @full_roam_scan_period: Pointer of a buffer to fill the full roam scan period
4514  *
4515  * Get the full scan period cached in neighborRoamInfo and fill in the given
4516  * buffer full_roam_scan_period.
4517  *
4518  * Return: QDF_STATUS
4519  */
4520 QDF_STATUS sme_get_full_roam_scan_period(mac_handle_t mac_handle,
4521 					 uint8_t vdev_id,
4522 					 uint32_t *full_roam_scan_period);
4523 
4524 /**
4525  * sme_check_for_duplicate_session() - check for duplicate session
4526  * @mac_handle: Opaque handle to the MAC context
4527  * @mac_list: List of mac address of peers.
4528  *
4529  * Check for duplicate mac address is available on other vdev.
4530  * The list pointed by @mac_list has to be NULL terminated.
4531  *
4532  * Return: QDF_STATUS
4533  */
4534 QDF_STATUS sme_check_for_duplicate_session(mac_handle_t mac_handle,
4535 					   uint8_t **mac_list);
4536 #ifdef FEATURE_ANI_LEVEL_REQUEST
4537 /*
4538  * sme_get_ani_level() -
4539  * A wrapper function that client calls to register a callback to get ani level
4540  *
4541  * @mac_handle - pointer to mac handle
4542  * @freqs - frequencies for which ANI level has to be fetched
4543  * @num_freqs - number of frequencies
4544  * @callback - SME sends back the ani level using the callback
4545  * @context - user context to be passed back along with the callback
4546  *
4547  * Return: QDF_STATUS
4548  */
4549 QDF_STATUS sme_get_ani_level(mac_handle_t mac_handle, uint32_t *freqs,
4550 			     uint8_t num_freqs, void (*callback)(
4551 			     struct wmi_host_ani_level_event *ani, uint8_t num,
4552 			     void *context), void *context);
4553 #endif /* FEATURE_ANI_LEVEL_REQUEST */
4554 
4555 /*
4556  * sme_vdev_self_peer_delete_resp() - Response for self peer delete
4557  * @del_vdev_params: parameters for which vdev self peer has been deleted
4558  *
4559  * This function is called by the lower level function as a response to
4560  * vdev self peer delete request.
4561  *
4562  * Return: QDF_STATUS.
4563  */
4564 QDF_STATUS sme_vdev_self_peer_delete_resp(struct del_vdev_params *param);
4565 
4566 /**
4567  * sme_vdev_del_resp() - Vdev delete response function
4568  * @vdev_id: vdevid which  has been deleted
4569  *
4570  * This function is called by the lower level function as a response to
4571  * vdev delete request
4572  *
4573  * Return: None
4574  */
4575 void sme_vdev_del_resp(uint8_t vdev_id);
4576 
4577 #ifdef FEATURE_MONITOR_MODE_SUPPORT
4578 /**
4579  * sme_set_monitor_mode_cb() - Register monitor mode vdev up operation callback
4580  * @mac_handle: Opaque handle to the MAC context
4581  * @monitor_mode_cb: callback to be registered
4582  *
4583  * Return: QDF_STATUS
4584  */
4585 QDF_STATUS sme_set_monitor_mode_cb(mac_handle_t mac_handle,
4586 				   void (*monitor_mode_cb)(uint8_t vdev_id));
4587 
4588 /*
4589  * sme_process_monitor_mode_vdev_up_evt() - Handle vdev up completion
4590  * @vdev_id: vdev id
4591  *
4592  * Return: QDF_STATUS.
4593  */
4594 QDF_STATUS sme_process_monitor_mode_vdev_up_evt(uint8_t vdev_id);
4595 #else
4596 static inline
sme_set_monitor_mode_cb(mac_handle_t mac_handle,void (* monitor_mode_cb)(uint8_t vdev_id))4597 QDF_STATUS sme_set_monitor_mode_cb(mac_handle_t mac_handle,
4598 				   void (*monitor_mode_cb)(uint8_t vdev_id))
4599 {
4600 	return QDF_STATUS_SUCCESS;
4601 }
4602 
4603 static inline QDF_STATUS
sme_process_monitor_mode_vdev_up_evt(uint8_t vdev_id)4604 sme_process_monitor_mode_vdev_up_evt(uint8_t vdev_id)
4605 {
4606 	return QDF_STATUS_E_FAILURE;
4607 }
4608 #endif
4609 
4610 #if defined(CLD_PM_QOS) && defined(WLAN_FEATURE_LL_MODE)
4611 /**
4612  * sme_set_beacon_latency_event_cb() - Register beacon latency IE callback
4613  * @mac_handle: Opaque handle to the MAC context
4614  * @beacon_latency_event_cb: callback to be registered
4615  *
4616  * Return: QDF_STATUS
4617  */
4618 QDF_STATUS
4619 sme_set_beacon_latency_event_cb(mac_handle_t mac_handle,
4620 				void (*beacon_latency_event_cb)
4621 				(uint32_t latency_level));
4622 #else
4623 static inline QDF_STATUS
sme_set_beacon_latency_event_cb(mac_handle_t mac_handle,void (* beacon_latency_event_cb)(uint32_t latency_level))4624 sme_set_beacon_latency_event_cb(mac_handle_t mac_handle,
4625 				void (*beacon_latency_event_cb)
4626 				(uint32_t latency_level))
4627 {
4628 	return QDF_STATUS_SUCCESS;
4629 }
4630 #endif
4631 
4632 /**
4633  * sme_fill_enc_type() - converts crypto cipher set to csr specific cipher type
4634  * @cipher_type: output csr cipher type
4635  * @ cipherset:input cipher set
4636  *
4637  * Return: None
4638  */
4639 
4640 void sme_fill_enc_type(eCsrEncryptionType *cipher_type,
4641 		       uint32_t cipherset);
4642 
4643 /**
4644  * sme_fill_auth_type() - converts auth mode set to csr specific auth type
4645  * @auth_type: output csr auth type
4646  * @ authmodeset: authmode set
4647  * @akm: akm
4648  * @ucastcipherset: ucastcipherset
4649  *
4650  * Return: None
4651  */
4652 void sme_fill_auth_type(enum csr_akm_type *auth_type,
4653 			uint32_t authmodeset, uint32_t akm,
4654 			uint32_t ucastcipherset);
4655 
4656 /**
4657  * sme_phy_mode_to_dot11mode() - converts phy mode to dot11 mode
4658  * @phy_mode: wlan phy mode
4659  *
4660  * Return: csr_cfgdot11mode
4661  */
4662 enum csr_cfgdot11mode sme_phy_mode_to_dot11mode(enum wlan_phymode phy_mode);
4663 
4664 #ifdef WLAN_FEATURE_11BE
4665 /**
4666  * sme_get_eht_ch_width() - SME API to get max supported EHT chan width by FW
4667  *
4668  * Return: Max EHT channel width supported by FW (eg. 80, 160, 320)
4669  */
4670 uint32_t sme_get_eht_ch_width(void);
4671 #else /* !WLAN_FEATURE_11BE */
sme_get_eht_ch_width(void)4672 static inline uint32_t sme_get_eht_ch_width(void)
4673 {
4674 	return 0;
4675 }
4676 #endif /* WLAN_FEATURE_11BE */
4677 
4678 /**
4679  * sme_switch_channel() - Request to switch channel
4680  * @mac_handle: Opaque handle to the MAC context
4681  * @bssid: current connected bssid
4682  * @chan_freq: new channel frequency
4683  * @chan_width: new channel width
4684  *
4685  * Return: QDF_STATUS
4686  */
4687 QDF_STATUS sme_switch_channel(mac_handle_t mac_handle,
4688 			      struct qdf_mac_addr *bssid,
4689 			      qdf_freq_t chan_freq,
4690 			      enum phy_ch_width chan_width);
4691 
4692 #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
4693 /**
4694  * sme_send_set_mac_addr() - Send set MAC address command to FW
4695  * @mac_addr: VDEV MAC address
4696  * @mld_addr: VDEV MLD address
4697  * @vdev: Pointer to object manager VDEV
4698  *
4699  * API to send set MAC address request command to FW
4700  *
4701  * Return: QDF_STATUS
4702  */
4703 QDF_STATUS sme_send_set_mac_addr(struct qdf_mac_addr mac_addr,
4704 				 struct qdf_mac_addr mld_addr,
4705 				 struct wlan_objmgr_vdev *vdev);
4706 
4707 /**
4708  * sme_update_vdev_mac_addr() - Update VDEV MAC address
4709  * @vdev: Objmgr VDEV pointer
4710  * @mac_addr: VDEV MAC address
4711  * @mld_addr: VDEV MLD address
4712  * @update_sta_self_peer: Flag to check self peer MAC address or not.
4713  * @update_mld_addr: Flag to check if MLD address update needed or not.
4714  * @req_status: Status of the set MAC address request to the FW
4715  *
4716  * API to update MLME structures with new MAC address. This will be invoked
4717  * after receiving success status form the FW for the set MAC address request
4718  * command.
4719  *
4720  * Return: QDF_STATUS
4721  */
4722 QDF_STATUS sme_update_vdev_mac_addr(struct wlan_objmgr_vdev *vdev,
4723 				    struct qdf_mac_addr mac_addr,
4724 				    struct qdf_mac_addr mld_addr,
4725 				    bool update_sta_self_peer,
4726 				    bool update_mld_addr, int req_status);
4727 #endif
4728 
4729 /**
4730  * sme_get_network_params() - SME API to get dot11 config for SAP
4731  * functionality
4732  *@mac_ctx: mac context
4733  *@dot11_cfg : pointer to dot11 config
4734  *
4735  * Return : QDF_STATUS
4736  */
4737 QDF_STATUS sme_get_network_params(struct mac_context *mac_ctx,
4738 				  struct bss_dot11_config *dot11_cfg);
4739 
4740 /**
4741  * sme_start_bss() -A wrapper function to request CSR to
4742  * inititiate start bss
4743  * @mac_handle: mac hancle
4744  * @vdev_id: vdev id
4745  * @bss_config: pointer to start bss config
4746  *
4747  * Return: QDF_STATUS
4748  */
4749 QDF_STATUS sme_start_bss(mac_handle_t mac_handle, uint8_t vdev_id,
4750 			 struct start_bss_config *bss_config);
4751 
4752 /**
4753  * sme_sap_ser_callback() - callback from serialization module
4754  * @cmd: serialization command
4755  * @reason: reason why serialization module has given this callback
4756  *
4757  * Serialization module will give callback to SME for why it triggered
4758  * the callback
4759  *
4760  * Return: QDF_STATUS
4761  */
4762 QDF_STATUS sme_sap_ser_callback(struct wlan_serialization_command *cmd,
4763 				enum wlan_serialization_cb_reason reason);
4764 
4765 /**
4766  *sme_fill_channel_change_request() - SME API to fill the channel
4767  * change request for monitor mode
4768  * @mac_handle: mac handle
4769  * @req: pointer to change channel request message
4770  * @phy_mode: phy mode of the vdev
4771  *
4772  * Return: QDF_STATUS
4773  */
4774 void sme_fill_channel_change_request(mac_handle_t mac_handle,
4775 				     struct channel_change_req *req,
4776 				      eCsrPhyMode phy_mode);
4777 
4778 /**
4779  * sme_send_channel_change_req() - SME API to post channel change
4780  * request to LIM
4781  * @mac_handle: mac handle
4782  * @req: pointer to change channel request message
4783  *
4784  * Return: QDF_STATUS
4785  */
4786 QDF_STATUS sme_send_channel_change_req(mac_handle_t mac_handle,
4787 				      struct channel_change_req *req);
4788 
4789 /**
4790  * sme_update_beacon_country_ie() - SME API to update beacon
4791  * country ie
4792  * @mac_handle: mac handle
4793  * @vdev_id: vdev id
4794  * @country_ie_for_all_band: country ie should take all band channel
4795  *			     or only the current band channel
4796  *
4797  * Return: QDF_STATUS
4798  */
4799 QDF_STATUS sme_update_beacon_country_ie(mac_handle_t mac_handle,
4800 					uint8_t vdev_id,
4801 					bool country_ie_for_all_band);
4802 
4803 #endif /* #if !defined( __SME_API_H ) */
4804