1 /*
2 * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
3 * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for
6 * any purpose with or without fee is hereby granted, provided that the
7 * above copyright notice and this permission notice appear in all
8 * copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
18 */
19
20 #ifndef WMA_API_H
21 #define WMA_API_H
22
23 #include "osdep.h"
24 #include "ani_global.h"
25 #include "a_types.h"
26 #include "osapi_linux.h"
27 #include "wmi_unified.h"
28 #ifdef NOT_YET
29 #include "htc_api.h"
30 #endif
31 #include "lim_global.h"
32 #include "cds_utils.h"
33 #include "scheduler_api.h"
34 #include "wlan_policy_mgr_api.h"
35 #include "wma_sar_public_structs.h"
36 #include <cdp_txrx_ops.h>
37 #include "include/wlan_vdev_mlme.h"
38 #include "wlan_mlme_vdev_mgr_interface.h"
39
40 typedef void *WMA_HANDLE;
41
42 /**
43 * enum GEN_PARAM - general parameters
44 * @GEN_VDEV_PARAM_AMPDU: Set ampdu size
45 * @GEN_VDEV_PARAM_AMSDU: Set amsdu size
46 * @GEN_PARAM_CRASH_INJECT: inject crash
47 * @GEN_PARAM_CAPTURE_TSF: read tsf
48 * @GEN_PARAM_RESET_TSF_GPIO: reset tsf gpio
49 * @GEN_VDEV_ROAM_SYNCH_DELAY: roam sync delay
50 * @GEN_VDEV_PARAM_TX_AMPDU: Set tx ampdu size
51 * @GEN_VDEV_PARAM_RX_AMPDU: Set rx ampdu size
52 * @GEN_VDEV_PARAM_TX_AMSDU: Set tx amsdu size
53 * @GEN_VDEV_PARAM_RX_AMSDU: Set rx amsdu size
54 * @GEN_PARAM_TSF_AUTO_REPORT_ENABLE: Enable auto report of clock delta change
55 * @GEN_PARAM_TSF_AUTO_REPORT_DISABLE: Disable auto report of clock delta change
56 */
57 enum GEN_PARAM {
58 GEN_VDEV_PARAM_AMPDU = 0x1,
59 GEN_VDEV_PARAM_AMSDU,
60 GEN_PARAM_CRASH_INJECT,
61 GEN_PARAM_CAPTURE_TSF,
62 GEN_PARAM_RESET_TSF_GPIO,
63 GEN_VDEV_ROAM_SYNCH_DELAY,
64 GEN_VDEV_PARAM_TX_AMPDU,
65 GEN_VDEV_PARAM_RX_AMPDU,
66 GEN_VDEV_PARAM_TX_AMSDU,
67 GEN_VDEV_PARAM_RX_AMSDU,
68 GEN_PARAM_TSF_AUTO_REPORT_ENABLE,
69 GEN_PARAM_TSF_AUTO_REPORT_DISABLE,
70 };
71
72 /**
73 * struct wma_caps_per_phy - various caps per phy
74 * @ht_2g: entire HT cap for 2G band in terms of 32 bit flag
75 * @ht_5g: entire HT cap for 5G band in terms of 32 bit flag
76 * @vht_2g: entire VHT cap for 2G band in terms of 32 bit flag
77 * @vht_5g: entire VHT cap for 5G band in terms of 32 bit flag
78 * @he_2g: entire HE cap for 2G band in terms of 32 bit flag
79 * @he_5g: entire HE cap for 5G band in terms of 32 bit flag
80 * @tx_chain_mask_2G: tx chain mask for 2g
81 * @rx_chain_mask_2G: rx chain mask for 2g
82 * @tx_chain_mask_5G: tx chain mask for 5g
83 * @rx_chain_mask_5G: rx chain mask for 5g
84 */
85 struct wma_caps_per_phy {
86 uint32_t ht_2g;
87 uint32_t ht_5g;
88 uint32_t vht_2g;
89 uint32_t vht_5g;
90 uint32_t he_2g[PSOC_HOST_MAX_MAC_SIZE];
91 uint32_t he_5g[PSOC_HOST_MAX_MAC_SIZE];
92 uint32_t tx_chain_mask_2G;
93 uint32_t rx_chain_mask_2G;
94 uint32_t tx_chain_mask_5G;
95 uint32_t rx_chain_mask_5G;
96 };
97
98 struct wma_ps_params {
99 enum wmi_sta_ps_scheme_cfg opm_mode;
100 uint16_t ps_ito;
101 uint16_t spec_wake;
102 };
103
104 /**
105 * enum wma_sta_ps_scheme_cfg - STA power save schemes
106 * @WMA_STA_PS_OPM_CONSERVATIVE - Conservative OPM mode
107 * @WMA_STA_PS_OPM_AGGRESSIVE - Aggressive OPM mode
108 * @WMA_STA_PS_USER_DEF - User defined OPM mode
109 */
110 enum wma_sta_ps_scheme_cfg {
111 WMA_STA_PS_OPM_CONSERVATIVE = 0,
112 WMA_STA_PS_OPM_AGGRESSIVE = 1,
113 WMA_STA_PS_USER_DEF = 2,
114 };
115
116 #define VDEV_CMD 1
117 #define PDEV_CMD 2
118 #define GEN_CMD 3
119 #define DBG_CMD 4
120 #define PPS_CMD 5
121 #define QPOWER_CMD 6
122 #define GTX_CMD 7
123
124 typedef void (*wma_peer_authorized_fp) (uint32_t vdev_id);
125
126
127 QDF_STATUS wma_pre_start(void);
128
129 QDF_STATUS wma_mc_process_handler(struct scheduler_msg *msg);
130
131 QDF_STATUS wma_start(void);
132
133 /**
134 * wma_stop() - wma stop function.
135 *
136 * Performs all of the operations required to stop the WMA layer
137 *
138 * Return: QDF_STATUS_SUCCESS on success, QDF Error on failure
139 */
140 QDF_STATUS wma_stop(void);
141
142 QDF_STATUS wma_close(void);
143
144 QDF_STATUS wma_wmi_service_close(void);
145
146 QDF_STATUS wma_wmi_work_close(void);
147
148 int wma_rx_ready_event(void *handle, uint8_t *ev, uint32_t len);
149
150 int wma_rx_service_ready_event(void *handle, uint8_t *ev, uint32_t len);
151
152 int wma_rx_service_ready_ext_event(void *handle, uint8_t *ev, uint32_t len);
153
154 /**
155 * wma_rx_service_ready_ext2_event() - evt handler for service ready ext2 event.
156 * @handle: wma handle
157 * @ev: params of the service ready extended event
158 * @len: param length
159 *
160 * Return: none
161 */
162 int wma_rx_service_ready_ext2_event(void *handle, uint8_t *ev, uint32_t len);
163
164 QDF_STATUS wma_wait_for_ready_event(WMA_HANDLE handle);
165
166 int wma_cli_get_command(int vdev_id, int param_id, int vpdev);
167 int wma_cli_set_command(int vdev_id, int param_id, int sval, int vpdev);
168 int wma_cli_set2_command(int vdev_id, int param_id, int sval1,
169 int sval2, int vpdev);
170
171 /**
172 * wma_get_fw_phy_mode_for_freq_cb() - Callback to get current PHY Mode.
173 * @freq: channel freq
174 * @chan_width: maximum channel width possible
175 * @phy_mode: firmware PHY Mode
176 *
177 * Return: None
178 */
179 void wma_get_fw_phy_mode_for_freq_cb(uint32_t freq, uint32_t chan_width,
180 uint32_t *phy_mode);
181 /**
182 * wma_get_phy_mode_cb() - Callback to get current PHY Mode.
183 * @freq: channel frequency
184 * @chan_width: maximum channel width possible
185 * @phy_mode: PHY Mode
186 *
187 * Return: None
188 */
189 void wma_get_phy_mode_cb(qdf_freq_t freq, uint32_t chan_width,
190 enum wlan_phymode *phy_mode);
191
192 QDF_STATUS wma_set_htconfig(uint8_t vdev_id, uint16_t ht_capab, int value);
193
194 QDF_STATUS wma_set_peer_param(void *wma_ctx, uint8_t *peer_addr,
195 uint32_t param_id,
196 uint32_t param_value, uint32_t vdev_id);
197 QDF_STATUS wma_get_link_speed(WMA_HANDLE handle,
198 struct link_speed_info *pLinkSpeed);
199 #ifdef NOT_YET
200 QDF_STATUS wma_update_channel_list(WMA_HANDLE handle, void *scan_chan_info);
201 #endif
202
203 /**
204 * wma_get_vdev_address_by_vdev_id() - lookup MAC address from vdev ID
205 * @vdev_id: vdev id
206 *
207 * Return: mac address
208 */
209 uint8_t *wma_get_vdev_address_by_vdev_id(uint8_t vdev_id);
210 struct wma_txrx_node *wma_get_interface_by_vdev_id(uint8_t vdev_id);
211 QDF_STATUS wma_get_connection_info(uint8_t vdev_id,
212 struct policy_mgr_vdev_entry_info *conn_table_entry);
213 QDF_STATUS wma_ndi_update_connection_info(uint8_t vdev_id,
214 struct nan_datapath_channel_info *ndp_chan_info);
215
216 #ifdef WLAN_FEATURE_PKT_CAPTURE
217 int wma_get_rmf_status(uint8_t vdev_id);
218 #endif
219
220 bool wma_is_vdev_up(uint8_t vdev_id);
221
222 void *wma_get_beacon_buffer_by_vdev_id(uint8_t vdev_id, uint32_t *buffer_size);
223
224 bool wma_get_fw_wlan_feat_caps(enum cap_bitmap feature);
225 void wma_set_fw_wlan_feat_caps(enum cap_bitmap feature);
226
227 QDF_STATUS wma_post_ctrl_msg(struct mac_context *mac, struct scheduler_msg *pMsg);
228
229 void wma_update_intf_hw_mode_params(uint32_t vdev_id, uint32_t mac_id,
230 uint32_t cfgd_hw_mode_index);
231
232 QDF_STATUS wma_get_caps_for_phyidx_hwmode(struct wma_caps_per_phy *caps_per_phy,
233 enum hw_mode_dbs_capab hw_mode, enum cds_band_type band);
234 bool wma_is_rx_ldpc_supported_for_channel(uint32_t ch_freq);
235
236 #ifdef WLAN_FEATURE_LINK_LAYER_STATS
237 int wma_unified_radio_tx_mem_free(void *handle);
238
239 /*
240 * wma_unified_link_stats_results_mem_free() - Free the memory for
241 * link_stats_results->results allocated when event comes.
242 * @link_stats_results: pointer to the memory that is to be freed
243 *
244 * Return: None
245 */
246 void
247 wma_unified_link_stats_results_mem_free(tSirLLStatsResults *link_stats_results);
248
249 #else /* WLAN_FEATURE_LINK_LAYER_STATS */
wma_unified_radio_tx_mem_free(void * handle)250 static inline int wma_unified_radio_tx_mem_free(void *handle)
251 {
252 return 0;
253 }
254 #endif /* WLAN_FEATURE_LINK_LAYER_STATS */
255
256 /**
257 * wma_form_unit_test_cmd_and_send() - to form a wma command and send it to FW
258 * @vdev_id: vdev id to be filled while forming the command
259 * @module_id: module id given by user to be filled in the command
260 * @arg_count: number of argument count
261 * @arg: pointer to argument list
262 *
263 * This API exposed to HDD layer which takes the argument from user and forms
264 * the wma unit test command to be sent down to firmware
265 *
266 * Return: QDF_STATUS based on overall success
267 */
268 QDF_STATUS wma_form_unit_test_cmd_and_send(uint32_t vdev_id,
269 uint32_t module_id, uint32_t arg_count, uint32_t *arg);
270
271 QDF_STATUS wma_remove_beacon_filter(WMA_HANDLE wma,
272 struct beacon_filter_param *filter_params);
273
274 QDF_STATUS wma_add_beacon_filter(WMA_HANDLE wma,
275 struct beacon_filter_param *filter_params);
276 QDF_STATUS wma_send_adapt_dwelltime_params(WMA_HANDLE handle,
277 struct adaptive_dwelltime_params *dwelltime_params);
278
279 /**
280 * wma_send_dbs_scan_selection_params() - send DBS scan selection configuration
281 * params to firmware
282 * @handle: wma handler
283 * @dbs_scan_params: pointer to wmi_dbs_scan_sel_params
284 *
285 * Return: QDF_STATUS_SUCCESS on success and QDF failure reason code for failure
286 */
287 QDF_STATUS wma_send_dbs_scan_selection_params(WMA_HANDLE handle,
288 struct wmi_dbs_scan_sel_params *dbs_scan_params);
289 QDF_STATUS wma_set_tx_power_scale(uint8_t vdev_id, int value);
290 QDF_STATUS wma_set_tx_power_scale_decr_db(uint8_t vdev_id, int value);
291 QDF_STATUS wma_enable_disable_imps(uint32_t pdev_id, uint32_t param_val);
292
293 bool wma_is_csa_offload_enabled(void);
294 /**
295 * wma_is_mbssid_enabled - checks MBSSID support
296 *
297 * Return: true or false
298 */
299 bool wma_is_mbssid_enabled(void);
300
301 #ifdef FEATURE_P2P_LISTEN_OFFLOAD
302 bool wma_is_p2p_lo_capable(void);
303 #else
wma_is_p2p_lo_capable(void)304 static inline bool wma_is_p2p_lo_capable(void)
305 {
306 return 0;
307 }
308 #endif
309 bool wma_capability_enhanced_mcast_filter(void);
310 void wma_process_pdev_hw_mode_trans_ind(void *wma,
311 wmi_pdev_hw_mode_transition_event_fixed_param *fixed_param,
312 wmi_pdev_set_hw_mode_response_vdev_mac_entry *vdev_mac_entry,
313 struct cm_hw_mode_trans_ind *hw_mode_trans_ind);
314
315 /**
316 * wma_set_cts2self_for_p2p_go() - set CTS2SELF command for P2P GO.
317 * @wma_handle: pointer to wma handle.
318 * @cts2self_for_p2p_go: value needs to set to firmware.
319 *
320 * At the time of driver startup, inform about ini parma to FW that
321 * if legacy client connects to P2P GO, stop using NOA for P2P GO.
322 *
323 * Return: QDF_STATUS.
324 */
325 QDF_STATUS wma_set_cts2self_for_p2p_go(void *wma_handle,
326 uint32_t cts2self_for_p2p_go);
327
328 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
329 /**
330 * wma_get_roam_scan_ch() - API to get roam scan channel list.
331 * @wma: pointer to wma handle.
332 * @vdev_id: vdev id
333 *
334 * Return: QDF_STATUS.
335 */
336 QDF_STATUS wma_get_roam_scan_ch(wmi_unified_t wma,
337 uint8_t vdev_id);
338 #else
339 static inline
wma_get_roam_scan_ch(wmi_unified_t wma,uint8_t vdev_id)340 QDF_STATUS wma_get_roam_scan_ch(wmi_unified_t wma,
341 uint8_t vdev_id)
342 {
343 return QDF_STATUS_E_FAILURE;
344 }
345 #endif
346
347 /**
348 * wma_set_tx_rx_aggr_size() - set tx rx aggregation size
349 * @vdev_id: vdev id
350 * @tx_size: tx aggr size
351 * @rx_size: rx aggr size
352 * @aggr_type: aggregation type
353 *
354 * This function try to set the aggregation size.
355 *
356 * Return: QDF_STATUS enumeration
357 */
358 QDF_STATUS wma_set_tx_rx_aggr_size(uint8_t vdev_id,
359 uint32_t tx_size,
360 uint32_t rx_size,
361 wmi_vdev_custom_aggr_type_t aggr_type);
362 /**
363 * wma_set_tx_rx_aggr_size_per_ac() - set aggregation size per ac
364 * @wma_handle: pointer to wma handle.
365 * @vdev_id: vdev_id
366 * @qos_aggr: QoS data
367 * @aggr_type: aggregation type
368 *
369 * This function try to set the aggregation size per AC.
370 *
371 * Return: QDF_STATUS enumeration
372 */
373 QDF_STATUS
374 wma_set_tx_rx_aggr_size_per_ac(WMA_HANDLE wma_handle,
375 uint8_t vdev_id,
376 struct wlan_mlme_qos *qos_aggr,
377 wmi_vdev_custom_aggr_type_t aggr_type);
378
379 /**
380 * wma_set_vdev_sw_retry_th() - set sw retry threshold per vdev
381 * @vdev_id: vdev id
382 * @sw_retry_count: sw retry number
383 * @retry_type: SW vdev retry type
384 *
385 * This function sends WMI command to set the sw retry threshold per vdev.
386 *
387 * Return: QDF_STATUS.
388 */
389 QDF_STATUS wma_set_vdev_sw_retry_th(uint8_t vdev_id, uint8_t sw_retry_count,
390 wmi_vdev_custom_sw_retry_type_t retry_type);
391
392 /**
393 * wma_set_sw_retry_threshold_per_ac() - set sw retry threshold per AC for tx
394 * @handle: wma handle
395 * @vdev_id: vdev id
396 * @qos_aggr: pointer to QOS TX/RX aggregation values
397 *
398 * This function sends WMI command to set the sw retry threshold per AC
399 * for Tx.
400 *
401 * Return: QDF_STATUS.
402 */
403 QDF_STATUS wma_set_sw_retry_threshold_per_ac
404 (WMA_HANDLE handle,
405 uint8_t vdev_id, struct wlan_mlme_qos *qos_aggr);
406
407 /**
408 * wma_set_sw_retry_threshold() - set sw retry threshold for tx
409 * @qos_aggr: pointer to wlan_mlme_qos
410 *
411 * This function sends WMI command to set the sw retry threshold for Tx.
412 *
413 * Return: QDF_STATUS.
414 */
415 QDF_STATUS wma_set_sw_retry_threshold(struct wlan_mlme_qos *qos_aggr);
416
417 /**
418 * wma_get_sar_limit() - get SAR limits from the target
419 * @handle: wma handle
420 * @callback: Callback function to invoke with the results
421 * @context: Opaque context to pass back to caller in the callback
422 *
423 * This function sends WMI command to get SAR limits.
424 *
425 * Return: QDF_STATUS enumeration
426 */
427 QDF_STATUS wma_get_sar_limit(WMA_HANDLE handle,
428 wma_sar_cb callback, void *context);
429
430 /**
431 * wma_set_sar_limit() - set sar limits in the target
432 * @handle: wma handle
433 * @sar_limit_params: sar limit cmd params
434 *
435 * This function sends WMI command to set SAR limits.
436 *
437 * Return: QDF_STATUS enumeration
438 */
439 QDF_STATUS wma_set_sar_limit(WMA_HANDLE handle,
440 struct sar_limit_cmd_params *sar_limit_params);
441
442 /**
443 * wma_send_coex_config_cmd() - Send coex config params
444 * @wma_handle: wma handle
445 * @coex_cfg_params: struct to coex cofig params
446 *
447 * This function sends WMI command to send coex cofig params
448 *
449 * Return: QDF_STATUS
450 */
451 QDF_STATUS wma_send_coex_config_cmd(WMA_HANDLE wma_handle,
452 struct coex_config_params *coex_cfg_params);
453
454 /**
455 * wma_set_power_config() - update power config in wma
456 * @vdev_id: the Id of the vdev to configure
457 * @power: new power value
458 *
459 * Return: QDF_STATUS_SUCCESS on success, error number otherwise
460 */
461 QDF_STATUS wma_set_power_config(uint8_t vdev_id,
462 enum wma_sta_ps_scheme_cfg power);
463
464 /**
465 * wma_set_power_config_ito() - update power save inactivity timeout
466 * @vdev_id: the Id of the vdev to configure
467 * @ps_ito: new power save inactivity timeout in milliseconds
468 *
469 * Return: QDF_STATUS_SUCCESS on success, error number otherwise
470 */
471 QDF_STATUS wma_set_power_config_ito(uint8_t vdev_id, uint16_t ps_ito);
472
473 /**
474 * wma_set_power_config_spec_wake() - update opm speculative wake interval
475 * @vdev_id: the Id of the vdev to configure
476 * @spec_wake: new opm speculative wake interval in milliseconds
477 *
478 * Return: QDF_STATUS_SUCCESS on success, error number otherwise
479 */
480 QDF_STATUS wma_set_power_config_spec_wake(uint8_t vdev_id, uint16_t spec_wake);
481
482 #ifdef FEATURE_WLAN_D0WOW
wma_d0_wow_is_supported(void)483 static inline bool wma_d0_wow_is_supported(void)
484 {
485 return true;
486 }
487 #else
wma_d0_wow_is_supported(void)488 static inline bool wma_d0_wow_is_supported(void)
489 {
490 return false;
491 }
492 #endif
493
494 /**
495 * wma_store_pdev() - store pdev
496 * @wma_ctx: wma context
497 * @pdev: pdev context
498 *
499 * Return: void
500 */
501 void wma_store_pdev(void *wma_ctx, struct wlan_objmgr_pdev *pdev);
502
503 #ifdef WLAN_FEATURE_LINK_LAYER_STATS
504 /**
505 * wmi_to_sir_peer_type() - convert peer type from WMI to SIR enum
506 * @type: enum wmi_peer_type
507 *
508 * Return: tSirWifiPeerType
509 */
510 tSirWifiPeerType wmi_to_sir_peer_type(enum wmi_peer_type type);
511 #endif /* WLAN_FEATURE_LINK_LAYER_STATS */
512
513 QDF_STATUS wma_crash_inject(WMA_HANDLE wma_handle, uint32_t type,
514 uint32_t delay_time_ms);
515
516 /**
517 * wma_critical_events_in_flight() - get the number of critical events in flight
518 *
519 * This API gets the number of events in flight which should prevent power
520 * collapse.
521 *
522 * Return: the number of critical events in flight
523 */
524 uint32_t wma_critical_events_in_flight(void);
525
526 #ifdef FEATURE_WLAN_DYNAMIC_CVM
527 /**
528 * wma_set_vc_mode_config() - set voltage corner mode config to FW.
529 * @wma_handle: pointer to wma handle.
530 * @vc_bitmap: value needs to set to firmware.
531 *
532 * At the time of driver startup, set operating voltage corner mode
533 * for differenet phymode and bw configurations.
534 *
535 * Return: QDF_STATUS.
536 */
537 QDF_STATUS wma_set_vc_mode_config(void *wma_handle,
538 uint32_t vc_bitmap);
539 #endif
540
541 QDF_STATUS wma_process_dhcp_ind(WMA_HANDLE wma_handle,
542 tAniDHCPInd *ta_dhcp_ind);
543
544 /**
545 * wma_wmi_stop() - send wmi stop cmd
546 *
547 * Return: None
548 */
549 void wma_wmi_stop(void);
550
551 /**
552 * wma_get_mcs_idx() - get mcs index
553 * @raw_rate: raw rate from fw
554 * @rate_flags: rate flags
555 * @is_he_mcs_12_13_supported: is he mcs12/13 supported
556 * @nss: nss
557 * @dcm: dcm
558 * @guard_interval: guard interval
559 * @mcs_rate_flag: mcs rate flags
560 *
561 * Return: mcs index
562 */
563 uint8_t wma_get_mcs_idx(uint16_t raw_rate, enum tx_rate_info rate_flags,
564 bool is_he_mcs_12_13_supported,
565 uint8_t *nss, uint8_t *dcm,
566 enum txrate_gi *guard_interval,
567 enum tx_rate_info *mcs_rate_flag);
568
569 /**
570 * wma_get_hidden_ssid_restart_in_progress() - check if hidden ssid restart is
571 * in progress
572 * @iface: iface pointer
573 *
574 * Return: true if hidden ssid restart is in progress else false
575 */
576 bool wma_get_hidden_ssid_restart_in_progress(struct wma_txrx_node *iface);
577
578 /**
579 * wma_get_channel_switch_in_progress() - check if channel switch is in progress
580 * @iface: iface pointer
581 *
582 * Return: true if channel switch is in progress else false
583 */
584 bool wma_get_channel_switch_in_progress(struct wma_txrx_node *iface);
585
586 /**
587 * wma_sta_mlme_vdev_start_continue() - VDEV start response handling
588 * @vdev_mlme: VDEV MLME comp object
589 * @data_len: data size
590 * @data: event data
591 *
592 * API invokes VDEV start response actions
593 *
594 * Return: SUCCESS on successful completion of start response operation
595 * FAILURE, if it fails due to any
596 */
597 QDF_STATUS wma_sta_mlme_vdev_start_continue(struct vdev_mlme_obj *vdev_mlme,
598 uint16_t data_len, void *data);
599
600 /**
601 * wma_ap_mlme_vdev_start_continue() - VDEV start response handling
602 * @vdev_mlme: VDEV MLME comp object
603 * @data_len: data size
604 * @data: event data
605 *
606 * API invokes VDEV start response actions
607 *
608 * Return: SUCCESS on successful completion of start response operation
609 * FAILURE, if it fails due to any
610 */
611 QDF_STATUS wma_ap_mlme_vdev_start_continue(struct vdev_mlme_obj *vdev_mlme,
612 uint16_t data_len, void *data);
613
614 /**
615 * wma_sta_vdev_up_send() - Send VDEV UP command
616 * @vdev_mlme: VDEV MLME comp object
617 * @data_len: data size
618 * @data: event data
619 *
620 * API invokes VDEV UP Command
621 *
622 * Return: SUCCESS on successful completion of start response operation
623 * FAILURE, if it fails due to any
624 */
625 QDF_STATUS wma_sta_vdev_up_send(struct vdev_mlme_obj *vdev_mlme,
626 uint16_t data_len, void *data);
627
628 /**
629 * wma_mlme_vdev_stop_continue() - VDEV stop response handling
630 * @vdev_mlme: VDEV MLME comp object
631 * @data_len: data size
632 * @data: event data
633 *
634 * API invokes VDEV stop response actions
635 *
636 * Return: SUCCESS on successful completion of stop response operation
637 * FAILURE, if it fails due to any
638 */
639 QDF_STATUS wma_mlme_vdev_stop_continue(struct vdev_mlme_obj *vdev_mlme,
640 uint16_t data_len, void *data);
641
642 /**
643 * wma_ap_mlme_vdev_down_send() - VDEV down operation
644 * @vdev_mlme: VDEV MLME comp object
645 * @data_len: data size
646 * @data: event data
647 *
648 * API invokes VDEV down operation
649 *
650 * Return: SUCCESS on successful completion of VDEV down operation
651 * FAILURE, if it fails due to any
652 */
653 QDF_STATUS wma_ap_mlme_vdev_down_send(struct vdev_mlme_obj *vdev_mlme,
654 uint16_t data_len, void *data);
655
656 /**
657 * wma_mlme_vdev_notify_down_complete() - VDEV init state transition
658 * notification
659 * @vdev_mlme: VDEV MLME comp object
660 * @data_len: data size
661 * @data: event data
662 *
663 * API notifies MLME on moving to INIT state
664 *
665 * Return: SUCCESS on successful completion of down notification
666 * FAILURE, if it fails due to any
667 */
668 QDF_STATUS
669 wma_mlme_vdev_notify_down_complete(struct vdev_mlme_obj *vdev_mlme,
670 uint16_t data_len, void *data);
671
672 /**
673 * wma_ap_mlme_vdev_stop_start_send() - handle vdev stop during start req
674 * @vdev_mlme: VDEV MLME comp object
675 * @type: restart req or start req
676 * @data_len: data size
677 * @data: event data
678 *
679 * API handle vdev stop during start req
680 *
681 * Return: SUCCESS alsways
682 */
683 QDF_STATUS wma_ap_mlme_vdev_stop_start_send(struct vdev_mlme_obj *vdev_mlme,
684 enum vdev_cmd_type type,
685 uint16_t data_len, void *data);
686
687 /**
688 * wma_post_vdev_create_setup() - Post vdev create setup
689 * @vdev: vdev obj
690 *
691 * This API is invoked after vded is created to perform post
692 * vdev create operations i.e. creating peer and setting vdev params.
693 *
694 * Return: SUCCESS on successful post vdev operations, FAILURE, if it
695 * fails due to any
696 */
697 QDF_STATUS wma_post_vdev_create_setup(struct wlan_objmgr_vdev *vdev);
698
699 /**
700 * wma_vdev_create_set_param() - vdev_create_set_param
701 * @vdev: vdev obj
702 *
703 * This API is invoked after vdev is created to perform post
704 * vdev create operations i.e. creating peer and setting vdev params.
705 *
706 * Return: SUCCESS on successful post vdev operations, FAILURE, if it
707 * fails due to any
708 */
709 QDF_STATUS wma_vdev_create_set_param(struct wlan_objmgr_vdev *vdev);
710
711 /**
712 * wma_send_multi_pdev_vdev_set_params - sends dev(vdev/pdev) set params
713 * @param_type: enum of type mlme_dev_setparam
714 * @dev_id: id of the particular vdev/pdev
715 * @param: Array of structure dev_set_param with @n_params combined
716 * @n_params: number of params that are combined in @param
717 *
718 * Return: SUCCESS on successful post vdev operations, FAILURE, if it
719 * fails due to any
720 */
721 QDF_STATUS
722 wma_send_multi_pdev_vdev_set_params(enum mlme_dev_setparam param_type,
723 uint8_t dev_id,
724 struct dev_set_param *param,
725 uint8_t n_params);
726
727 /**
728 * wma_validate_txrx_chain_mask - validates tx/rx chain mask set params
729 * @paramid: paramid of chainmask
730 * @paramvalue: param value
731 *
732 * Return: SUCCESS on successful post vdev operations, FAILURE, if it
733 * fails due to any
734 */
735 QDF_STATUS
736 wma_validate_txrx_chain_mask(uint32_t paramid, uint32_t paramvalue);
737
738 /**
739 * wma_vdev_set_data_tx_callback() - Set dp vdev tx callback
740 * @vdev: vdev obj
741 *
742 * This API is used to set dp dev tx callback.
743 *
744 * Return: SUCCESS on successful post vdev operations, FAILURE, if it
745 * fails due to any
746 */
747 QDF_STATUS wma_vdev_set_data_tx_callback(struct wlan_objmgr_vdev *vdev);
748
749 /**
750 * wma_mon_mlme_vdev_start_continue() - VDEV start response handling
751 * @vdev_mlme: VDEV MLME comp object
752 * @data_len: data size
753 * @data: event data
754 *
755 * API invokes VDEV start response actions
756 *
757 * Return: SUCCESS on successful completion of start response operation
758 * FAILURE, if it fails due to any
759 */
760 QDF_STATUS wma_mon_mlme_vdev_start_continue(struct vdev_mlme_obj *vdev_mlme,
761 uint16_t data_len, void *data);
762
763 /**
764 * wma_mon_mlme_vdev_up_send() - Send VDEV UP command
765 * @vdev_mlme: VDEV MLME comp object
766 * @data_len: data size
767 * @data: event data
768 *
769 * API invokes VDEV UP Command
770 *
771 * Return: SUCCESS on successful completion of start response operation
772 * FAILURE, if it fails due to any
773 */
774 QDF_STATUS wma_mon_mlme_vdev_up_send(struct vdev_mlme_obj *vdev_mlme,
775 uint16_t data_len, void *data);
776
777 /**
778 * wma_mon_mlme_vdev_stop_send() - VDEV stop operation
779 * @vdev_mlme: VDEV MLME comp object
780 * @data_len: data size
781 * @data: event data
782 *
783 * API invokes VDEV stop operation
784 *
785 * Return: SUCCESS on successful completion of VDEV stop operation
786 * FAILURE, if it fails due to any
787 */
788 QDF_STATUS wma_mon_mlme_vdev_stop_send(struct vdev_mlme_obj *vdev_mlme,
789 uint16_t data_len, void *data);
790
791 /**
792 * wma_mon_mlme_vdev_down_send() - VDEV down operation
793 * @vdev_mlme: VDEV MLME comp object
794 * @data_len: data size
795 * @data: event data
796 *
797 * API invokes VDEV down operation
798 *
799 * Return: SUCCESS on successful completion of VDEV down operation
800 * FAILURE, if it fails due to any
801 */
802 QDF_STATUS wma_mon_mlme_vdev_down_send(struct vdev_mlme_obj *vdev_mlme,
803 uint16_t data_len, void *data);
804
805 /**
806 * wma_vdev_detach_callback() - VDEV delete response handler
807 * @rsp: pointer to vdev delete response
808 *
809 * This API processes vdev delete response and gives to upper layers
810 *
811 * Return: SUCCESS on successful completion of VDEV delete operation
812 * FAILURE, if it fails due to any
813 */
814 QDF_STATUS wma_vdev_detach_callback(struct vdev_delete_response *rsp);
815
816 /**
817 * wma_vdev_stop_resp_handler() - vdev stop response handler
818 * @vdev_mlme: vdev mlme obj
819 * @rsp: vdev stup response
820 *
821 * Return: QDF_STATUS_SUCCESS for success or error code
822 */
823 QDF_STATUS wma_vdev_stop_resp_handler(struct vdev_mlme_obj *vdev_mlme,
824 struct vdev_stop_response *rsp);
825
826 /**
827 * wma_vdev_start_resp_handler() - vdev start response handler
828 * @vdev_mlme: vdev mlme obj
829 * @rsp: vdev start response
830 *
831 * Return: QDF status
832 */
833 QDF_STATUS wma_vdev_start_resp_handler(struct vdev_mlme_obj *vdev_mlme,
834 struct vdev_start_response *rsp);
835
836 #ifdef FEATURE_WLM_STATS
837 /**
838 * typedef wma_wlm_stats_cb() - Callback function for WLM stats
839 * @cookie: Cookie provided by client during callback registration
840 * @data: Hex ASCII representation of the WLM stats
841 */
842 typedef void (*wma_wlm_stats_cb)(void *cookie, const char *data);
843
844 /**
845 * wma_wlm_stats_req() - Send a req to WLAN Latency Manager in FW
846 * @vdev_id: vdev id to be sent to FW's WLM
847 * @bitmask: A bitmask which is requested by user to be sent to FW's WLM
848 * @max_size: Size of user's buffer to store the response
849 * @cb: A callback to be called to once response is available
850 * @cookie: A cookie to be used by callback to retrieve the context of req
851 *
852 * This API is used to send a message to WLAN latency manager component
853 * in FW to retrieve some latency related data and send it to user space.
854 * Driver is just a pass-through for user to interact with FW.
855 *
856 * Return: 0 on success and non-zero for error
857 */
858 int wma_wlm_stats_req(int vdev_id, uint32_t bitmask, uint32_t max_size,
859 wma_wlm_stats_cb cb, void *cookie);
860
861 /**
862 * wma_wlm_stats_rsp() - Handler to handle the response from FW's WLM component
863 * @wma_ctx: WMA context
864 * @event: WMI TLV event data
865 * @len: WMI TLV length
866 *
867 * This API is registered with WMI component in order to handle the response
868 * coming from FW's WLM correspondence to WLM REQ to FW. This API takes the
869 * data coming as HEX stream and write in to CHAR buffer as HEX CHAR stream
870 * and send this char buffer to user space through callback.
871 *
872 * Return: 0 on success and non-zero for error
873 */
874 int wma_wlm_stats_rsp(void *wma_ctx, uint8_t *event, uint32_t len);
875 #endif /* FEATURE_WLM_STATS */
876
877 /**
878 * wma_vdev_self_peer_create() - create self peer in objmgr
879 * @vdev_mlme: vdev mlme component private object
880 *
881 * Create the self peer in firmware for beaconing vdev's and create then
882 * object manager self-peer for the vdev.
883 *
884 * Return: QDF_STATUS
885 */
886 QDF_STATUS wma_vdev_self_peer_create(struct vdev_mlme_obj *vdev_mlme);
887
888 /**
889 * wma_cleanup_vdev() - cleanup wma layers vdev
890 * @vdev: Object manager vdev
891 *
892 * This function cleansup the wma layers vdev related data.
893 *
894 * Return: None
895 */
896 void wma_cleanup_vdev(struct wlan_objmgr_vdev *vdev);
897
898 /**
899 * wma_set_wakeup_logs_to_console() - Enable/disable wakeup logs to console
900 * @value: boolean value
901 *
902 * API to enable/disable wow host wakeup event logs to console.
903 *
904 * Return: None
905 */
906 void wma_set_wakeup_logs_to_console(bool value);
907 #endif /* WMA_API_H */
908