blob: ad78989f38ea9e2569d2142e38cf238a3ed13caa [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
2 * Copyright (c) 2012-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_API_H
29#define WMA_API_H
30
31#include "osdep.h"
32#include "cds_mq.h"
33#include "ani_global.h"
34#include "a_types.h"
35#include "wmi_unified.h"
36#ifdef NOT_YET
37#include "htc_api.h"
38#endif
39#include "lim_global.h"
40
41typedef void *WMA_HANDLE;
42
43/**
44 * enum GEN_PARAM - general parameters
45 * @GEN_VDEV_PARAM_AMPDU: Set ampdu size
46 * @GEN_VDEV_PARAM_AMSDU: Set amsdu size
47 * @GEN_PARAM_DUMP_AGC_START: dump agc start
48 * @GEN_PARAM_DUMP_AGC: dump agc
49 * @GEN_PARAM_DUMP_CHANINFO_START: dump channel info start
50 * @GEN_PARAM_DUMP_CHANINFO: dump channel info
51 * @GEN_PARAM_CRASH_INJECT: inject crash
52 * @GEN_PARAM_DUMP_PCIE_ACCESS_LOG: dump pcie access log
53 * @GEN_PARAM_TX_CHAIN_MASK_CCK: cck tx chain mask
54 */
55typedef enum {
56 GEN_VDEV_PARAM_AMPDU = 0x1,
57 GEN_VDEV_PARAM_AMSDU,
58 GEN_PARAM_DUMP_AGC_START,
59 GEN_PARAM_DUMP_AGC,
60 GEN_PARAM_DUMP_CHANINFO_START,
61 GEN_PARAM_DUMP_CHANINFO,
62 GEN_PARAM_DUMP_WATCHDOG,
63 GEN_PARAM_CRASH_INJECT,
64#ifdef CONFIG_ATH_PCIE_ACCESS_DEBUG
65 GEN_PARAM_DUMP_PCIE_ACCESS_LOG,
66#endif
67 GEN_PARAM_MODULATED_DTIM,
68} GEN_PARAM;
69
70#define VDEV_CMD 1
71#define PDEV_CMD 2
72#define GEN_CMD 3
73#define DBG_CMD 4
74#define PPS_CMD 5
75#define QPOWER_CMD 6
76#define GTX_CMD 7
77
78typedef void (*wma_peer_authorized_fp) (uint32_t vdev_id);
79
80
81CDF_STATUS wma_pre_start(void *cds_context);
82
83CDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg);
84
85CDF_STATUS wma_start(void *cds_context);
86
87CDF_STATUS wma_stop(void *cds_context, uint8_t reason);
88
89CDF_STATUS wma_close(void *cds_context);
90
91CDF_STATUS wma_wmi_service_close(void *cds_context);
92
93void wma_rx_ready_event(WMA_HANDLE handle, void *ev);
94
95void wma_rx_service_ready_event(WMA_HANDLE handle, void *ev);
96
97void wma_rx_service_ready_ext_event(WMA_HANDLE handle, void *ev);
98
99void wma_setneedshutdown(void *cds_context);
100
101bool wma_needshutdown(void *cds_context);
102
103CDF_STATUS wma_wait_for_ready_event(WMA_HANDLE handle);
104
105uint8_t wma_map_channel(uint8_t mapChannel);
106
107int wma_cli_get_command(int vdev_id, int param_id, int vpdev);
108int wma_cli_set_command(int vdev_id, int param_id, int sval, int vpdev);
109int wma_cli_set2_command(int vdev_id, int param_id, int sval1,
110 int sval2, int vpdev);
111
112CDF_STATUS wma_set_htconfig(uint8_t vdev_id, uint16_t ht_capab, int value);
113CDF_STATUS wma_set_reg_domain(void *clientCtxt, v_REGDOMAIN_t regId);
114
115CDF_STATUS wma_get_wcnss_software_version(void *p_cds_gctx,
116 uint8_t *pVersion,
117 uint32_t versionBufferSize);
118int wma_bus_suspend(void);
119int wma_suspend_target(WMA_HANDLE handle, int disable_target_intr);
120void wma_target_suspend_acknowledge(void *context);
121int wma_bus_resume(void);
122int wma_resume_target(WMA_HANDLE handle);
123CDF_STATUS wma_disable_wow_in_fw(WMA_HANDLE handle);
124CDF_STATUS wma_disable_d0wow_in_fw(WMA_HANDLE handle);
125int wma_is_wow_mode_selected(WMA_HANDLE handle);
126CDF_STATUS wma_enable_wow_in_fw(WMA_HANDLE handle);
127CDF_STATUS wma_enable_d0wow_in_fw(WMA_HANDLE handle);
128bool wma_check_scan_in_progress(WMA_HANDLE handle);
129void wma_set_peer_authorized_cb(void *wma_ctx, wma_peer_authorized_fp auth_cb);
130int wma_set_peer_param(void *wma_ctx, uint8_t *peer_addr, uint32_t param_id,
131 uint32_t param_value, uint32_t vdev_id);
132#ifdef NOT_YET
133CDF_STATUS wma_update_channel_list(WMA_HANDLE handle, void *scan_chan_info);
134#endif
135
136uint8_t *wma_get_vdev_address_by_vdev_id(uint8_t vdev_id);
137struct wma_txrx_node *wma_get_interface_by_vdev_id(uint8_t vdev_id);
138bool wma_is_vdev_up(uint8_t vdev_id);
139
140void *wma_get_beacon_buffer_by_vdev_id(uint8_t vdev_id, uint32_t *buffer_size);
141
142uint8_t wma_get_fw_wlan_feat_caps(uint8_t featEnumValue);
143tSirRetStatus wma_post_ctrl_msg(tpAniSirGlobal pMac, tSirMsgQ *pMsg);
144
145void wma_enable_disable_wakeup_event(WMA_HANDLE handle,
146 uint32_t vdev_id,
147 uint32_t bitmap,
148 bool enable);
149void wma_register_wow_wakeup_events(WMA_HANDLE handle, uint8_t vdev_id,
150 uint8_t vdev_type, uint8_t sub_type);
151void wma_register_wow_default_patterns(WMA_HANDLE handle, uint8_t vdev_id);
152int8_t wma_get_hw_mode_idx_from_dbs_hw_list(enum hw_mode_ss_config mac0_ss,
153 enum hw_mode_bandwidth mac0_bw,
154 enum hw_mode_ss_config mac1_ss,
155 enum hw_mode_bandwidth mac1_bw,
156 enum hw_mode_dbs_capab dbs,
157 enum hw_mode_agile_dfs_capab dfs);
158CDF_STATUS wma_get_hw_mode_from_idx(uint32_t idx,
159 struct sir_hw_mode_params *hw_mode);
160int8_t wma_get_num_dbs_hw_modes(void);
161bool wma_is_hw_dbs_capable(void);
162bool wma_is_hw_agile_dfs_capable(void);
163int8_t wma_get_mac_id_of_vdev(uint32_t vdev_id);
164void wma_update_intf_hw_mode_params(uint32_t vdev_id, uint32_t mac_id,
165 uint32_t cfgd_hw_mode_index);
166CDF_STATUS wma_get_old_and_new_hw_index(uint32_t *old_hw_mode_index,
167 uint32_t *new_hw_mode_index);
168void wma_set_dbs_capability_ut(uint32_t dbs);
169CDF_STATUS wma_get_dbs_hw_modes(bool *one_by_one_dbs, bool *two_by_two_dbs);
170CDF_STATUS wma_get_current_hw_mode(struct sir_hw_mode_params *hw_mode);
171bool wma_is_dbs_enable(void);
172bool wma_is_agile_dfs_enable(void);
173CDF_STATUS wma_get_updated_scan_config(uint32_t *scan_config,
174 bool dbs_scan,
175 bool dbs_plus_agile_scan,
176 bool single_mac_scan_with_dfs);
177CDF_STATUS wma_get_updated_fw_mode_config(uint32_t *fw_mode_config,
178 bool dbs,
179 bool agile_dfs);
180bool wma_get_dbs_scan_config(void);
181bool wma_get_dbs_plus_agile_scan_config(void);
182bool wma_get_single_mac_scan_with_dfs_config(void);
183bool wma_get_dbs_config(void);
184bool wma_get_agile_dfs_config(void);
185bool wma_is_dual_mac_disabled_in_ini(void);
186bool wma_get_prev_dbs_config(void);
187bool wma_get_prev_agile_dfs_config(void);
188bool wma_get_prev_dbs_scan_config(void);
189bool wma_get_prev_dbs_plus_agile_scan_config(void);
190bool wma_get_prev_single_mac_scan_with_dfs_config(void);
191
192#define LRO_IPV4_SEED_ARR_SZ 5
193#define LRO_IPV6_SEED_ARR_SZ 11
194
195/**
196 * struct wma_lro_init_cmd_t - set LRO init parameters
197 * @lro_enable: indicates whether lro is enabled
198 * @tcp_flag: If the TCP flags from the packet do not match
199 * the values in this field after masking with TCP flags mask
200 * below, packet is not LRO eligible
201 * @tcp_flag_mask: field for comparing the TCP values provided
202 * above with the TCP flags field in the received packet
203 * @toeplitz_hash_ipv4: contains seed needed to compute the flow id
204 * 5-tuple toeplitz hash for ipv4 packets
205 * @toeplitz_hash_ipv6: contains seed needed to compute the flow id
206 * 5-tuple toeplitz hash for ipv6 packets
207 */
208struct wma_lro_config_cmd_t {
209 uint32_t lro_enable;
210 uint32_t tcp_flag:9,
211 tcp_flag_mask:9;
212 uint32_t toeplitz_hash_ipv4[LRO_IPV4_SEED_ARR_SZ];
213 uint32_t toeplitz_hash_ipv6[LRO_IPV6_SEED_ARR_SZ];
214};
215
216#if defined(FEATURE_LRO)
217int wma_lro_init(struct wma_lro_config_cmd_t *lro_config);
218#endif
219bool wma_is_scan_simultaneous_capable(void);
220#endif