blob: a737fa2f10ec108ce8de385f4dd85d7e9d551473 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
2 * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28#ifndef WMA_INTERNAL_H
29#define WMA_INTERNAL_H
30
31/* ################### defines ################### */
32/*
33 * TODO: Following constant should be shared by firwmare in
34 * wmi_unified.h. This will be done once wmi_unified.h is updated.
35 */
36#define WMI_PEER_STATE_AUTHORIZED 0x2
37
38#define WMA_2_4_GHZ_MAX_FREQ 3000
39#define WOW_CSA_EVENT_OFFSET 12
40
41#define WMA_DEFAULT_SCAN_REQUESTER_ID 1
42#define WMI_SCAN_FINISH_EVENTS (WMI_SCAN_EVENT_START_FAILED | \
43 WMI_SCAN_EVENT_COMPLETED | \
44 WMI_SCAN_EVENT_DEQUEUED)
45/* default value */
46#define DEFAULT_INFRA_STA_KEEP_ALIVE_PERIOD 20
47/* pdev vdev and peer stats*/
48#define FW_PDEV_STATS_SET 0x1
49#define FW_VDEV_STATS_SET 0x2
50#define FW_PEER_STATS_SET 0x4
51#define FW_STATS_SET 0x7
52
53/*AR9888/AR6320 noise floor approx value
54 * similar to the mentioned the WMA
55 */
56#define WMA_TGT_NOISE_FLOOR_DBM (-96)
57
58/*
59 * Make sure that link monitor and keep alive
60 * default values should be in sync with CFG.
61 */
62#define WMA_LINK_MONITOR_DEFAULT_TIME_SECS 10
63#define WMA_KEEP_ALIVE_DEFAULT_TIME_SECS 5
64
65#define AGC_DUMP 1
66#define CHAN_DUMP 2
67#define WD_DUMP 3
68#ifdef CONFIG_ATH_PCIE_ACCESS_DEBUG
69#define PCIE_DUMP 4
70#endif
71
72/* conformance test limits */
73#define FCC 0x10
74#define MKK 0x40
75#define ETSI 0x30
76
77/* Maximum Buffer length allowed for DFS phyerrors */
78#define DFS_MAX_BUF_LENGHT 4096
79
80#define WMI_DEFAULT_NOISE_FLOOR_DBM (-96)
81
82#define WMI_MCC_MIN_CHANNEL_QUOTA 20
83#define WMI_MCC_MAX_CHANNEL_QUOTA 80
84#define WMI_MCC_MIN_NON_ZERO_CHANNEL_LATENCY 30
85
86/* The maximum number of patterns that can be transmitted by the firmware
87 * and maximum patterns size.
88 */
89#define WMA_MAXNUM_PERIODIC_TX_PTRNS 6
90
91#define WMI_MAX_HOST_CREDITS 2
92#define WMI_WOW_REQUIRED_CREDITS 1
93
94#define MAX_HT_MCS_IDX 8
95#define MAX_VHT_MCS_IDX 10
96#define INVALID_MCS_IDX 255
97
98#define LINK_STATUS_LEGACY 0
99#define LINK_STATUS_VHT 0x1
100#define LINK_STATUS_MIMO 0x2
101#define LINK_SUPPORT_VHT 0x4
102#define LINK_SUPPORT_MIMO 0x8
103
104#define LINK_RATE_VHT 0x3
105
106#define MAX_ENTRY_HOLD_REQ_QUEUE 2
107/**
108 * struct index_data_rate_type - non vht data rate type
109 * @beacon_rate_index: Beacon rate index
110 * @supported_rate: Supported rate table
111 */
112struct index_data_rate_type {
113 uint8_t beacon_rate_index;
114 uint16_t supported_rate[4];
115};
116
117#ifdef WLAN_FEATURE_11AC
118/**
119 * struct index_vht_data_rate_type - vht data rate type
120 * @beacon_rate_index: Beacon rate index
121 * @supported_VHT80_rate: VHT80 rate
122 * @supported_VHT40_rate: VHT40 rate
123 * @supported_VHT20_rate: VHT20 rate
124 */
125struct index_vht_data_rate_type {
126 uint8_t beacon_rate_index;
127 uint16_t supported_VHT80_rate[2];
128 uint16_t supported_VHT40_rate[2];
129 uint16_t supported_VHT20_rate[2];
130};
131#endif
132
133/*
134 * wma_main.c functions declarations
135 */
136
137int
138wmi_unified_pdev_set_param(wmi_unified_t wmi_handle, WMI_PDEV_PARAM param_id,
139 uint32_t param_value);
140
141void wma_send_msg(tp_wma_handle wma_handle, uint16_t msg_type,
142 void *body_ptr, uint32_t body_val);
143
144void wma_data_tx_ack_comp_hdlr(void *wma_context,
145 cdf_nbuf_t netbuf, int32_t status);
146
147CDF_STATUS wma_set_ppsconfig(uint8_t vdev_id, uint16_t pps_param,
148 int value);
149
150/*
151 * wma_scan_roam.c functions declarations
152 */
153
154#ifdef WLAN_FEATURE_ROAM_OFFLOAD
155void wma_process_roam_invoke(WMA_HANDLE handle,
156 struct wma_roam_invoke_cmd *roaminvoke);
157
158void wma_process_roam_synch_fail(WMA_HANDLE handle,
159 struct roam_offload_synch_fail *synch_fail);
160
161int wma_roam_synch_event_handler(void *handle, uint8_t *event,
162 uint32_t len);
163#endif
164
165CDF_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle,
166 tSirScanOffloadReq *scan_req,
167 wmi_buf_t *buf, int *buf_len);
168
169CDF_STATUS wma_get_buf_stop_scan_cmd(tp_wma_handle wma_handle,
170 wmi_buf_t *buf,
171 int *buf_len,
172 tAbortScanParams *abort_scan_req);
173
174CDF_STATUS wma_start_scan(tp_wma_handle wma_handle,
175 tSirScanOffloadReq *scan_req, uint16_t msg_type);
176
177CDF_STATUS wma_stop_scan(tp_wma_handle wma_handle,
178 tAbortScanParams *abort_scan_req);
179
180CDF_STATUS wma_update_channel_list(WMA_HANDLE handle,
181 tSirUpdateChanList *chan_list);
182
183#ifdef WLAN_FEATURE_ROAM_OFFLOAD
184CDF_STATUS wma_roam_scan_fill_self_caps(tp_wma_handle wma_handle,
185 wmi_roam_offload_tlv_param *
186 roam_offload_params,
187 tSirRoamOffloadScanReq *roam_req);
188#endif
189
190CDF_STATUS wma_roam_scan_offload_mode(tp_wma_handle wma_handle,
191 wmi_start_scan_cmd_fixed_param *
192 scan_cmd_fp,
193 tSirRoamOffloadScanReq *roam_req,
194 uint32_t mode, uint32_t vdev_id);
195
196CDF_STATUS wma_roam_scan_offload_rssi_thresh(tp_wma_handle wma_handle,
197 tSirRoamOffloadScanReq *roam_req);
198
199CDF_STATUS wma_roam_scan_offload_scan_period(tp_wma_handle wma_handle,
200 uint32_t scan_period,
201 uint32_t scan_age,
202 uint32_t vdev_id);
203
204CDF_STATUS wma_roam_scan_offload_rssi_change(tp_wma_handle wma_handle,
205 uint32_t vdev_id,
206 int32_t rssi_change_thresh,
207 uint32_t bcn_rssi_weight,
208 uint32_t hirssi_delay_btw_scans);
209
210CDF_STATUS wma_roam_scan_offload_chan_list(tp_wma_handle wma_handle,
211 uint8_t chan_count,
212 uint8_t *chan_list,
213 uint8_t list_type, uint32_t vdev_id);
214
215A_UINT32 e_csr_auth_type_to_rsn_authmode(eCsrAuthType authtype,
216 eCsrEncryptionType encr);
217
218A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
219
220void wma_roam_scan_fill_ap_profile(tp_wma_handle wma_handle,
221 tpAniSirGlobal pMac,
222 tSirRoamOffloadScanReq *roam_req,
223 wmi_ap_profile *ap_profile_p);
224
225void wma_roam_scan_fill_scan_params(tp_wma_handle wma_handle,
226 tpAniSirGlobal pMac,
227 tSirRoamOffloadScanReq *roam_req,
228 wmi_start_scan_cmd_fixed_param *
229 scan_params);
230
231CDF_STATUS wma_roam_scan_offload_ap_profile(tp_wma_handle wma_handle,
232 wmi_ap_profile *ap_profile_p,
233 uint32_t vdev_id);
234
235CDF_STATUS wma_roam_scan_bmiss_cnt(tp_wma_handle wma_handle,
236 A_INT32 first_bcnt,
237 A_UINT32 final_bcnt, uint32_t vdev_id);
238
239CDF_STATUS wma_roam_scan_offload_command(tp_wma_handle wma_handle,
240 uint32_t command, uint32_t vdev_id);
241
242CDF_STATUS wma_process_roam_scan_req(tp_wma_handle wma_handle,
243 tSirRoamOffloadScanReq *roam_req);
244
245CDF_STATUS wma_roam_preauth_chan_set(tp_wma_handle wma_handle,
246 tpSwitchChannelParams params,
247 uint8_t vdev_id);
248
249CDF_STATUS wma_roam_preauth_chan_cancel(tp_wma_handle wma_handle,
250 tpSwitchChannelParams params,
251 uint8_t vdev_id);
252
253void wma_roam_preauth_scan_event_handler(tp_wma_handle wma_handle,
254 uint8_t vdev_id,
255 wmi_scan_event_fixed_param *
256 wmi_event);
257
258void wma_set_channel(tp_wma_handle wma, tpSwitchChannelParams params);
259
260#ifdef FEATURE_WLAN_SCAN_PNO
261CDF_STATUS wma_pno_start(tp_wma_handle wma, tpSirPNOScanReq pno);
262
263CDF_STATUS wma_pno_stop(tp_wma_handle wma, uint8_t vdev_id);
264
265void wma_config_pno(tp_wma_handle wma, tpSirPNOScanReq pno);
266
267#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
268CDF_STATUS wma_plm_start(tp_wma_handle wma, const tpSirPlmReq plm);
269
270CDF_STATUS wma_plm_stop(tp_wma_handle wma, const tpSirPlmReq plm);
271
272void wma_config_plm(tp_wma_handle wma, tpSirPlmReq plm);
273#endif
274
275void wma_scan_cache_updated_ind(tp_wma_handle wma, uint8_t sessionId);
276#endif
277
278#ifdef WLAN_FEATURE_ROAM_OFFLOAD
279void wma_set_ric_req(tp_wma_handle wma, void *msg, uint8_t is_add_ts);
280#endif
281
282#ifdef FEATURE_WLAN_EXTSCAN
283
284int wma_extscan_start_stop_event_handler(void *handle,
285 uint8_t *cmd_param_info,
286 uint32_t len);
287
288int wma_extscan_operations_event_handler(void *handle,
289 uint8_t *cmd_param_info,
290 uint32_t len);
291
292int wma_extscan_table_usage_event_handler(void *handle,
293 uint8_t *cmd_param_info,
294 uint32_t len);
295
296int wma_extscan_capabilities_event_handler(void *handle,
297 uint8_t *cmd_param_info,
298 uint32_t len);
299
300int wma_extscan_hotlist_match_event_handler(void *handle,
301 uint8_t *cmd_param_info,
302 uint32_t len);
303
304int wma_extscan_cached_results_event_handler(void *handle,
305 uint8_t *cmd_param_info,
306 uint32_t len);
307
308int wma_extscan_change_results_event_handler(void *handle,
309 uint8_t *cmd_param_info,
310 uint32_t len);
311
312int wma_passpoint_match_event_handler(void *handle,
313 uint8_t *cmd_param_info,
314 uint32_t len);
315
316int
317wma_extscan_hotlist_ssid_match_event_handler(void *handle,
318 uint8_t *cmd_param_info,
319 uint32_t len);
320#endif
321
322void wma_register_extscan_event_handler(tp_wma_handle wma_handle);
323
324#ifdef FEATURE_WLAN_EXTSCAN
325CDF_STATUS wma_get_buf_extscan_start_cmd(tp_wma_handle wma_handle,
326 tSirWifiScanCmdReqParams *pstart,
327 wmi_buf_t *buf, int *buf_len);
328
329CDF_STATUS wma_start_extscan(tp_wma_handle wma,
330 tSirWifiScanCmdReqParams *pstart);
331
332CDF_STATUS wma_stop_extscan(tp_wma_handle wma,
333 tSirExtScanStopReqParams *pstopcmd);
334
335CDF_STATUS wma_get_buf_extscan_hotlist_cmd(tp_wma_handle wma_handle,
336 tSirExtScanSetBssidHotListReqParams *
337 photlist, int *buf_len);
338
339CDF_STATUS wma_extscan_start_hotlist_monitor(tp_wma_handle wma,
340 tSirExtScanSetBssidHotListReqParams
341 *photlist);
342
343CDF_STATUS wma_extscan_stop_hotlist_monitor(tp_wma_handle wma,
344 tSirExtScanResetBssidHotlistReqParams
345 *photlist_reset);
346
347CDF_STATUS wma_get_buf_extscan_change_monitor_cmd(tp_wma_handle wma_handle,
348 tSirExtScanSetSigChangeReqParams
349 *psigchange, wmi_buf_t *buf,
350 int *buf_len);
351
352CDF_STATUS wma_extscan_start_change_monitor(tp_wma_handle wma,
353 tSirExtScanSetSigChangeReqParams *
354 psigchange);
355
356CDF_STATUS wma_extscan_stop_change_monitor(tp_wma_handle wma,
357 tSirExtScanResetSignificantChangeReqParams
358 *pResetReq);
359
360CDF_STATUS wma_extscan_get_cached_results(tp_wma_handle wma,
361 tSirExtScanGetCachedResultsReqParams *
362 pcached_results);
363
364CDF_STATUS wma_extscan_get_capabilities(tp_wma_handle wma,
365 tSirGetExtScanCapabilitiesReqParams *
366 pgetcapab);
367CDF_STATUS wma_set_epno_network_list(tp_wma_handle wma,
368 struct wifi_epno_params *req);
369
370CDF_STATUS wma_set_passpoint_network_list(tp_wma_handle wma,
371 struct wifi_passpoint_req *req);
372
373CDF_STATUS wma_reset_passpoint_network_list(tp_wma_handle wma,
374 struct wifi_passpoint_req *req);
375CDF_STATUS
376wma_set_ssid_hotlist(tp_wma_handle wma,
377 struct sir_set_ssid_hotlist_request *request);
378#endif
379
380CDF_STATUS wma_ipa_offload_enable_disable(tp_wma_handle wma,
381 struct sir_ipa_offload_enable_disable *ipa_offload);
382
383#ifdef WLAN_FEATURE_ROAM_OFFLOAD
384void wma_process_unit_test_cmd(WMA_HANDLE handle,
385 t_wma_unit_test_cmd *wma_utest);
386#endif
387
388CDF_STATUS wma_scan_probe_setoui(tp_wma_handle wma, tSirScanMacOui *psetoui);
389
390int wma_scan_event_callback(WMA_HANDLE handle, uint8_t *data, uint32_t len);
391
392void wma_roam_better_ap_handler(tp_wma_handle wma, uint32_t vdev_id);
393
394int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
395 uint32_t len);
396
397#ifdef FEATURE_WLAN_SCAN_PNO
398int wma_nlo_match_evt_handler(void *handle, uint8_t *event, uint32_t len);
399
400int wma_nlo_scan_cmp_evt_handler(void *handle, uint8_t *event, uint32_t len);
401#endif
402
403#ifdef WLAN_FEATURE_ROAM_OFFLOAD
404void wma_process_roam_synch_complete(WMA_HANDLE handle,
405 tSirSmeRoamOffloadSynchCnf *synchcnf);
406#endif
407
408/*
409 * wma_dev_if.c functions declarations
410 */
411
412void *wma_find_vdev_by_addr(tp_wma_handle wma, uint8_t *addr,
413 uint8_t *vdev_id);
414
415/**
416 * wma_find_vdev_by_id() - Returns vdev handle for given vdev id.
417 * @wma - wma handle
418 * @vdev_id - vdev ID
419 *
420 * Return: Returns vdev handle if given vdev id is valid.
421 * Otherwise returns NULL.
422 */
423static inline void *wma_find_vdev_by_id(tp_wma_handle wma, uint8_t vdev_id)
424{
425 if (vdev_id > wma->max_bssid)
426 return NULL;
427
428 return wma->interfaces[vdev_id].handle;
429}
430
431/**
432 * wma_get_vdev_count() - Returns number of active vdev.
433 * @wma - wma handle
434 *
435 * Return: Returns valid vdev count.
436 */
437static inline uint8_t wma_get_vdev_count(tp_wma_handle wma)
438{
439 uint8_t vdev_count = 0, i;
440
441 for (i = 0; i < wma->max_bssid; i++) {
442 if (wma->interfaces[i].handle)
443 vdev_count++;
444 }
445 return vdev_count;
446}
447
448bool wma_is_vdev_in_ap_mode(tp_wma_handle wma, uint8_t vdev_id);
449
450#ifdef QCA_IBSS_SUPPORT
451bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id);
452#endif
453
454/**
455 * wma_find_bssid_by_vdev_id() - Get the BSS ID corresponding to the vdev ID
456 * @wma - wma handle
457 * @vdev_id - vdev ID
458 *
459 * Return: Returns pointer to bssid on success,
460 * otherwise returns NULL.
461 */
462static inline uint8_t *wma_find_bssid_by_vdev_id(tp_wma_handle wma,
463 uint8_t vdev_id)
464{
465 if (vdev_id >= wma->max_bssid)
466 return NULL;
467
468 return wma->interfaces[vdev_id].bssid;
469}
470
471void *wma_find_vdev_by_bssid(tp_wma_handle wma, uint8_t *bssid,
472 uint8_t *vdev_id);
473
474int wma_unified_vdev_create_send(wmi_unified_t wmi_handle, uint8_t if_id,
475 uint32_t type, uint32_t subtype,
476 uint8_t macaddr[IEEE80211_ADDR_LEN]);
477
478CDF_STATUS wma_vdev_detach(tp_wma_handle wma_handle,
479 struct del_sta_self_params *pdel_sta_self_req_param,
480 uint8_t generateRsp);
481
482int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
483 uint32_t len);
484
485int wmi_unified_vdev_set_param_send(wmi_unified_t wmi_handle, uint32_t if_id,
486 uint32_t param_id, uint32_t param_value);
487
488int32_t wmi_unified_peer_flush_tids_send(wmi_unified_t wmi,
489 uint8_t peer_addr
490 [IEEE80211_ADDR_LEN],
491 uint32_t peer_tid_bitmap,
492 uint8_t vdev_id);
493
494void wma_remove_peer(tp_wma_handle wma, uint8_t *bssid,
495 uint8_t vdev_id, ol_txrx_peer_handle peer,
496 bool roam_synch_in_progress);
497
498CDF_STATUS wma_create_peer(tp_wma_handle wma, ol_txrx_pdev_handle pdev,
499 ol_txrx_vdev_handle vdev,
500 u8 peer_addr[IEEE80211_ADDR_LEN],
501 uint32_t peer_type, uint8_t vdev_id,
502 bool roam_synch_in_progress);
503
504int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
505 u32 len);
506
507ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle,
508 struct add_sta_self_params *self_sta_req,
509 uint8_t generateRsp);
510
511CDF_STATUS wma_vdev_start(tp_wma_handle wma,
512 struct wma_vdev_start_req *req, bool isRestart);
513
514void wma_vdev_resp_timer(void *data);
515
516struct wma_target_req *wma_fill_vdev_req(tp_wma_handle wma,
517 uint8_t vdev_id,
518 uint32_t msg_type, uint8_t type,
519 void *params, uint32_t timeout);
520
521void wma_hold_req_timer(void *data);
522struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma,
523 uint8_t vdev_id, uint32_t msg_type,
524 uint8_t type, void *params,
525 uint32_t timeout);
526
527void wma_remove_vdev_req(tp_wma_handle wma, uint8_t vdev_id,
528 uint8_t type);
529
530void wma_add_bss(tp_wma_handle wma, tpAddBssParams params);
531
532int wmi_unified_vdev_up_send(wmi_unified_t wmi,
533 uint8_t vdev_id, uint16_t aid,
534 uint8_t bssid[IEEE80211_ADDR_LEN]);
535
536void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta);
537
538void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta);
539
540int32_t wmi_unified_vdev_stop_send(wmi_unified_t wmi, uint8_t vdev_id);
541
542void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params);
543
544int32_t wma_find_vdev_by_type(tp_wma_handle wma, int32_t type);
545
546void wma_set_vdev_intrabss_fwd(tp_wma_handle wma_handle,
547 tpDisableIntraBssFwd pdis_intra_fwd);
548
549/*
550 * wma_mgmt.c functions declarations
551 */
552
553int wma_beacon_swba_handler(void *handle, uint8_t *event, uint32_t len);
554
555int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len);
556
557void wma_extscan_wow_event_callback(void *handle, void *event, uint32_t len);
558
559int wma_unified_bcntx_status_event_handler(void *handle,
560 uint8_t *cmd_param_info,
561 uint32_t len);
562
563
564void wma_set_sta_keep_alive(tp_wma_handle wma, uint8_t vdev_id,
565 uint32_t method, uint32_t timeperiod,
566 uint8_t *hostv4addr, uint8_t *destv4addr,
567 uint8_t *destmac);
568
569int wma_vdev_install_key_complete_event_handler(void *handle,
570 uint8_t *event,
571 uint32_t len);
572
573int32_t wmi_unified_send_peer_assoc(tp_wma_handle wma,
574 tSirNwType nw_type,
575 tpAddStaParams params);
576
577int wmi_unified_vdev_set_gtx_cfg_send(wmi_unified_t wmi_handle, uint32_t if_id,
578 gtx_config_t *gtx_info);
579
580void wma_update_protection_mode(tp_wma_handle wma, uint8_t vdev_id,
581 uint8_t llbcoexist);
582
583void wma_process_update_beacon_params(tp_wma_handle wma,
584 tUpdateBeaconParams *bcn_params);
585
586void wma_update_cfg_params(tp_wma_handle wma, tSirMsgQ *cfgParam);
587
588void wma_set_bsskey(tp_wma_handle wma_handle, tpSetBssKeyParams key_info);
589
590void wma_adjust_ibss_heart_beat_timer(tp_wma_handle wma,
591 uint8_t vdev_id,
592 int8_t peer_num_delta);
593
594void wma_set_stakey(tp_wma_handle wma_handle, tpSetStaKeyParams key_info);
595
596CDF_STATUS wma_process_update_edca_param_req(WMA_HANDLE handle,
597 tEdcaParams *edca_params);
598
599int wma_tbttoffset_update_event_handler(void *handle, uint8_t *event,
600 uint32_t len);
601
602void wma_send_probe_rsp_tmpl(tp_wma_handle wma,
603 tpSendProbeRespParams probe_rsp_info);
604
605void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info);
606
607void wma_set_keepalive_req(tp_wma_handle wma,
608 tSirKeepAliveReq *keepalive);
609
610void wma_beacon_miss_handler(tp_wma_handle wma, uint32_t vdev_id);
611
612void wma_process_update_opmode(tp_wma_handle wma_handle,
613 tUpdateVHTOpMode *update_vht_opmode);
614
615void wma_process_update_rx_nss(tp_wma_handle wma_handle,
616 tUpdateRxNss *update_rx_nss);
617
618void wma_process_update_membership(tp_wma_handle wma_handle,
619 tUpdateMembership *membership);
620
621void wma_process_update_userpos(tp_wma_handle wma_handle,
622 tUpdateUserPos *userpos);
623
624void wma_hidden_ssid_vdev_restart(tp_wma_handle wma_handle,
625 tHalHiddenSsidVdevRestart *pReq);
626
627/*
628 * wma_power.c functions declarations
629 */
630
631void wma_enable_sta_ps_mode(tp_wma_handle wma, tpEnablePsParams ps_req);
632
633int32_t wmi_unified_set_sta_ps_param(wmi_unified_t wmi_handle,
634 uint32_t vdev_id, uint32_t param,
635 uint32_t value);
636
637CDF_STATUS
638wma_set_ibss_pwrsave_params(tp_wma_handle wma, uint8_t vdev_id);
639
640int32_t wma_set_ap_peer_uapsd(tp_wma_handle wma, uint32_t vdev_id,
641 uint8_t *peer_addr, uint8_t uapsd_value,
642 uint8_t max_sp);
643
644void wma_update_edca_params_for_ac(tSirMacEdcaParamRecord *edca_param,
645 wmi_wmm_vparams *wmm_param, int ac);
646
647void wma_set_tx_power(WMA_HANDLE handle,
648 tMaxTxPowerParams *tx_pwr_params);
649
650void wma_set_max_tx_power(WMA_HANDLE handle,
651 tMaxTxPowerParams *tx_pwr_params);
652
653int32_t wmi_unified_set_sta_ps(wmi_unified_t wmi_handle,
654 uint32_t vdev_id, uint8_t val);
655
656void wma_disable_sta_ps_mode(tp_wma_handle wma, tpDisablePsParams ps_req);
657
658void wma_enable_uapsd_mode(tp_wma_handle wma, tpEnableUapsdParams ps_req);
659
660void wma_disable_uapsd_mode(tp_wma_handle wma,
661 tpDisableUapsdParams ps_req);
662
663CDF_STATUS wma_get_temperature(tp_wma_handle wma_handle);
664
665int wma_pdev_temperature_evt_handler(void *handle, uint8_t *event,
666 uint32_t len);
667
668CDF_STATUS wma_process_tx_power_limits(WMA_HANDLE handle,
669 tSirTxPowerLimit *ptxlim);
670
671void wma_update_noa(struct beacon_info *beacon,
672 struct p2p_sub_element_noa *noa_ie);
673
674void wma_update_probe_resp_noa(tp_wma_handle wma_handle,
675 struct p2p_sub_element_noa *noa_ie);
676
677int wma_p2p_noa_event_handler(void *handle, uint8_t *event,
678 uint32_t len);
679
680void wma_process_set_p2pgo_noa_req(tp_wma_handle wma,
681 tP2pPsParams *ps_params);
682
683void wma_process_set_mimops_req(tp_wma_handle wma_handle,
684 tSetMIMOPS *mimops);
685
686CDF_STATUS wma_set_mimops(tp_wma_handle wma, uint8_t vdev_id, int value);
687
688CDF_STATUS wma_notify_modem_power_state(void *wma_ptr,
689 tSirModemPowerStateInd *pReq);
690
691CDF_STATUS wma_set_smps_params(tp_wma_handle wma, uint8_t vdev_id,
692 int value);
693
694void wma_set_suspend_dtim(tp_wma_handle wma);
695
696void wma_set_resume_dtim(tp_wma_handle wma);
697
698/*
699 * wma_data.c functions declarations
700 */
701
702
703void wma_set_bss_rate_flags(struct wma_txrx_node *iface,
704 tpAddBssParams add_bss);
705
706int32_t wmi_unified_send_txbf(tp_wma_handle wma, tpAddStaParams params);
707
708void wma_update_txrx_chainmask(int num_rf_chains, int *cmd_value);
709
710int wma_peer_state_change_event_handler(void *handle,
711 uint8_t *event_buff,
712 uint32_t len);
713
714CDF_STATUS wma_set_enable_disable_mcc_adaptive_scheduler(uint32_t
715 mcc_adaptive_scheduler);
716
717CDF_STATUS wma_set_mcc_channel_time_latency
718 (tp_wma_handle wma,
719 uint32_t mcc_channel, uint32_t mcc_channel_time_latency);
720
721CDF_STATUS wma_set_mcc_channel_time_quota
722 (tp_wma_handle wma,
723 uint32_t adapter_1_chan_number,
724 uint32_t adapter_1_quota, uint32_t adapter_2_chan_number);
725
726void wma_set_linkstate(tp_wma_handle wma, tpLinkStateParams params);
727
728void wma_unpause_vdev(tp_wma_handle wma);
729
730CDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma,
731 tSirRateUpdateInd *
732 pRateUpdateParams);
733
734CDF_STATUS wma_tx_attach(tp_wma_handle wma_handle);
735
736CDF_STATUS wma_tx_detach(tp_wma_handle wma_handle);
737
738#if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || defined(QCA_LL_TX_FLOW_CONTROL_V2)
739int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event,
740 uint32_t len);
741#endif
742
743CDF_STATUS wma_process_init_thermal_info(tp_wma_handle wma,
744 t_thermal_mgmt *pThermalParams);
745
746CDF_STATUS wma_process_set_thermal_level(tp_wma_handle wma,
747 uint8_t thermal_level);
748
749CDF_STATUS wma_set_thermal_mgmt(tp_wma_handle wma_handle,
750 t_thermal_cmd_params thermal_info);
751
752int wma_thermal_mgmt_evt_handler(void *handle, uint8_t *event,
753 uint32_t len);
754
755/*
756 * wma_utils.c functions declarations
757 */
758
759#ifdef WLAN_FEATURE_STATS_EXT
760int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf,
761 uint32_t len);
762#endif
763
764tSmpsModeValue host_map_smps_mode(A_UINT32 fw_smps_mode);
765
766#ifdef WLAN_FEATURE_LINK_LAYER_STATS
767void wma_register_ll_stats_event_handler(tp_wma_handle wma_handle);
768
769CDF_STATUS wma_process_ll_stats_clear_req
770 (tp_wma_handle wma, const tpSirLLStatsClearReq clearReq);
771
772CDF_STATUS wma_process_ll_stats_set_req
773 (tp_wma_handle wma, const tpSirLLStatsSetReq setReq);
774
775CDF_STATUS wma_process_ll_stats_get_req
776 (tp_wma_handle wma, const tpSirLLStatsGetReq getReq) ;
777
778int wma_unified_link_iface_stats_event_handler(void *handle,
779 uint8_t *cmd_param_info,
780 uint32_t len);
781#endif
782
783void wma_post_link_status(tAniGetLinkStatus *pGetLinkStatus,
784 uint8_t link_status);
785
786int wma_link_status_event_handler(void *handle, uint8_t *cmd_param_info,
787 uint32_t len);
788
789int wma_stats_event_handler(void *handle, uint8_t *cmd_param_info,
790 uint32_t len);
791
792CDF_STATUS wma_send_link_speed(uint32_t link_speed);
793
794int wma_link_speed_event_handler(void *handle, uint8_t *cmd_param_info,
795 uint32_t len);
796
797CDF_STATUS wma_wni_cfg_dnld(tp_wma_handle wma_handle);
798
799int wma_unified_debug_print_event_handler(void *handle, uint8_t *datap,
800 uint32_t len);
801
802bool wma_is_sap_active(tp_wma_handle wma_handle);
803
804bool wma_is_p2p_go_active(tp_wma_handle wma_handle);
805
806bool wma_is_p2p_cli_active(tp_wma_handle wma_handle);
807
808bool wma_is_sta_active(tp_wma_handle wma_handle);
809
810WLAN_PHY_MODE wma_peer_phymode(tSirNwType nw_type, uint8_t sta_type,
811 uint8_t is_ht, uint8_t ch_width,
812 uint8_t is_vht);
813
814int32_t wma_txrx_fw_stats_reset(tp_wma_handle wma_handle,
815 uint8_t vdev_id, uint32_t value);
816
817int32_t wma_set_txrx_fw_stats_level(tp_wma_handle wma_handle,
818 uint8_t vdev_id, uint32_t value);
819
820int wmi_crash_inject(wmi_unified_t wmi_handle, uint32_t type,
821 uint32_t delay_time_ms);
822
823void wma_get_stats_req(WMA_HANDLE handle,
824 tAniGetPEStatsReq *get_stats_param);
825
826#if defined(QCA_WIFI_FTM)
827void wma_utf_detach(tp_wma_handle wma_handle);
828
829void wma_utf_attach(tp_wma_handle wma_handle);
830
831CDF_STATUS
832wma_process_ftm_command(tp_wma_handle wma_handle,
833 struct ar6k_testmode_cmd_data *msg_buffer);
834#endif
835
836/*
837 * wma_features.c functions declarations
838 */
839
840void wma_process_link_status_req(tp_wma_handle wma,
841 tAniGetLinkStatus *pGetLinkStatus);
842
843#ifdef FEATURE_WLAN_LPHB
844CDF_STATUS wma_process_lphb_conf_req(tp_wma_handle wma_handle,
845 tSirLPHBReq *lphb_conf_req);
846
847#endif
848
849CDF_STATUS wma_process_dhcp_ind(tp_wma_handle wma_handle,
850 tAniDHCPInd *ta_dhcp_ind);
851
852WLAN_PHY_MODE wma_chan_to_mode(u8 chan, phy_ch_width chan_width,
853 u8 vht_capable, u8 dot11_mode);
854
855CDF_STATUS wma_get_link_speed(WMA_HANDLE handle, tSirLinkSpeedInfo *pLinkSpeed);
856
857#ifdef FEATURE_GREEN_AP
858int32_t wmi_unified_pdev_green_ap_ps_enable_cmd(wmi_unified_t wmi_handle,
859 uint32_t value);
860#endif
861
862void wma_wow_tx_complete(void *wma);
863
864int wmi_unified_nat_keepalive_enable(tp_wma_handle wma, uint8_t vdev_id);
865
866int wmi_unified_csa_offload_enable(tp_wma_handle wma, uint8_t vdev_id);
867
868#ifdef WLAN_FEATURE_NAN
869int wma_nan_rsp_event_handler(void *handle, uint8_t *event_buf, uint32_t len);
870#endif
871
872#ifdef FEATURE_WLAN_TDLS
873int wma_tdls_event_handler(void *handle, uint8_t *event, uint32_t len);
874#endif
875
876int wma_csa_offload_handler(void *handle, uint8_t *event, uint32_t len);
877
878#ifdef WLAN_FEATURE_GTK_OFFLOAD
879int wma_gtk_offload_status_event(void *handle, uint8_t *event, uint32_t len);
880#endif
881
882#ifdef FEATURE_OEM_DATA_SUPPORT
883int wma_oem_capability_event_callback(void *handle,
884 uint8_t *datap, uint32_t len);
885
886int wma_oem_measurement_report_event_callback(void *handle, uint8_t *datap,
887 uint32_t len);
888
889int wma_oem_error_report_event_callback(void *handle, uint8_t *datap,
890 uint32_t len);
891#endif
892
893void wma_register_dfs_event_handler(tp_wma_handle wma_handle);
894
895int
896wma_unified_dfs_phyerr_filter_offload_enable(tp_wma_handle wma_handle);
897
898#if !defined(REMOVE_PKT_LOG)
899CDF_STATUS wma_pktlog_wmi_send_cmd(WMA_HANDLE handle,
900 struct ath_pktlog_wmi_params *params);
901#endif
902
903int wma_wow_wakeup_host_event(void *handle, uint8_t *event,
904 uint32_t len);
905int wma_pdev_resume_event_handler(void *handle, uint8_t *event, uint32_t len);
906
907/**
908 * wma_get_wow_bus_suspend() - check is wow bus suspended or not
909 * @wma: wma handle
910 *
911 * Return: true/false
912 */
913static inline int wma_get_wow_bus_suspend(tp_wma_handle wma)
914{
915
916 return cdf_atomic_read(&wma->is_wow_bus_suspended);
917}
918
919CDF_STATUS wma_resume_req(tp_wma_handle wma);
920
921CDF_STATUS wma_wow_add_pattern(tp_wma_handle wma,
922 struct wow_add_pattern *ptrn);
923
924CDF_STATUS wma_wow_delete_user_pattern(tp_wma_handle wma,
925 struct wow_delete_pattern *pattern);
926
927CDF_STATUS wma_wow_enter(tp_wma_handle wma, tpSirHalWowlEnterParams info);
928
929CDF_STATUS wma_wow_exit(tp_wma_handle wma, tpSirHalWowlExitParams info);
930
931CDF_STATUS wma_suspend_req(tp_wma_handle wma, tpSirWlanSuspendParam info);
932
933void wma_del_ts_req(tp_wma_handle wma, tDelTsParams *msg);
934
935void wma_aggr_qos_req(tp_wma_handle wma,
936 tAggrAddTsParams *pAggrQosRspMsg);
937
938void wma_add_ts_req(tp_wma_handle wma, tAddTsParams *msg);
939
940int wma_process_receive_filter_set_filter_req(tp_wma_handle wma_handle,
941 tSirRcvPktFilterCfgType *
942 rcv_filter_param);
943
944int wma_process_receive_filter_clear_filter_req(tp_wma_handle wma_handle,
945 tSirRcvFltPktClearParam *
946 rcv_clear_param);
947
948#ifdef FEATURE_OEM_DATA_SUPPORT
949void wma_start_oem_data_req(tp_wma_handle wma_handle,
950 tStartOemDataReq *startOemDataReq);
951#endif
952
953#ifdef FEATURE_WLAN_ESE
954CDF_STATUS wma_process_tsm_stats_req(tp_wma_handle wma_handler,
955 void *pTsmStatsMsg);
956#endif
957
958CDF_STATUS wma_process_mcbc_set_filter_req(tp_wma_handle wma_handle,
959 tSirRcvFltMcAddrList *mcbc_param);
960#ifdef WLAN_FEATURE_GTK_OFFLOAD
961CDF_STATUS wma_process_gtk_offload_req(tp_wma_handle wma,
962 tpSirGtkOffloadParams params);
963
964CDF_STATUS wma_process_gtk_offload_getinfo_req(tp_wma_handle wma,
965 tpSirGtkOffloadGetInfoRspParams
966 params);
967#endif
968
969CDF_STATUS wma_enable_arp_ns_offload(tp_wma_handle wma,
970 tpSirHostOffloadReq pHostOffloadParams,
971 bool bArpOnly);
972
973CDF_STATUS wma_process_add_periodic_tx_ptrn_ind(WMA_HANDLE handle,
974 tSirAddPeriodicTxPtrn *
975 pAddPeriodicTxPtrnParams);
976
977CDF_STATUS wma_process_del_periodic_tx_ptrn_ind(WMA_HANDLE handle,
978 tSirDelPeriodicTxPtrn *
979 pDelPeriodicTxPtrnParams);
980
981#ifdef WLAN_FEATURE_STATS_EXT
982CDF_STATUS wma_stats_ext_req(void *wma_ptr, tpStatsExtRequest preq);
983#endif
984
985CDF_STATUS wma_process_ibss_route_table_update_ind(void *wma_handle,
986 tAniIbssRouteTable *pData);
987
988#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
989int wma_enable_ext_wow(tp_wma_handle wma, tpSirExtWoWParams params);
990
991int wma_set_app_type1_params_in_fw(tp_wma_handle wma,
992 tpSirAppType1Params appType1Params);
993
994int wma_set_app_type2_params_in_fw(tp_wma_handle wma,
995 tpSirAppType2Params appType2Params);
996#endif
997
998#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
999int wma_auto_shutdown_event_handler(void *handle, uint8_t *event,
1000 uint32_t len);
1001
1002CDF_STATUS wma_set_auto_shutdown_timer_req(tp_wma_handle wma_handle,
1003 tSirAutoShutdownCmdParams *
1004 auto_sh_cmd);
1005#endif
1006
1007#ifdef WLAN_FEATURE_NAN
1008
1009CDF_STATUS wma_nan_req(void *wma_ptr, tpNanRequest nan_req);
1010#endif
1011
1012#ifdef DHCP_SERVER_OFFLOAD
1013int wma_process_dhcpserver_offload(tp_wma_handle wma_handle,
1014 tSirDhcpSrvOffloadInfo *
1015 pDhcpSrvOffloadInfo);
1016#endif
1017
1018#ifdef WLAN_FEATURE_GPIO_LED_FLASHING
1019CDF_STATUS wma_set_led_flashing(tp_wma_handle wma_handle,
1020 tSirLedFlashingReq *flashing);
1021#endif
1022
1023#ifdef FEATURE_WLAN_CH_AVOID
1024int wma_channel_avoid_evt_handler(void *handle, uint8_t *event,
1025 uint32_t len);
1026
1027CDF_STATUS wma_process_ch_avoid_update_req(tp_wma_handle wma_handle,
1028 tSirChAvoidUpdateReq *
1029 ch_avoid_update_req);
1030#endif
1031
1032int wma_suspend_target(WMA_HANDLE handle, int disable_target_intr);
1033
1034#ifdef FEATURE_WLAN_TDLS
1035
1036int wma_update_fw_tdls_state(WMA_HANDLE handle, void *pwmaTdlsparams);
1037int wma_update_tdls_peer_state(WMA_HANDLE handle,
1038 tTdlsPeerStateParams *peerStateParams);
1039/**
1040 * wma_set_tdls_offchan_mode() - set tdls off channel mode
1041 * @handle: wma handle
1042 * @chan_switch_params: Pointer to tdls channel switch parameter structure
1043 *
1044 * This function sets tdls off channel mode
1045 *
1046 * Return: 0 on success; negative errno otherwise
1047 */
1048int wma_set_tdls_offchan_mode(WMA_HANDLE wma_handle,
1049 tdls_chan_switch_params *chan_switch_params);
1050#endif
1051
1052struct ieee80211com *wma_dfs_attach(struct ieee80211com *dfs_ic);
1053
1054void wma_dfs_detach(struct ieee80211com *dfs_ic);
1055
1056void wma_dfs_configure(struct ieee80211com *ic);
1057
1058struct ieee80211_channel *wma_dfs_configure_channel(struct ieee80211com *dfs_ic,
1059 wmi_channel *chan,
1060 WLAN_PHY_MODE chanmode,
1061 struct wma_vdev_start_req
1062 *req);
1063void wma_set_sap_keepalive(tp_wma_handle wma, uint8_t vdev_id);
1064
1065#ifdef REMOVE_PKT_LOG
1066static inline void wma_set_wifi_start_packet_stats(void *wma_handle,
1067 struct sir_wifi_start_log *start_log)
1068{
1069 return;
1070}
1071#endif
1072int wma_rssi_breached_event_handler(void *handle,
1073 u_int8_t *cmd_param_info, u_int32_t len);
1074#ifdef WLAN_FEATURE_MEMDUMP
1075int wma_fw_mem_dump_event_handler(void *handle, u_int8_t *cmd_param_info,
1076 u_int32_t len);
1077CDF_STATUS wma_process_fw_mem_dump_req(tp_wma_handle wma,
1078 struct fw_dump_req *mem_dump_req);
1079#else
1080static inline int wma_fw_mem_dump_event_handler(void *handle,
1081 u_int8_t *cmd_param_info, u_int32_t len)
1082{
1083 return 0;
1084}
1085
1086static inline CDF_STATUS wma_process_fw_mem_dump_req(tp_wma_handle wma,
1087 void *mem_dump_req)
1088{
1089 return CDF_STATUS_SUCCESS;
1090}
1091#endif
1092CDF_STATUS wma_process_set_ie_info(tp_wma_handle wma,
1093 struct vdev_ie_info *ie_info);
1094int wma_peer_assoc_conf_handler(void *handle, uint8_t *cmd_param_info,
1095 uint32_t len);
1096
1097#endif