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