blob: 4d6489c366380800b09464535631a3a64785c02a [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Yue Mad03d10b2019-12-23 15:09:53 -08002 * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080019#if !defined(__SME_API_H)
20#define __SME_API_H
21
22/**
23 * file smeApi.h
24 *
25 * brief prototype for SME APIs
26 */
27
28/*--------------------------------------------------------------------------
29 Include Files
30 ------------------------------------------------------------------------*/
31#include "csr_api.h"
Anurag Chouhana37b5b72016-02-21 14:53:42 +053032#include "qdf_lock.h"
Anurag Chouhan6d760662016-02-20 16:05:43 +053033#include "qdf_types.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080034#include "sir_api.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080035#include "cds_regdomain.h"
36#include "sme_internal.h"
Krishna Kumaar Natarajan052c6e62015-09-28 15:32:55 -070037#include "wma_tgt_cfg.h"
Jeff Johnson6136fb92017-03-30 15:21:49 -070038#include "wma_fips_public_structs.h"
Jeff Johnsonf0e54b02017-12-18 15:22:25 -080039#include "wma_sar_public_structs.h"
gaurank kathpalia78af1932018-10-27 20:33:10 +053040#include "wlan_mlme_public_struct.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080041#include "sme_rrm_internal.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080042#include "sir_types.h"
Krunal Sonid32c6bc2016-10-18 18:00:21 -070043#include "scheduler_api.h"
Varun Reddy Yeturu35c07f92017-02-28 10:35:00 -080044#include "wlan_serialization_legacy_api.h"
Kiran Kumar Lokereacd107d2019-01-09 15:02:11 -080045#include <qca_vendor.h>
Arun Kumar Khandavallideda5a82019-03-11 15:32:19 +053046#include "wmi_unified.h"
Paul Zhangda2970b2019-06-23 18:16:38 +080047#include "wmi_unified_param.h"
Krunal Sonid32c6bc2016-10-18 18:00:21 -070048
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080049/*--------------------------------------------------------------------------
50 Preprocessor definitions and constants
51 ------------------------------------------------------------------------*/
52
Sandeep Puligillaaa26b652018-06-13 18:59:35 -070053#define sme_alert(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_SME, params)
54#define sme_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_SME, params)
55#define sme_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_SME, params)
56#define sme_info(params...) QDF_TRACE_INFO(QDF_MODULE_ID_SME, params)
57#define sme_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_SME, params)
Srinivas Girigowdaaf487f62017-03-16 15:53:46 -070058
Nirav Shah790d9432018-07-12 19:42:48 +053059#define sme_nofl_alert(params...) \
60 QDF_TRACE_FATAL_NO_FL(QDF_MODULE_ID_SME, params)
61#define sme_nofl_err(params...) \
62 QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_SME, params)
63#define sme_nofl_warn(params...) \
64 QDF_TRACE_WARN_NO_FL(QDF_MODULE_ID_SME, params)
65#define sme_nofl_info(params...) \
66 QDF_TRACE_INFO_NO_FL(QDF_MODULE_ID_SME, params)
67#define sme_nofl_debug(params...) \
68 QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_SME, params)
69
Sandeep Puligillaaa26b652018-06-13 18:59:35 -070070#define sme_alert_rl(params...) QDF_TRACE_FATAL_RL(QDF_MODULE_ID_SME, params)
71#define sme_err_rl(params...) QDF_TRACE_ERROR_RL(QDF_MODULE_ID_SME, params)
72#define sme_warn_rl(params...) QDF_TRACE_WARN_RL(QDF_MODULE_ID_SME, params)
73#define sme_info_rl(params...) QDF_TRACE_INFO_RL(QDF_MODULE_ID_SME, params)
74#define sme_debug_rl(params...) QDF_TRACE_DEBUG_RL(QDF_MODULE_ID_SME, params)
Srinivas Girigowdaaf487f62017-03-16 15:53:46 -070075
Nirav Shahd6fa0f82018-07-06 15:52:25 +053076#define SME_ENTER() QDF_TRACE_ENTER(QDF_MODULE_ID_SME, "enter")
77#define SME_EXIT() QDF_TRACE_EXIT(QDF_MODULE_ID_SME, "exit")
Srinivas Girigowdaaf487f62017-03-16 15:53:46 -070078
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080079#define SME_SESSION_ID_ANY 50
Wu Gaoa0230a62018-01-04 20:56:57 +080080#define SME_SESSION_ID_BROADCAST 0xFF
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080081
82#define SME_INVALID_COUNTRY_CODE "XX"
Krunal Sonibfd05492017-10-03 15:48:37 -070083#define INVALID_ROAM_ID 0
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080084
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080085#define SME_SET_CHANNEL_REG_POWER(reg_info_1, val) do { \
86 reg_info_1 &= 0xff00ffff; \
87 reg_info_1 |= ((val & 0xff) << 16); \
88} while (0)
89
90#define SME_SET_CHANNEL_MAX_TX_POWER(reg_info_2, val) do { \
91 reg_info_2 &= 0xffff00ff; \
92 reg_info_2 |= ((val & 0xff) << 8); \
93} while (0)
94
Varun Reddy Yeturub43fda12015-09-10 18:16:21 -070095#define SME_CONFIG_TO_ROAM_CONFIG 1
96#define ROAM_CONFIG_TO_SME_CONFIG 2
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080097
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -070098#define NUM_OF_BANDS 2
Naveen Rawatb56880c2016-12-13 17:56:03 -080099
Arif Hussainf8f6b3b2019-01-10 19:42:09 -0800100#define SUPPORTED_CRYPTO_CAPS 0x3FFFF
Kiran Kumar Lokere4ce40482018-08-30 16:31:00 -0700101
Naveen Rawatb56880c2016-12-13 17:56:03 -0800102#define SME_ACTIVE_LIST_CMD_TIMEOUT_VALUE (30*1000)
103#define SME_CMD_TIMEOUT_VALUE (SME_ACTIVE_LIST_CMD_TIMEOUT_VALUE + 1000)
Vignesh Viswanathan865daaa2018-10-11 19:30:44 +0530104
Abhishek Singhfc0c4242019-06-17 10:45:43 +0530105/* Disconnect timeout = vdev stop + bss peer delete + 1 sec */
Abhishek Singh5606ee02019-08-19 13:18:01 +0530106#define SME_CMD_VDEV_DISCONNECT_TIMEOUT (STOP_RESPONSE_TIMER + \
Abhishek Singhfc0c4242019-06-17 10:45:43 +0530107 SIR_DELETE_STA_TIMEOUT + 1000)
Abhishek Singhd1f21c72019-01-21 15:16:34 +0530108#define SME_DISCONNECT_TIMEOUT (SME_CMD_VDEV_DISCONNECT_TIMEOUT + 1000)
Abhishek Singh13bf0ce2018-10-24 14:26:14 +0530109
Abhishek Singh682cf6f2019-08-19 11:45:00 +0530110/* AP start timeout = vdev start + 2 sec */
Abhishek Singh5606ee02019-08-19 13:18:01 +0530111#define SME_CMD_VDEV_START_BSS_TIMEOUT (START_RESPONSE_TIMER + 2000)
Abhishek Singhd1f21c72019-01-21 15:16:34 +0530112#define SME_CMD_START_BSS_TIMEOUT (SME_CMD_VDEV_START_BSS_TIMEOUT + 1000)
113
Abhishek Singhfc0c4242019-06-17 10:45:43 +0530114/* AP stop timeout = vdev stop + self peer delete + 1 sec */
Abhishek Singh5606ee02019-08-19 13:18:01 +0530115#define SME_CMD_STOP_BSS_CMD_TIMEOUT (STOP_RESPONSE_TIMER + \
Abhishek Singhfc0c4242019-06-17 10:45:43 +0530116 SIR_DELETE_STA_TIMEOUT + 1000)
117#define SME_CMD_STOP_BSS_TIMEOUT (SME_CMD_STOP_BSS_CMD_TIMEOUT + 1000)
Abhishek Singhd1f21c72019-01-21 15:16:34 +0530118
Abhishek Singhfc0c4242019-06-17 10:45:43 +0530119/* Peer disconenct timeout = peer delete + 1 sec */
120#define SME_CMD_PEER_DISCONNECT_TIMEOUT (SIR_DELETE_STA_TIMEOUT + 1000)
121#define SME_PEER_DISCONNECT_TIMEOUT (SME_CMD_PEER_DISCONNECT_TIMEOUT + 1000)
Abhishek Singhd1f21c72019-01-21 15:16:34 +0530122
Abhishek Singhfc0c4242019-06-17 10:45:43 +0530123/* Roam cmds timeout = vdev start + peer assoc + 1 sec */
Abhishek Singh5606ee02019-08-19 13:18:01 +0530124#define SME_CMD_ROAM_CMD_TIMEOUT (START_RESPONSE_TIMER + \
Abhishek Singhfc0c4242019-06-17 10:45:43 +0530125 SIR_PEER_ASSOC_TIMEOUT + 1000)
Abhishek Singhd1f21c72019-01-21 15:16:34 +0530126#define SME_CMD_ADD_DEL_TS_TIMEOUT (4 * 1000)
127
Abhishek Singhbb9deb42019-05-24 10:11:24 +0530128/*
129 * POLICY_MGR_SER_CMD_TIMEOUT should be same as SME_CMD_POLICY_MGR_CMD_TIMEOUT
130 * if SME_CMD_POLICY_MGR_CMD_TIMEOUT is changed change
131 * POLICY_MGR_SER_CMD_TIMEOUT as well.
132 */
Abhishek Singh682cf6f2019-08-19 11:45:00 +0530133#define SME_CMD_POLICY_MGR_CMD_TIMEOUT (SIR_VDEV_PLCY_MGR_TIMEOUT + 1000)
Abhishek Singhd1f21c72019-01-21 15:16:34 +0530134#define SME_POLICY_MGR_CMD_TIMEOUT (SME_CMD_POLICY_MGR_CMD_TIMEOUT + 1000)
135
Abhishek Singh5606ee02019-08-19 13:18:01 +0530136#define SME_VDEV_DELETE_CMD_TIMEOUT (DELETE_RESPONSE_TIMER + 2000)
Abhishek Singh682cf6f2019-08-19 11:45:00 +0530137#define SME_CMD_VDEV_CREATE_DELETE_TIMEOUT QDF_MAX(13000, \
138 SME_VDEV_DELETE_CMD_TIMEOUT + 1)
Abhishek Singh13bf0ce2018-10-24 14:26:14 +0530139
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800140/*--------------------------------------------------------------------------
141 Type declarations
142 ------------------------------------------------------------------------*/
Jeff Johnson46b4f0e2019-03-08 10:48:35 -0800143struct sme_config_params {
Jeff Johnsone94ccd02019-04-02 15:02:56 -0700144 struct csr_config_params csr_config;
Jeff Johnson46b4f0e2019-03-08 10:48:35 -0800145};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800146
147#ifdef FEATURE_WLAN_TDLS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800148#define BW_20_OFFSET_BIT 0
149#define BW_40_OFFSET_BIT 1
150#define BW_80_OFFSET_BIT 2
151#define BW_160_OFFSET_BIT 3
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800152#endif /* FEATURE_WLAN_TDLS */
153
154/* Thermal Mitigation*/
155typedef struct {
156 uint16_t smeMinTempThreshold;
157 uint16_t smeMaxTempThreshold;
158} tSmeThermalLevelInfo;
159
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800160typedef 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
Abhishek Singh12be60f2017-08-11 13:52:42 +0530167/*
168 * Enumeration of the various TSPEC directions
169 * From 802.11e/WMM specifications
170 */
171enum sme_qos_wmm_dir_type {
Naveen Rawatd9dd4b32017-07-05 14:32:54 -0700172 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,
Abhishek Singh12be60f2017-08-11 13:52:42 +0530176};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800177
Krishna Kumaar Natarajan53ca2902015-12-04 14:01:46 -0800178/**
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 */
186struct 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
Manjeet Singha9cae432017-02-28 11:58:22 +0530193/**
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 */
202struct 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
Krunal Soni8d184fa2017-11-20 21:52:05 -0800211/**
212 * struct sme_session_params: Session creation params passed by HDD layer
Abhishek Ambure74709762019-05-27 19:43:26 +0530213 * @vdev: pointer to vdev object
Krunal Soni8d184fa2017-11-20 21:52:05 -0800214 */
215struct sme_session_params {
Abhishek Ambure74709762019-05-27 19:43:26 +0530216 struct wlan_objmgr_vdev *vdev;
Krunal Soni8d184fa2017-11-20 21:52:05 -0800217};
218
Vignesh Viswanathan9dd88d32017-11-22 14:22:03 +0530219#define MAX_CANDIDATE_INFO 10
220
221/**
222 * struct bss_candidate_info - Candidate bss information
223 *
224 * @bssid : BSSID of candidate bss
225 * @status : status code for candidate bss
226 */
227struct bss_candidate_info {
228 struct qdf_mac_addr bssid;
229 uint32_t status;
230};
231
232/*
233 * MBO transition reason codes
234 */
235enum {
236 MBO_TRANSITION_REASON_UNSPECIFIED,
237 MBO_TRANSITION_REASON_EXCESSIVE_FRAME_LOSS_RATE,
238 MBO_TRANSITION_REASON_EXCESSIVE_DELAY_FOR_CURRENT_TRAFFIC,
239 MBO_TRANSITION_REASON_INSUFFICIENT_BANDWIDTH_FOR_CURRENT_TRAFFIC,
240 MBO_TRANSITION_REASON_LOAD_BALANCING,
241 MBO_TRANSITION_REASON_LOW_RSSI,
242 MBO_TRANSITION_REASON_RECEIVED_EXCESSIVE_RETRANSMISSIONS,
243 MBO_TRANSITION_REASON_HIGH_INTERFERENCE,
244 MBO_TRANSITION_REASON_GRAY_ZONE,
245 MBO_TRANSITION_REASON_TRANSITIONING_TO_PREMIUM_AP,
246};
247
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800248/*-------------------------------------------------------------------------
249 Function declarations and documenation
250 ------------------------------------------------------------------------*/
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800251QDF_STATUS sme_open(mac_handle_t mac_handle);
Jeff Johnsonc7309062018-11-09 20:59:42 -0800252QDF_STATUS sme_init_chan_list(mac_handle_t mac_handle, uint8_t *alpha2,
Amar Singhala297bfa2015-10-15 15:07:29 -0700253 enum country_src cc_src);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800254QDF_STATUS sme_close(mac_handle_t mac_handle);
255QDF_STATUS sme_start(mac_handle_t mac_handle);
Jeff Johnson62cd6802018-07-20 12:38:25 -0700256
257/**
258 * sme_stop() - Stop all SME modules and put them at idle state
259 * @mac_handle: Opaque handle to the MAC context
260 *
261 * The function stops each module in SME. Upon return, all modules are
262 * at idle state ready to start.
263 *
264 * This is a synchronous call
265 *
266 * Return: QDF_STATUS_SUCCESS if SME is stopped. Other status means
267 * SME failed to stop one or more modules but caller should
268 * still consider SME is stopped.
269 */
270QDF_STATUS sme_stop(mac_handle_t mac_handle);
271
gaurank kathpalia78af1932018-10-27 20:33:10 +0530272/**
273 * sme_populate_nss_chain_params() - fill vdev nss chain params from ini
274 * @mac_handle: The handle returned by mac_open.
275 * @vdev_ini_cfg: pointer to the structure to be filled
276 * @device_mode: device mode (eg STA, SAP etc.)
277 * @rf_chains_supported: number of chains supported by fw(updated during
278 * service ready event)
279 *
gaurank kathpaliab414bce2018-11-09 18:44:46 +0530280 * This API will fill the nss chain params for the particular vdev from ini
gaurank kathpalia78af1932018-10-27 20:33:10 +0530281 * configuration for the respective vdev.
282 *
283 * Return: none
284 */
285void sme_populate_nss_chain_params(mac_handle_t mac_handle,
286 struct wlan_mlme_nss_chains *vdev_ini_cfg,
287 enum QDF_OPMODE device_mode,
288 uint8_t rf_chains_supported);
289
290/**
gaurank kathpaliab414bce2018-11-09 18:44:46 +0530291 * sme_store_nss_chains_cfg_in_vdev() - fill vdev nss chain params from ini
292 * @vdev: Pointer to vdev obj
293 * @vdev_ini_cfg: pointer to the structure the values are to be filled from
294 *
295 * This API will copy the nss chain params for the particular vdev from ini
296 * configuration to the respective vdev's dynamic, and ini config.
297 *
298 * Return: none
299 */
300void
301sme_store_nss_chains_cfg_in_vdev(struct wlan_objmgr_vdev *vdev,
302 struct wlan_mlme_nss_chains *vdev_ini_cfg);
303
304/**
gaurank kathpaliafa7ad0a2019-03-12 19:17:56 +0530305 * sme_modify_nss_chains_tgt_cfg() - Change the nss in ini for
306 * particular opmode, and band, according to the chain config supported by FW.
307 * @mac_handle: The handle returned by mac_open.
308 * @vdev_op_mode: vdev operation mode.
309 * @band:- band for which user wants to change nss.
310 *
311 * This API will change the nss in ini (for eg. rx_nss_2g) in the mlme cfg i.e
312 * the global config structure kept in mac context, according to the max
313 * supported chains per band which is got as part of ext service ready event.
314 *
315 * Return: none
316 */
317void
318sme_modify_nss_chains_tgt_cfg(mac_handle_t mac_handle,
319 enum QDF_OPMODE vdev_op_mode,
320 enum nss_chains_band_info band);
321
322/**
323 * sme_update_nss_in_mlme_cfg() - Change the nss in ini(rx_nss_(band)) for
gaurank kathpalia6c4b50c2019-02-28 14:07:48 +0530324 * particular opmode, and band.
325 * @mac_handle: The handle returned by mac_open.
326 * @rx_nss: new value of rx nss that user wants to change.
327 * @tx_nss: new value of tx nss that user wants to change.
328 * @vdev_op_mode: vdev operation mode.
329 * @band:- band for which user wants to change nss.
330 *
331 * This API will change the nss in ini (for eg. rx_nss_2g) in the mlme cfg i.e
332 * the global config structure kept in mac context.
333 *
334 * Return: none
335 */
336void
gaurank kathpaliafa7ad0a2019-03-12 19:17:56 +0530337sme_update_nss_in_mlme_cfg(mac_handle_t mac_handle,
338 uint8_t rx_nss, uint8_t tx_nss,
339 enum QDF_OPMODE vdev_op_mode,
340 enum nss_chains_band_info band);
gaurank kathpalia6c4b50c2019-02-28 14:07:48 +0530341
342/**
gaurank kathpalia2b32de02018-10-24 18:31:14 +0530343 * sme_nss_chains_update() - validate and send the user params to fw
344 * @mac_handle: The handle returned by mac_open.
345 * @user_cfg: pointer to the structure to be validated and sent to fw
346 * @vdev_id: vdev id
347 *
348 *
349 * This API will validate the config, and if found correct will update the
350 * config in dynamic config, and send to the fw.
351 *
352 * Return: QDF_STATUS
353 */
354QDF_STATUS
355sme_nss_chains_update(mac_handle_t mac_handle,
356 struct wlan_mlme_nss_chains *user_cfg,
357 uint8_t vdev_id);
358
359/**
Arun Kumar Khandavalli4f6a5bd2019-10-23 16:01:15 +0530360 * sme_vdev_create() - Create vdev for given persona
Abhishek Ambure74709762019-05-27 19:43:26 +0530361 * @mac_handle: The handle returned by mac_open
Arun Kumar Khandavalli4f6a5bd2019-10-23 16:01:15 +0530362 * @vdev_params: params required for vdev creation
Krunal Soni8d184fa2017-11-20 21:52:05 -0800363 *
Arun Kumar Khandavalli4f6a5bd2019-10-23 16:01:15 +0530364 * This API will create the object manager vdev and in the same
365 * context vdev mlme object manager notification is invoked, which
366 * will send the vdev create to the firmware.
Jeff Johnsonc7309062018-11-09 20:59:42 -0800367 *
Arun Kumar Khandavalli4f6a5bd2019-10-23 16:01:15 +0530368 * If the vdev creation is successful the following object is referenced
369 * by below modules:
370 * 1) WLAN_OBJMGR_ID
371 * 2) WLAN_LEGACY_SME_ID
372 * 3) WLAN_LEGACY_WMA_ID
373 *
374 * Return: Newly created Vdev object or NULL incase in any error
Krunal Soni8d184fa2017-11-20 21:52:05 -0800375 */
Arun Kumar Khandavalli4f6a5bd2019-10-23 16:01:15 +0530376struct wlan_objmgr_vdev *sme_vdev_create(mac_handle_t mac_handle,
377 struct wlan_vdev_create_params *vdev_params);
378
Krunal Soni8d184fa2017-11-20 21:52:05 -0800379
gaurank kathpalia78af1932018-10-27 20:33:10 +0530380/**
Abhishek Amburecbef1442019-06-10 17:15:00 +0530381 * sme_vdev_delete() - Delete vdev for given id
Arun Kumar Khandavalli4f6a5bd2019-10-23 16:01:15 +0530382 * @mac_handle: The handle returned by mac_open.
383 * @vdev: VDEV Object
Krunal Soni8d184fa2017-11-20 21:52:05 -0800384 *
Abhishek Amburecbef1442019-06-10 17:15:00 +0530385 * This is a synchronous API. This API needs to be called to delete vdev
Krunal Soni8d184fa2017-11-20 21:52:05 -0800386 * in SME module before terminating the session completely.
387 *
Arun Kumar Khandavalli4f6a5bd2019-10-23 16:01:15 +0530388 * The following modules releases their reference to the vdev object:
389 * 1) WLAN_LEGACY_WMA_ID
390 * 2) WLAN_LEGACY_SME_ID
Krunal Soni8d184fa2017-11-20 21:52:05 -0800391 *
Arun Kumar Khandavalli4f6a5bd2019-10-23 16:01:15 +0530392 * Return: QDF_STATUS_SUCCESS - vdev is deleted.
393 * QDF_STATUS_E_INVAL when failed to delete vdev.
Krunal Soni8d184fa2017-11-20 21:52:05 -0800394 */
Arun Kumar Khandavalli4f6a5bd2019-10-23 16:01:15 +0530395QDF_STATUS sme_vdev_delete(mac_handle_t mac_handle,
396 struct wlan_objmgr_vdev *vdev);
Jeff Johnson5a6a0c92019-02-17 16:12:02 -0800397
398/**
Jianmin Zhu387e65c2019-10-18 20:21:57 +0800399 * sme_cleanup_session() - clean up sme session info for vdev
400 * @mac_handle: mac handle
401 * @vdev_id: vdev id
402 *
403 * Return: none
404 */
405void sme_cleanup_session(mac_handle_t mac_handle, uint8_t vdev_id);
406
407/**
Jeff Johnson5a6a0c92019-02-17 16:12:02 -0800408 * sme_set_curr_device_mode() - Sets the current operating device mode.
409 * @mac_handle: The handle returned by mac_open.
410 * @curr_device_mode: Current operating device mode.
411 */
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800412void sme_set_curr_device_mode(mac_handle_t mac_handle,
Jeff Johnson5a6a0c92019-02-17 16:12:02 -0800413 enum QDF_OPMODE curr_device_mode);
414
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800415QDF_STATUS sme_update_roam_params(mac_handle_t mac_handle,
416 uint8_t session_id,
417 struct roam_ext_params *roam_params_src,
418 int update_param);
419QDF_STATUS sme_update_config(mac_handle_t mac_handle,
Jeff Johnson46b4f0e2019-03-08 10:48:35 -0800420 struct sme_config_params *pSmeConfigParams);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800421
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800422QDF_STATUS sme_set11dinfo(mac_handle_t mac_handle,
Jeff Johnson46b4f0e2019-03-08 10:48:35 -0800423 struct sme_config_params *pSmeConfigParams);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800424QDF_STATUS sme_hdd_ready_ind(mac_handle_t mac_handle);
Abhinav Kumar4d1f9f42019-05-07 13:14:49 +0530425
426#ifdef WLAN_BCN_RECV_FEATURE
427/*
428 * sme_register_bcn_report_pe_cb() - Register SME callback
429 * @mac_handle: The handle returned by mac_open.
430 * @cb: cb of type beacon_report_cb
431 *
432 * This function Register SME callback in order to send
433 * beacon report to upper layer
434 *
435 * Return QDF_STATUS_SUCCESS -
436 */
437QDF_STATUS
438sme_register_bcn_report_pe_cb(mac_handle_t mac_handle, beacon_report_cb cb);
439#else
440static inline QDF_STATUS
441sme_register_bcn_report_pe_cb(mac_handle_t mac_handle, beacon_report_cb cb)
442{
443 return QDF_STATUS_SUCCESS;
444}
445#endif
446
Krunal Sonia8270f52017-02-23 19:51:25 -0800447/**
448 * sme_ser_cmd_callback() - callback from serialization module
Rajeev Kumar Sirasanagandla4477e7e2019-01-29 14:05:44 -0800449 * @cmd: serialization command
Krunal Sonia8270f52017-02-23 19:51:25 -0800450 * @reason: reason why serialization module has given this callback
451 *
452 * Serialization module will give callback to SME for why it triggered
453 * the callback
454 *
455 * Return: QDF_STATUS_SUCCESS
456 */
Rajeev Kumar Sirasanagandla4477e7e2019-01-29 14:05:44 -0800457QDF_STATUS sme_ser_cmd_callback(struct wlan_serialization_command *cmd,
Krunal Sonia8270f52017-02-23 19:51:25 -0800458 enum wlan_serialization_cb_reason reason);
Jeff Johnson5f9ce2d2018-06-09 21:20:45 -0700459
Abhishek Singh0d0568a2018-11-22 15:01:51 +0530460/**
461 * sme_purge_pdev_all_ser_cmd_list() - purge all scan and non-scan
462 * active and pending cmds for pdev
463 * @mac_handle: pointer to global MAC context
464 *
465 * Return : none
466 */
467void sme_purge_pdev_all_ser_cmd_list(mac_handle_t mac_handle);
468
Jeff Johnson5f9ce2d2018-06-09 21:20:45 -0700469/*
470 * sme_process_msg() - The main message processor for SME.
471 * @mac: The global mac context
472 * @msg: The message to be processed.
473 *
474 * This function is called by a message dispatcher when to process a message
475 * targeted for SME.
476 * This is a synchronous call
477 *
478 * Return: QDF_STATUS_SUCCESS - SME successfully processed the message.
479 * Other status means SME failed to process the message to HAL.
480 */
Jeff Johnson0a8786a2018-12-02 10:49:01 -0800481QDF_STATUS sme_process_msg(struct mac_context *mac, struct scheduler_msg *pMsg);
Jeff Johnson5f9ce2d2018-06-09 21:20:45 -0700482
Krunal Sonid32c6bc2016-10-18 18:00:21 -0700483QDF_STATUS sme_mc_process_handler(struct scheduler_msg *msg);
Abhishek Amburec5151392019-10-14 12:15:24 +0530484/*
485 * sme_scan_get_result() - Return scan results based on filter
486 * @mac: Pointer to Global MAC structure
487 * @vdev_id: vdev_id
488 * @filter: If pFilter is NULL, all cached results are returned
489 * @phResult: an object for the result.
490 *
491 * Return QDF_STATUS
492 */
493QDF_STATUS sme_scan_get_result(mac_handle_t mac_handle, uint8_t vdev_id,
494 struct scan_filter *filter,
495 tScanResultHandle *phResult);
Archana Ramachandran2eb7a612017-03-23 22:58:42 -0700496QDF_STATUS sme_get_ap_channel_from_scan_cache(
Jeff Johnson66ee8a92018-03-17 15:24:26 -0700497 struct csr_roam_profile *profile,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800498 tScanResultHandle *scan_cache,
Manikandan Mohan0ba7e552019-10-23 17:38:35 -0700499 uint32_t *ap_ch_freq);
Manikandan Mohan932c11e2019-08-14 14:09:08 -0700500/**
501 * sme_get_ap_channel_from_scan() - a wrapper function to get
502 * AP's channel id from
503 * CSR by filtering the
504 * result which matches
505 * our roam profile.
506 * @profile: SAP profile
507 * @ap_ch_freq: pointer to channel id of SAP. Fill the value after finding the
508 * best ap from scan cache.
509 *
510 * This function is written to get AP's channel id from CSR by filtering
511 * the result which matches our roam profile. This is a synchronous call.
512 *
513 * Return: QDF_STATUS.
514 */
Archana Ramachandran2eb7a612017-03-23 22:58:42 -0700515QDF_STATUS sme_get_ap_channel_from_scan(void *profile,
Manikandan Mohan932c11e2019-08-14 14:09:08 -0700516 tScanResultHandle *scan_cache,
517 uint32_t *ap_ch_freq);
518
Jeff Johnson1f2dabc2018-11-07 15:33:01 -0800519tCsrScanResultInfo *sme_scan_result_get_first(mac_handle_t,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800520 tScanResultHandle hScanResult);
Jeff Johnson1f2dabc2018-11-07 15:33:01 -0800521tCsrScanResultInfo *sme_scan_result_get_next(mac_handle_t,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800522 tScanResultHandle hScanResult);
Archana Ramachandran2eb7a612017-03-23 22:58:42 -0700523QDF_STATUS sme_scan_result_purge(tScanResultHandle hScanResult);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800524QDF_STATUS sme_roam_connect(mac_handle_t mac_handle, uint8_t sessionId,
Jeff Johnson66ee8a92018-03-17 15:24:26 -0700525 struct csr_roam_profile *pProfile, uint32_t *pRoamId);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800526QDF_STATUS sme_roam_reassoc(mac_handle_t mac_handle, uint8_t sessionId,
Jeff Johnson66ee8a92018-03-17 15:24:26 -0700527 struct csr_roam_profile *pProfile,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800528 tCsrRoamModifyProfileFields modProfileFields,
529 uint32_t *pRoamId, bool fForce);
Varun Reddy Yeturu363809c2018-06-27 14:12:52 -0700530
531/**
532 * sme_roam_disconnect() - API to request CSR to disconnect
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -0800533 * @mac_handle: Opaque handle to the global MAC context
Varun Reddy Yeturu363809c2018-06-27 14:12:52 -0700534 * @session: SME session identifier
535 * @reason: Reason to disconnect
536 *
537 * Return: QDF Status success or failure
538 */
Jeff Johnsonc7309062018-11-09 20:59:42 -0800539QDF_STATUS sme_roam_disconnect(mac_handle_t mac_handle, uint8_t session,
Varun Reddy Yeturu363809c2018-06-27 14:12:52 -0700540 eCsrRoamDisconnectReason reason);
541
Jeff Johnsonc7309062018-11-09 20:59:42 -0800542void sme_dhcp_done_ind(mac_handle_t mac_handle, uint8_t session_id);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800543QDF_STATUS sme_roam_stop_bss(mac_handle_t mac_handle, uint8_t sessionId);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800544QDF_STATUS sme_roam_disconnect_sta(mac_handle_t mac_handle, uint8_t sessionId,
Jeff Johnsone6bf7192017-11-07 15:16:09 -0800545 struct csr_del_sta_params *p_del_sta_params);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800546QDF_STATUS sme_roam_deauth_sta(mac_handle_t mac_handle, uint8_t sessionId,
Jeff Johnsone6bf7192017-11-07 15:16:09 -0800547 struct csr_del_sta_params *pDelStaParams);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800548QDF_STATUS sme_roam_get_connect_profile(mac_handle_t mac_handle,
549 uint8_t sessionId,
550 tCsrRoamConnectedProfile *pProfile);
Naveen Rawatdf0a7e72016-01-06 18:35:53 -0800551void sme_roam_free_connect_profile(tCsrRoamConnectedProfile *profile);
gaurank kathpalia99d06c12018-05-16 16:28:35 +0530552
Abhinav Kumar7830d9c2018-06-27 17:57:48 +0530553#ifdef WLAN_FEATURE_ROAM_OFFLOAD
gaurank kathpalia99d06c12018-05-16 16:28:35 +0530554/**
555 * sme_get_pmk_info(): A wrapper function to request CSR to save PMK
Jeff Johnsonc7309062018-11-09 20:59:42 -0800556 * @mac_handle: Global structure
gaurank kathpalia99d06c12018-05-16 16:28:35 +0530557 * @session_id: SME session_id
558 * @pmk_cache: pointer to a structure of pmk
559 *
560 * Return: none
561 */
Jeff Johnsonc7309062018-11-09 20:59:42 -0800562void sme_get_pmk_info(mac_handle_t mac_handle, uint8_t session_id,
gaurank kathpalia99d06c12018-05-16 16:28:35 +0530563 tPmkidCacheInfo *pmk_cache);
564
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800565QDF_STATUS sme_roam_set_psk_pmk(mac_handle_t mac_handle, uint8_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800566 uint8_t *pPSK_PMK, size_t pmk_len);
Karthik Kantamneni20548292019-01-25 11:56:58 +0530567#else
568static inline
569void sme_get_pmk_info(mac_handle_t mac_handle, uint8_t session_id,
570 tPmkidCacheInfo *pmk_cache)
571{}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800572#endif
Jeff Johnson0a078b52018-06-01 16:15:54 -0700573
574/**
575 * sme_roam_get_wpa_rsn_req_ie() - Retrieve WPA/RSN Request IE
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -0800576 * @mac_handle: Opaque handle to the global MAC context
Jeff Johnson0a078b52018-06-01 16:15:54 -0700577 * @session_id: ID of the specific session
578 * @len: Caller allocated memory that has the length of @buf as input.
579 * Upon returned, @len has the length of the IE store in @buf
580 * @buf: Caller allocated memory that contain the IE field, if any,
581 * upon return
582 *
583 * A wrapper function to request CSR to return the WPA or RSN IE CSR
584 * passes to PE to JOIN request or START_BSS request
585 * This is a synchronous call.
586 *
587 * Return: QDF_STATUS - when fail, it usually means the buffer allocated is not
588 * big enough
589 */
Jeff Johnsonc7309062018-11-09 20:59:42 -0800590QDF_STATUS sme_roam_get_wpa_rsn_req_ie(mac_handle_t mac_handle,
591 uint8_t session_id,
Jeff Johnson0a078b52018-06-01 16:15:54 -0700592 uint32_t *len, uint8_t *buf);
593
594/**
595 * sme_roam_get_wpa_rsn_rsp_ie() - Retrieve WPA/RSN Response IE
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -0800596 * @mac_handle: Opaque handle to the global MAC context
Jeff Johnson0a078b52018-06-01 16:15:54 -0700597 * @session_id: ID of the specific session
598 * @len: Caller allocated memory that has the length of @buf as input.
599 * Upon returned, @len has the length of the IE store in @buf
600 * @buf: Caller allocated memory that contain the IE field, if any,
601 * upon return
602 *
603 * A wrapper function to request CSR to return the WPA or RSN IE CSR
604 * passes to PE to JOIN request or START_BSS request
605 * This is a synchronous call.
606 *
607 * Return: QDF_STATUS - when fail, it usually means the buffer allocated is not
608 * big enough
609 */
Jeff Johnsonc7309062018-11-09 20:59:42 -0800610QDF_STATUS sme_roam_get_wpa_rsn_rsp_ie(mac_handle_t mac_handle,
611 uint8_t session_id,
Jeff Johnson0a078b52018-06-01 16:15:54 -0700612 uint32_t *len, uint8_t *buf);
613
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800614QDF_STATUS sme_get_config_param(mac_handle_t mac_handle,
Jeff Johnson46b4f0e2019-03-08 10:48:35 -0800615 struct sme_config_params *pParam);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800616QDF_STATUS sme_get_snr(mac_handle_t mac_handle,
Sourav Mohapatra05a52ed2019-08-06 16:07:05 +0530617 tCsrSnrCallback callback,
618 struct qdf_mac_addr bssId, void *pContext);
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800619#ifdef FEATURE_WLAN_ESE
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800620QDF_STATUS sme_get_tsm_stats(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800621 tCsrTsmStatsCallback callback,
Sourav Mohapatradcd8f8d2019-07-03 15:43:15 +0530622 struct qdf_mac_addr bssId,
Jeff Johnson30f84552017-09-13 14:55:25 -0700623 void *pContext, uint8_t tid);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800624QDF_STATUS sme_set_cckm_ie(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800625 uint8_t sessionId,
626 uint8_t *pCckmIe, uint8_t cckmIeLen);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800627QDF_STATUS sme_set_ese_beacon_request(mac_handle_t mac_handle,
628 const uint8_t sessionId,
Jeff Johnsonb2c3d042019-02-26 12:23:26 -0800629 const tCsrEseBeaconReq *in_req);
Jeff Johnson218f9be2019-03-01 22:18:48 -0800630
631/**
632 * sme_set_plm_request() - set plm request
633 * @mac_handle: Opaque handle to the global MAC context
634 * @req: Pointer to input plm request
635 *
636 * Return: QDF_STATUS enumeration
637 */
Jeff Johnson36583f02019-02-26 08:02:11 -0800638QDF_STATUS sme_set_plm_request(mac_handle_t mac_handle,
639 struct plm_req_params *req);
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800640#endif /*FEATURE_WLAN_ESE */
Jeff Johnson36583f02019-02-26 08:02:11 -0800641
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800642QDF_STATUS sme_get_modify_profile_fields(mac_handle_t mac_handle,
643 uint8_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800644 tCsrRoamModifyProfileFields *
645 pModifyProfileFields);
646
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800647#ifdef FEATURE_OEM_DATA_SUPPORT
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800648QDF_STATUS sme_register_oem_data_rsp_callback(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800649 sme_send_oem_data_rsp_msg callback);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800650void sme_deregister_oem_data_rsp_callback(mac_handle_t mac_handle);
Arun Khandavalli4b55da72016-07-19 19:55:01 +0530651
Prashanth Bhatta75fa9a12016-01-11 18:30:08 -0800652#else
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800653static inline
Jeff Johnsonc7309062018-11-09 20:59:42 -0800654QDF_STATUS sme_register_oem_data_rsp_callback(mac_handle_t mac_handle,
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800655 void *callback)
Prashanth Bhatta75fa9a12016-01-11 18:30:08 -0800656{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530657 return QDF_STATUS_SUCCESS;
Prashanth Bhatta75fa9a12016-01-11 18:30:08 -0800658}
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800659
660static inline
661void sme_deregister_oem_data_rsp_callback(mac_handle_t mac_handle)
Arun Khandavalli4b55da72016-07-19 19:55:01 +0530662{
663}
664
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800665#endif
666
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800667QDF_STATUS sme_roam_set_key(mac_handle_t mac_handle, uint8_t sessionId,
668 tCsrRoamSetKey *pSetKey, uint32_t *pRoamId);
669QDF_STATUS sme_get_country_code(mac_handle_t mac_handle, uint8_t *pBuf,
670 uint8_t *pbLen);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800671
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800672QDF_STATUS sme_generic_change_country_code(mac_handle_t mac_handle,
Amar Singhal7f1f3ec2015-10-13 17:14:08 -0700673 uint8_t *pCountry);
Mukul Sharmaecf8e092017-12-19 22:36:31 +0530674
675
Jeff Johnson330c0bf2018-06-01 15:13:12 -0700676/**
677 * sme_update_channel_list() - Update configured channel list to fwr
678 * This is a synchronous API.
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -0800679 * @mac_handle: Opaque handle to the global MAC context.
Jeff Johnson330c0bf2018-06-01 15:13:12 -0700680 *
681 * Return: QDF_STATUS SUCCESS.
682 * FAILURE or RESOURCES The API finished and failed.
683 */
Jeff Johnsonc7309062018-11-09 20:59:42 -0800684QDF_STATUS sme_update_channel_list(mac_handle_t mac_handle);
Mukul Sharmaecf8e092017-12-19 22:36:31 +0530685
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800686QDF_STATUS sme_tx_fail_monitor_start_stop_ind(mac_handle_t mac_handle,
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800687 uint8_t tx_fail_count,
688 void *txFailIndCallback);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800689QDF_STATUS sme_dhcp_start_ind(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800690 uint8_t device_mode,
691 uint8_t *macAddr, uint8_t sessionId);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800692QDF_STATUS sme_dhcp_stop_ind(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800693 uint8_t device_mode,
694 uint8_t *macAddr, uint8_t sessionId);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800695QDF_STATUS sme_neighbor_report_request(mac_handle_t mac_handle,
696 uint8_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800697 tpRrmNeighborReq pRrmNeighborReq,
698 tpRrmNeighborRspCallbackInfo callbackInfo);
Paul Zhangda2970b2019-06-23 18:16:38 +0800699
700#ifdef FEATURE_OEM_DATA
701/**
702 * sme_oem_data_cmd() - the wrapper to send oem data cmd to wma
703 * @mac_handle: Opaque handle to the global MAC context.
704 * @oem_data: the pointer of oem data
705 *
706 * Return: QDF_STATUS
707 */
708QDF_STATUS sme_oem_data_cmd(mac_handle_t mac_handle,
709 struct oem_data *oem_data);
710#endif
711
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800712#ifdef FEATURE_OEM_DATA_SUPPORT
Paul Zhangda2970b2019-06-23 18:16:38 +0800713/**
714 * sme_oem_req_cmd() - send oem request cmd to WMA
715 * @mac_handle: Opaque handle to the global MAC context
716 * @oem_req: OEM data request
717 *
718 * Return: QDF_STATUS
719 */
720QDF_STATUS sme_oem_req_cmd(mac_handle_t mac_handle,
721 struct oem_data_req *oem_req);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800722QDF_STATUS sme_oem_update_capability(mac_handle_t mac_handle,
Krishna Kumaar Natarajan53ca2902015-12-04 14:01:46 -0800723 struct sme_oem_capability *cap);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800724QDF_STATUS sme_oem_get_capability(mac_handle_t mac_handle,
Krishna Kumaar Natarajan53ca2902015-12-04 14:01:46 -0800725 struct sme_oem_capability *cap);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800726#endif /*FEATURE_OEM_DATA_SUPPORT */
Archana Ramachandran2eb7a612017-03-23 22:58:42 -0700727QDF_STATUS sme_change_mcc_beacon_interval(uint8_t sessionId);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800728QDF_STATUS sme_set_host_offload(mac_handle_t mac_handle, uint8_t sessionId,
Jeff Johnsond6fda812019-02-06 21:54:23 -0800729 struct sir_host_offload_req *pRequest);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800730QDF_STATUS sme_set_keep_alive(mac_handle_t mac_handle, uint8_t sessionId,
Jeff Johnson562ccad2019-02-06 22:10:24 -0800731 struct keep_alive_req *pRequest);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800732QDF_STATUS sme_get_operation_channel(mac_handle_t mac_handle,
Jianmin Zhubc841052019-10-28 17:24:39 +0800733 uint32_t *chan_freq,
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800734 uint8_t sessionId);
735QDF_STATUS sme_register_mgmt_frame(mac_handle_t mac_handle, uint8_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800736 uint16_t frameType, uint8_t *matchData,
737 uint16_t matchLen);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800738QDF_STATUS sme_deregister_mgmt_frame(mac_handle_t mac_handle,
739 uint8_t sessionId,
740 uint16_t frameType, uint8_t *matchData,
741 uint16_t matchLen);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800742#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800743QDF_STATUS sme_configure_ext_wow(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800744 tpSirExtWoWParams wlanExtParams,
745 csr_readyToSuspendCallback callback,
746 void *callbackContext);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800747QDF_STATUS sme_configure_app_type1_params(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800748 tpSirAppType1Params wlanAppType1Params);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800749QDF_STATUS sme_configure_app_type2_params(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800750 tpSirAppType2Params wlanAppType2Params);
751#endif
Abhishek Singhb1954c62019-02-14 10:18:28 +0530752/**
753 * sme_get_beaconing_concurrent_operation_channel() - To get concurrent
Kiran Kumar Lokere229212a2019-08-20 19:03:30 -0700754 * operating channel frequency of beaconing interface
Abhishek Singhb1954c62019-02-14 10:18:28 +0530755 * @mac_handle: Pointer to mac context
756 * @vdev_id_to_skip: channel of which vdev id to skip
757 *
758 * This routine will return operating channel of active AP/GO channel
759 * and will skip the channel of vdev_id_to_skip.
760 * If other no reqested mode is active it will return 0
761 *
Kiran Kumar Lokere229212a2019-08-20 19:03:30 -0700762 * Return: uint32_t
Abhishek Singhb1954c62019-02-14 10:18:28 +0530763 */
Kiran Kumar Lokere229212a2019-08-20 19:03:30 -0700764uint32_t sme_get_beaconing_concurrent_operation_channel(mac_handle_t mac_handle,
Abhishek Singhb1954c62019-02-14 10:18:28 +0530765 uint8_t vdev_id_to_skip);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800766#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
Liangwei Dong10054b92019-11-29 18:44:14 +0800767/**
768 * sme_check_concurrent_channel_overlap() - Get interfering concurrent channel
769 * @mac_handle: SAP context pointer
770 * @sap_ch_freq: SAP home channel frequency
771 * @sapPhyMode: sap phymode
772 * @cc_switch_mode: force scc channel switch mode
773 *
774 * Determine if a concurrent channel is interfering.
775 *
776 * Return: Channel freq (Mhz) of the interfering channel, or 0 if none.
777 */
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800778uint16_t sme_check_concurrent_channel_overlap(mac_handle_t mac_handle,
Kiran Kumar Lokere229212a2019-08-20 19:03:30 -0700779 uint16_t sap_ch_freq,
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800780 eCsrPhyMode sapPhyMode,
781 uint8_t cc_switch_mode);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800782#endif
Will Huanga6af7e12019-10-31 17:40:06 +0800783
784/**
785 * sme_get_cfg_valid_channels() - To get valid channel list
786 * @valid_ch_freq: pointer to array which save the valid channel list
787 * @len: the length of the valid channel list
788 *
789 * Return: QDF status
790 */
791QDF_STATUS sme_get_cfg_valid_channels(uint32_t *valid_ch_freq, uint32_t *len);
792
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800793#ifdef WLAN_FEATURE_PACKET_FILTERING
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800794QDF_STATUS sme_8023_multicast_list(mac_handle_t mac_handle, uint8_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800795 tpSirRcvFltMcAddrList pMulticastAddrs);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800796#endif /* WLAN_FEATURE_PACKET_FILTERING */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800797uint16_t sme_chn_to_freq(uint8_t chanNum);
wadesonga8940a22019-11-11 16:58:16 +0800798
799/*
800 * sme_is_channel_valid() - validate a channel against current regdmn
801 * To check if the channel is valid for currently established domain
802 * This is a synchronous API.
803 *
804 * mac_handle - The handle returned by mac_open.
805 * chan_freq - channel to verify
806 *
807 * Return: true/false, true if channel is valid
808 */
809bool sme_is_channel_valid(mac_handle_t mac_handle, uint32_t chan_freq);
810
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800811QDF_STATUS sme_set_max_tx_power(mac_handle_t mac_handle,
812 struct qdf_mac_addr pBssid,
813 struct qdf_mac_addr pSelfMacAddress, int8_t dB);
Varun Reddy Yeturua48bc412017-11-17 15:33:35 -0800814QDF_STATUS sme_set_max_tx_power_per_band(enum band_info band, int8_t db);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800815QDF_STATUS sme_set_tx_power(mac_handle_t mac_handle, uint8_t sessionId,
Anurag Chouhan6d760662016-02-20 16:05:43 +0530816 struct qdf_mac_addr bssid,
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800817 enum QDF_OPMODE dev_mode, int power);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530818QDF_STATUS sme_set_custom_mac_addr(tSirMacAddr customMacAddr);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800819QDF_STATUS sme_hide_ssid(mac_handle_t mac_handle, uint8_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800820 uint8_t ssidHidden);
Jeff Johnsonce85b5a2018-12-19 13:00:29 -0800821
Srinivas Dasaria5a42fa2019-09-20 12:47:15 +0530822/**
823 * sme_update_roam_scan_n_probes() - Update no.of roam scan probes
824 * @mac_handle: The handle returned by mac_open
825 * @vdev_id: vdev identifier
826 * @probes: number of probe requests to be sent out
827 *
828 * Return: QDF_STATUS
829 */
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800830QDF_STATUS sme_update_roam_scan_n_probes(mac_handle_t mac_handle,
Srinivas Dasaria5a42fa2019-09-20 12:47:15 +0530831 uint8_t vdev_id,
832 const uint8_t probes);
Srinivas Dasari7bedcd12019-09-20 12:43:11 +0530833
834/**
835 * sme_update_roam_scan_home_away_time() - Update roam scan Home away time
836 * @mac_handle: Opaque handle to the global MAC context
837 * @vdev_id: vdev identifier
838 * @roam_scan_home_away_time: Scan home away time
839 * @send_offload_cmd: If it's true, the command is sent to firmware,
840 * otherwise the command is not sent to firmware
841 *
842 * Return: QDF_STATUS
843 */
844QDF_STATUS
845sme_update_roam_scan_home_away_time(mac_handle_t mac_handle, uint8_t vdev_id,
846 const uint16_t roam_scan_home_away_time,
847 const bool send_offload_cmd);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800848
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800849bool sme_get_roam_intra_band(mac_handle_t mac_handle);
Srinivas Dasaria5a42fa2019-09-20 12:47:15 +0530850
851/**
852 * sme_get_roam_scan_n_probes() - get Roam scan number of probes
853 * @mac_handle: The handle returned by mac_open
854 * @vdev_id: vdev identifier
855 * @roam_scan_n_probes: Buffer to fill the number of probes.
856 * Valid only if the return status is success.
857 *
858 * Return: QDF_STATUS
859 */
860QDF_STATUS sme_get_roam_scan_n_probes(mac_handle_t mac_handle, uint8_t vdev_id,
861 uint8_t *roam_scan_n_probes);
Srinivas Dasari7f48ac02019-09-16 17:44:43 +0530862
863/**
864 * sme_update_roam_rssi_diff() - Update RoamRssiDiff
865 * @mac_handle: Opaque handle to the global MAC context
866 * @vdev_id: vdev identifier
867 * @roam_rssi_diff: Minimum rssi difference between potential candidate and
868 * current AP.
869 *
870 * Return: QDF_STATUS
871 */
872QDF_STATUS sme_update_roam_rssi_diff(mac_handle_t mac_handle, uint8_t vdev_id,
873 uint8_t roam_rssi_diff);
Srinivas Dasari7bedcd12019-09-20 12:43:11 +0530874
875/**
876 * sme_get_roam_scan_home_away_time() - get Roam scan home away time
877 * @mac_handle: The handle returned by mac_open
878 * @vdev_id: vdev identifier
879 * @roam_scan_home_away_time: Buffer to fill the roam scan home away time.
880 * Valid only if the return status is success.
881 *
882 * Return: QDF_STATUS
883 */
884QDF_STATUS sme_get_roam_scan_home_away_time(mac_handle_t mac_handle,
885 uint8_t vdev_id,
886 uint16_t *roam_scan_home_away_time);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800887QDF_STATUS sme_update_wes_mode(mac_handle_t mac_handle, bool isWESModeEnabled,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800888 uint8_t sessionId);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800889QDF_STATUS sme_set_roam_scan_control(mac_handle_t mac_handle, uint8_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800890 bool roamScanControl);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800891
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800892QDF_STATUS sme_update_is_fast_roam_ini_feature_enabled(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800893 uint8_t sessionId,
894 const bool
895 isFastRoamIniFeatureEnabled);
Mukul Sharma69c44cd2016-09-12 18:33:57 +0530896
Jeff Johnsonc7309062018-11-09 20:59:42 -0800897QDF_STATUS sme_config_fast_roaming(mac_handle_t mac_handle, uint8_t session_id,
898 const bool is_fast_roam_enabled);
Mukul Sharma69c44cd2016-09-12 18:33:57 +0530899
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800900QDF_STATUS sme_stop_roaming(mac_handle_t mac_handle, uint8_t sessionId,
Abhinav Kumar523ca372019-08-30 16:28:19 +0530901 uint8_t reason, uint32_t requestor);
Abhishek Singhd5686472017-09-20 15:18:50 +0530902
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800903QDF_STATUS sme_start_roaming(mac_handle_t mac_handle, uint8_t sessionId,
Abhinav Kumar523ca372019-08-30 16:28:19 +0530904 uint8_t reason, uint32_t requestor);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800905#ifdef FEATURE_WLAN_ESE
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800906QDF_STATUS sme_update_is_ese_feature_enabled(mac_handle_t mac_handle,
907 uint8_t sessionId,
908 const bool isEseIniFeatureEnabled);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800909#endif /* FEATURE_WLAN_ESE */
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800910QDF_STATUS sme_set_roam_rescan_rssi_diff(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800911 uint8_t sessionId,
912 const uint8_t nRoamRescanRssiDiff);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800913uint8_t sme_get_roam_rescan_rssi_diff(mac_handle_t mac_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800914
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800915QDF_STATUS sme_set_roam_opportunistic_scan_threshold_diff(
916 mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800917 uint8_t sessionId,
918 const uint8_t nOpportunisticThresholdDiff);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800919uint8_t sme_get_roam_opportunistic_scan_threshold_diff(mac_handle_t mac_handle);
Srinivas Dasari9249a982019-09-16 14:56:27 +0530920
921/**
922 * sme_set_neighbor_lookup_rssi_threshold() - update neighbor lookup rssi thr
923 * @mac_handle: The handle returned by mac_open
924 * @vdev_id: vdev identifier
925 * @neighbor_lookup_rssi_threshold: Neighbor lookup rssi threshold
926 *
927 * Return: QDF_STATUS
928 */
929QDF_STATUS
930sme_set_neighbor_lookup_rssi_threshold(mac_handle_t mac_handle,
931 uint8_t vdev_id,
932 uint8_t neighbor_lookup_rssi_threshold);
933
934/**
935 * sme_get_neighbor_lookup_rssi_threshold() - get neighbor lookup rssi threshold
936 * @mac_handle: The handle returned by mac_open
937 * @vdev_id: vdev identifier
938 * @lookup_threshold: Buffer to fill the neighbor lookup threshold.
939 * Valid only if the return status is success.
940 *
941 * Return: QDF_STATUS
942 */
943QDF_STATUS sme_get_neighbor_lookup_rssi_threshold(mac_handle_t mac_handle,
944 uint8_t vdev_id,
945 uint8_t *lookup_threshold);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800946QDF_STATUS sme_set_neighbor_scan_refresh_period(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800947 uint8_t sessionId, uint16_t neighborScanResultsRefreshPeriod);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800948uint16_t sme_get_neighbor_scan_refresh_period(mac_handle_t mac_handle);
Srinivas Dasari456aa702019-09-17 14:19:50 +0530949
950/**
Srinivas Dasari240d3272019-09-20 12:00:57 +0530951 * sme_get_empty_scan_refresh_period_global() - get global scan refresh period
952 * @mac_handle: The handle returned by mac_open
953 *
954 * Return: Empty scan refresh period configured through ini
955 */
956uint16_t sme_get_empty_scan_refresh_period_global(mac_handle_t mac_handle);
957
958/**
Srinivas Dasari456aa702019-09-17 14:19:50 +0530959 * sme_get_empty_scan_refresh_period() - get empty scan refresh period
960 * @mac_handle: The handle returned by mac_open.
961 * @vdev_id: vdev identifier
962 * @refresh_threshold: Buffer to fill the empty scan refresh period.
963 * Valid only if the return status is success.
964 *
965 * Return: QDF_STATUS
966 */
967QDF_STATUS sme_get_empty_scan_refresh_period(mac_handle_t mac_handle,
968 uint8_t vdev_id,
969 uint16_t *refresh_threshold);
Jeff Johnsonb460dd72018-11-08 10:26:51 -0800970QDF_STATUS sme_update_empty_scan_refresh_period(mac_handle_t mac_handle,
Jeff Johnson96259452019-02-26 20:38:17 -0800971 uint8_t sessionId, uint16_t empty_scan_refresh_period);
Srinivas Dasari0628e842019-08-22 01:17:38 +0530972/**
973 * sme_update_full_roam_scan_period() - Send full roam scan period to SME
974 * @mac_handle: Opaque handle to the MAC context
975 * @vdev_id: vdev id
976 * @full_roam_scan_period: Idle period in seconds between two successive
977 * full channel roam scans
978 *
979 * Updated full scan period in roam info and a roam_offload_scan request.
980 *
981 * Return: QDF_STATUS
982 */
983QDF_STATUS sme_update_full_roam_scan_period(mac_handle_t mac_handle,
984 uint8_t vdev_id,
985 uint32_t full_roam_scan_period);
Srinivas Dasari5fb81902019-08-22 01:39:42 +0530986
987/**
988 * sme_modify_roam_cand_sel_criteria() - Modify candidate selection criteria
989 * @mac_handle: Opaque handle to the global MAC context
990 * @vdev_id: vdev Identifier
991 * @enable_scoring_for_roam: Carries enable/disable indication
992 *
993 * Enable/disable scoring for roam candidate selection based on the value of
994 * enable_scoring_for_roam. Below is the description of enable/disable,
995 * Disable-0: Disable scoring for roam candidate selection. Roaming
996 * shall fallback to legacy selection criteria, only RSSI.
997 * Enable-1 : Enable scoring for roam candidate selection.
998 *
999 * Return: Success or failure
1000 */
1001QDF_STATUS
1002sme_modify_roam_cand_sel_criteria(mac_handle_t mac_handle,
1003 uint8_t vdev_id,
1004 bool enable_scoring_for_roam);
Srinivas Dasarib6798ec2019-08-21 12:07:22 +05301005
1006/**
1007 * sme_roam_control_restore_default_config - Restore roam config to default
1008 * @mac_handle: Opaque handle to the global MAC context
1009 * @vdev_id: vdev Identifier
1010 *
1011 * Restore enable_scoring_for_roam, emptyScanRefreshPeriod,
1012 * full_roam_scan_period to their default values and send RSO command to
1013 * firmware with the updated values.
1014 *
1015 * Return: Success or failure
1016 */
1017QDF_STATUS sme_roam_control_restore_default_config(mac_handle_t mac_handle,
1018 uint8_t vdev_id);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001019QDF_STATUS sme_set_neighbor_scan_min_chan_time(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001020 const uint16_t nNeighborScanMinChanTime,
1021 uint8_t sessionId);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001022QDF_STATUS sme_set_neighbor_scan_max_chan_time(mac_handle_t mac_handle,
1023 uint8_t sessionId,
1024 const uint16_t nNeighborScanMaxChanTime);
1025uint16_t sme_get_neighbor_scan_min_chan_time(mac_handle_t mac_handle,
1026 uint8_t sessionId);
1027uint32_t sme_get_neighbor_roam_state(mac_handle_t mac_handle,
1028 uint8_t sessionId);
1029uint32_t sme_get_current_roam_state(mac_handle_t mac_handle, uint8_t sessionId);
1030uint32_t sme_get_current_roam_sub_state(mac_handle_t mac_handle,
1031 uint8_t sessionId);
1032uint32_t sme_get_lim_sme_state(mac_handle_t mac_handle);
1033uint32_t sme_get_lim_mlm_state(mac_handle_t mac_handle);
1034bool sme_is_lim_session_valid(mac_handle_t mac_handle, uint8_t sessionId);
1035uint32_t sme_get_lim_sme_session_state(mac_handle_t mac_handle,
1036 uint8_t sessionId);
1037uint32_t sme_get_lim_mlm_session_state(mac_handle_t mac_handle,
1038 uint8_t sessionId);
1039uint16_t sme_get_neighbor_scan_max_chan_time(mac_handle_t mac_handle,
1040 uint8_t sessionId);
1041QDF_STATUS sme_set_neighbor_scan_period(mac_handle_t mac_handle,
1042 uint8_t sessionId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001043 const uint16_t nNeighborScanPeriod);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001044uint16_t sme_get_neighbor_scan_period(mac_handle_t mac_handle,
1045 uint8_t sessionId);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001046QDF_STATUS sme_set_roam_bmiss_first_bcnt(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001047 uint8_t sessionId, const uint8_t nRoamBmissFirstBcnt);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001048QDF_STATUS sme_set_roam_bmiss_final_bcnt(mac_handle_t mac_handle,
1049 uint8_t sessionId,
1050 const uint8_t nRoamBmissFinalBcnt);
Srinivas Dasari7f48ac02019-09-16 17:44:43 +05301051/**
1052 * sme_get_roam_rssi_diff() - get Roam rssi diff
1053 * @mac_handle: The handle returned by mac_open
1054 * @vdev_id: vdev identifier
1055 * @rssi_diff: Buffer to fill the roam RSSI diff.
1056 * Valid only if the return status is success.
1057 *
1058 * Return: QDF_STATUS
1059 */
1060QDF_STATUS sme_get_roam_rssi_diff(mac_handle_t mac_handle, uint8_t vdev_id,
1061 uint8_t *rssi_diff);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001062QDF_STATUS sme_change_roam_scan_channel_list(mac_handle_t mac_handle,
1063 uint8_t sessionId,
Liangwei Dong075afa72019-10-30 12:58:22 +08001064 uint32_t *channel_freq_list,
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001065 uint8_t numChannels);
Srinivas Dasari25d77b22019-08-07 16:21:48 +05301066
1067/**
1068 * sme_update_roam_scan_freq_list() - Update roam scan freq list
1069 * @mac_handle: Opaque handle to the global MAC context
1070 * @vdev_id: vdev identifier
1071 * @freq_list: List of frequencies to be configured
1072 * @num_channels: Number of frequencies to be configured
1073 * @freq_list_type: Type of frequency list to be configured to
1074 *
1075 * Update the frequencies from freq_list to the corresponding channel list
1076 * in neighborRoamInfo
1077 *
1078 * Return: QDF_STATUS
1079 */
1080QDF_STATUS
1081sme_update_roam_scan_freq_list(mac_handle_t mac_handle, uint8_t vdev_id,
1082 uint32_t *freq_list, uint8_t num_chan,
1083 uint32_t freq_list_type);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001084QDF_STATUS sme_set_ese_roam_scan_channel_list(mac_handle_t mac_handle,
1085 uint8_t sessionId,
Liangwei Dong075afa72019-10-30 12:58:22 +08001086 uint32_t *chan_freq_list,
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001087 uint8_t numChannels);
1088QDF_STATUS sme_get_roam_scan_channel_list(mac_handle_t mac_handle,
Jianmin Zhu203d7532019-10-28 17:17:05 +08001089 uint32_t *freq_list,
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001090 uint8_t *pNumChannels,
1091 uint8_t sessionId);
Srinivas Dasari25d77b22019-08-07 16:21:48 +05301092/**
1093 * sme_dump_freq_list() - Dump the frequencies from given chan info
1094 * @chan_info: Contains the frequency list and number of frequencies
1095 *
1096 * Extract number of frequencies and frequency list from chan_info and print
1097 * to the logs.
1098 *
1099 * Return: None
1100 */
1101void sme_dump_freq_list(tCsrChannelInfo *chan_info);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001102bool sme_get_is_ese_feature_enabled(mac_handle_t mac_handle);
1103bool sme_get_wes_mode(mac_handle_t mac_handle);
1104bool sme_get_roam_scan_control(mac_handle_t mac_handle);
1105bool sme_get_is_lfr_feature_enabled(mac_handle_t mac_handle);
1106bool sme_get_is_ft_feature_enabled(mac_handle_t mac_handle);
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07001107bool sme_is_feature_supported_by_fw(enum cap_bitmap feature);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001108
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001109QDF_STATUS sme_set_phy_mode(mac_handle_t mac_handle, eCsrPhyMode phyMode);
1110eCsrPhyMode sme_get_phy_mode(mac_handle_t mac_handle);
1111QDF_STATUS sme_handoff_request(mac_handle_t mac_handle, uint8_t sessionId,
Amar Singhale4f28ee2015-10-21 14:36:56 -07001112 tCsrHandoffRequest *pHandoffInfo);
Jeff Johnson68660882018-12-16 15:55:56 -08001113
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001114QDF_STATUS sme_add_periodic_tx_ptrn(mac_handle_t mac_handle,
1115 tSirAddPeriodicTxPtrn *addPeriodicTxPtrnParams);
1116QDF_STATUS sme_del_periodic_tx_ptrn(mac_handle_t mac_handle,
1117 tSirDelPeriodicTxPtrn *delPeriodicTxPtrnParams);
1118QDF_STATUS sme_send_rate_update_ind(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001119 tSirRateUpdateInd *rateUpdateParams);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001120QDF_STATUS sme_roam_del_pmkid_from_cache(mac_handle_t mac_handle,
1121 uint8_t sessionId,
1122 tPmkidCacheInfo *pmksa,
1123 bool flush_cache);
1124void sme_get_command_q_status(mac_handle_t mac_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001125
Rachit Kankaneee1735c2018-08-02 13:19:34 +05301126#ifdef FEATURE_WLAN_RMC
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001127QDF_STATUS sme_enable_rmc(mac_handle_t mac_handle, uint32_t sessionId);
1128QDF_STATUS sme_disable_rmc(mac_handle_t mac_handle, uint32_t sessionId);
1129QDF_STATUS sme_send_rmc_action_period(mac_handle_t mac_handle,
1130 uint32_t sessionId);
Rachit Kankaneee1735c2018-08-02 13:19:34 +05301131#endif
Abhishek Amburee0fe68d2019-09-18 15:06:32 +05301132
1133#ifdef QCA_IBSS_SUPPORT
1134/*
1135 * sme_request_ibss_peer_info() - request ibss peer info
1136 * @mac_handle: Opaque handle to the global MAC context
1137 * @cb_context: Pointer to user data
1138 * @peer_info_cb: Peer info callback
1139 * @allPeerInfoReqd: All peer info required or not
1140 * @staIdx: sta index
1141 *
1142 * Return: QDF_STATUS
1143 */
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001144QDF_STATUS sme_request_ibss_peer_info(mac_handle_t mac_handle,
Jeff Johnsonafa022c2019-02-26 09:24:17 -08001145 void *cb_context,
Jeff Johnsond6a23162019-02-17 16:46:37 -08001146 ibss_peer_info_cb peer_info_cb,
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001147 bool allPeerInfoReqd,
Yeshwanth Sriram Guntuka3f262102019-07-16 15:41:08 +05301148 uint8_t *mac_addr);
Abhishek Amburee0fe68d2019-09-18 15:06:32 +05301149#else
1150static inline
1151QDF_STATUS sme_request_ibss_peer_info(mac_handle_t mac_handle,
1152 void *cb_context,
1153 ibss_peer_info_cb peer_info_cb,
1154 bool allPeerInfoReqd,
Yeshwanth Sriram Guntuka4ac15842019-07-16 15:47:21 +05301155 uint8_t *mac_addr)
Abhishek Amburee0fe68d2019-09-18 15:06:32 +05301156{
1157 return QDF_STATUS_SUCCESS;
1158}
1159#endif
1160
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001161QDF_STATUS sme_send_cesium_enable_ind(mac_handle_t mac_handle,
1162 uint32_t sessionId);
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001163
Paul Zhang99fe8842017-12-08 14:43:46 +08001164/**
1165 * sme_set_wlm_latency_level_ind() - Used to set the latency level to fw
Jeff Johnsonc7309062018-11-09 20:59:42 -08001166 * @mac_handle
Paul Zhang99fe8842017-12-08 14:43:46 +08001167 * @session_id
1168 * @latency_level
1169 *
1170 * Return QDF_STATUS
1171 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08001172QDF_STATUS sme_set_wlm_latency_level(mac_handle_t mac_handle,
Paul Zhang99fe8842017-12-08 14:43:46 +08001173 uint16_t session_id,
1174 uint16_t latency_level);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001175/*
1176 * SME API to enable/disable idle mode powersave
1177 * This should be called only if powersave offload
1178 * is enabled
1179 */
Arunk Khandavalli847969d2017-09-25 15:15:36 +05301180QDF_STATUS sme_set_idle_powersave_config(bool value);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001181QDF_STATUS sme_notify_modem_power_state(mac_handle_t mac_handle,
1182 uint32_t value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001183
1184/*SME API to convert convert the ini value to the ENUM used in csr and MAC*/
1185ePhyChanBondState sme_get_cb_phy_state_from_cb_ini_value(uint32_t cb_ini_value);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001186int sme_update_ht_config(mac_handle_t mac_handle, uint8_t sessionId,
1187 uint16_t htCapab,
1188 int value);
1189int16_t sme_get_ht_config(mac_handle_t mac_handle, uint8_t session_id,
1190 uint16_t ht_capab);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001191#ifdef QCA_HT_2040_COEX
Yeshwanth Sriram Guntuka3f262102019-07-16 15:41:08 +05301192QDF_STATUS sme_notify_ht2040_mode(mac_handle_t mac_handle,
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001193 struct qdf_mac_addr macAddrSTA,
1194 uint8_t sessionId,
1195 uint8_t channel_type);
1196QDF_STATUS sme_set_ht2040_mode(mac_handle_t mac_handle, uint8_t sessionId,
1197 uint8_t channel_type, bool obssEnabled);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001198#endif
bingse063e4f2019-10-31 18:26:46 +08001199
1200/**
1201 * sme_get_reg_info() - To get tx power information
1202 * @mac_handle: Opaque handle to the global MAC context
1203 * @chan_freq: channel freq
1204 * @regInfo1: first reg info to fill
1205 * @regInfo2: second reg info to fill
1206 *
1207 * This routine will give you tx power information
1208 *
1209 * Return: QDF_STATUS
1210 */
1211QDF_STATUS sme_get_reg_info(mac_handle_t mac_handle, uint32_t chan_freq,
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001212 uint32_t *regInfo1, uint32_t *regInfo2);
Nirav Shaheb017be2018-02-15 11:20:58 +05301213
1214#ifdef FEATURE_WLAN_CH_AVOID
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001215QDF_STATUS sme_ch_avoid_update_req(mac_handle_t mac_handle);
Nirav Shaheb017be2018-02-15 11:20:58 +05301216#else
1217static inline
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001218QDF_STATUS sme_ch_avoid_update_req(mac_handle_t mac_handle)
Nirav Shaheb017be2018-02-15 11:20:58 +05301219{
1220 return QDF_STATUS_SUCCESS;
1221}
1222#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001223#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
Jeff Johnsoneb7bbed2019-02-17 10:34:24 -08001224/**
1225 * sme_set_auto_shutdown_cb() - Register auto shutdown evt handler
1226 * @mac_handle: Handle to the global MAC context
1227 * @callback_fn: callback function to be invoked when an auto shutdown
1228 * event is received
1229 *
1230 * Return: QDF_STATUS
1231 */
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001232QDF_STATUS sme_set_auto_shutdown_cb(mac_handle_t mac_handle,
Jeff Johnsoneb7bbed2019-02-17 10:34:24 -08001233 void (*callback_fn)(void));
1234
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001235QDF_STATUS sme_set_auto_shutdown_timer(mac_handle_t mac_handle,
1236 uint32_t timer_value);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001237#endif
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001238QDF_STATUS sme_roam_channel_change_req(mac_handle_t mac_handle,
Amar Singhale4f28ee2015-10-21 14:36:56 -07001239 struct qdf_mac_addr bssid,
Amar Singhal5cccafe2017-02-15 12:42:58 -08001240 struct ch_params *ch_params,
Jeff Johnson66ee8a92018-03-17 15:24:26 -07001241 struct csr_roam_profile *profile);
Amar Singhale4f28ee2015-10-21 14:36:56 -07001242
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001243QDF_STATUS sme_roam_start_beacon_req(mac_handle_t mac_handle,
1244 struct qdf_mac_addr bssid,
1245 uint8_t dfsCacWaitStatus);
Abhishek Singh20a8e442018-09-12 15:50:44 +05301246
Abhishek Singh20a8e442018-09-12 15:50:44 +05301247/**
Tushnim Bhattacharyyafaa9c012019-10-28 15:18:36 -07001248 * sme_roam_csa_ie_request() - request CSA IE transmission from PE
1249 * @mac_handle: handle returned by mac_open
1250 * @bssid: SAP bssid
1251 * @target_chan_freq: target channel frequency information
1252 * @csaIeReqd: CSA IE Request
1253 * @ch_params: channel information
Abhishek Singh20a8e442018-09-12 15:50:44 +05301254 *
1255 * Return: QDF_STATUS
1256 */
Jeff Johnson0a8786a2018-12-02 10:49:01 -08001257QDF_STATUS sme_csa_restart(struct mac_context *mac_ctx, uint8_t session_id);
Abhishek Singh20a8e442018-09-12 15:50:44 +05301258
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001259QDF_STATUS sme_roam_csa_ie_request(mac_handle_t mac_handle,
1260 struct qdf_mac_addr bssid,
Tushnim Bhattacharyyafaa9c012019-10-28 15:18:36 -07001261 uint32_t target_chan_freq, uint8_t csaIeReqd,
Amar Singhal5cccafe2017-02-15 12:42:58 -08001262 struct ch_params *ch_params);
Amar Singhale4f28ee2015-10-21 14:36:56 -07001263
Kiran Kumar Lokere08195ef2018-01-17 19:25:15 -08001264/**
1265 * sme_set_addba_accept() - Allow/Reject the ADDBA req session
Jeff Johnsonc7309062018-11-09 20:59:42 -08001266 * @mac_handle: handle returned by mac_open
Kiran Kumar Lokere08195ef2018-01-17 19:25:15 -08001267 * @session_id: sme session id
1268 * @value: Allow/Reject AddBA session
1269 *
1270 * Allows/Rejects the ADDBA req session
1271 *
1272 * Return: 0 on success else errno
1273 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08001274int sme_set_addba_accept(mac_handle_t mac_handle, uint8_t session_id,
1275 int value);
Kiran Kumar Lokere08195ef2018-01-17 19:25:15 -08001276
Manikandan Mohan9045e2e2018-11-26 16:44:19 -08001277QDF_STATUS sme_init_thermal_info(mac_handle_t mac_handle);
Amar Singhale4f28ee2015-10-21 14:36:56 -07001278
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001279QDF_STATUS sme_set_thermal_level(mac_handle_t mac_handle, uint8_t level);
Jeff Johnson19ce8d02019-02-08 22:56:23 -08001280QDF_STATUS sme_txpower_limit(mac_handle_t mac_handle,
1281 struct tx_power_limit *psmetx);
Jeff Johnsone943bca2019-02-08 22:45:17 -08001282
1283/**
1284 * sme_get_link_speed() - Retrieve current link speed
1285 * @mac_handle: Global MAC handle
1286 * @req: Link speed request structure
1287 * @context: User context to be passed back when invoking @cb
1288 * @cb: Callback function to be invoked with link speed results
1289 *
1290 * Return: QDF_STATUS_SUCCESS if the request was accepted, otherwise
1291 * an appropriate error status.
1292 */
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001293QDF_STATUS sme_get_link_speed(mac_handle_t mac_handle,
Jeff Johnsone943bca2019-02-08 22:45:17 -08001294 struct link_speed_info *req,
1295 void *context,
1296 sme_link_speed_cb cb);
1297
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001298QDF_STATUS sme_modify_add_ie(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001299 tSirModifyIE *pModifyIE, eUpdateIEsType updateType);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001300QDF_STATUS sme_update_add_ie(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001301 tSirUpdateIE *pUpdateIE, eUpdateIEsType updateType);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001302QDF_STATUS sme_update_connect_debug(mac_handle_t mac_handle,
1303 uint32_t set_value);
Rajeev Kumar43e25b12016-04-15 16:26:36 -07001304const char *sme_bss_type_to_string(const uint8_t bss_type);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001305QDF_STATUS sme_ap_disable_intra_bss_fwd(mac_handle_t mac_handle,
1306 uint8_t sessionId,
1307 bool disablefwd);
Jeff Johnson45843652018-07-04 12:47:34 -07001308
Qiwei Caie689a262018-07-26 15:50:22 +08001309/**
1310 * sme_send_unit_test_cmd() - send unit test command to lower layer
1311 * @session_id: sme session id to be filled while forming the command
1312 * @module_id: module id given by user to be filled in the command
1313 * @arg_count: number of argument count
1314 * @arg: pointer to argument list
1315 *
1316 * This API exposed to HDD layer which takes the argument from user and sends
1317 * down to lower layer for further processing
1318 *
1319 * Return: QDF_STATUS based on overall success
1320 */
1321QDF_STATUS sme_send_unit_test_cmd(uint32_t vdev_id, uint32_t module_id,
1322 uint32_t arg_count, uint32_t *arg);
1323
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001324typedef struct sStatsExtRequestReq {
1325 uint32_t request_data_len;
1326 uint8_t *request_data;
1327} tStatsExtRequestReq, *tpStatsExtRequestReq;
Jeff Johnson45843652018-07-04 12:47:34 -07001328
Qiwei Caie689a262018-07-26 15:50:22 +08001329#ifdef WLAN_FEATURE_STATS_EXT
lifeng66831662017-05-19 16:01:35 +08001330/**
Jeff Johnson45843652018-07-04 12:47:34 -07001331 * sme_stats_ext_register_callback() - Register stats ext callback
1332 * @mac_handle: Opaque handle to the MAC context
1333 * @callback: Function to be invoked for stats ext events
1334 *
1335 * This function is called to register the callback that send vendor
1336 * event for stats ext
1337 */
1338void sme_stats_ext_register_callback(mac_handle_t mac_handle,
1339 stats_ext_cb callback);
1340
1341/**
1342 * sme_stats_ext_deregister_callback() - Deregister stats ext callback
1343 * @mac_handle: Opaque handle to the MAC context
1344 *
1345 * This function is called to deregister the callback that send vendor
1346 * event for stats ext
1347 */
1348void sme_stats_ext_deregister_callback(mac_handle_t mac_handle);
1349
1350/**
1351 * sme_stats_ext2_register_callback() - Register stats ext2 callback
1352 * @mac_handle: Opaque handle to the MAC context
1353 * @callback: Function to be invoked for stats ext2 events
lifeng66831662017-05-19 16:01:35 +08001354 *
1355 * This function will register a callback for frame aggregation failure
1356 * indications processing.
1357 *
1358 * Return: void
1359 */
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001360void sme_stats_ext2_register_callback(mac_handle_t mac_handle,
Jeff Johnson45843652018-07-04 12:47:34 -07001361 stats_ext2_cb callback);
1362
1363QDF_STATUS sme_stats_ext_request(uint8_t session_id,
1364 tpStatsExtRequestReq input);
Qiwei Caie689a262018-07-26 15:50:22 +08001365#else
1366static inline void
1367sme_stats_ext_register_callback(mac_handle_t mac_handle,
1368 stats_ext_cb callback)
1369{
1370}
1371
1372static inline void
Min Liud35ae312019-05-08 15:43:13 +08001373sme_stats_ext_deregister_callback(mac_handle_t mac_handle)
1374{
1375}
1376
1377static inline void
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001378sme_stats_ext2_register_callback(mac_handle_t mac_handle,
Qiwei Caie689a262018-07-26 15:50:22 +08001379 stats_ext2_cb callback)
1380{
1381}
Jeff Johnson45843652018-07-04 12:47:34 -07001382#endif /* WLAN_FEATURE_STATS_EXT */
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001383QDF_STATUS sme_update_dfs_scan_mode(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001384 uint8_t sessionId,
1385 uint8_t allowDFSChannelRoam);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001386uint8_t sme_get_dfs_scan_mode(mac_handle_t mac_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001387
Will Huanga6af7e12019-10-31 17:40:06 +08001388/**
1389 * sme_get_valid_channels_by_band() - to fetch valid channels filtered by band
1390 * @mac_handle: Opaque handle to the global MAC context
1391 * @wifi_band: RF band information
1392 * @valid_chan_list: output array to store channel info
1393 * @valid_chan_len: output number of channels
1394 *
1395 * SME API to fetch all valid channels filtered by band
1396 *
1397 * Return: QDF_STATUS
1398 */
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001399QDF_STATUS sme_get_valid_channels_by_band(mac_handle_t mac_handle,
Will Huanga6af7e12019-10-31 17:40:06 +08001400 uint8_t wifi_band,
1401 uint32_t *valid_chan_list,
1402 uint8_t *valid_chan_len);
Jeff Johnsonfed9a732018-07-18 12:18:03 -07001403
Ashish Kumar Dhanotiya1a720e72019-09-06 15:42:05 +05301404#ifdef FEATURE_WLAN_EXTSCAN
Jeff Johnsonfed9a732018-07-18 12:18:03 -07001405/**
1406 * sme_ext_scan_get_capabilities() - SME API to fetch extscan capabilities
1407 * @mac_handle: Opaque handle to the MAC context
1408 * @params: extscan capabilities request structure
1409 *
1410 * Return: QDF_STATUS
1411 */
1412QDF_STATUS
1413sme_ext_scan_get_capabilities(mac_handle_t mac_handle,
1414 struct extscan_capabilities_params *params);
1415
Jeff Johnsondab58602018-07-14 15:30:24 -07001416/**
1417 * sme_ext_scan_start() - SME API to issue extscan start
1418 * @mac_handle: Opaque handle to the MAC context
1419 * @params: extscan start structure
1420 *
1421 * Return: QDF_STATUS
1422 */
1423QDF_STATUS
1424sme_ext_scan_start(mac_handle_t mac_handle,
1425 struct wifi_scan_cmd_req_params *params);
1426
Jeff Johnson7272ea72018-07-15 17:22:27 -07001427/**
1428 * sme_ext_scan_stop() - SME API to issue extscan stop
1429 * @mac_handle: Opaque handle to the MAC context
1430 * @params: extscan stop structure
1431 *
1432 * Return: QDF_STATUS
1433 */
1434QDF_STATUS sme_ext_scan_stop(mac_handle_t mac_handle,
1435 struct extscan_stop_req_params *params);
Jeff Johnson1148cb02018-07-13 23:14:32 -07001436
1437/**
1438 * sme_set_bss_hotlist() - SME API to set BSSID hotlist
1439 * @mac_handle: Opaque handle to the MAC context
1440 * @params: extscan set hotlist structure
1441 *
1442 * Handles the request to set the BSSID hotlist in firmware.
1443 *
1444 * Return: QDF_STATUS
1445 */
1446QDF_STATUS
1447sme_set_bss_hotlist(mac_handle_t mac_handle,
1448 struct extscan_bssid_hotlist_set_params *params);
1449
Jeff Johnson9743eb72018-07-14 10:30:04 -07001450/**
1451 * sme_reset_bss_hotlist() - SME API to reset BSSID hotlist
1452 * @mac_handle: Opaque handle to the MAC context
1453 * @params: extscan reset hotlist structure
1454 *
1455 * Handles the request to reset the BSSID hotlist in firmware.
1456 *
1457 * Return: QDF_STATUS
1458 */
1459QDF_STATUS
1460sme_reset_bss_hotlist(mac_handle_t mac_handle,
1461 struct extscan_bssid_hotlist_reset_params *params);
1462
Jeff Johnsonb43ed032018-07-16 06:59:21 -07001463/**
1464 * sme_set_significant_change() - SME API to set significant change
1465 * @mac_handle: Opaque handle to the MAC context
1466 * @params: extscan set significant change structure
1467 *
1468 * Return: QDF_STATUS
1469 */
1470QDF_STATUS
1471sme_set_significant_change(mac_handle_t mac_handle,
1472 struct extscan_set_sig_changereq_params *params);
1473
Jeff Johnson0c8dbc32018-07-16 22:10:48 -07001474/**
1475 * sme_reset_significant_change() - SME API to reset significant change
1476 * @mac_handle: Opaque handle to the MAC context
1477 * @params: extscan reset significant change structure
1478 *
1479 * Return: QDF_STATUS
1480 */
1481QDF_STATUS
1482sme_reset_significant_change(mac_handle_t mac_handle,
1483 struct extscan_capabilities_reset_params *params);
1484
Jeff Johnson2ba60092018-07-17 08:19:37 -07001485/**
1486 * sme_get_cached_results() - SME API to get cached results
1487 * @mac_handle: Opaque handle to the MAC context
1488 * @params: extscan get cached results structure
1489 *
1490 * Return: QDF_STATUS
1491 */
1492QDF_STATUS
1493sme_get_cached_results(mac_handle_t mac_handle,
1494 struct extscan_cached_result_params *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001495
Jeff Johnson360135b2018-07-18 20:51:47 -07001496/**
1497 * sme_set_epno_list() - set epno network list
1498 * @mac_handle: Opaque handle to the MAC context
1499 * @params: request message
1500 *
1501 * This function sends an Enhanced PNO configuration to firmware.
1502 *
1503 * Return: QDF_STATUS enumeration
1504 */
1505QDF_STATUS sme_set_epno_list(mac_handle_t mac_handle,
1506 struct wifi_enhanced_pno_params *params);
1507
Jeff Johnson2a7f1012018-07-19 07:21:06 -07001508/**
1509 * sme_set_passpoint_list() - set passpoint network list
1510 * @mac_handle: Opaque handle to the MAC context
1511 * @params: set passpoint list request parameters
1512 *
1513 * This function constructs the cds message and fill in message type,
1514 * bodyptr with @params and posts it to WDA queue.
1515 *
1516 * Return: QDF_STATUS enumeration
1517 */
1518QDF_STATUS sme_set_passpoint_list(mac_handle_t mac_handle,
1519 struct wifi_passpoint_req_param *params);
1520
1521/**
1522 * sme_reset_passpoint_list() - reset passpoint network list
1523 * @mac_handle: Opaque handle to the MAC context
1524 * @params: reset passpoint list request parameters
1525 *
1526 * Return: QDF_STATUS enumeration
1527 */
1528QDF_STATUS sme_reset_passpoint_list(mac_handle_t mac_handle,
1529 struct wifi_passpoint_req_param *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001530
Jeff Johnson17b12392018-07-03 22:21:15 -07001531QDF_STATUS sme_ext_scan_register_callback(mac_handle_t mac_handle,
1532 ext_scan_ind_cb ext_scan_ind_cb);
Prashanth Bhatta75fa9a12016-01-11 18:30:08 -08001533#else
Jeff Johnson17b12392018-07-03 22:21:15 -07001534static inline
1535QDF_STATUS sme_ext_scan_register_callback(mac_handle_t mac_handle,
1536 ext_scan_ind_cb ext_scan_ind_cb)
Prashanth Bhatta75fa9a12016-01-11 18:30:08 -08001537{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301538 return QDF_STATUS_SUCCESS;
Prashanth Bhatta75fa9a12016-01-11 18:30:08 -08001539}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001540#endif /* FEATURE_WLAN_EXTSCAN */
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001541QDF_STATUS sme_abort_roam_scan(mac_handle_t mac_handle, uint8_t sessionId);
gaurank kathpalia31800672019-11-22 13:50:11 +05301542
1543/**
1544 * sme_get_vht_ch_width() - SME API to get the max supported FW chan width
1545 *
1546 * Return: Max channel width supported by FW (eg. 20, 40, 80, 160, 80+80)
1547 */
1548uint32_t sme_get_vht_ch_width(void);
1549
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001550#ifdef WLAN_FEATURE_LINK_LAYER_STATS
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001551QDF_STATUS sme_ll_stats_clear_req(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001552 tSirLLStatsClearReq * pclearStatsReq);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001553QDF_STATUS sme_ll_stats_set_req(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001554 tSirLLStatsSetReq *psetStatsReq);
Dundi Ravitejae232cf12018-05-16 18:34:34 +05301555
1556/**
1557 * sme_ll_stats_get_req() - SME API to get the Link Layer Statistics
1558 * @mac_handle: Global MAC handle
1559 * @get_stats_req: Link Layer get stats request params structure
1560 * @context: Callback context
1561 *
1562 * Return: QDF_STATUS
1563 */
1564QDF_STATUS sme_ll_stats_get_req(mac_handle_t mac_handle,
1565 tSirLLStatsGetReq *get_stats_req,
1566 void *context);
Jeff Johnson959f3692018-07-03 17:30:40 -07001567
1568/**
1569 * sme_set_link_layer_stats_ind_cb() -
1570 * SME API to trigger the stats are available after get request
1571 * @mac_handle: MAC handle
Dundi Ravitejae232cf12018-05-16 18:34:34 +05301572 * @callback: HDD callback which needs to be invoked after
Jeff Johnson959f3692018-07-03 17:30:40 -07001573 * getting status notification from FW
1574 *
1575 * Return: QDF_STATUS
1576 */
1577QDF_STATUS sme_set_link_layer_stats_ind_cb(mac_handle_t mac_handle,
1578 link_layer_stats_cb callback);
1579
Jeff Johnsonc7309062018-11-09 20:59:42 -08001580QDF_STATUS sme_set_link_layer_ext_cb(mac_handle_t mac_handle,
Jeff Johnson2d292122018-06-02 21:02:02 -07001581 void (*ll_stats_ext_cb)(hdd_handle_t callback_ctx,
Zhang Qiana6e9c102016-12-22 16:47:24 +08001582 tSirLLStatsResults * rsp));
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001583QDF_STATUS sme_reset_link_layer_stats_ind_cb(mac_handle_t mac_handle);
Jeff Johnsonc7309062018-11-09 20:59:42 -08001584QDF_STATUS sme_ll_stats_set_thresh(mac_handle_t mac_handle,
Zhang Qian73c348a2017-03-13 16:15:55 +08001585 struct sir_ll_ext_stats_threshold *threshold);
Qiwei Cai3719efe2018-06-11 21:09:29 +08001586#else /* WLAN_FEATURE_LINK_LAYER_STATS */
1587static inline QDF_STATUS
Jeff Johnsonc7309062018-11-09 20:59:42 -08001588sme_set_link_layer_ext_cb(mac_handle_t mac_handle, void (*ll_stats_ext_cb)
Qiwei Cai3719efe2018-06-11 21:09:29 +08001589 (hdd_handle_t callback_ctx, tSirLLStatsResults
1590 *rsp))
1591{
1592 return QDF_STATUS_SUCCESS;
1593}
1594
1595static inline QDF_STATUS
Jeff Johnson959f3692018-07-03 17:30:40 -07001596sme_set_link_layer_stats_ind_cb(mac_handle_t mac_handle,
1597 link_layer_stats_cb callback)
Qiwei Cai3719efe2018-06-11 21:09:29 +08001598{
1599 return QDF_STATUS_SUCCESS;
1600}
1601
1602static inline QDF_STATUS
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001603sme_reset_link_layer_stats_ind_cb(mac_handle_t mac_handle)
Qiwei Cai3719efe2018-06-11 21:09:29 +08001604{
1605 return QDF_STATUS_SUCCESS;
1606}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001607#endif /* WLAN_FEATURE_LINK_LAYER_STATS */
1608
Jeff Johnsonc7309062018-11-09 20:59:42 -08001609QDF_STATUS sme_set_wisa_params(mac_handle_t mac_handle,
1610 struct sir_wisa_params *wisa_params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001611#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Jeff Johnsond5fb2db2018-11-08 14:20:28 -08001612QDF_STATUS sme_update_roam_key_mgmt_offload_enabled(mac_handle_t mac_handle,
Deepak Dhamdheref2a7d8b2016-08-19 16:17:38 -07001613 uint8_t session_id,
1614 bool key_mgmt_offload_enabled,
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08001615 struct pmkid_mode_bits *pmkid_modes);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001616#endif
Jeff Johnsonca7a7162018-07-07 12:56:54 -07001617QDF_STATUS sme_get_link_status(mac_handle_t mac_handle,
1618 csr_link_status_callback callback,
1619 void *context, uint8_t session_id);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001620QDF_STATUS sme_get_temperature(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001621 void *tempContext,
1622 void (*pCallbackfn)(int temperature,
1623 void *pContext));
Jeff Johnson9d45f332019-01-29 08:42:00 -08001624
1625/**
1626 * sme_set_scanning_mac_oui() - SME API to set scanning mac oui
1627 * @mac_handle: MAC Handle
1628 * @scan_mac_oui: Scanning Mac Oui
1629 *
1630 * Return: QDF_STATUS
1631 */
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001632QDF_STATUS sme_set_scanning_mac_oui(mac_handle_t mac_handle,
Jeff Johnson9d45f332019-01-29 08:42:00 -08001633 struct scan_mac_oui *scan_mac_oui);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001634
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001635#ifdef DHCP_SERVER_OFFLOAD
Jeff Johnson8bfc29e2019-02-15 07:58:15 -08001636/**
1637 * sme_set_dhcp_srv_offload() - Set DHCP server offload
1638 * @mac_handle: Handle to the global MAC context
1639 * @dhcp_srv_info : DHCP server offload info struct
1640 *
1641 * Return: QDF_STATUS
1642 */
1643QDF_STATUS
1644sme_set_dhcp_srv_offload(mac_handle_t mac_handle,
1645 struct dhcp_offload_info_params *dhcp_srv_info);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001646#endif /* DHCP_SERVER_OFFLOAD */
1647#ifdef WLAN_FEATURE_GPIO_LED_FLASHING
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001648QDF_STATUS sme_set_led_flashing(mac_handle_t mac_handle, uint8_t type,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001649 uint32_t x0, uint32_t x1);
1650#endif
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001651QDF_STATUS sme_enable_dfs_chan_scan(mac_handle_t mac_handle, uint8_t dfs_flag);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301652QDF_STATUS sme_set_mas(uint32_t val);
Jeff Johnsonc7309062018-11-09 20:59:42 -08001653QDF_STATUS sme_set_miracast(mac_handle_t mac_handle, uint8_t filter_type);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001654QDF_STATUS sme_ext_change_channel(mac_handle_t mac_handle, uint32_t channel,
Jeff Johnsonc7309062018-11-09 20:59:42 -08001655 uint8_t session_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001656
Jeff Johnsonc7309062018-11-09 20:59:42 -08001657QDF_STATUS sme_configure_stats_avg_factor(mac_handle_t mac_handle,
1658 uint8_t session_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001659 uint16_t stats_avg_factor);
1660
Jeff Johnsonc7309062018-11-09 20:59:42 -08001661QDF_STATUS sme_configure_guard_time(mac_handle_t mac_handle, uint8_t session_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001662 uint32_t guard_time);
1663
Jeff Johnsonc7309062018-11-09 20:59:42 -08001664QDF_STATUS sme_wifi_start_logger(mac_handle_t mac_handle,
1665 struct sir_wifi_start_log start_log);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001666
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001667bool sme_neighbor_middle_of_roaming(mac_handle_t mac_handle,
Jeff Johnsonc7309062018-11-09 20:59:42 -08001668 uint8_t sessionId);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001669
Jeff Johnson40894142018-11-17 12:05:54 -08001670/**
Padma, Santhosh Kumar86747ec2018-05-29 18:28:29 +05301671 * sme_is_any_session_in_middle_of_roaming() - check if roaming is in progress
Jeff Johnsonc7309062018-11-09 20:59:42 -08001672 * @mac_handle: MAC Handle
Padma, Santhosh Kumar86747ec2018-05-29 18:28:29 +05301673 *
1674 * Checks if any SME session is in middle of roaming
1675 *
Jeff Johnson40894142018-11-17 12:05:54 -08001676 * Return: true if roaming is in progress else false
Padma, Santhosh Kumar86747ec2018-05-29 18:28:29 +05301677 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08001678bool sme_is_any_session_in_middle_of_roaming(mac_handle_t mac_handle);
Padma, Santhosh Kumar86747ec2018-05-29 18:28:29 +05301679
Jeff Johnsona1e92612017-09-24 15:33:44 -07001680/**
Jeff Johnson40894142018-11-17 12:05:54 -08001681 * sme_send_flush_logs_cmd_to_fw() - Initiate command to FW to flush logs
1682 *
1683 * This function will initiate a command to firmware to flush their logs.
1684 * This should normally be done in response to an anomaly detected by the
1685 * host.
1686 *
1687 * Return: QDF_STATUS_SUCCESS if the command was sent, otherwise an
1688 * appropriate QDF_STATUS error
1689 */
1690QDF_STATUS sme_send_flush_logs_cmd_to_fw(void);
1691
1692/**
Jeff Johnson698eacd2018-05-12 17:00:03 -07001693 * sme_enable_uapsd_for_ac() - enable uapsd for access category request to WMA
Jeff Johnson698eacd2018-05-12 17:00:03 -07001694 * @ac: access category
Jeff Johnsona1e92612017-09-24 15:33:44 -07001695 * @tid: tid value
1696 * @pri: user priority
1697 * @srvc_int: service interval
1698 * @sus_int: suspend interval
1699 * @dir: tspec direction
1700 * @psb: PSB value
1701 * @sessionId: session id
1702 * @delay_interval: delay interval
1703 *
1704 * Return: QDF status
1705 */
Sourav Mohapatraa3cf12a2019-08-19 15:40:49 +05301706QDF_STATUS sme_enable_uapsd_for_ac(sme_ac_enum_type ac, uint8_t tid,
Jeff Johnsonc7309062018-11-09 20:59:42 -08001707 uint8_t pri, uint32_t srvc_int,
1708 uint32_t sus_int,
1709 enum sme_qos_wmm_dir_type dir,
1710 uint8_t psb, uint32_t sessionId,
1711 uint32_t delay_interval);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001712
Jeff Johnsona1e92612017-09-24 15:33:44 -07001713/**
Jeff Johnson698eacd2018-05-12 17:00:03 -07001714 * sme_disable_uapsd_for_ac() - disable uapsd access category request to WMA
Jeff Johnson698eacd2018-05-12 17:00:03 -07001715 * @ac: access category
Jeff Johnsona1e92612017-09-24 15:33:44 -07001716 * @sessionId: session id
1717 *
1718 * Return: QDF status
1719 */
Sourav Mohapatraa3cf12a2019-08-19 15:40:49 +05301720QDF_STATUS sme_disable_uapsd_for_ac(sme_ac_enum_type ac, uint32_t sessionId);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001721
Qiwei Caie689a262018-07-26 15:50:22 +08001722#ifdef FEATURE_RSSI_MONITOR
Jeff Johnsonc7309062018-11-09 20:59:42 -08001723QDF_STATUS sme_set_rssi_monitoring(mac_handle_t mac_handle,
Jeff Johnson4c6d40f2019-02-22 20:49:56 -08001724 struct rssi_monitor_param *input);
Jeff Johnson3201e622018-07-04 10:05:18 -07001725
1726/**
1727 * sme_set_rssi_threshold_breached_cb() - Set RSSI threshold breached callback
1728 * @mac_handle: global MAC handle
1729 * @cb: callback function pointer
1730 *
1731 * This function registers the RSSI threshold breached callback function.
1732 *
1733 * Return: QDF_STATUS enumeration.
1734 */
1735QDF_STATUS sme_set_rssi_threshold_breached_cb(mac_handle_t mac_handle,
1736 rssi_threshold_breached_cb cb);
Qiwei Caie689a262018-07-26 15:50:22 +08001737#else /* FEATURE_RSSI_MONITOR */
1738static inline
1739QDF_STATUS sme_set_rssi_threshold_breached_cb(mac_handle_t mac_handle,
1740 rssi_threshold_breached_cb cb)
1741{
1742 return QDF_STATUS_SUCCESS;
1743}
1744#endif
Jeff Johnson3201e622018-07-04 10:05:18 -07001745/**
1746 * sme_reset_rssi_threshold_breached_cb() - Reset RSSI threshold breached
1747 * callback
1748 * @mac_handle: global MAC handle
1749 *
1750 * This function de-registers the RSSI threshold breached callback function.
1751 *
1752 * Return: QDF_STATUS enumeration.
1753 */
1754QDF_STATUS sme_reset_rssi_threshold_breached_cb(mac_handle_t mac_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001755
Jeff Johnsonc7309062018-11-09 20:59:42 -08001756QDF_STATUS sme_register_mgmt_frame_ind_callback(mac_handle_t mac_handle,
Abhishek Singh7996eb72015-12-30 17:24:02 +05301757 sir_mgmt_frame_ind_callback callback);
1758
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001759QDF_STATUS sme_update_nss(mac_handle_t mac_handle, uint8_t nss);
Jeff Johnsonc7309062018-11-09 20:59:42 -08001760void sme_update_user_configured_nss(mac_handle_t mac_handle, uint8_t nss);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001761
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001762bool sme_is_any_session_in_connected_state(mac_handle_t mac_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001763
Krunal Soni8a090df2018-05-03 15:02:54 -07001764QDF_STATUS sme_pdev_set_pcl(struct policy_mgr_pcl_list *msg);
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08001765QDF_STATUS sme_pdev_set_hw_mode(struct policy_mgr_hw_mode msg);
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08001766QDF_STATUS sme_nss_update_request(uint32_t vdev_id,
Liangwei Dong8c65f232019-10-23 15:42:59 +08001767 uint8_t new_nss, uint8_t ch_width,
Jeff Johnsonc7309062018-11-09 20:59:42 -08001768 policy_mgr_nss_update_cback cback,
1769 uint8_t next_action,
1770 struct wlan_objmgr_psoc *psoc,
1771 enum policy_mgr_conn_update_reason reason,
1772 uint32_t original_vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001773
1774typedef void (*sme_peer_authorized_fp) (uint32_t vdev_id);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301775QDF_STATUS sme_set_peer_authorized(uint8_t *peer_addr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001776 sme_peer_authorized_fp auth_fp,
1777 uint32_t vdev_id);
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08001778QDF_STATUS sme_soc_set_dual_mac_config(struct policy_mgr_dual_mac_config msg);
Jeff Johnsonc7309062018-11-09 20:59:42 -08001779QDF_STATUS sme_soc_set_antenna_mode(mac_handle_t mac_handle,
1780 struct sir_antenna_mode_param *msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001781
Jeff Johnsonc7309062018-11-09 20:59:42 -08001782void sme_setdef_dot11mode(mac_handle_t mac_handle);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001783
Kiran Kumar Lokere6c7f3fa2018-05-14 18:12:27 -07001784/**
1785 * sme_update_tx_bfee_supp() - sets the Tx Bfee support
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08001786 * @mac_handle: Opaque handle to the global MAC context
Kiran Kumar Lokere6c7f3fa2018-05-14 18:12:27 -07001787 * @session_id: SME session id
1788 * @cfg_val: Tx Bfee config value
1789 *
1790 * Return: 0 on success else err code
1791 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08001792int sme_update_tx_bfee_supp(mac_handle_t mac_handle, uint8_t session_id,
1793 uint8_t cfg_val);
Kiran Kumar Lokere6c7f3fa2018-05-14 18:12:27 -07001794
Kiran Kumar Lokeref3044852018-06-27 14:14:24 -07001795/**
1796 * sme_update_tx_bfee_nsts() - sets the Tx Bfee nsts
Jeff Johnsonc7309062018-11-09 20:59:42 -08001797 * @mac_handle: MAC handle
Kiran Kumar Lokeref3044852018-06-27 14:14:24 -07001798 * @session_id: SME session id
1799 * @usr_cfg_val: user config value
1800 * @nsts_val: Tx Bfee nsts config value
1801 *
1802 * Return: 0 on success else err code
1803 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08001804int sme_update_tx_bfee_nsts(mac_handle_t mac_handle, uint8_t session_id,
Kiran Kumar Lokeref3044852018-06-27 14:14:24 -07001805 uint8_t usr_cfg_val, uint8_t nsts_val);
1806
Jeff Johnson18562662018-11-09 14:27:23 -08001807void wlan_sap_enable_phy_error_logs(mac_handle_t mac_handle,
1808 uint32_t enable_log);
Agrawal Ashishb141b092016-09-02 19:59:26 +05301809#ifdef WLAN_FEATURE_DSRC
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001810int sme_ocb_gen_timing_advert_frame(mac_handle_t mac_handle,
1811 tSirMacAddr self_addr,
Naveen Rawatb4d37622015-11-13 16:15:25 -08001812 uint8_t **buf, uint32_t *timestamp_offset,
1813 uint32_t *time_value_offset);
1814
Agrawal Ashishb141b092016-09-02 19:59:26 +05301815#else
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001816static inline
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001817int sme_ocb_gen_timing_advert_frame(mac_handle_t mac_handle,
1818 tSirMacAddr self_addr, uint8_t **buf,
1819 uint32_t *timestamp_offset,
1820 uint32_t *time_value_offset)
Agrawal Ashishb141b092016-09-02 19:59:26 +05301821{
1822 return 0;
1823}
1824
Agrawal Ashishb141b092016-09-02 19:59:26 +05301825#endif
Kiran Kumar Lokere1a43bcf2018-05-15 15:51:58 -07001826
Jeff Johnsonc7309062018-11-09 20:59:42 -08001827void sme_add_set_thermal_level_callback(mac_handle_t mac_handle,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001828 sme_set_thermal_level_callback callback);
1829
Jeff Johnsonc7309062018-11-09 20:59:42 -08001830void sme_update_tgt_services(mac_handle_t mac_handle,
1831 struct wma_tgt_services *cfg);
Masti, Narayanraddic4a7ab82015-11-25 15:41:10 +05301832
Jeff Johnsonc7309062018-11-09 20:59:42 -08001833bool sme_validate_sap_channel_switch(mac_handle_t mac_handle,
Tushnim Bhattacharyyafaa9c012019-10-28 15:18:36 -07001834 uint32_t sap_ch_freq, eCsrPhyMode sap_phy_mode,
Jeff Johnsonc7309062018-11-09 20:59:42 -08001835 uint8_t cc_switch_mode,
1836 uint8_t session_id);
1837
1838bool sme_is_session_id_valid(mac_handle_t mac_handle, uint32_t session_id);
Chandrasekaran, Manishekar2859de42016-02-11 16:17:38 +05301839
Masti, Narayanraddic4a7ab82015-11-25 15:41:10 +05301840#ifdef FEATURE_WLAN_TDLS
Jeff Johnsonc7309062018-11-09 20:59:42 -08001841void sme_get_opclass(mac_handle_t mac_handle, uint8_t channel,
1842 uint8_t bw_offset, uint8_t *opclass);
Masti, Narayanraddic4a7ab82015-11-25 15:41:10 +05301843#else
1844static inline void
Jeff Johnsonc7309062018-11-09 20:59:42 -08001845sme_get_opclass(mac_handle_t mac_handle, uint8_t channel, uint8_t bw_offset,
Masti, Narayanraddic4a7ab82015-11-25 15:41:10 +05301846 uint8_t *opclass)
1847{
1848}
1849#endif
1850
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08001851#ifdef FEATURE_LFR_SUBNET_DETECTION
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001852QDF_STATUS sme_gateway_param_update(mac_handle_t mac_handle,
Jeff Johnson38d0ce62019-02-22 17:05:14 -08001853 struct gateway_update_req_param *request);
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08001854#endif
1855
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001856void sme_update_fine_time_measurement_capab(mac_handle_t mac_handle,
1857 uint8_t session_id,
1858 uint32_t val);
1859QDF_STATUS sme_ht40_stop_obss_scan(mac_handle_t mac_handle, uint32_t vdev_id);
Anurag Chouhanbf5e0e22016-09-12 12:54:09 +05301860QDF_STATUS sme_set_fw_test(struct set_fwtest_params *fw_test);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001861QDF_STATUS sme_set_tsfcb(mac_handle_t mac_handle,
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07001862 int (*cb_fn)(void *cb_ctx, struct stsf *ptsf), void *cb_ctx);
Krunal Sonie3531942016-04-12 17:43:53 -07001863
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001864QDF_STATUS sme_reset_tsfcb(mac_handle_t mac_handle);
Arun Khandavalli4b55da72016-07-19 19:55:01 +05301865
yuanl2746f072018-09-21 19:19:16 +08001866#if defined(WLAN_FEATURE_TSF) && !defined(WLAN_FEATURE_TSF_PLUS_NOIRQ)
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001867QDF_STATUS sme_set_tsf_gpio(mac_handle_t mac_handle, uint32_t pinvalue);
Manikandan Mohan976e7562016-03-15 16:33:31 -07001868#endif
1869
Jeff Johnsonb460dd72018-11-08 10:26:51 -08001870QDF_STATUS sme_update_mimo_power_save(mac_handle_t mac_handle,
Archana Ramachandran20d2e232016-02-11 16:58:40 -08001871 uint8_t is_ht_smps_enabled,
Archana Ramachandranfec24812016-02-16 16:31:56 -08001872 uint8_t ht_smps_mode,
1873 bool send_smps_action);
Abhinav Kumardbbfd2c2019-05-07 12:22:06 +05301874#ifdef WLAN_BCN_RECV_FEATURE
1875/**
1876 * sme_handle_bcn_recv_start() - Enable fw to start sending
1877 * beacons of the current connected AP
1878 * @mac_handle: Opaque handle to the global MAC context
1879 * @vdev_id: SME session id
Abhinav Kumar8475bc32019-06-05 15:35:56 +05301880 * @nth_value: Beacon report period
Abhinav Kumare85ae552019-06-05 19:02:14 +05301881 * @do_not_resume: beacon reporting resume after a pause is completed
Abhinav Kumardbbfd2c2019-05-07 12:22:06 +05301882 *
1883 * This function remove beacon filter. It allow fw to send
1884 * all beacons from connected peer to driver.
1885 *
1886 * Return: QDF_STATUS enumeration
1887 */
1888QDF_STATUS sme_handle_bcn_recv_start(mac_handle_t mac_handle,
Abhinav Kumar8475bc32019-06-05 15:35:56 +05301889 uint32_t vdev_id,
Abhinav Kumare85ae552019-06-05 19:02:14 +05301890 uint32_t nth_value,
1891 bool do_not_resume);
Abhinav Kumar39222152019-05-13 23:53:40 +05301892
1893/**
1894 * sme_is_beacon_report_started() - Check bcn recv started
1895 * @mac_handle: Opaque handle to the global MAC context
1896 * @session_id: SME session id
1897 *
1898 * This function is to check beacon report started or not.
1899 *
1900 * Return: true on success
1901 */
1902bool sme_is_beacon_report_started(mac_handle_t mac_handle,
1903 uint32_t session_id);
1904
1905/**
Abhinav Kumare85ae552019-06-05 19:02:14 +05301906 * sme_is_beacon_reporting_do_not_resume() - Check auto resume allowed or not
1907 * @mac_handle: Opaque handle to the global MAC context
1908 * @session_id: SME session id
1909 *
1910 * This function is to check auto resume of beacon reporting is allowed or not.
1911 *
1912 * Return: true on success
1913 */
1914bool sme_is_beacon_reporting_do_not_resume(mac_handle_t mac_handle,
1915 uint32_t session_id);
1916
1917/**
Abhinav Kumar39222152019-05-13 23:53:40 +05301918 * stop_beacon_report() - To stop beacon report
1919 * @mac_handle: Opaque handle to the global MAC context
1920 * @session_id: SME session id
1921 *
1922 * Return: None
1923 */
1924void sme_stop_beacon_report(mac_handle_t mac_handle,
1925 uint32_t session_id);
1926
1927#else
1928static inline
1929bool sme_is_beacon_report_started(mac_handle_t mac_handle,
1930 uint32_t session_id)
1931{
1932 return true;
1933}
1934
1935static inline
Abhinav Kumare85ae552019-06-05 19:02:14 +05301936bool sme_is_beacon_reporting_do_not_resume(mac_handle_t mac_handle,
1937 uint32_t session_id)
1938{
1939 return false;
1940}
1941
1942static inline
Abhinav Kumar39222152019-05-13 23:53:40 +05301943void sme_stop_beacon_report(mac_handle_t mac_handle,
1944 uint32_t session_id)
1945{
1946}
1947
Abhinav Kumardbbfd2c2019-05-07 12:22:06 +05301948#endif
Archana Ramachandran20d2e232016-02-11 16:58:40 -08001949
Jeff Johnsonc7309062018-11-09 20:59:42 -08001950QDF_STATUS sme_add_beacon_filter(mac_handle_t mac_handle,
1951 uint32_t session_id, uint32_t *ie_map);
1952QDF_STATUS sme_remove_beacon_filter(mac_handle_t mac_handle,
1953 uint32_t session_id);
Arun Khandavalli2476ef52016-04-26 20:19:43 +05301954
Nachiket Kukade177b5b02018-05-22 20:52:17 +05301955#ifdef FEATURE_WLAN_APF
Jeff Johnsona867e0c2017-01-26 13:43:51 -08001956/**
Nachiket Kukade177b5b02018-05-22 20:52:17 +05301957 * sme_get_apf_capabilities() - Get APF capabilities
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08001958 * @mac_handle: Opaque handle to the global MAC context
Jeff Johnsona867e0c2017-01-26 13:43:51 -08001959 * @callback: Callback function to be called with the result
1960 * @context: Opaque context to be used by the caller to associate the
1961 * request with the response
1962 *
1963 * This function constructs the cds message and fill in message type,
1964 * post the same to WDA.
1965 *
1966 * Return: QDF_STATUS enumeration
1967 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08001968QDF_STATUS sme_get_apf_capabilities(mac_handle_t mac_handle,
Nachiket Kukade177b5b02018-05-22 20:52:17 +05301969 apf_get_offload_cb callback,
1970 void *context);
Jeff Johnsona867e0c2017-01-26 13:43:51 -08001971
Nachiket Kukade177b5b02018-05-22 20:52:17 +05301972/**
1973 * sme_set_apf_instructions() - Set APF apf filter instructions.
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08001974 * @mac_handle: Opaque handle to the global MAC context
Nachiket Kukade177b5b02018-05-22 20:52:17 +05301975 * @apf_set_offload: struct to set apf filter instructions.
1976 *
1977 * APFv2 (Legacy APF) API to set the APF packet filter.
1978 *
1979 * Return: QDF_STATUS enumeration.
1980 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08001981QDF_STATUS sme_set_apf_instructions(mac_handle_t mac_handle,
Nachiket Kukade177b5b02018-05-22 20:52:17 +05301982 struct sir_apf_set_offload
1983 *apf_set_offload);
1984
1985/**
1986 * sme_set_apf_enable_disable - Send apf enable/disable cmd
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08001987 * @mac_handle: Opaque handle to the global MAC context
Nachiket Kukade177b5b02018-05-22 20:52:17 +05301988 * @vdev_id: vdev id
1989 * @apf_enable: true: Enable APF Int., false: Disable APF Int.
1990 *
1991 * API to either enable or disable the APF interpreter.
1992 *
1993 * Return: QDF_STATUS enumeration.
1994 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08001995QDF_STATUS sme_set_apf_enable_disable(mac_handle_t mac_handle, uint8_t vdev_id,
Nachiket Kukade177b5b02018-05-22 20:52:17 +05301996 bool apf_enable);
1997
1998/**
1999 * sme_apf_write_work_memory - Write into the apf work memory
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002000 * @mac_handle: Opaque handle to the global MAC context
Nachiket Kukade177b5b02018-05-22 20:52:17 +05302001 * @write_params: APF parameters for the write operation
2002 *
2003 * API for writing into the APF work memory.
2004 *
2005 * Return: QDF_STATUS enumeration.
2006 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002007QDF_STATUS sme_apf_write_work_memory(mac_handle_t mac_handle,
Nachiket Kukade177b5b02018-05-22 20:52:17 +05302008 struct wmi_apf_write_memory_params
2009 *write_params);
2010
2011/**
2012 * sme_apf_read_work_memory - Read part of apf work memory
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002013 * @mac_handle: Opaque handle to the global MAC context
Nachiket Kukade177b5b02018-05-22 20:52:17 +05302014 * @read_params: APF parameters for the get operation
2015 * @callback: callback to handle the the read response
2016 *
2017 * API for issuing a APF read memory request.
2018 *
2019 * Return: QDF_STATUS enumeration.
2020 */
2021QDF_STATUS
Jeff Johnsonc7309062018-11-09 20:59:42 -08002022sme_apf_read_work_memory(mac_handle_t mac_handle,
Nachiket Kukade177b5b02018-05-22 20:52:17 +05302023 struct wmi_apf_read_memory_params *read_params,
2024 apf_read_mem_cb callback);
2025
2026#endif /* FEATURE_WLAN_APF */
2027
Jeff Johnsonc7309062018-11-09 20:59:42 -08002028uint32_t sme_get_wni_dot11_mode(mac_handle_t mac_handle);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08002029QDF_STATUS sme_create_mon_session(mac_handle_t mac_handle, uint8_t *bssid,
Rajeev Kumar Sirasanagandlae3b59912018-08-24 15:53:31 +05302030 uint8_t vdev_id);
Naveen Rawata410c5a2016-09-19 14:22:33 -07002031
Jinwei Chenbdd977f2019-06-14 15:09:30 +08002032/**
2033 * sme_delete_mon_session() - post message to delete PE session for mon_mode
2034 * operation
2035 * @mac_handle: Opaque handle to the global MAC context
2036 * @vdev_id: sme session id
2037 *
2038 * Return: QDF_STATUS_SUCCESS on success, non-zero error code on failure.
2039 */
2040QDF_STATUS sme_delete_mon_session(mac_handle_t mac_handle, uint8_t vdev_id);
2041
Jeff Johnsonc7309062018-11-09 20:59:42 -08002042void sme_set_vdev_ies_per_band(mac_handle_t mac_handle, uint8_t vdev_id);
Jeff Johnsonb460dd72018-11-08 10:26:51 -08002043void sme_set_pdev_ht_vht_ies(mac_handle_t mac_handle, bool enable2x2);
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07002044
Jeff Johnsonc7309062018-11-09 20:59:42 -08002045/**
2046 * sme_update_vdev_type_nss() - sets the nss per vdev type
2047 * @mac_handle: Opaque handle to the global MAC context
2048 * @max_supp_nss: max_supported Nss
2049 * @band: 5G or 2.4G band
2050 *
2051 * Sets the per band Nss for each vdev type based on INI and configured
2052 * chain mask value.
2053 *
2054 * Return: None
2055 */
2056void sme_update_vdev_type_nss(mac_handle_t mac_handle, uint8_t max_supp_nss,
gaurank kathpalia651abcd2018-11-12 22:41:23 +05302057 enum nss_chains_band_info band);
Jeff Johnsonc7309062018-11-09 20:59:42 -08002058
Rachit Kankane026e77a2018-07-31 16:21:09 +05302059#ifdef FEATURE_P2P_LISTEN_OFFLOAD
Jeff Johnsonb460dd72018-11-08 10:26:51 -08002060void sme_register_p2p_lo_event(mac_handle_t mac_handle, void *context,
Peng Xu8fdaa492016-06-22 10:20:47 -07002061 p2p_lo_callback callback);
Rachit Kankane026e77a2018-07-31 16:21:09 +05302062#else
Jeff Johnsonb460dd72018-11-08 10:26:51 -08002063static inline void sme_register_p2p_lo_event(mac_handle_t mac_handle,
Rachit Kankane026e77a2018-07-31 16:21:09 +05302064 void *context,
2065 p2p_lo_callback callback)
2066{
2067}
2068#endif
Manjeet Singhf82ed072016-07-08 11:40:00 +05302069
Jeff Johnsonc7309062018-11-09 20:59:42 -08002070QDF_STATUS sme_remove_bssid_from_scan_list(mac_handle_t mac_handle,
Abhishek Singhc9941602016-08-09 16:06:22 +05302071 tSirMacAddr bssid);
2072
Jeff Johnsonc7309062018-11-09 20:59:42 -08002073QDF_STATUS sme_process_mac_pwr_dbg_cmd(mac_handle_t mac_handle,
2074 uint32_t session_id,
Manjeet Singhf82ed072016-07-08 11:40:00 +05302075 struct sir_mac_pwr_dbg_cmd*
2076 dbg_args);
2077
Jeff Johnsonc1e62782017-11-09 09:50:17 -08002078void sme_get_vdev_type_nss(enum QDF_OPMODE dev_mode,
2079 uint8_t *nss_2g, uint8_t *nss_5g);
Jeff Johnsonc7309062018-11-09 20:59:42 -08002080QDF_STATUS sme_roam_set_default_key_index(mac_handle_t mac_handle,
2081 uint8_t session_id,
Masti, Narayanraddiab712a72016-08-04 11:59:11 +05302082 uint8_t default_idx);
Jeff Johnsonc7309062018-11-09 20:59:42 -08002083void sme_send_disassoc_req_frame(mac_handle_t mac_handle,
2084 uint8_t session_id, uint8_t *peer_mac,
2085 uint16_t reason, uint8_t wait_for_ack);
2086QDF_STATUS sme_update_access_policy_vendor_ie(mac_handle_t mac_handle,
2087 uint8_t session_id,
2088 uint8_t *vendor_ie,
2089 int access_policy);
Kondabattini, Ganeshe4f18e02016-09-13 13:01:22 +05302090
Krishna Kumaar Natarajanf1581df2017-02-21 13:42:08 -08002091/**
2092 * sme_set_peer_param() - set peer param
2093 * @vdev_id: vdev ID
2094 * @peer_addr: peer MAC address
2095 * @param_id: param ID to be updated
2096 * @param_Value: paraam value
2097 *
2098 * This SME API is used to send the peer param to WMA to be sent to FW.
2099 *
2100 * Return: QDF_STATUS
2101 */
2102QDF_STATUS sme_set_peer_param(uint8_t *peer_addr, uint32_t param_id,
2103 uint32_t param_value, uint32_t vdev_id);
2104
Jeff Johnsonc7309062018-11-09 20:59:42 -08002105QDF_STATUS sme_update_sta_roam_policy(mac_handle_t mac_handle,
Agrawal Ashish21ba2572016-09-03 16:40:10 +05302106 enum sta_roam_policy_dfs_mode dfs_mode,
2107 bool skip_unsafe_channels,
Agrawal, Ashish9f84c402016-11-30 16:19:44 +05302108 uint8_t session_id, uint8_t sap_operating_band);
Jeff Johnsonc7309062018-11-09 20:59:42 -08002109QDF_STATUS sme_enable_disable_chanavoidind_event(mac_handle_t mac_handle,
Selvaraj, Sridharebda0f22016-08-29 16:05:23 +05302110 uint8_t set_value);
Jeff Johnsonc7309062018-11-09 20:59:42 -08002111QDF_STATUS sme_set_default_scan_ie(mac_handle_t mac_handle, uint16_t session_id,
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05302112 uint8_t *ie_data, uint16_t ie_len);
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302113/**
2114 * sme_update_session_param() - API to update PE session param
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002115 * @mac_handle: Opaque handle to the global MAC context
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302116 * @session_id: Session ID
2117 * @param_type: Param type to be updated
2118 * @param_val: Param value to be update
2119 *
2120 * Note: this setting will not persist over reboots.
2121 *
2122 * Return: QDF_STATUS
2123 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002124QDF_STATUS sme_update_session_param(mac_handle_t mac_handle, uint8_t session_id,
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302125 uint32_t param_type, uint32_t param_val);
Jeff Johnson6136fb92017-03-30 15:21:49 -07002126#ifdef WLAN_FEATURE_FIPS
2127/**
2128 * sme_fips_request() - Perform a FIPS certification operation
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002129 * @mac_handle: Opaque handle to the global MAC context
Jeff Johnson6136fb92017-03-30 15:21:49 -07002130 * @param: The FIPS certification parameters
2131 * @callback: Callback function to invoke with the results
2132 * @context: Opaque context to pass back to caller in the callback
2133 *
2134 * Return: QDF_STATUS_SUCCESS if the request is successfully sent
2135 * to firmware for processing, otherwise an error status.
2136 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002137QDF_STATUS sme_fips_request(mac_handle_t mac_handle, struct fips_params *param,
Jeff Johnson6136fb92017-03-30 15:21:49 -07002138 wma_fips_cb callback, void *context);
2139#else
2140static inline
Jeff Johnsonc7309062018-11-09 20:59:42 -08002141QDF_STATUS sme_fips_request(mac_handle_t mac_handle, struct fips_params *param,
Jeff Johnson6136fb92017-03-30 15:21:49 -07002142 wma_fips_cb callback, void *context)
2143{
2144 return QDF_STATUS_E_NOSUPPORT;
2145}
2146#endif /* WLAN_FEATURE_FIPS */
2147
Agrawal Ashishb2d1a452016-05-05 12:23:58 +05302148/**
2149 * sme_set_cts2self_for_p2p_go() - sme function to set ini parms to FW.
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002150 * @mac_handle: Opaque handle to the global MAC context
Agrawal Ashishb2d1a452016-05-05 12:23:58 +05302151 *
2152 * Return: QDF_STATUS
2153 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002154QDF_STATUS sme_set_cts2self_for_p2p_go(mac_handle_t mac_handle);
Jeff Johnson42246bd2018-12-31 11:23:11 -08002155
Jeff Johnsonb460dd72018-11-08 10:26:51 -08002156QDF_STATUS sme_update_tx_fail_cnt_threshold(mac_handle_t mac_handle,
Agrawal, Ashish35b251d2016-09-08 19:21:03 +05302157 uint8_t session_id, uint32_t tx_fail_count);
Jeff Johnson63dab5d2018-12-17 22:44:14 -08002158
yeshwanth sriram guntukaa1ba9a22017-02-28 16:17:32 +05302159/**
2160 * sme_roam_is_ese_assoc() - Check if association type is ESE
2161 * @roam_info: Pointer to roam info
2162 *
2163 * Return: true if ESE Association, false otherwise.
2164 */
2165#ifdef FEATURE_WLAN_ESE
Jeff Johnson172237b2017-11-07 15:32:59 -08002166bool sme_roam_is_ese_assoc(struct csr_roam_info *roam_info);
yeshwanth sriram guntukaa1ba9a22017-02-28 16:17:32 +05302167#else
Jeff Johnson172237b2017-11-07 15:32:59 -08002168static inline bool sme_roam_is_ese_assoc(struct csr_roam_info *roam_info)
yeshwanth sriram guntukaa1ba9a22017-02-28 16:17:32 +05302169{
2170 return false;
2171}
2172#endif
2173/**
2174 * sme_neighbor_roam_is11r_assoc() - Check if association type is 11R
Jeff Johnsonc7309062018-11-09 20:59:42 -08002175 * @mac_handle: MAC_HANDLE handle
yeshwanth sriram guntukaa1ba9a22017-02-28 16:17:32 +05302176 * @session_id: session id
2177 *
2178 * Return: true if 11r Association, false otherwise.
2179 */
Jeff Johnsond5fb2db2018-11-08 14:20:28 -08002180bool sme_neighbor_roam_is11r_assoc(mac_handle_t mac_handle, uint8_t session_id);
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05302181
2182/**
2183 * sme_update_sta_inactivity_timeout(): Update sta_inactivity_timeout to FW
Jeff Johnsonc7309062018-11-09 20:59:42 -08002184 * @mac_handle: Handle returned by mac_open
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05302185 * @sta_inactivity_timer: struct for sta inactivity timer
2186 *
2187 * If a station does not send anything in sta_inactivity_timeout seconds, an
2188 * empty data frame is sent to it in order to verify whether it is
2189 * still in range. If this frame is not ACKed, the station will be
2190 * disassociated and then deauthenticated.
2191 *
2192 * Return: QDF_STATUS_SUCCESS or non-zero on failure.
2193*/
Jeff Johnsonb460dd72018-11-08 10:26:51 -08002194QDF_STATUS sme_update_sta_inactivity_timeout(mac_handle_t mac_handle,
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05302195 struct sme_sta_inactivity_timeout *sta_inactivity_timer);
2196
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05302197/**
2198 * sme_set_lost_link_info_cb() - plug in callback function for receiving
Jeff Johnsondc198ec2018-07-04 17:39:53 -07002199 * @mac_handle: Opaque handle to the MAC context
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05302200 * @cb: callback function
2201 *
2202 * Return: HAL status
2203 */
Jeff Johnsondc198ec2018-07-04 17:39:53 -07002204QDF_STATUS sme_set_lost_link_info_cb(mac_handle_t mac_handle,
2205 lost_link_info_cb cb);
Yingying Tang95409972016-10-20 15:16:15 +08002206
Kapil Gupta8878ad92017-02-13 11:56:04 +05302207/**
2208 * sme_update_new_channel_event() - update new channel event for sapFsm
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002209 * @mac_handle: Opaque handle to the global MAC context
Kapil Gupta8878ad92017-02-13 11:56:04 +05302210 * @session_id: session id
2211 *
2212 * Return: QDF_STATUS_SUCCESS or non-zero on failure.
2213 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002214QDF_STATUS sme_update_new_channel_event(mac_handle_t mac_handle,
2215 uint8_t session_id);
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05302216#ifdef WLAN_POWER_DEBUGFS
Jeff Johnsonc7309062018-11-09 20:59:42 -08002217QDF_STATUS sme_power_debug_stats_req(
2218 mac_handle_t mac_handle,
2219 void (*callback_fn)(struct power_stats_response *response,
2220 void *context),
2221 void *power_stats_context);
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05302222#endif
Jeff Johnsonf0e54b02017-12-18 15:22:25 -08002223
Arunk Khandavallica56d4b2018-11-29 15:46:00 +05302224#ifdef WLAN_FEATURE_BEACON_RECEPTION_STATS
2225/**
2226 * sme_beacon_debug_stats_req() - SME API to collect beacon debug stats
2227 * @vdev_id: Vdev id on which stats is being requested
2228 * @callback_fn: Pointer to the callback function for beacon stats event
2229 * @beacon_stats_context: Pointer to context
2230 *
2231 * Return: QDF_STATUS
2232 */
2233QDF_STATUS sme_beacon_debug_stats_req(
2234 mac_handle_t mac_handle, uint32_t vdev_id,
2235 void (*callback_fn)(struct bcn_reception_stats_rsp
2236 *response, void *context),
2237 void *beacon_stats_context);
2238#endif
2239
Jeff Johnsonf0e54b02017-12-18 15:22:25 -08002240/**
2241 * sme_get_sar_power_limits() - get SAR limits
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002242 * @mac_handle: Opaque handle to the global MAC context
Jeff Johnsonf0e54b02017-12-18 15:22:25 -08002243 * @callback: Callback function to invoke with the results
2244 * @context: Opaque context to pass back to caller in the callback
2245 *
2246 * Return: QDF_STATUS_SUCCESS if the request is successfully sent
2247 * to firmware for processing, otherwise an error status.
2248 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002249QDF_STATUS sme_get_sar_power_limits(mac_handle_t mac_handle,
Jeff Johnsonf0e54b02017-12-18 15:22:25 -08002250 wma_sar_cb callback, void *context);
2251
Kabilan Kannan3c0a7352016-12-02 18:49:38 -08002252/**
2253 * sme_set_sar_power_limits() - set sar limits
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002254 * @mac_handle: Opaque handle to the global MAC context
Kabilan Kannan3c0a7352016-12-02 18:49:38 -08002255 * @sar_limit_cmd: struct to send sar limit cmd.
2256 *
2257 * Return: QDF_STATUS enumeration.
2258 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002259QDF_STATUS sme_set_sar_power_limits(mac_handle_t mac_handle,
Kabilan Kannan3c0a7352016-12-02 18:49:38 -08002260 struct sar_limit_cmd_params *sar_limit_cmd);
Jeff Johnsonf0e54b02017-12-18 15:22:25 -08002261
Dundi Raviteja3b637092018-09-12 13:42:50 +05302262/**
2263 * sme_send_coex_config_cmd() - Send COEX config params
2264 * @coex_cfg_params: struct to coex config params
2265 *
2266 * Return: QDF_STATUS
2267 */
2268QDF_STATUS sme_send_coex_config_cmd(struct coex_config_params *coex_cfg_params);
2269
Jeff Johnsonb460dd72018-11-08 10:26:51 -08002270void sme_set_cc_src(mac_handle_t mac_handle, enum country_src);
Yingying Tang95409972016-10-20 15:16:15 +08002271
2272
2273#ifdef WLAN_FEATURE_WOW_PULSE
2274QDF_STATUS sme_set_wow_pulse(struct wow_pulse_mode *wow_pulse_set_info);
2275#endif
2276
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05302277/* ARP DEBUG STATS */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002278QDF_STATUS sme_set_nud_debug_stats(mac_handle_t mac_handle,
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05302279 struct set_arp_stats_params
2280 *set_stats_param);
Jeff Johnsonc7309062018-11-09 20:59:42 -08002281QDF_STATUS sme_get_nud_debug_stats(mac_handle_t mac_handle,
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05302282 struct get_arp_stats_params
2283 *get_stats_param);
Jeff Johnsonc7309062018-11-09 20:59:42 -08002284QDF_STATUS sme_set_nud_debug_stats_cb(mac_handle_t mac_handle,
Dundi Raviteja3bcf3a82018-05-22 13:24:18 +05302285 void (*cb)(void *, struct rsp_stats *, void *context),
2286 void *context);
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05302287
Kapil Gupta4f0c0c12017-02-07 15:21:15 +05302288/**
2289 * sme_set_chan_info_callback() - Register chan info callback
Jeff Johnsonc7309062018-11-09 20:59:42 -08002290 * @mac_handle - MAC global handle
Kapil Gupta4f0c0c12017-02-07 15:21:15 +05302291 * @callback_routine - callback routine from HDD
2292 *
2293 * This API is invoked by HDD to register its callback to mac
2294 *
2295 * Return: QDF_STATUS
2296 */
Jeff Johnsonb460dd72018-11-08 10:26:51 -08002297void sme_set_chan_info_callback(mac_handle_t mac_handle,
Kapil Gupta4f0c0c12017-02-07 15:21:15 +05302298 void (*callback)(struct scan_chan_info *chan_info));
Naveen Rawat664a7cb2017-01-19 17:58:14 -08002299
2300/**
Hanumanth Reddy Pothula90051782017-05-04 22:14:43 +05302301 * sme_get_rssi_snr_by_bssid() - gets the rssi and snr by bssid from scan cache
Jeff Johnsonc7309062018-11-09 20:59:42 -08002302 * @mac_handle: handle returned by mac_open
Hanumanth Reddy Pothula90051782017-05-04 22:14:43 +05302303 * @profile: current connected profile
2304 * @bssid: bssid to look for in scan cache
2305 * @rssi: rssi value found
2306 * @snr: snr value found
2307 *
2308 * Return: QDF_STATUS
2309 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002310QDF_STATUS sme_get_rssi_snr_by_bssid(mac_handle_t mac_handle,
Jeff Johnson66ee8a92018-03-17 15:24:26 -07002311 struct csr_roam_profile *profile,
Hanumanth Reddy Pothula90051782017-05-04 22:14:43 +05302312 const uint8_t *bssid, int8_t *rssi,
2313 int8_t *snr);
2314
2315/**
Naveen Rawat664a7cb2017-01-19 17:58:14 -08002316 * sme_get_beacon_frm() - gets the bss descriptor from scan cache and prepares
2317 * beacon frame
Jeff Johnsonb460dd72018-11-08 10:26:51 -08002318 * @mac_handle: handle returned by mac_open
Naveen Rawat664a7cb2017-01-19 17:58:14 -08002319 * @profile: current connected profile
2320 * @bssid: bssid to look for in scan cache
2321 * @frame_buf: frame buffer to populate
2322 * @frame_len: length of constructed frame
Manikandan Mohan0ba7e552019-10-23 17:38:35 -07002323 * @ch_freq: Pointer to channel freq info to be filled
Naveen Rawat664a7cb2017-01-19 17:58:14 -08002324 *
2325 * Return: QDF_STATUS
2326 */
Jeff Johnsonb460dd72018-11-08 10:26:51 -08002327QDF_STATUS sme_get_beacon_frm(mac_handle_t mac_handle,
2328 struct csr_roam_profile *profile,
Jeff Johnson66ee8a92018-03-17 15:24:26 -07002329 const tSirMacAddr bssid,
2330 uint8_t **frame_buf, uint32_t *frame_len,
Manikandan Mohan0ba7e552019-10-23 17:38:35 -07002331 uint32_t *ch_freq);
Paul Zhangc3fc0a82018-01-09 16:38:20 +08002332
2333#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Naveen Rawat4195c5e2017-05-22 17:07:45 -07002334/**
2335 * sme_fast_reassoc() - invokes FAST REASSOC command
Jeff Johnsonc7309062018-11-09 20:59:42 -08002336 * @mac_handle: handle returned by mac_open
Naveen Rawat4195c5e2017-05-22 17:07:45 -07002337 * @profile: current connected profile
2338 * @bssid: bssid to look for in scan cache
Manikandan Mohan0ba7e552019-10-23 17:38:35 -07002339 * @ch_freq: channel on which reassoc should be send
Naveen Rawat4195c5e2017-05-22 17:07:45 -07002340 * @vdev_id: vdev id
Krunal Soni332f4af2017-06-01 14:36:17 -07002341 * @connected_bssid: bssid of currently connected profile
Naveen Rawat4195c5e2017-05-22 17:07:45 -07002342 *
2343 * Return: QDF_STATUS
2344 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002345QDF_STATUS sme_fast_reassoc(mac_handle_t mac_handle,
2346 struct csr_roam_profile *profile,
Manikandan Mohan0ba7e552019-10-23 17:38:35 -07002347 const tSirMacAddr bssid, uint32_t ch_freq,
Krunal Soni332f4af2017-06-01 14:36:17 -07002348 uint8_t vdev_id, const tSirMacAddr connected_bssid);
gaurank kathpalia7ef72182019-05-29 19:41:25 +05302349
2350/**
2351 * sme_roam_invoke_nud_fail() - invokes REASSOC command to best available bssid
2352 * @mac_handle: handle returned by mac_open
2353 * @vdev_id: vdev id
2354 *
2355 * Return: QDF_STATUS
2356 */
2357QDF_STATUS sme_roam_invoke_nud_fail(mac_handle_t mac_handle, uint8_t vdev_id);
2358
Jianmin Zhu462ab862019-02-21 11:14:49 +08002359#else
2360static inline
2361QDF_STATUS sme_fast_reassoc(mac_handle_t mac_handle,
2362 struct csr_roam_profile *profile,
Manikandan Mohan0ba7e552019-10-23 17:38:35 -07002363 const tSirMacAddr bssid, uint32_t ch_freq,
Jianmin Zhu462ab862019-02-21 11:14:49 +08002364 uint8_t vdev_id, const tSirMacAddr connected_bssid)
2365{
2366 return QDF_STATUS_SUCCESS;
2367}
gaurank kathpalia7ef72182019-05-29 19:41:25 +05302368
2369static inline
2370QDF_STATUS sme_roam_invoke_nud_fail(mac_handle_t mac_handle, uint8_t vdev_id)
2371{
2372 return QDF_STATUS_SUCCESS;
2373}
2374
Paul Zhangc3fc0a82018-01-09 16:38:20 +08002375#endif
Padma, Santhosh Kumar16dacfb2017-03-21 19:05:40 +05302376
Tushnim Bhattacharyya9e81b4c2017-02-15 17:11:14 -08002377/**
Varun Reddy Yeturu076eaa82018-01-16 12:16:14 -08002378 * sme_register_tx_queue_cb(): Register tx queue callback
Jeff Johnsonda2afa42018-07-04 10:25:42 -07002379 * @mac_handle: Opaque handle for MAC context
Varun Reddy Yeturu076eaa82018-01-16 12:16:14 -08002380 * @tx_queue_cb: Transmit Queues callback
2381 *
2382 * Return: QDF_STATUS
2383 */
Jeff Johnsonda2afa42018-07-04 10:25:42 -07002384QDF_STATUS sme_register_tx_queue_cb(mac_handle_t mac_handle,
2385 tx_queue_cb tx_queue_cb);
Varun Reddy Yeturu076eaa82018-01-16 12:16:14 -08002386
2387/**
2388 * sme_deregister_tx_queue_cb() - Deregister the tx queue callback
Jeff Johnsonda2afa42018-07-04 10:25:42 -07002389 * @mac_handle: Opaque handle for MAC context
Varun Reddy Yeturu076eaa82018-01-16 12:16:14 -08002390 *
2391 * Return: QDF status
2392 */
Jeff Johnsonda2afa42018-07-04 10:25:42 -07002393QDF_STATUS sme_deregister_tx_queue_cb(mac_handle_t mac_handle);
Varun Reddy Yeturu076eaa82018-01-16 12:16:14 -08002394
2395/**
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +05302396 * sme_rso_cmd_status_cb() - Set RSO cmd status callback
Jeff Johnson43975142018-07-04 15:33:47 -07002397 * @mac_handle: Opaque handle for the MAC context
2398 * @cb: HDD Callback to rso command status read
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +05302399 *
2400 * This function is used to save HDD RSO Command status callback in MAC
2401 *
2402 * Return: QDF_STATUS
2403 */
Jeff Johnson43975142018-07-04 15:33:47 -07002404QDF_STATUS sme_rso_cmd_status_cb(mac_handle_t mac_handle,
2405 rso_cmd_status_cb cb);
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +05302406
2407/**
Tushnim Bhattacharyya9e81b4c2017-02-15 17:11:14 -08002408 * sme_register_set_connection_info_cb() - Register connection
2409 * info callback
Jeff Johnsonc7309062018-11-09 20:59:42 -08002410 * @mac_handle - MAC global handle
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08002411 * @set_connection_info_cb - callback routine from HDD to set
2412 * connection info flag
2413 * @get_connection_info_cb - callback routine from HDD to get
2414 * connection info
Tushnim Bhattacharyya9e81b4c2017-02-15 17:11:14 -08002415 *
2416 * This API is invoked by HDD to register its callback to mac
2417 *
2418 * Return: QDF_STATUS
2419 */
Jeff Johnsonb460dd72018-11-08 10:26:51 -08002420QDF_STATUS sme_register_set_connection_info_cb(mac_handle_t mac_handle,
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08002421 bool (*set_connection_info_cb)(bool),
2422 bool (*get_connection_info_cb)(uint8_t *session_id,
2423 enum scan_reject_states *reason));
Tushnim Bhattacharyya9e81b4c2017-02-15 17:11:14 -08002424
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -07002425/**
Nitesh Shahf9a09ff2017-05-22 15:46:25 +05302426 * sme_set_dbs_scan_selection_config() - Update DBS scan selection
2427 * configuration
Jeff Johnsonc7309062018-11-09 20:59:42 -08002428 * @mac_handle: The handle returned by macOpen
Nitesh Shahf9a09ff2017-05-22 15:46:25 +05302429 * @params: wmi_dbs_scan_sel_params config
2430 *
2431 * Return: QDF_STATUS if DBS scan selection update
2432 * configuration success else failure status
2433 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002434QDF_STATUS sme_set_dbs_scan_selection_config(mac_handle_t mac_handle,
Nitesh Shahf9a09ff2017-05-22 15:46:25 +05302435 struct wmi_dbs_scan_sel_params *params);
2436
2437/**
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -07002438 * sme_store_pdev() - store pdev
Jeff Johnsonc7309062018-11-09 20:59:42 -08002439 * @mac_handle - MAC global handle
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -07002440 * @pdev - pdev ptr
2441 *
2442 * Return: QDF_STATUS
2443 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002444void sme_store_pdev(mac_handle_t mac_handle, struct wlan_objmgr_pdev *pdev);
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -07002445
Sandeep Puligillaf587adf2017-04-27 19:53:21 -07002446/**
lifeng66831662017-05-19 16:01:35 +08002447 * sme_set_reorder_timeout() - set reorder timeout value
2448 * including Voice,Video,Besteffort,Background parameters
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002449 * @mac_handle: Opaque handle to the global MAC context
lifeng66831662017-05-19 16:01:35 +08002450 * @reg: struct sir_set_rx_reorder_timeout_val
2451 *
2452 * Return: QDF_STATUS_SUCCESS or non-zero on failure.
2453 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002454QDF_STATUS sme_set_reorder_timeout(mac_handle_t mac_handle,
lifeng66831662017-05-19 16:01:35 +08002455 struct sir_set_rx_reorder_timeout_val *req);
2456
2457/**
2458 * sme_set_rx_set_blocksize() - set blocksize value
2459 * including mac_addr and win_limit parameters
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002460 * @mac_handle: Opaque handle to the global MAC context
lifeng66831662017-05-19 16:01:35 +08002461 * @reg: struct sir_peer_set_rx_blocksize
2462 *
2463 * Return: QDF_STATUS_SUCCESS or non-zero on failure.
2464 */
2465
Jeff Johnsonc7309062018-11-09 20:59:42 -08002466QDF_STATUS sme_set_rx_set_blocksize(mac_handle_t mac_handle,
2467 struct sir_peer_set_rx_blocksize *req);
lifeng66831662017-05-19 16:01:35 +08002468
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05302469/**
2470 * sme_get_rcpi() - gets the rcpi value for peer mac addr
Jeff Johnsonc7309062018-11-09 20:59:42 -08002471 * @mac_handle: handle returned by mac_open
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05302472 * @rcpi: rcpi request containing peer mac addr, callback and related info
2473 *
2474 * This function posts the rcpi measurement request message to wma queue
2475 *
2476 * Return: QDF_STATUS
2477 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002478QDF_STATUS sme_get_rcpi(mac_handle_t mac_handle, struct sme_rcpi_req *rcpi);
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05302479
Jeff Johnsonb7fa2562018-07-02 08:36:17 -07002480/**
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05302481 * sme_set_chip_pwr_save_fail_cb() - set chip power save failure callback
Jeff Johnsonb7fa2562018-07-02 08:36:17 -07002482 * @mac_handle: opaque handle to the MAC context
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05302483 * @cb: callback function pointer
2484 *
2485 * This function stores the chip power save failure callback function.
2486 *
2487 * Return: QDF_STATUS enumeration.
2488 */
2489
Jeff Johnsonb7fa2562018-07-02 08:36:17 -07002490QDF_STATUS sme_set_chip_pwr_save_fail_cb(mac_handle_t mac_handle,
2491 pwr_save_fail_cb cb);
Naveen Rawat247a8682017-06-05 15:00:31 -07002492/**
2493 * sme_cli_set_command() - SME wrapper API over WMA "set" command
2494 * processor cmd
2495 * @vdev_id: virtual device for the command
2496 * @param_id: parameter id
2497 * @sval: parameter value
2498 * @vpdev: parameter category
2499 *
2500 * Command handler for set operations
2501 *
2502 * Return: 0 on success, errno on failure
2503 */
2504int sme_cli_set_command(int vdev_id, int param_id, int sval, int vpdev);
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05302505
Vidyullatha Kanchanapallybe0ebb32017-03-23 14:36:21 +05302506/**
2507 * sme_set_bt_activity_info_cb - set the callback handler for bt events
Jeff Johnsond0b6c7e2018-07-04 14:53:06 -07002508 * @mac_handle: handle returned by mac_open
Vidyullatha Kanchanapallybe0ebb32017-03-23 14:36:21 +05302509 * @cb: callback handler
2510 *
2511 * Return: QDF_STATUS
2512 */
Jeff Johnsond0b6c7e2018-07-04 14:53:06 -07002513QDF_STATUS sme_set_bt_activity_info_cb(mac_handle_t mac_handle,
2514 bt_activity_info_cb cb);
Vidyullatha Kanchanapallybe0ebb32017-03-23 14:36:21 +05302515
Will Huang558f8082017-05-31 16:22:24 +08002516/**
Vignesh Viswanathana851d752018-10-03 19:44:38 +05302517 * sme_set_enable_mem_deep_sleep - set the mem deep sleep config to FW
2518 * @mac_handle: handle returned by mac_open
2519 * @vdev_id: vdev id
2520 *
2521 * Return: 0 for success else failure code
2522 */
2523int sme_set_enable_mem_deep_sleep(mac_handle_t mac_handle, int vdev_id);
2524
2525/**
2526 * sme_set_cck_tx_fir_override - set the CCK TX FIR Override to FW
2527 * @mac_handle: handle returned by mac_open
2528 * @vdev_id: vdev id
2529 *
2530 * Return: 0 for success else failure code
2531 */
2532int sme_set_cck_tx_fir_override(mac_handle_t mac_handle, int vdev_id);
2533
2534/**
Ashish Kumar Dhanotiyab28338c2017-07-21 20:12:34 +05302535 * sme_set_smps_cfg() - set SMPS config params
2536 * @vdev_id: virtual device for the command
2537 * @param_id: parameter id
2538 * @param_val: parameter value
2539 *
2540 * Return: QDF_STATUS_SUCCESS or non-zero on failure
2541 */
2542
2543QDF_STATUS sme_set_smps_cfg(uint32_t vdev_id, uint32_t param_id,
2544 uint32_t param_val);
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +05302545
2546/**
Will Huang558f8082017-05-31 16:22:24 +08002547 * sme_get_peer_info_ext() - sme api to get peer ext info
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002548 * @mac_handle: Opaque handle to the global MAC context
Will Huang558f8082017-05-31 16:22:24 +08002549 * @req: peer ext info request struct send to wma
2550 * @context: context of callback function
2551 * @callbackfn: hdd callback function when receive response
2552 *
2553 * This function will send WMA_GET_PEER_INFO_EXT to WMA
2554 *
2555 * Return: QDF_STATUS_SUCCESS or non-zero on failure
2556 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002557QDF_STATUS sme_get_peer_info_ext(mac_handle_t mac_handle,
Will Huang558f8082017-05-31 16:22:24 +08002558 struct sir_peer_info_ext_req *req,
2559 void *context,
2560 void (*callbackfn)(struct sir_peer_info_ext_resp *param,
2561 void *pcontext));
Manjeet Singha9cae432017-02-28 11:58:22 +05302562
Tushnim Bhattacharyya518e80f2017-08-30 17:35:33 -07002563/**
lifengd217d192017-05-09 19:44:16 +08002564 * sme_get_chain_rssi() - Get chain rssi
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002565 * @mac_handle: Opaque handle to the global MAC context
lifengd217d192017-05-09 19:44:16 +08002566 * @input: get chain rssi req params
2567 * @callback: Callback function to be called with the result
2568 * @context: Opaque context to be used by the caller to associate the
2569 * request with the response
2570 *
2571 * This function constructs the cds message and fill in message type,
2572 * post the same to WDA.
2573 *
2574 * Return: QDF_STATUS enumeration
2575 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002576QDF_STATUS sme_get_chain_rssi(mac_handle_t mac_handle,
lifengd217d192017-05-09 19:44:16 +08002577 struct get_chain_rssi_req_params *input,
2578 get_chain_rssi_callback callback,
2579 void *context);
Tushnim Bhattacharyyac3c375e2017-08-04 23:39:55 -07002580
guangde4853c402019-05-06 15:54:04 +08002581/**
2582 * sme_get_isolation() - sme api to get antenna isolation
2583 * @mac_handle: hal handle for getting global mac struct
2584 * @context: context of callback function
2585 * @callbackfn: hdd callback function when receive response
2586 *
2587 * This function will send WMA_GET_ISOLATION to WMA
2588 *
2589 * Return: QDF_STATUS_SUCCESS or non-zero on failure
2590 */
2591QDF_STATUS sme_get_isolation(mac_handle_t mac_handle,
2592 void *context,
2593 sme_get_isolation_cb callbackfn);
2594
Qun Zhangef655622019-02-25 10:48:10 +08002595#ifdef FEATURE_FW_STATE
2596/**
2597 * sme_get_fw_state() - Get fw state
2598 * @mac_handle: Opaque handle to the global MAC context
2599 * @callback: Callback function to be called with the result
2600 * @context: Opaque context to be used by the caller to associate the
2601 * request with the response
2602 *
2603 * This function constructs the cds message and fill in message type,
2604 * post the same to WDA.
2605 *
2606 * Return: QDF_STATUS enumeration
2607 */
2608QDF_STATUS sme_get_fw_state(mac_handle_t mac_handle,
2609 fw_state_callback callback,
2610 void *context);
2611#endif /* FEATURE_FW_STATE */
2612
Tushnim Bhattacharyyac3c375e2017-08-04 23:39:55 -07002613/**
2614 * sme_get_valid_channels() - sme api to get valid channels for
2615 * current regulatory domain
Manikandan Mohan932c11e2019-08-14 14:09:08 -07002616 * @ch_freq_list: list of the valid channel frequencies
Tushnim Bhattacharyyac3c375e2017-08-04 23:39:55 -07002617 * @list_len: length of the channel list
2618 *
2619 * This function will get valid channels for current regulatory
2620 * domain
2621 *
2622 * Return: QDF_STATUS_SUCCESS or non-zero on failure
2623 */
Manikandan Mohan932c11e2019-08-14 14:09:08 -07002624QDF_STATUS sme_get_valid_channels(uint32_t *ch_freq_list, uint32_t *list_len);
Tushnim Bhattacharyya518e80f2017-08-30 17:35:33 -07002625
2626/**
2627 * sme_get_mac_context() - sme api to get the pmac context
2628 *
2629 * This function will return the pmac context
2630 *
2631 * Return: pointer to pmac context
2632 */
Jeff Johnson0a8786a2018-12-02 10:49:01 -08002633struct mac_context *sme_get_mac_context(void);
Vignesh Viswanathan66c951d2017-09-06 12:23:42 +05302634
2635/**
2636 * sme_display_disconnect_stats() - Display per session Disconnect stats
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002637 * @mac_handle: Opaque handle to the global MAC context
Vignesh Viswanathan66c951d2017-09-06 12:23:42 +05302638 * session_id: SME session id
2639 *
2640 * Return: None
2641 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002642void sme_display_disconnect_stats(mac_handle_t mac_handle, uint8_t session_id);
Sandeep Puligilla1426d612017-04-12 18:22:06 -07002643
2644/**
2645 * sme_process_msg_callback() - process callback message from LIM
Jeff Johnson5f9ce2d2018-06-09 21:20:45 -07002646 * @mac: global mac context
Sandeep Puligilla1426d612017-04-12 18:22:06 -07002647 * @msg: scheduler message
2648 *
2649 * This function process the callback messages from LIM.
2650 *
2651 * Return: QDF_STATUS enumeration.
2652 */
Jeff Johnson0a8786a2018-12-02 10:49:01 -08002653QDF_STATUS sme_process_msg_callback(struct mac_context *mac,
Jeff Johnson5f9ce2d2018-06-09 21:20:45 -07002654 struct scheduler_msg *msg);
Nachiket Kukadeaaf8a712017-07-27 19:15:36 +05302655
2656/**
2657 * sme_set_bmiss_bcnt() - set bmiss config parameters
2658 * @vdev_id: virtual device for the command
2659 * @first_cnt: bmiss first value
2660 * @final_cnt: bmiss final value
2661 *
2662 * Return: QDF_STATUS_SUCCESS or non-zero on failure
2663 */
2664QDF_STATUS sme_set_bmiss_bcnt(uint32_t vdev_id, uint32_t first_cnt,
2665 uint32_t final_cnt);
2666
Ganesh Kondabattini479a8ae2017-10-03 16:49:24 +05302667/**
2668 * sme_send_limit_off_channel_params() - send limit off channel parameters
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002669 * @mac_handle: Opaque handle to the global MAC context
Ganesh Kondabattini479a8ae2017-10-03 16:49:24 +05302670 * @vdev_id: vdev id
2671 * @is_tos_active: tos active or inactive
2672 * @max_off_chan_time: max off channel time
2673 * @rest_time: rest time
2674 * @skip_dfs_chan: skip dfs channel
2675 *
2676 * This function sends command to WMA for setting limit off channel command
2677 * parameters.
2678 *
2679 * Return: QDF_STATUS enumeration.
2680 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002681QDF_STATUS sme_send_limit_off_channel_params(mac_handle_t mac_handle,
2682 uint8_t vdev_id,
2683 bool is_tos_active,
2684 uint32_t max_off_chan_time,
2685 uint32_t rest_time,
2686 bool skip_dfs_chan);
Ganesh Kondabattini479a8ae2017-10-03 16:49:24 +05302687
Rachit Kankanef6834c42018-08-02 18:47:50 +05302688#ifdef FEATURE_WLAN_DYNAMIC_CVM
Nachiket Kukade8983cf62017-10-12 18:14:48 +05302689/**
2690 * sme_set_vc_mode_config() - Set voltage corner config to FW.
2691 * @bitmap: Bitmap that refers to voltage corner config with
2692 * different phymode and bw configuration
2693 *
2694 * Return: QDF_STATUS
2695 */
2696QDF_STATUS sme_set_vc_mode_config(uint32_t vc_bitmap);
Rachit Kankanef6834c42018-08-02 18:47:50 +05302697#endif
Nachiket Kukade8983cf62017-10-12 18:14:48 +05302698
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05302699/**
2700 * sme_set_del_pmkid_cache() - API to update PMKID cache
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002701 * @mac_handle: Opaque handle to the global MAC context
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05302702 * @session_id: Session id
2703 * @pmk_cache_info: Pointer to PMK cache info
2704 * @is_add: boolean that implies whether to add or delete PMKID entry
2705 *
2706 * Return: QDF_STATUS
2707 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002708QDF_STATUS sme_set_del_pmkid_cache(mac_handle_t mac_handle, uint8_t session_id,
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05302709 tPmkidCacheInfo *pmk_cache_info,
2710 bool is_add);
2711
2712/**
2713 * sme_send_hlp_ie_info() - API to send HLP IE info to fw
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002714 * @mac_handle: Opaque handle to the global MAC context
Pragaspathi Thilagaraj6695ba92019-04-04 17:59:47 +05302715 * @vdev_id: vdev id
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05302716 * @profile: CSR Roam profile
2717 * @if_addr: IP address
2718 *
2719 * This API is used to send HLP IE info along with IP address
2720 * to fw if LFR3 is enabled.
2721 *
Pragaspathi Thilagaraj6695ba92019-04-04 17:59:47 +05302722 * Return: None
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05302723 */
Pragaspathi Thilagaraj6695ba92019-04-04 17:59:47 +05302724void sme_send_hlp_ie_info(mac_handle_t mac_handle, uint8_t vdev_id,
Jeff Johnson66ee8a92018-03-17 15:24:26 -07002725 struct csr_roam_profile *profile, uint32_t if_addr);
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05302726
Pragaspathi Thilagaraj6695ba92019-04-04 17:59:47 +05302727/**
2728 * sme_update_session_assoc_ie() - Updates the assoc IEs to csr_roam_session
2729 * @mac_handle: Opaque handle to the global MAC context
2730 * @vdev_id: vdev id
2731 * @src_profile: Pointer to Roam profile in HDD
2732 *
2733 * This API is used to copy the assoc IE sent from user space to
2734 * csr_roam_session
2735 *
2736 * Return: None
2737 */
2738void sme_update_session_assoc_ie(mac_handle_t mac_handle,
2739 uint8_t vdev_id,
2740 struct csr_roam_profile *src_profile);
2741
2742/**
2743 * sme_send_rso_connect_params() - Updates the assoc IEs to csr_roam_session
2744 * @mac_handle: Opaque handle to the global MAC context
2745 * @vdev_id: vdev id
2746 * @src_profile: CSR Roam profile
2747 *
2748 * When the user space updates the assoc IEs or FILS auth type or FILS ERP info,
2749 * host driver needs to send these updated parameters to firmware via
2750 * RSO update command.
2751 *
2752 * Return: None
2753 */
2754QDF_STATUS sme_send_rso_connect_params(mac_handle_t mac_handle,
2755 uint8_t vdev_id,
2756 struct csr_roam_profile *src_profile);
2757
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05302758#if defined(WLAN_FEATURE_FILS_SK)
2759/**
2760 * sme_update_fils_config - Update FILS config to CSR roam session
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002761 * @mac_handle: Opaque handle to the global MAC context
Pragaspathi Thilagaraj6695ba92019-04-04 17:59:47 +05302762 * @vdev_id: vdev id
2763 * @src_profile: Source roam profile having latest FILS config
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05302764 *
Pragaspathi Thilagaraj6695ba92019-04-04 17:59:47 +05302765 * API to update FILS config to roam csr session.
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05302766 *
2767 * Return: QDF_STATUS
2768 */
Pragaspathi Thilagaraj6695ba92019-04-04 17:59:47 +05302769QDF_STATUS sme_update_fils_config(mac_handle_t mac_handle, uint8_t vdev_id,
Jeff Johnsonc7309062018-11-09 20:59:42 -08002770 struct csr_roam_profile *src_profile);
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05302771
2772/**
2773 * sme_free_join_rsp_fils_params - free fils params
2774 * @roam_info: roam info
2775 *
2776 * Return: void
2777 */
Jeff Johnson172237b2017-11-07 15:32:59 -08002778void sme_free_join_rsp_fils_params(struct csr_roam_info *roam_info);
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05302779#else
Jeff Johnsonc7309062018-11-09 20:59:42 -08002780static inline
Pragaspathi Thilagaraj6695ba92019-04-04 17:59:47 +05302781QDF_STATUS sme_update_fils_config(mac_handle_t mac_handle, uint8_t vdev_id,
Jeff Johnsonc7309062018-11-09 20:59:42 -08002782 struct csr_roam_profile *src_profile)
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05302783{
2784 return QDF_STATUS_SUCCESS;
2785}
2786
Jeff Johnson172237b2017-11-07 15:32:59 -08002787static inline
2788void sme_free_join_rsp_fils_params(struct csr_roam_info *roam_info)
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05302789{}
2790
2791#endif
Padma, Santhosh Kumar22c462c2018-01-16 17:56:44 +05302792
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -07002793#ifdef WLAN_FEATURE_11AX_BSS_COLOR
2794/**
2795 * sme_set_he_bss_color() - Sets the HE BSS color
2796 *
Jeff Johnsonc7309062018-11-09 20:59:42 -08002797 * @mac_handle: The handle returned by mac_open
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -07002798 * @session_id: session_id of the request
2799 * @bss_color: HE BSS color value to set
2800 *
2801 * Return: QDF_STATUS
2802 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002803QDF_STATUS sme_set_he_bss_color(mac_handle_t mac_handle, uint8_t session_id,
2804 uint8_t bss_color);
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -07002805#else
Jeff Johnsonc7309062018-11-09 20:59:42 -08002806static inline
2807QDF_STATUS sme_set_he_bss_color(mac_handle_t mac_handle, uint8_t session_id,
2808 uint8_t bss_color)
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -07002809{
2810 return QDF_STATUS_SUCCESS;
2811}
2812#endif
Vignesh Viswanathan9dd88d32017-11-22 14:22:03 +05302813
2814/**
Vignesh Viswanathan7c43a7a2018-09-24 15:52:47 +05302815 * sme_is_conn_state_connected() -- check if SME connection state is connected
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002816 * @mac_handle: Opaque handle to the global MAC context
Vignesh Viswanathan7c43a7a2018-09-24 15:52:47 +05302817 * @session_id: current Session Id
2818 *
2819 * This API checks if the current SME connection state is connected for the
2820 * given session id.
2821 *
2822 * Return: True if connected, false if any other state.
2823 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002824bool sme_is_conn_state_connected(mac_handle_t mac_handle, uint8_t session_id);
Vignesh Viswanathan7c43a7a2018-09-24 15:52:47 +05302825
2826/**
Vignesh Viswanathan9dd88d32017-11-22 14:22:03 +05302827 * sme_scan_get_result_for_bssid - gets the scan result from scan cache for the
2828 * bssid specified
Jeff Johnsonc7309062018-11-09 20:59:42 -08002829 * @mac_handle: handle returned by mac_open
Vignesh Viswanathan9dd88d32017-11-22 14:22:03 +05302830 * @bssid: bssid to get the scan result for
2831 * @res: pointer to tCsrScanResultInfo allocated from caller
2832 *
2833 * Return: QDF_STATUS
2834 */
Jeff Johnsonb460dd72018-11-08 10:26:51 -08002835QDF_STATUS sme_scan_get_result_for_bssid(mac_handle_t mac_handle,
Vignesh Viswanathan9dd88d32017-11-22 14:22:03 +05302836 struct qdf_mac_addr *bssid,
2837 tCsrScanResultInfo *res);
2838
2839/**
2840 * sme_get_bss_transition_status() - get bss transition status all cadidates
Jeff Johnsonc7309062018-11-09 20:59:42 -08002841 * @mac_handle: handle returned by mac_open
Vignesh Viswanathan9dd88d32017-11-22 14:22:03 +05302842 * @transition_reason : Transition reason
2843 * @bssid: bssid to get BSS transition status
2844 * @info : bss candidate information
2845 * @n_candidates : number of candidates
2846 * @is_bt_in_progress: bt activity indicator
2847 *
Jeff Johnson62737252018-11-17 10:59:43 -08002848 * Return: QDF_STATUS_SUCCESS on success otherwise a QDF_STATUS error
Vignesh Viswanathan9dd88d32017-11-22 14:22:03 +05302849 */
Jeff Johnson62737252018-11-17 10:59:43 -08002850QDF_STATUS sme_get_bss_transition_status(mac_handle_t mac_handle,
2851 uint8_t transition_reason,
2852 struct qdf_mac_addr *bssid,
2853 struct bss_candidate_info *info,
2854 uint16_t n_candidates,
2855 bool is_bt_in_progress);
Vignesh Viswanathan9dd88d32017-11-22 14:22:03 +05302856
Abhishek Singh7dcb85b2017-12-27 15:15:01 +05302857/**
2858 * sme_unpack_rsn_ie: wrapper to unpack RSN IE and update def RSN params
2859 * if optional fields are not present.
Jeff Johnsonc7309062018-11-09 20:59:42 -08002860 * @mac_handle: handle returned by mac_open
Abhishek Singh7dcb85b2017-12-27 15:15:01 +05302861 * @buf: rsn ie buffer pointer
2862 * @buf_len: rsn ie buffer length
2863 * @rsn_ie: outframe rsn ie structure
2864 * @append_ie: flag to indicate if the rsn_ie need to be appended from buf
2865 *
2866 * Return: parse status
2867 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002868uint32_t sme_unpack_rsn_ie(mac_handle_t mac_handle, uint8_t *buf,
2869 uint8_t buf_len, tDot11fIERSN *rsn_ie,
2870 bool append_ie);
Kiran Kumar Lokere89f01f02019-08-06 18:22:39 -07002871
2872/**
2873 * sme_add_qcn_ie: Adds QCN IE data to IE buffer
2874 * @mac_handle: handle returned by mac_open
2875 * @ie_data: ie buffer pointer
2876 * @ie_len: ie length pointer
2877 *
2878 * Return: none
2879 */
2880void sme_add_qcn_ie(mac_handle_t mac_handle, uint8_t *ie_data,
2881 uint16_t *ie_len);
2882
Sandeep Puligilla063a4342018-01-10 02:50:14 -08002883/**
2884 * sme_get_oper_chan_freq - gets the operating channel freq
2885 * @vdev: vdev handle
2886 *
2887 * Return: operating channel frequency
2888 */
2889int16_t sme_get_oper_chan_freq(struct wlan_objmgr_vdev *vdev);
2890
2891/**
2892 * sme_get_oper_ch_width - gets the operating channel width
2893 * @vdev: vdev handle
2894 *
2895 * Return: operating channel width
2896 */
2897enum phy_ch_width sme_get_oper_ch_width(struct wlan_objmgr_vdev *vdev);
2898
2899/**
2900 * sme_get_oper_ch_width - gets the secondary channel frequency
2901 * @vdev: vdev handle
2902 * @sec20chan_freq: secondary channel frequency
2903 *
2904 * Return: secondary channel frequency
2905 */
2906int sme_get_sec20chan_freq_mhz(struct wlan_objmgr_vdev *vdev,
2907 uint16_t *sec20chan_freq);
Abhishek Singh7dcb85b2017-12-27 15:15:01 +05302908
Abhishek Singh1f217ec2017-12-22 11:48:27 +05302909/**
2910 * sme_enable_roaming_on_connected_sta() - Enable roaming on an connected sta
Jeff Johnsonc7309062018-11-09 20:59:42 -08002911 * @mac_handle: handle returned by mac_open
Yeshwanth Sriram Guntuka1669fc02019-09-04 16:03:44 +05302912 * @vdev_id: vdev id
Abhishek Singh1f217ec2017-12-22 11:48:27 +05302913 *
2914 * The function check if any connected STA is present on which roaming is not
2915 * enabled and if present enabled roaming on that STA.
2916 *
2917 * Return: none
2918 */
Yeshwanth Sriram Guntuka1669fc02019-09-04 16:03:44 +05302919void sme_enable_roaming_on_connected_sta(mac_handle_t mac_handle,
2920 uint8_t vdev_id);
Abhishek Singh1f217ec2017-12-22 11:48:27 +05302921
Padma, Santhosh Kumar22c462c2018-01-16 17:56:44 +05302922/**
2923 * sme_send_mgmt_tx() - Sends mgmt frame from CSR to LIM
Jeff Johnsonc7309062018-11-09 20:59:42 -08002924 * @mac_handle: The handle returned by mac_open
Padma, Santhosh Kumar22c462c2018-01-16 17:56:44 +05302925 * @session_id: session id
2926 * @buf: pointer to frame
2927 * @len: frame length
2928 *
2929 * Return: QDF_STATUS
2930 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002931QDF_STATUS sme_send_mgmt_tx(mac_handle_t mac_handle, uint8_t session_id,
2932 const uint8_t *buf, uint32_t len);
Padma, Santhosh Kumardd3f4852018-01-16 18:51:51 +05302933
2934#ifdef WLAN_FEATURE_SAE
2935/**
2936 * sme_handle_sae_msg() - Sends SAE message received from supplicant
Jeff Johnsonc7309062018-11-09 20:59:42 -08002937 * @mac_handle: The handle returned by mac_open
Padma, Santhosh Kumardd3f4852018-01-16 18:51:51 +05302938 * @session_id: session id
2939 * @sae_status: status of SAE authentication
Srinivas Dasarie854ff02019-02-11 17:24:48 +05302940 * @peer_mac_addr: mac address of the peer to be authenticated
Pragaspathi Thilagaraja97d4982019-07-18 01:18:44 +05302941 * @pmkid: PMKID derived at the end of SAE authentication
Padma, Santhosh Kumardd3f4852018-01-16 18:51:51 +05302942 *
2943 * Return: QDF_STATUS
2944 */
Srinivas Dasarie854ff02019-02-11 17:24:48 +05302945QDF_STATUS sme_handle_sae_msg(mac_handle_t mac_handle,
2946 uint8_t session_id,
2947 uint8_t sae_status,
Pragaspathi Thilagaraja97d4982019-07-18 01:18:44 +05302948 struct qdf_mac_addr peer_mac_addr,
2949 const uint8_t *pmkid);
Padma, Santhosh Kumardd3f4852018-01-16 18:51:51 +05302950#else
Jeff Johnsonc7309062018-11-09 20:59:42 -08002951static inline
Srinivas Dasarie854ff02019-02-11 17:24:48 +05302952QDF_STATUS sme_handle_sae_msg(mac_handle_t mac_handle,
2953 uint8_t session_id,
2954 uint8_t sae_status,
Pragaspathi Thilagaraja97d4982019-07-18 01:18:44 +05302955 struct qdf_mac_addr peer_mac_addr,
2956 const uint8_t *pmkid)
Padma, Santhosh Kumardd3f4852018-01-16 18:51:51 +05302957{
2958 return QDF_STATUS_SUCCESS;
2959}
2960#endif
2961
Kiran Kumar Lokerebc87bec2018-02-27 20:06:42 -08002962/**
2963 * sme_set_ba_buff_size() - sets BA buffer size
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002964 * @mac_handle: Opaque handle to the global MAC context
Kiran Kumar Lokerebc87bec2018-02-27 20:06:42 -08002965 * @session_id: SME session id
2966 * @buff_size: BA buffer size
2967 *
2968 * Return: 0 on success else err code
2969 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002970int sme_set_ba_buff_size(mac_handle_t mac_handle, uint8_t session_id,
2971 uint16_t buff_size);
Kiran Kumar Lokerebc87bec2018-02-27 20:06:42 -08002972
2973/**
2974 * sme_send_addba_req() - send ADDBA request with user config
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002975 * @mac_handle: Opaque handle to the global MAC context
Kiran Kumar Lokerebc87bec2018-02-27 20:06:42 -08002976 * @session_id: SME session id
2977 * @tid: tid val for BA session
2978 * @buff_size: BA buffer size
2979 *
2980 * Return: 0 on success else err code
2981 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002982int sme_send_addba_req(mac_handle_t mac_handle, uint8_t session_id, uint8_t tid,
2983 uint16_t buff_size);
Kiran Kumar Lokerebc87bec2018-02-27 20:06:42 -08002984
Kiran Kumar Lokere3324f632018-03-01 21:43:21 -08002985/**
2986 * sme_set_no_ack_policy() - Sets no ack policy for AC
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002987 * @mac_handle: Opaque handle to the global MAC context
Kiran Kumar Lokere3324f632018-03-01 21:43:21 -08002988 * @session_id: SME session id
2989 * @val: no ack policy value
2990 * @ac: access category
2991 *
2992 * Return: 0 on success else err code
2993 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08002994int sme_set_no_ack_policy(mac_handle_t mac_handle, uint8_t session_id,
2995 uint8_t val, uint8_t ac);
Kiran Kumar Lokere3324f632018-03-01 21:43:21 -08002996
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08002997/**
2998 * sme_set_auto_rate_he_sgi() - Sets SGI for auto rate
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08002999 * @mac_handle: Opaque handle to the global MAC context
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08003000 * @session_id: SME session id
3001 * @cfg_val: SGI configuration value
3002 *
3003 * Return: 0 on success else err code
3004 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08003005int sme_set_auto_rate_he_sgi(mac_handle_t mac_handle, uint8_t session_id,
3006 uint8_t cfg_val);
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08003007
3008/**
3009 * sme_set_auto_rate_he_ltf() - Sets HE LTF for auto rate
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08003010 * @mac_handle: Opaque handle to the global MAC context
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08003011 * @session_id: SME session id
3012 * @cfg_val: LTF configuration value
3013 *
3014 * Return: 0 on success else err code
3015 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08003016int sme_set_auto_rate_he_ltf(mac_handle_t mac_handle, uint8_t session_id,
3017 uint8_t cfg_val);
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08003018
Kiran Kumar Lokere44a29432018-01-24 16:10:30 -08003019#ifdef WLAN_FEATURE_11AX
3020/**
Jinwei Chen998a1a02018-06-20 17:20:34 +08003021 * sme_update_tgt_he_cap() - sets the HE caps to pmac
Jinwei Chenef742dc2018-06-27 12:57:50 +08003022 * @mac_handle: Pointer to MAC handle
3023 * @cfg: Pointer to WMA target CFG
Jinwei Chenffaa4672018-08-30 16:55:09 +08003024 * @he_cap_ini: Pointer to HE CAP configured by INI
Jinwei Chen998a1a02018-06-20 17:20:34 +08003025 *
3026 * Return: None
3027 */
Jinwei Chenffaa4672018-08-30 16:55:09 +08003028void sme_update_tgt_he_cap(mac_handle_t mac_handle,
3029 struct wma_tgt_cfg *cfg,
3030 tDot11fIEhe_cap *he_cap_ini);
Jinwei Chen998a1a02018-06-20 17:20:34 +08003031
3032/**
Kiran Kumar Lokere44a29432018-01-24 16:10:30 -08003033 * sme_update_he_cap_nss() - sets the nss based on user request
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08003034 * @mac_handle: Opaque handle to the global MAC context
Kiran Kumar Lokere44a29432018-01-24 16:10:30 -08003035 * @session_id: SME session id
3036 * @nss: no.of spatial streams value
3037 *
3038 * Return: None
3039 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08003040void sme_update_he_cap_nss(mac_handle_t mac_handle, uint8_t session_id,
3041 uint8_t nss);
Kiran Kumar Lokere96246e52018-01-24 16:44:35 -08003042
3043/**
Kiran Kumar Lokere6c7f3fa2018-05-14 18:12:27 -07003044 * sme_update_he_tx_bfee_supp() - sets the HE Tx Bfee support
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08003045 * @mac_handle: Opaque handle to the global MAC context
Kiran Kumar Lokere6c7f3fa2018-05-14 18:12:27 -07003046 * @session_id: SME session id
3047 * @cfg_val: Tx Bfee config value
3048 *
3049 * Return: 0 on success else err code
3050 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08003051int sme_update_he_tx_bfee_supp(mac_handle_t mac_handle, uint8_t session_id,
3052 uint8_t cfg_val);
Kiran Kumar Lokeref3044852018-06-27 14:14:24 -07003053
3054/**
3055 * sme_update_he_tx_bfee_nsts() - sets the HE Tx Bfee NSTS
Jeff Johnsonc7309062018-11-09 20:59:42 -08003056 * @mac_handle: MAC handle
Kiran Kumar Lokeref3044852018-06-27 14:14:24 -07003057 * @session_id: SME session id
3058 * @cfg_val: Tx Bfee NSTS value
3059 *
3060 * Return: 0 on success else err code
3061 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08003062int sme_update_he_tx_bfee_nsts(mac_handle_t mac_handle, uint8_t session_id,
Kiran Kumar Lokeref3044852018-06-27 14:14:24 -07003063 uint8_t cfg_val);
Kiran Kumar Lokere86e85592018-07-18 15:34:24 -07003064
3065/**
3066 * sme_set_he_tx_bf_cbf_rates() - sets the HE Tx Bfee CBF frame rates to FW
3067 * @session_id: SME session id
3068 *
3069 * Return: None
3070 */
3071void sme_set_he_tx_bf_cbf_rates(uint8_t session_id);
3072
Kiran Kumar Lokere6c7f3fa2018-05-14 18:12:27 -07003073/**
Kiran Kumar Lokereefdbd0b2018-09-25 18:53:46 -07003074 * sme_config_su_ppdu_queue() - Configures SU PPDU queue enable/disable in FW
3075 * @session_id: SME session id
3076 * @enable: Enable/Disable config
3077 *
3078 * Return: None
3079 */
3080void sme_config_su_ppdu_queue(uint8_t session_id, bool enable);
3081
3082/**
Kiran Kumar Lokere96246e52018-01-24 16:44:35 -08003083 * sme_update_he_mcs() - sets the HE MCS based on user request
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08003084 * @mac_handle: Opaque handle to the global MAC context
Kiran Kumar Lokere96246e52018-01-24 16:44:35 -08003085 * @session_id: SME session id
3086 * @he_mcs: HE MCS value
3087 *
3088 * Return: 0 on success else err code
3089 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08003090int sme_update_he_mcs(mac_handle_t mac_handle, uint8_t session_id,
3091 uint16_t he_mcs);
Kiran Kumar Lokerefba20632018-07-05 16:51:27 -07003092
3093/**
Kiran Kumar Lokeref54b8552018-07-10 00:53:38 -07003094 * sme_update_he_trigger_frm_mac_pad() - sets the HE MAC padding capability
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08003095 * @mac_handle: Opaque handle to the global MAC context
Kiran Kumar Lokeref54b8552018-07-10 00:53:38 -07003096 * @session_id: SME session id
3097 * @cfg_val: HE MAC padding duration value
3098 *
3099 * Return: 0 on success else err code
3100 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08003101int sme_update_he_trigger_frm_mac_pad(mac_handle_t mac_handle,
3102 uint8_t session_id,
Kiran Kumar Lokeref54b8552018-07-10 00:53:38 -07003103 uint8_t cfg_val);
Kiran Kumar Lokeref1a96f42018-08-29 18:53:47 -07003104
3105/**
3106 * sme_update_he_om_ctrl_supp() - sets the HE OM control capability
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08003107 * @mac_handle: Opaque handle to the global MAC context
Kiran Kumar Lokeref1a96f42018-08-29 18:53:47 -07003108 * @session_id: SME session id
3109 * @cfg_val: HE OM control config
3110 *
3111 * Return: 0 on success else err code
3112 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08003113int sme_update_he_om_ctrl_supp(mac_handle_t mac_handle, uint8_t session_id,
Kiran Kumar Lokeref1a96f42018-08-29 18:53:47 -07003114 uint8_t cfg_val);
Kiran Kumar Lokere94634152018-09-24 19:08:35 -07003115
Kiran Kumar Lokereacd107d2019-01-09 15:02:11 -08003116#define A_CTRL_ID_OMI 0x1
3117struct omi_ctrl_tx {
3118 uint32_t omi_in_vht:1;
3119 uint32_t omi_in_he:1;
3120 uint32_t a_ctrl_id:4;
3121 uint32_t rx_nss:3;
3122 uint32_t ch_bw:2;
3123 uint32_t ul_mu_dis:1;
3124 uint32_t tx_nsts:3;
3125 uint32_t er_su_dis:1;
3126 uint32_t dl_mu_mimo_resound:1;
3127 uint32_t ul_mu_data_dis:1;
3128 uint32_t reserved:14;
3129};
3130
Jeff Johnsonc7309062018-11-09 20:59:42 -08003131int sme_send_he_om_ctrl_bw_update(mac_handle_t mac_handle, uint8_t session_id,
Kiran Kumar Lokere94634152018-09-24 19:08:35 -07003132 uint8_t cfg_val);
3133
Jeff Johnsonc7309062018-11-09 20:59:42 -08003134int sme_send_he_om_ctrl_nss_update(mac_handle_t mac_handle, uint8_t session_id,
Kiran Kumar Lokere94634152018-09-24 19:08:35 -07003135 uint8_t cfg_val);
3136
Jeff Johnsonc7309062018-11-09 20:59:42 -08003137void sme_reset_he_om_ctrl(mac_handle_t mac_handle);
Kiran Kumar Lokere94634152018-09-24 19:08:35 -07003138
Kiran Kumar Lokeref54b8552018-07-10 00:53:38 -07003139/**
Kiran Kumar Lokereee205772018-09-27 00:27:27 -07003140 * sme_config_action_tx_in_tb_ppdu() - Sends action frame in TB PPDU cfg to FW
3141 * @mac_handle: Pointer to MAC handle
3142 * @session_id: SME session id
3143 * @cfg_val: configuration setting value
3144 *
3145 * Return: 0 on success else err code
3146 */
3147int sme_config_action_tx_in_tb_ppdu(mac_handle_t mac_handle, uint8_t session_id,
3148 uint8_t cfg_val);
Kiran Kumar Lokereacd107d2019-01-09 15:02:11 -08003149
3150/**
3151 * sme_send_he_om_ctrl_update() - Send HE OM ctrl Tx cmd to FW
3152 * @mac_handle: Pointer to mac handle
3153 * @session_id: SME session id
3154 *
3155 * Return: 0 on success else err code
3156 */
3157int sme_send_he_om_ctrl_update(mac_handle_t mac_handle, uint8_t session_id);
3158
3159/**
3160 * sme_set_he_om_ctrl_param() - Update HE OM control params for OMI Tx
3161 * @mac_handle: Pointer to mac handle
3162 * @session_id: SME session id
3163 * @param: HE om control parameter
3164 * @cfg_val: HE OM control parameter config value
3165 *
3166 * Return: 0 on success else err code
3167 */
3168int sme_set_he_om_ctrl_param(mac_handle_t mac_handle, uint8_t session_id,
3169 enum qca_wlan_vendor_attr_he_omi_tx param,
3170 uint8_t cfg_val);
3171
Kiran Kumar Lokereee205772018-09-27 00:27:27 -07003172/**
Kiran Kumar Lokeref54b8552018-07-10 00:53:38 -07003173 * sme_set_usr_cfg_mu_edca() - sets the user cfg MU EDCA params flag
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08003174 * @mac_handle: Opaque handle to the global MAC context
Kiran Kumar Lokeref54b8552018-07-10 00:53:38 -07003175 * @val: value to be set
3176 *
3177 * Return: none
3178 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08003179void sme_set_usr_cfg_mu_edca(mac_handle_t mac_handle, bool val);
Kiran Kumar Lokeref54b8552018-07-10 00:53:38 -07003180
3181/**
Kiran Kumar Lokerefba20632018-07-05 16:51:27 -07003182 * sme_set_he_mu_edca_def_cfg() - sets the default MU EDCA params values
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08003183 * @mac_handle: Opaque handle to the global MAC context
Kiran Kumar Lokerefba20632018-07-05 16:51:27 -07003184 *
3185 * Return: none
3186 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08003187void sme_set_he_mu_edca_def_cfg(mac_handle_t mac_handle);
Kiran Kumar Lokerefba20632018-07-05 16:51:27 -07003188
3189/**
Kiran Kumar Lokereacd107d2019-01-09 15:02:11 -08003190 * sme_update_he_htc_he_supp() - Update +HTC-HE support in HE capabilities
3191 * @mac_handle: Pointer to mac handle
3192 * @session_id: SME session id
3193 * @cfg_val: config setting
3194 *
3195 * Return: 0 on success else err code
3196 */
3197int sme_update_he_htc_he_supp(mac_handle_t mac_handle, uint8_t session_id,
3198 bool cfg_val);
3199
3200/**
Kiran Kumar Lokerefba20632018-07-05 16:51:27 -07003201 * sme_update_mu_edca_params() - updates MU EDCA params values
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08003202 * @mac_handle: Opaque handle to the global MAC context
Kiran Kumar Lokerefba20632018-07-05 16:51:27 -07003203 * @session_id: SME session id
3204 *
3205 * Return: 0 on success else err code
3206 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08003207int sme_update_mu_edca_params(mac_handle_t mac_handle, uint8_t session_id);
Kiran Kumar Lokerefba20632018-07-05 16:51:27 -07003208
Kiran Kumar Lokere13dedac2018-02-05 19:51:59 -08003209/**
3210 * sme_update_he_tx_stbc_cap() - Sets the HE Tx STBC capability
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08003211 * @mac_handle: Opaque handle to the global MAC context
Kiran Kumar Lokere13dedac2018-02-05 19:51:59 -08003212 * @session_id: SME session id
3213 * @value: set value
3214 *
3215 * Return: 0 on success else err code
3216 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08003217int sme_update_he_tx_stbc_cap(mac_handle_t mac_handle, uint8_t session_id,
3218 int value);
Kiran Kumar Lokere13dedac2018-02-05 19:51:59 -08003219
3220/**
3221 * sme_update_he_rx_stbc_cap() - Sets the HE Rx STBC capability
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08003222 * @mac_handle: Opaque handle to the global MAC context
Kiran Kumar Lokere13dedac2018-02-05 19:51:59 -08003223 * @session_id: SME session id
3224 * @value: set value
3225 *
3226 * Return: 0 on success else err code
3227 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08003228int sme_update_he_rx_stbc_cap(mac_handle_t mac_handle, uint8_t session_id,
3229 int value);
Kiran Kumar Lokere5cc2f0d2018-02-08 17:10:05 -08003230
3231/**
3232 * sme_update_he_frag_supp() - sets the HE fragmentation support
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08003233 * @mac_handle: Opaque handle to the global MAC context
Kiran Kumar Lokere5cc2f0d2018-02-08 17:10:05 -08003234 * @session_id: SME session id
3235 * @he_frag: HE fragmention support value
3236 *
3237 * Return: 0 on success else err code
3238 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08003239int sme_update_he_frag_supp(mac_handle_t mac_handle, uint8_t session_id,
3240 uint16_t he_frag);
Kiran Kumar Lokeree43a4582018-05-08 19:54:03 -07003241
3242/**
3243 * sme_update_he_ldpc_supp() - sets the HE LDPC support
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08003244 * @mac_handle: Opaque handle to the global MAC context
Kiran Kumar Lokeree43a4582018-05-08 19:54:03 -07003245 * @session_id: SME session id
3246 * @he_ldpc: HE LDPC support value
3247 *
3248 * Return: 0 on success else err code
3249 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08003250int sme_update_he_ldpc_supp(mac_handle_t mac_handle, uint8_t session_id,
Kiran Kumar Lokeree43a4582018-05-08 19:54:03 -07003251 uint16_t he_ldpc);
Arif Hussain1f58cbb2019-03-14 17:06:56 -07003252
3253/**
3254 * sme_update_he_twt_req_support() - Sets twt request capability
3255 * @mac_handle: Opaque handle to the global MAC context
3256 * @session_id: SME session id
3257 * @value: set value
3258 *
3259 * Return: 0 on success else err code
3260 */
3261int sme_update_he_twt_req_support(mac_handle_t mac_handle, uint8_t session_id,
3262 uint8_t cfg_val);
Kiran Kumar Lokere44a29432018-01-24 16:10:30 -08003263#else
Jinwei Chenef742dc2018-06-27 12:57:50 +08003264static inline void sme_update_tgt_he_cap(mac_handle_t mac_handle,
Jinwei Chenffaa4672018-08-30 16:55:09 +08003265 struct wma_tgt_cfg *cfg,
3266 tDot11fIEhe_cap *he_cap_ini)
Jinwei Chen998a1a02018-06-20 17:20:34 +08003267{}
Jeff Johnsonc7309062018-11-09 20:59:42 -08003268static inline void sme_update_he_cap_nss(mac_handle_t mac_handle,
3269 uint8_t session_id,
3270 uint8_t nss)
Kiran Kumar Lokere44a29432018-01-24 16:10:30 -08003271{}
Jeff Johnsonc7309062018-11-09 20:59:42 -08003272static inline int sme_update_he_mcs(mac_handle_t mac_handle, uint8_t session_id,
Kiran Kumar Lokere96246e52018-01-24 16:44:35 -08003273 uint16_t he_mcs)
3274{
3275 return 0;
3276}
Kiran Kumar Lokerefba20632018-07-05 16:51:27 -07003277
Jeff Johnsonc7309062018-11-09 20:59:42 -08003278static inline void sme_set_he_mu_edca_def_cfg(mac_handle_t mac_handle)
Kiran Kumar Lokerefba20632018-07-05 16:51:27 -07003279{
3280}
3281
Jeff Johnsonc7309062018-11-09 20:59:42 -08003282static inline int sme_update_mu_edca_params(mac_handle_t mac_handle,
Kiran Kumar Lokerefba20632018-07-05 16:51:27 -07003283 uint8_t session_id)
3284{
3285 return 0;
3286}
Jeff Johnsonc7309062018-11-09 20:59:42 -08003287
3288static inline int sme_update_he_trigger_frm_mac_pad(mac_handle_t mac_handle,
Kiran Kumar Lokeref54b8552018-07-10 00:53:38 -07003289 uint8_t session_id,
3290 uint8_t cfg_val)
3291{
3292 return 0;
3293}
3294
Jeff Johnsonc7309062018-11-09 20:59:42 -08003295static inline int sme_update_he_om_ctrl_supp(mac_handle_t mac_handle,
Kiran Kumar Lokeref1a96f42018-08-29 18:53:47 -07003296 uint8_t session_id,
3297 uint8_t cfg_val)
3298{
3299 return 0;
3300}
3301
Kiran Kumar Lokere94634152018-09-24 19:08:35 -07003302
Kiran Kumar Lokereacd107d2019-01-09 15:02:11 -08003303static inline int
3304sme_set_he_om_ctrl_param(mac_handle_t mac_handle, uint8_t session_id,
3305 enum qca_wlan_vendor_attr_he_omi_tx param,
3306 uint8_t cfg_val)
Kiran Kumar Lokere94634152018-09-24 19:08:35 -07003307{
3308 return 0;
3309}
3310
Jeff Johnsonc7309062018-11-09 20:59:42 -08003311static inline void sme_reset_he_om_ctrl(mac_handle_t mac_handle)
Kiran Kumar Lokere94634152018-09-24 19:08:35 -07003312{
3313}
3314
Kiran Kumar Lokereee205772018-09-27 00:27:27 -07003315static inline int sme_config_action_tx_in_tb_ppdu(mac_handle_t mac_handle,
3316 uint8_t session_id,
3317 uint8_t cfg_val)
3318{
3319 return 0;
3320}
3321
Kiran Kumar Lokereacd107d2019-01-09 15:02:11 -08003322static inline int sme_update_he_htc_he_supp(mac_handle_t mac_handle,
3323 uint8_t session_id,
3324 bool cfg_val)
3325{
3326 return 0;
3327}
3328
3329static inline int
3330sme_send_he_om_ctrl_update(mac_handle_t mac_handle, uint8_t session_id)
3331{
3332 return 0;
3333}
Jeff Johnsonc7309062018-11-09 20:59:42 -08003334static inline void sme_set_usr_cfg_mu_edca(mac_handle_t mac_handle, bool val)
Kiran Kumar Lokeref54b8552018-07-10 00:53:38 -07003335{
3336}
3337
Jeff Johnsonc7309062018-11-09 20:59:42 -08003338static inline int sme_update_he_tx_stbc_cap(mac_handle_t mac_handle,
3339 uint8_t session_id,
Kiran Kumar Lokere13dedac2018-02-05 19:51:59 -08003340 int value)
3341{
3342 return 0;
3343}
3344
Jeff Johnsonc7309062018-11-09 20:59:42 -08003345static inline int sme_update_he_rx_stbc_cap(mac_handle_t mac_handle,
3346 uint8_t session_id,
Kiran Kumar Lokere13dedac2018-02-05 19:51:59 -08003347 int value)
3348{
3349 return 0;
3350}
Kiran Kumar Lokere5cc2f0d2018-02-08 17:10:05 -08003351
Jeff Johnsonc7309062018-11-09 20:59:42 -08003352static inline int sme_update_he_frag_supp(mac_handle_t mac_handle,
3353 uint8_t session_id,
3354 uint16_t he_frag)
Kiran Kumar Lokere5cc2f0d2018-02-08 17:10:05 -08003355{
3356 return 0;
3357}
Kiran Kumar Lokere6c7f3fa2018-05-14 18:12:27 -07003358
Jeff Johnsonc7309062018-11-09 20:59:42 -08003359static inline int sme_update_he_ldpc_supp(mac_handle_t mac_handle,
3360 uint8_t session_id,
Kiran Kumar Lokeree43a4582018-05-08 19:54:03 -07003361 uint16_t he_ldpc)
3362{
3363 return 0;
3364}
Kiran Kumar Lokere6c7f3fa2018-05-14 18:12:27 -07003365
Jeff Johnsonc7309062018-11-09 20:59:42 -08003366static inline int sme_update_he_tx_bfee_supp(mac_handle_t mac_handle,
3367 uint8_t session_id,
3368 uint8_t cfg_val)
Kiran Kumar Lokere6c7f3fa2018-05-14 18:12:27 -07003369{
3370 return 0;
3371}
Jeff Johnsonc7309062018-11-09 20:59:42 -08003372static inline int sme_update_he_tx_bfee_nsts(mac_handle_t mac_handle,
3373 uint8_t session_id,
Kiran Kumar Lokeref3044852018-06-27 14:14:24 -07003374 uint8_t cfg_val)
3375{
3376 return 0;
3377}
Kiran Kumar Lokere86e85592018-07-18 15:34:24 -07003378
3379static inline void sme_set_he_tx_bf_cbf_rates(uint8_t session_id)
3380{
3381}
Kiran Kumar Lokereefdbd0b2018-09-25 18:53:46 -07003382
3383static inline void sme_config_su_ppdu_queue(uint8_t session_id, bool enable)
3384{
3385}
Arif Hussain1f58cbb2019-03-14 17:06:56 -07003386
3387static inline int sme_update_he_twt_req_support(mac_handle_t mac_handle,
3388 uint8_t session_id,
3389 uint8_t cfg_val)
3390{
3391 return 0;
3392}
3393
Kiran Kumar Lokere44a29432018-01-24 16:10:30 -08003394#endif
3395
Vignesh Viswanathan0a569292018-02-14 15:34:47 +05303396/**
3397 * sme_is_sta_key_exchange_in_progress() - checks whether the STA/P2P client
3398 * session has key exchange in progress
3399 *
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08003400 * @mac_handle: Opaque handle to the global MAC context
Vignesh Viswanathan0a569292018-02-14 15:34:47 +05303401 * @session_id: session id
3402 *
3403 * Return: true - if key exchange in progress
3404 * false - if not in progress
3405 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08003406bool sme_is_sta_key_exchange_in_progress(mac_handle_t mac_handle,
3407 uint8_t session_id);
Vignesh Viswanathan0a569292018-02-14 15:34:47 +05303408
Vignesh Viswanathana2f5ce582018-05-09 20:38:39 +05303409/*
3410 * sme_validate_channel_list() - Validate the given channel list
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08003411 * @mac_handle: Opaque handle to the global MAC context
Liangwei Dong075afa72019-10-30 12:58:22 +08003412 * @chan_freq_list: Pointer to the channel list
Vignesh Viswanathana2f5ce582018-05-09 20:38:39 +05303413 * @num_channels: number of channels present in the chan_list
3414 *
3415 * Validates the given channel list with base channels in mac context
3416 *
3417 * Return: True if all channels in the list are valid, false otherwise
3418 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08003419bool sme_validate_channel_list(mac_handle_t mac_handle,
Liangwei Dong075afa72019-10-30 12:58:22 +08003420 uint32_t *chan_freq_list,
Jeff Johnsonc7309062018-11-09 20:59:42 -08003421 uint8_t num_channels);
Arif Hussain0e246802018-05-01 18:13:44 -07003422/**
3423 * sme_set_amsdu() - set amsdu enable/disable based on user cfg
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08003424 * @mac_handle: Opaque handle to the global MAC context
Arif Hussain0e246802018-05-01 18:13:44 -07003425 * @enable: enable or disable
3426 *
3427 * Return: None
3428 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08003429void sme_set_amsdu(mac_handle_t mac_handle, bool enable);
Vignesh Viswanathana2f5ce582018-05-09 20:38:39 +05303430
Kiran Kumar Lokere921b5a52019-02-24 21:53:20 -08003431#ifdef WLAN_FEATURE_11AX
3432void sme_set_he_testbed_def(mac_handle_t mac_handle, uint8_t vdev_id);
3433void sme_reset_he_caps(mac_handle_t mac_handle, uint8_t vdev_id);
3434#else
3435static inline void sme_set_he_testbed_def(mac_handle_t mac_handle,
3436 uint8_t vdev_id)
3437{
3438}
3439static inline void sme_reset_he_caps(mac_handle_t mac_handle, uint8_t vdev_id)
3440{
3441}
3442#endif
3443
Naveen Rawatfa2a1002018-05-17 16:06:37 -07003444/**
3445 * sme_get_mcs_idx() - gets mcs index
Jingxiang Gef1d81592019-10-20 12:03:22 +08003446 * @raw_rate: raw rate from fw
Naveen Rawatfa2a1002018-05-17 16:06:37 -07003447 * @rate_flags: rate flags
3448 * @nss: number of nss
Jingxiang Gef1d81592019-10-20 12:03:22 +08003449 * @dcm: dcm will be calculated from rate
3450 * @guard_interval: guard interval info from rate
Naveen Rawatfa2a1002018-05-17 16:06:37 -07003451 * @mcs_rate_flags: mcs rate flag
3452 *
3453 * Return: return mcs index
3454 */
Jingxiang Gef1d81592019-10-20 12:03:22 +08003455uint8_t sme_get_mcs_idx(uint16_t raw_rate, enum tx_rate_info rate_flags,
3456 uint8_t *nss, uint8_t *dcm,
3457 enum txrate_gi *guard_interval,
3458 enum tx_rate_info *mcs_rate_flags);
Naveen Rawatfa2a1002018-05-17 16:06:37 -07003459
Varun Reddy Yeturud33033f2018-06-11 10:58:30 -07003460#ifdef WLAN_SUPPORT_TWT
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07003461/**
3462 * sme_register_twt_enable_complete_cb() - TWT enable registrar
Jeff Johnson3a08ff92018-07-03 19:40:44 -07003463 * @mac_handle: MAC handle
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07003464 * @twt_enable_cb: Function callback to handle enable event
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07003465 *
3466 * Return: QDF Status
3467 */
Jeff Johnson3a08ff92018-07-03 19:40:44 -07003468QDF_STATUS sme_register_twt_enable_complete_cb(mac_handle_t mac_handle,
3469 twt_enable_cb twt_enable_cb);
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07003470
3471/**
3472 * sme_register_twt_disable_complete_cb - TWT disable registrar
Jeff Johnson3a08ff92018-07-03 19:40:44 -07003473 * @mac_handle: MAC handle
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07003474 * @twt_disable_cb: Function callback to handle disable event
3475 *
3476 * Return: QDF Status
3477 */
Jeff Johnson3a08ff92018-07-03 19:40:44 -07003478QDF_STATUS sme_register_twt_disable_complete_cb(mac_handle_t mac_handle,
3479 twt_disable_cb twt_disable_cb);
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07003480
3481/**
3482 * sme_deregister_twt_enable_complete_cb() - TWT enable deregistrar
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08003483 * @mac_handle: Opaque handle to the global MAC context
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07003484 *
3485 * Return: QDF Status
3486 */
Jeff Johnson3a08ff92018-07-03 19:40:44 -07003487QDF_STATUS sme_deregister_twt_enable_complete_cb(mac_handle_t mac_handle);
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07003488
3489/**
3490 * sme_deregister_twt_disable_complete_cb - TWT disable deregistrar
Jeff Johnsone0d1dbe2018-11-17 08:51:09 -08003491 * @mac_handle: Opaque handle to the global MAC context
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07003492 *
3493 * Return: QDF Status
3494 */
Jeff Johnson3a08ff92018-07-03 19:40:44 -07003495QDF_STATUS sme_deregister_twt_disable_complete_cb(mac_handle_t mac_handle);
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07003496
3497#else
Jeff Johnson3a08ff92018-07-03 19:40:44 -07003498static inline
3499QDF_STATUS sme_register_twt_enable_complete_cb(mac_handle_t mac_handle,
3500 twt_enable_cb twt_enable_cb)
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07003501{
3502 return QDF_STATUS_SUCCESS;
3503}
3504
Jeff Johnson3a08ff92018-07-03 19:40:44 -07003505static inline
3506QDF_STATUS sme_register_twt_disable_complete_cb(mac_handle_t mac_handle,
3507 twt_disable_cb twt_disable_cb)
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07003508{
3509 return QDF_STATUS_SUCCESS;
3510}
3511
Jeff Johnson3a08ff92018-07-03 19:40:44 -07003512static inline
3513QDF_STATUS sme_deregister_twt_enable_complete_cb(mac_handle_t mac_handle)
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07003514{
3515 return QDF_STATUS_SUCCESS;
3516}
3517
Jeff Johnson3a08ff92018-07-03 19:40:44 -07003518static inline
3519QDF_STATUS sme_deregister_twt_disable_complete_cb(mac_handle_t mac_handle)
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07003520{
3521 return QDF_STATUS_SUCCESS;
3522}
3523#endif
Krunal Soni5e483782018-10-25 15:42:44 -07003524/**
3525 * sme_get_sta_cxn_info() - This function populates all the connection
3526 * information which is formed by DUT-STA to AP
3527 * by calling CSR helper API.
3528 * @mac_ctx: pointer to mac context
3529 * @session: pointer to sta session
3530 * @conn_profile: pointer to connected DUTSTA-REFAP profile
3531 * @buf: pointer to char buffer to write all the connection information.
3532 * @buf_size: maximum size of the provided buffer
3533 *
3534 * Returns: QDF_STATUS
3535 */
3536#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
3537QDF_STATUS sme_get_sta_cxn_info(mac_handle_t mac_handle, uint32_t session_id,
3538 char *buf, uint32_t buf_sz);
3539#else
3540static inline QDF_STATUS
3541sme_get_sta_cxn_info(mac_handle_t mac_handle, uint32_t session_id,
3542 char *buf, uint32_t buf_sz)
3543{
3544 qdf_scnprintf(buf, buf_sz,
3545 "\nDiag macro disable, ask vendor to enable");
3546 return QDF_STATUS_SUCCESS;
3547}
3548#endif
Varun Reddy Yeturu3c9f89c2018-04-18 19:10:34 -07003549
Pragaspathi Thilagaraj974c27e2019-03-02 22:26:05 +05303550#if defined(FEATURE_WLAN_ESE) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
Kiran Kumar Lokere7d6e4c92018-09-19 13:45:47 -07003551/**
3552 * sme_add_key_btk() - Add BTK key
3553 * @mac_handle: MAC handle
3554 * @session_id: SME session identifier
3555 * @key: key material
3556 * @key_len: length of the key
3557 *
3558 * Return: 0 on success and negative value for failure
3559 */
3560int sme_add_key_btk(mac_handle_t mac_handle, uint8_t session_id,
3561 const uint8_t *key, const int key_len);
Pragaspathi Thilagaraj974c27e2019-03-02 22:26:05 +05303562
3563#else
3564static inline int sme_add_key_btk(mac_handle_t mac_handle, uint8_t session_id,
3565 const uint8_t *key, const int key_len)
3566{
3567 return 0;
3568}
3569#endif
3570
3571#ifdef FEATURE_WLAN_ESE
Kiran Kumar Lokere7d6e4c92018-09-19 13:45:47 -07003572/**
3573 * sme_add_key_krk() - Add KRK key
3574 * @mac_handle: MAC handle
3575 * @session_id: SME session identifier
3576 * @key: key material
3577 * @key_len: length of the key
3578 *
3579 * Return: 0 on success and negative value for failure
3580 */
3581int sme_add_key_krk(mac_handle_t mac_handle, uint8_t session_id,
3582 const uint8_t *key, const int key_len);
3583
3584#else
Kiran Kumar Lokere7d6e4c92018-09-19 13:45:47 -07003585
3586static inline int sme_add_key_krk(mac_handle_t mac_handle, uint8_t session_id,
3587 const uint8_t *key, const int key_len)
3588{
3589 return 0;
3590}
3591#endif
3592
Chaoli Zhou75b062f2018-06-11 12:36:54 +08003593/**
Rajeev Kumar Sirasanagandla4f20b672018-03-12 13:52:50 +05303594 * sme_get_roam_scan_stats() - Send roam scan stats cmd to wma
Jeff Johnsonc7309062018-11-09 20:59:42 -08003595 * @mac_handle: handle returned by mac_open
Rajeev Kumar Sirasanagandla4f20b672018-03-12 13:52:50 +05303596 * @cb: call-back invoked for roam scan stats response
3597 * @context: context of callback
3598 * @vdev_id: vdev id
3599 *
3600 * Return: QDF_STATUS
3601 */
3602QDF_STATUS
Jeff Johnsonc7309062018-11-09 20:59:42 -08003603sme_get_roam_scan_stats(mac_handle_t mac_handle, roam_scan_stats_cb cb,
3604 void *context, uint32_t vdev_id);
Rajeev Kumar Sirasanagandla4f20b672018-03-12 13:52:50 +05303605
Vignesh Viswanathan987f0bb2018-09-17 17:00:29 +05303606/**
3607 * sme_update_score_config() - Update the Scoring Config from MLME
Jeff Johnsonc7309062018-11-09 20:59:42 -08003608 * @mac_handle: Mac Handle
Vignesh Viswanathan987f0bb2018-09-17 17:00:29 +05303609 * @score_config: Pointer to the scoring config structure to be populated
3610 *
3611 * Return: None
3612 */
Jeff Johnsonc7309062018-11-09 20:59:42 -08003613void sme_update_score_config(mac_handle_t mac_handle,
Vignesh Viswanathan987f0bb2018-09-17 17:00:29 +05303614 struct scoring_config *score_config);
lifengfaa83cb2018-11-24 01:53:56 +08003615
3616/**
3617 * sme_enable_fw_module_log_level() - enable fw module log level
3618 * @mac_handle: handle returned by mac_open
3619 * @vdev_id: vdev id
3620 *
3621 * Return: None
3622 */
3623void sme_enable_fw_module_log_level(mac_handle_t mac_handle, int vdev_id);
Visweswara Tanuku633976b2019-01-07 16:13:12 +05303624
3625#ifdef WLAN_FEATURE_MOTION_DETECTION
3626/**
3627 * sme_motion_det_cfg - motion detection configuration
3628 * @vdev_id: vdev id
3629 * @time_t1: Time T1 for motion detection in msecs
3630 * @time_t2: Time T2 for motion detection in msecs
3631 * @n1: number of packets for coarse detection
3632 * @n2: number of packets for fine detection
3633 * @time_t1_gap: gap between packets in coarse detection in msecs
3634 * @time_t2_gap: gap between packets in fine detection in msecs
3635 * @coarse_k: number of times fine motion detection has to be performed for
3636 * coarse detection
3637 * @fine_k: number of times fine motion detection has to be performed for
3638 * fine detection
3639 * @coarse_q: number of times motion is expected to be detected for success
3640 * case in coarse detection
3641 * @fine_q: number of times motion is expected to be detected for success
3642 * case in fine detection
3643 * @md_coarse_thr_high: higher threshold value (in percent) from host to FW,
3644 * which will be used in coarse detection phase of motion
3645 * detection. This is the threshold for the correlation of
3646 * the old RF local-scattering environment with current RF
3647 * local-scattering environment. Value of 100(%) indicates
3648 * that neither the transceiver nor any nearby objects
3649 * have changed position
3650 * @md_fine_thr_high: higher threshold value (in percent) from host to FW, which
3651 * will be used in fine detection phase of motion detection.
3652 * This is the threshold for correlation between the old and
3653 * current RF environments, as explained above
3654 * @md_coarse_thr_low: lower threshold value (in percent) for immediate
3655 * detection of motion in coarse detection phase. This is
3656 * the threshold for correlation between the old and current
3657 * RF environments, as explained above
3658 * @md_fine_thr_low: lower threshold value (in percent) for immediate detection
3659 * of motion in fine detection phase. This is the threshold
3660 * for correlation between the old and current RF
3661 * environments, as explained above
3662 * @eSME_TDLS_PEER_REMOVE_MAC_ADDR: remove peer mac from connection table
3663 */
3664
3665struct sme_motion_det_cfg {
3666 uint8_t vdev_id;
3667 uint32_t time_t1;
3668 uint32_t time_t2;
3669 uint32_t n1;
3670 uint32_t n2;
3671 uint32_t time_t1_gap;
3672 uint32_t time_t2_gap;
3673 uint32_t coarse_K;
3674 uint32_t fine_K;
3675 uint32_t coarse_Q;
3676 uint32_t fine_Q;
3677 uint8_t md_coarse_thr_high;
3678 uint8_t md_fine_thr_high;
3679 uint8_t md_coarse_thr_low;
3680 uint8_t md_fine_thr_low;
3681};
3682
3683/**
3684 * sme_motion_det_base_line_cfg - motion detection base line configuration
3685 * @vdev_id : vdev id
3686 * @bl_time_t: time T for baseline (in ms), every bl_time_t, bl_n pkts are sent
3687 * @bl_packet_gap: gap between packets for baseline in msecs
3688 * bl_n: number of packets to be sent during one baseline
3689 * bl_num_meas: number of times the baseline measurement to be done
3690 */
3691struct sme_motion_det_base_line_cfg {
3692 uint8_t vdev_id;
3693 uint32_t bl_time_t;
3694 uint32_t bl_packet_gap;
3695 uint32_t bl_n;
3696 uint32_t bl_num_meas;
3697};
3698
3699/**
3700 * sme_motion_det_en - Start/Stop motion detection
3701 * @vdev_id: vdev_id
3702 * @enable: start = 1, stop =0
3703 */
3704struct sme_motion_det_en {
3705 uint8_t vdev_id;
3706 bool enable;
3707};
3708
3709/**
3710 * sme_motion_det_base_line_en - Start/Stop motion detection base line
3711 * @vdev_id: vdev_id
3712 * @enable: start = 1, stop =0
3713 */
3714struct sme_motion_det_base_line_en {
3715 uint8_t vdev_id;
3716 bool enable;
3717};
3718
3719/**
3720 * sme_motion_det_config - Post motion detection configuration msg to scheduler
3721 * @mac_handle: mac handle
3722 * @motion_det_cfg: motion detection configuration
3723 *
3724 * Return: QDF_STATUS_SUCCESS or non-zero on failure
3725 */
3726QDF_STATUS sme_motion_det_config(mac_handle_t mac_handle,
3727 struct sme_motion_det_cfg *motion_det_cfg);
3728
3729/**
3730 * sme_motion_det_enable - Post motion detection start/stop msg to scheduler
3731 * @mac_handle: mac handle
3732 * @motion_det_en: motion detection start/stop
3733 *
3734 * Return: QDF_STATUS_SUCCESS or non-zero on failure
3735 */
3736QDF_STATUS sme_motion_det_enable(mac_handle_t mac_handle,
3737 struct sme_motion_det_en *motion_det_en);
3738
3739/**
3740 * sme_motion_det_base_line_config - Post md baselining cfg msg to scheduler
3741 * @mac_handle: mac handle
3742 * @motion_det_base_line_cfg: motion detection baselining configuration
3743 *
3744 * Return: QDF_STATUS_SUCCESS or non-zero on failure
3745 */
3746QDF_STATUS sme_motion_det_base_line_config(
3747 mac_handle_t mac_handle,
3748 struct sme_motion_det_base_line_cfg *motion_det_base_line_cfg);
3749
3750/**
3751 * sme_motion_det_base_line_enable - Post md baselining enable msg to scheduler
3752 * @mac_handle: mac handle
3753 * @motion_det_base_line_en: motion detection baselining start/stop
3754 *
3755 * Return: QDF_STATUS_SUCCESS or non-zero on failure
3756 */
3757QDF_STATUS sme_motion_det_base_line_enable(
3758 mac_handle_t mac_handle,
3759 struct sme_motion_det_base_line_en *motion_det_base_line_en);
3760
3761/**
3762 * sme_set_md_host_evt_cb - Register/set motion detection callback
3763 * @mac_handle: mac handle
3764 * @callback_fn: motion detection callback function pointer
3765 * @hdd_ctx: hdd context
3766 *
3767 * Return: QDF_STATUS_SUCCESS or non-zero on failure
3768 */
Visweswara Tanuku633976b2019-01-07 16:13:12 +05303769QDF_STATUS sme_set_md_host_evt_cb
3770(
3771 mac_handle_t mac_handle,
3772 QDF_STATUS (*callback_fn)(void *ctx, struct sir_md_evt *event),
3773 void *hdd_ctx
3774);
Visweswara Tanuku41d21c02019-10-25 14:51:59 +05303775
3776/**
3777 * sme_set_md_bl_evt_cb - Register/set motion detection baseline callback
3778 * @mac_handle: mac handle
3779 * @callback_fn: callback function pointer
3780 * @hdd_ctx: hdd context
3781 *
3782 * Return: QDF_STATUS_SUCCESS or non-zero on failure
3783 */
3784QDF_STATUS sme_set_md_bl_evt_cb
3785(
3786 mac_handle_t mac_handle,
3787 QDF_STATUS (*callback_fn)(void *ctx, struct sir_md_bl_evt *event),
3788 void *hdd_ctx
3789);
Visweswara Tanuku633976b2019-01-07 16:13:12 +05303790#endif /* WLAN_FEATURE_MOTION_DETECTION */
Visweswara Tanuku41d21c02019-10-25 14:51:59 +05303791
Visweswara Tanuku025f5862019-01-08 17:35:33 +05303792#ifdef FW_THERMAL_THROTTLE_SUPPORT
3793/**
3794 * sme_set_thermal_throttle_cfg() - SME API to set the thermal throttle
3795 * configuration parameters
3796 * @mac_handle: Opaque handle to the global MAC context
3797 * @enable: Enable Throttle
3798 * @dc: duty cycle in msecs
3799 * @dc_off_percent: duty cycle off percentage
3800 * @prio: Disables the transmit queues in fw that have lower priority
3801 * than value defined by prio
3802 * @target_temp: Target temperature
3803 *
3804 * Return: QDF_STATUS
3805 */
3806QDF_STATUS sme_set_thermal_throttle_cfg(mac_handle_t mac_handle, bool enable,
3807 uint32_t dc, uint32_t dc_off_percent,
3808 uint32_t prio, uint32_t target_temp);
Visweswara Tanuku633976b2019-01-07 16:13:12 +05303809
Visweswara Tanuku025f5862019-01-08 17:35:33 +05303810/**
3811 * sme_set_thermal_mgmt() - SME API to set the thermal management params
3812 * @mac_handle: Opaque handle to the global MAC context
3813 * @lower_thresh_deg: Lower threshold value of Temperature
3814 * @higher_thresh_deg: Higher threshold value of Temperature
3815 *
3816 * Return: QDF_STATUS
3817 */
3818QDF_STATUS sme_set_thermal_mgmt(mac_handle_t mac_handle,
3819 uint16_t lower_thresh_deg,
3820 uint16_t higher_thresh_deg);
3821#endif /* FW_THERMAL_THROTTLE_SUPPORT */
Abhinav Kumar338e57d2019-02-04 17:30:10 +05303822
3823/**
3824 * sme_update_hidden_ssid_status_cb() - cb fun to update hidden ssid stats
3825 * @mac_handle: mac handler
3826 * @cb: cb of type hidden_ssid_cb
3827 */
3828QDF_STATUS sme_update_hidden_ssid_status_cb(mac_handle_t mac_handle,
3829 hidden_ssid_cb cb);
3830
Min Liu0daa0982019-02-01 17:50:44 +08003831/**
3832 * sme_update_owe_info() - Update OWE info
3833 * @mac: mac context
3834 * @assoc_ind: assoc ind
3835 *
3836 * Return: QDF_STATUS
3837 */
3838QDF_STATUS sme_update_owe_info(struct mac_context *mac,
3839 struct assoc_ind *assoc_ind);
Arun Kumar Khandavallideda5a82019-03-11 15:32:19 +05303840
3841#ifdef WLAN_MWS_INFO_DEBUGFS
3842/**
3843 * sme_get_mws_coex_info() - SME API to get the coex information
3844 * @mac_handle: mac handler
3845 * @vdev_id: Vdev_id
3846 * @cmd_id: enum mws_coex_cmdid which information is needed.
3847 * @callback_fn: Callback function
3848 * @context: callback context
3849 *
3850 * Return: QDF_STATUS
3851 */
3852QDF_STATUS
3853sme_get_mws_coex_info(mac_handle_t mac_handle, uint32_t vdev_id,
3854 uint32_t cmd_id, void (*callback_fn)(void *coex_info_data,
3855 void *context,
3856 wmi_mws_coex_cmd_id
3857 cmd_id),
3858 void *context);
3859#endif /* WLAN_MWS_INFO_DEBUGFS */
3860
Abhinav Kumar0ed614c2019-04-11 22:11:47 +05303861#ifdef WLAN_BCN_RECV_FEATURE
3862/**
3863 * sme_register_bcn_recv_pause_ind_cb() - Register pause ind cb
3864 * mac_handle: man handler
3865 * cb: callback function to HDD
3866 *
3867 * This function register HDD callback in order to indicate beacon
3868 * receive pause indication to userspace.
3869 *
3870 * return QDF_STATUS of cb registration
3871 */
3872QDF_STATUS sme_register_bcn_recv_pause_ind_cb(mac_handle_t mac_handle,
3873 beacon_pause_cb cb);
3874
3875#else
3876static inline
3877QDF_STATUS sme_register_bcn_recv_pause_ind_cb(mac_handle_t mac_handle,
3878 beacon_pause_cb cb)
3879{
3880 return QDF_STATUS_SUCCESS;
3881}
3882#endif
3883
Srinivas Dasari37e37312019-06-30 23:50:24 +05303884/**
3885 * sme_set_disconnect_ies() - set disconnect IEs
3886 * @mac_handle: handle returned by mac_open
3887 * @vdev_id: vdev id
3888 * @ie_data: Disconnect IE data
3889 * @ie_len: Disconnect IE length
3890 *
3891 * Return: QDF_STATUS
3892 */
3893QDF_STATUS sme_set_disconnect_ies(mac_handle_t mac_handle, uint8_t vdev_id,
3894 uint8_t *ie_data, uint16_t ie_len);
Jianmin Zhu5ce64f42019-07-15 19:20:09 +08003895
Jianmin Zhu5ce64f42019-07-15 19:20:09 +08003896void sme_chan_to_freq_list(
3897 struct wlan_objmgr_pdev *pdev,
3898 uint32_t *freq_list,
3899 const uint8_t *chan_list,
3900 uint32_t chan_list_len);
Srinivas Dasarif4e1b122019-08-22 03:39:48 +05303901
3902/**
3903 * sme_set_roam_triggers() - Send roam trigger bitmap to WMA
3904 * @mac_handle: Opaque handle to the MAC context
3905 * @triggers: Carries pointer of the object containing vdev id and
3906 * roam_trigger_bitmap.
3907 *
3908 * Send the roam trigger bitmap received to WMA/WMI. WMI converts
3909 * the bitmap to firmware compatible bitmap as per reasons
3910 * defined @WMI_ROAM_TRIGGER_REASON_ID
3911 *
3912 * Return: QDF_STATUS
3913 */
3914QDF_STATUS sme_set_roam_triggers(mac_handle_t mac_handle,
3915 struct roam_triggers *triggers);
Srinivas Dasari391692d2019-08-21 08:40:53 +05303916
3917/**
3918 * sme_set_roam_config_enable() - Cache roam config status in SME
3919 * @mac_handle: Opaque handle to the MAC context
3920 * @vdev_id: vdev id
3921 * @roam_control_enable: Carries a non-zero value if the current set request is
3922 * for enable, otherwise carries a 0.
3923 *
3924 * Cache control roam config enable/disable status in SME so that the
3925 * userspace can query for the status based on a vdev/session at any time.
3926 *
3927 * Return: QDF_STATUS
3928 */
3929QDF_STATUS sme_set_roam_config_enable(mac_handle_t mac_handle,
3930 uint8_t vdev_id,
3931 uint8_t roam_control_enable);
Srinivas Dasari9ad9e252019-08-20 11:43:06 +05303932
3933/**
3934 * sme_get_roam_config_status() - Get roam config status from SME
3935 * @mac_handle: Opaque handle to the MAC context
3936 * @vdev_id: vdev id
3937 * @config_status: Pointer of a buffer to fill the status
3938 *
3939 * Get the cached control roam config status in SME and copy to status.
3940 *
3941 * Return: QDF_STATUS
3942 */
3943QDF_STATUS sme_get_roam_config_status(mac_handle_t mac_handle, uint8_t vdev_id,
3944 uint8_t *config_status);
Srinivas Dasaria33fdd82019-08-21 16:15:22 +05303945
3946/**
Srinivas Dasari240d3272019-09-20 12:00:57 +05303947 * sme_get_full_roam_scan_period_global() - get global full scan refresh period
3948 * @mac_handle: The handle returned by mac_open
3949 *
3950 * Return: Full roam scan period configured through ini
3951 */
3952uint16_t sme_get_full_roam_scan_period_global(mac_handle_t mac_handle);
3953
3954/**
Srinivas Dasaria33fdd82019-08-21 16:15:22 +05303955 * sme_get_full_roam_scan_period() - Get full roam scan period
3956 * @mac_handle: Opaque handle to the MAC context
3957 * @vdev_id: vdev id
3958 * @full_roam_scan_period: Pointer of a buffer to fill the full roam scan period
3959 *
3960 * Get the full scan period cached in neighborRoamInfo and fill in the given
3961 * buffer full_roam_scan_period.
3962 *
3963 * Return: QDF_STATUS
3964 */
3965QDF_STATUS sme_get_full_roam_scan_period(mac_handle_t mac_handle,
3966 uint8_t vdev_id,
3967 uint32_t *full_roam_scan_period);
Arun Kumar Khandavalliadd284b2019-10-23 12:27:39 +05303968
3969/**
3970 * sme_check_for_duplicate_session() - check for duplicate session
3971 * @mac_handle: Opaque handle to the MAC context
3972 * @peer_addr: Peer device mac address
3973 *
3974 * Check for duplicate mac address is available on other vdev.
3975 *
3976 * Return: QDF_STATUS
3977 */
3978QDF_STATUS sme_check_for_duplicate_session(mac_handle_t mac_handle,
3979 uint8_t *peer_addr);
Sourav Mohapatra2a67b0e2019-10-15 17:59:59 +05303980#ifdef FEATURE_ANI_LEVEL_REQUEST
3981/*
3982 * sme_get_ani_level() -
3983 * A wrapper function that client calls to register a callback to get ani level
3984 *
3985 * @mac_handle - pointer to mac handle
3986 * @freqs - frequencies for which ANI level has to be fetched
3987 * @num_freqs - number of frequencies
3988 * @callback - SME sends back the ani level using the callback
3989 * @context - user context to be passed back along with the callback
3990 *
3991 * Return: QDF_STATUS
3992 */
3993QDF_STATUS sme_get_ani_level(mac_handle_t mac_handle, uint32_t *freqs,
3994 uint8_t num_freqs, void (*callback)(
3995 struct wmi_host_ani_level_event *ani, uint8_t num,
3996 void *context), void *context);
3997#endif /* FEATURE_ANI_LEVEL_REQUEST */
Ashish Kumar Dhanotiyad8d7dea2019-10-24 14:34:56 +05303998
3999#ifdef FEATURE_OEM_DATA
4000/**
4001 * sme_set_oem_data_event_handler_cb() - Register oem data event handler
4002 * callback
4003 * @mac_handle: Opaque handle to the MAC context
4004 * @oem_data_event_handler_cb: callback to be registered
4005 *
4006 * Return: QDF_STATUS
4007 */
4008QDF_STATUS sme_set_oem_data_event_handler_cb(
4009 mac_handle_t mac_handle,
4010 void (*oem_data_event_handler_cb)
4011 (const struct oem_data *oem_event_data));
4012
4013/**
4014 * sme_reset_oem_data_event_handler_cb() - De-register oem data event handler
4015 * @mac_handle: Handler return by mac_open
4016 *
4017 * This function De-registers the OEM data event handler callback to SME
4018 *
4019 * Return: None
4020 */
4021void sme_reset_oem_data_event_handler_cb(mac_handle_t mac_handle);
4022#else
4023static inline QDF_STATUS sme_set_oem_data_event_handler_cb(
4024 mac_handle_t mac_handle,
4025 void (*oem_data_event_handler_cb)
4026 (void *oem_event_data))
4027{
4028 return QDF_STATUS_SUCCESS;
4029}
4030
4031static inline void sme_reset_oem_data_event_handler_cb(mac_handle_t mac_handle)
4032{
4033}
4034#endif
4035
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004036#endif /* #if !defined( __SME_API_H ) */