blob: 84bc8eba7eef9bea3128c2e01e4a5110c0e8e36e [file] [log] [blame]
Sourav Mohapatra113685f2018-08-29 14:21:55 +05301/*
Harprit Chhabadad59ae762019-01-08 16:40:43 -08002 * Copyright (c) 2012 - 2019 The Linux Foundation. All rights reserved.
Sourav Mohapatra113685f2018-08-29 14:21:55 +05303 *
4 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18/**
19 * DOC: declare utility API related to the fw_offload component
20 * called by other components
21 */
22
23#ifndef _WLAN_FW_OFFLOAD_MAIN_H_
24#define _WLAN_FW_OFFLOAD_MAIN_H_
25
26#include <wlan_objmgr_psoc_obj.h>
27#include <wlan_objmgr_global_obj.h>
28#include <wlan_cmn.h>
29
Pragaspathi Thilagaraj3cf0f652018-10-29 16:40:35 +053030#include "cfg_ucfg_api.h"
Dundi Raviteja9ab4e7b2018-09-28 14:18:28 +053031
Sourav Mohapatra113685f2018-08-29 14:21:55 +053032#define fwol_alert(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_FWOL, params)
33#define fwol_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_FWOL, params)
34#define fwol_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_FWOL, params)
35#define fwol_info(params...) QDF_TRACE_INFO(QDF_MODULE_ID_FWOL, params)
36#define fwol_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_FWOL, params)
37
38/**
Dundi Raviteja3b637092018-09-12 13:42:50 +053039 * struct wlan_fwol_three_antenna_btc - Three antenna BTC config items
40 * @btc_mode: Config BTC mode
41 * @antenna_isolation: Antenna isolation
42 * @max_tx_power_for_btc: Max wlan tx power in co-ex scenario
43 * @wlan_low_rssi_threshold: Wlan low rssi threshold for BTC mode switching
44 * @bt_low_rssi_threshold: BT low rssi threshold for BTC mode switching
45 * @bt_interference_low_ll: Lower limit of low level BT interference
46 * @bt_interference_low_ul: Upper limit of low level BT interference
47 * @bt_interference_medium_ll: Lower limit of medium level BT interference
48 * @bt_interference_medium_ul: Upper limit of medium level BT interference
49 * @bt_interference_high_ll: Lower limit of high level BT interference
50 * @bt_interference_high_ul: Upper limit of high level BT interference
stonezc9936cb2019-03-11 16:41:22 +080051 * @btc_mpta_helper_enable: Enable/Disable tri-radio MPTA helper
Dundi Raviteja3b637092018-09-12 13:42:50 +053052 */
53struct wlan_fwol_coex_config {
54 uint8_t btc_mode;
55 uint8_t antenna_isolation;
56 uint8_t max_tx_power_for_btc;
57 int16_t wlan_low_rssi_threshold;
58 int16_t bt_low_rssi_threshold;
59 int16_t bt_interference_low_ll;
60 int16_t bt_interference_low_ul;
61 int16_t bt_interference_medium_ll;
62 int16_t bt_interference_medium_ul;
63 int16_t bt_interference_high_ll;
64 int16_t bt_interference_high_ul;
stonezc9936cb2019-03-11 16:41:22 +080065#ifdef FEATURE_MPTA_HELPER
66 bool btc_mpta_helper_enable;
67#endif
Dundi Raviteja3b637092018-09-12 13:42:50 +053068};
69
Manikandan Mohan9045e2e2018-11-26 16:44:19 -080070#define FWOL_THERMAL_LEVEL_MAX 4
71#define FWOL_THERMAL_THROTTLE_LEVEL_MAX 4
Dundi Raviteja47ac7092018-09-07 10:40:28 +053072/*
73 * struct wlan_fwol_thermal_temp - Thermal temperature config items
Manikandan Mohan9045e2e2018-11-26 16:44:19 -080074 * @thermal_temp_min_level: Array of temperature minimum levels
75 * @thermal_temp_max_level: Array of temperature maximum levels
76 * @thermal_mitigation_enable: Control for Thermal mitigation feature
77 * @throttle_period: Thermal throttle period value
78 * @throttle_dutycycle_level: Array of throttle duty cycle levels
Dundi Raviteja47ac7092018-09-07 10:40:28 +053079 */
80struct wlan_fwol_thermal_temp {
Manikandan Mohan9045e2e2018-11-26 16:44:19 -080081 bool thermal_mitigation_enable;
82 uint32_t throttle_period;
83 uint16_t thermal_temp_min_level[FWOL_THERMAL_LEVEL_MAX];
84 uint16_t thermal_temp_max_level[FWOL_THERMAL_LEVEL_MAX];
85 uint32_t throttle_dutycycle_level[FWOL_THERMAL_THROTTLE_LEVEL_MAX];
Dundi Raviteja47ac7092018-09-07 10:40:28 +053086};
87
Dundi Raviteja3b637092018-09-12 13:42:50 +053088/**
Dundi Raviteja85a240a2018-09-10 15:03:07 +053089 * struct wlan_fwol_ie_whitelist - Probe request IE whitelist config items
Dundi Raviteja9ab4e7b2018-09-28 14:18:28 +053090 * @ie_whitelist: IE whitelist flag
91 * @ie_bitmap_0: IE bitmap 0
92 * @ie_bitmap_1: IE bitmap 1
93 * @ie_bitmap_2: IE bitmap 2
94 * @ie_bitmap_3: IE bitmap 3
95 * @ie_bitmap_4: IE bitmap 4
96 * @ie_bitmap_5: IE bitmap 5
97 * @ie_bitmap_6: IE bitmap 6
98 * @ie_bitmap_7: IE bitmap 7
99 * @no_of_probe_req_ouis: Total number of ouis present in probe req
100 * @probe_req_voui: Stores oui values after parsing probe req ouis
Dundi Raviteja85a240a2018-09-10 15:03:07 +0530101 */
102struct wlan_fwol_ie_whitelist {
103 bool ie_whitelist;
104 uint32_t ie_bitmap_0;
105 uint32_t ie_bitmap_1;
106 uint32_t ie_bitmap_2;
107 uint32_t ie_bitmap_3;
108 uint32_t ie_bitmap_4;
109 uint32_t ie_bitmap_5;
110 uint32_t ie_bitmap_6;
111 uint32_t ie_bitmap_7;
Dundi Raviteja9ab4e7b2018-09-28 14:18:28 +0530112 uint32_t no_of_probe_req_ouis;
113 uint32_t probe_req_voui[MAX_PROBE_REQ_OUIS];
Dundi Raviteja85a240a2018-09-10 15:03:07 +0530114};
115
116/**
Manikandan Mohan06d38d82018-11-26 18:36:58 -0800117 * struct wlan_fwol_neighbor_report_cfg - Neighbor report config params
118 * @enable_bitmask: Neighbor report offload bitmask control
119 * @params_bitmask: Param validity bitmask
120 * @time_offset: Neighbor report frame time offset
121 * @low_rssi_offset: Low RSSI offset
122 * @bmiss_count_trigger: Beacon miss trigger count
123 * @per_threshold_offset: PER Threshold offset
124 * @cache_timeout: Cache timeout
125 * @max_req_cap: Max request per peer
126 */
127struct wlan_fwol_neighbor_report_cfg {
128 uint32_t enable_bitmask;
129 uint32_t params_bitmask;
130 uint32_t time_offset;
131 uint32_t low_rssi_offset;
132 uint32_t bmiss_count_trigger;
133 uint32_t per_threshold_offset;
134 uint32_t cache_timeout;
135 uint32_t max_req_cap;
136};
137
138/**
Sourav Mohapatra113685f2018-08-29 14:21:55 +0530139 * struct wlan_fwol_cfg - fwol config items
Manikandan Mohan06d38d82018-11-26 18:36:58 -0800140 * @coex_config: coex config items
141 * @thermal_temp_cfg: Thermal temperature related config items
142 * @ie_whitelist_cfg: IE Whitelist related config items
143 * @neighbor_report_cfg: 11K neighbor report config
Sourav Mohapatrad9387d82018-09-07 12:28:52 +0530144 * @ani_enabled: ANI enable/disable
145 * @enable_rts_sifsbursting: Enable RTS SIFS Bursting
146 * @max_mpdus_inampdu: Max number of MPDUS
147 * @arp_ac_category: ARP AC category
148 * @enable_phy_reg_retention: Enable PHY reg retention
149 * @upper_brssi_thresh: Upper BRSSI threshold
150 * @lower_brssi_thresh: Lower BRSSI threshold
151 * @enable_dtim_1chrx: Enable/disable DTIM 1 CHRX
152 * @alternative_chainmask_enabled: Alternate chainmask
Sourav Mohapatra0f3b8572018-09-12 10:03:51 +0530153 * @smart_chainmask_enabled: Enable/disable chainmask
154 * @get_rts_profile: Set the RTS profile
155 * @enable_fw_log_level: Set the FW log level
156 * @enable_fw_log_type: Set the FW log type
lifengfaa83cb2018-11-24 01:53:56 +0800157 * @enable_fw_module_log_level: enable fw module log level
158 * @enable_fw_module_log_level_num: enablefw module log level num
Sourav Mohapatra0f3b8572018-09-12 10:03:51 +0530159 * @is_rate_limit_enabled: Enable/disable RA rate limited
160 * @tsf_gpio_pin: TSF GPIO Pin config
Manikandan Mohand350c192018-11-29 14:01:12 -0800161 * @tsf_ptp_options: TSF Plus feature options config
162 * @lprx_enable: LPRx feature enable config
163 * @sae_enable: SAE feature enable config
164 * @gcmp_enable: GCMP feature enable config
165 * @enable_tx_sch_delay: Enable TX SCH delay value config
166 * @enable_secondary_rate: Enable secondary retry rate config
Sourav Mohapatra0f3b8572018-09-12 10:03:51 +0530167 * @enable_dhcp_server_offload: DHCP Offload is enabled or not
168 * @dhcp_max_num_clients: Max number of DHCP client supported
Harprit Chhabadad59ae762019-01-08 16:40:43 -0800169 * @dwelltime_params: adaptive dwell time parameters
Sourav Mohapatra113685f2018-08-29 14:21:55 +0530170 */
171struct wlan_fwol_cfg {
Sourav Mohapatrad9387d82018-09-07 12:28:52 +0530172 /* Add CFG and INI items here */
Dundi Raviteja3b637092018-09-12 13:42:50 +0530173 struct wlan_fwol_coex_config coex_config;
Dundi Raviteja47ac7092018-09-07 10:40:28 +0530174 struct wlan_fwol_thermal_temp thermal_temp_cfg;
Dundi Raviteja85a240a2018-09-10 15:03:07 +0530175 struct wlan_fwol_ie_whitelist ie_whitelist_cfg;
Manikandan Mohan06d38d82018-11-26 18:36:58 -0800176 struct wlan_fwol_neighbor_report_cfg neighbor_report_cfg;
Sourav Mohapatrad9387d82018-09-07 12:28:52 +0530177 bool ani_enabled;
178 bool enable_rts_sifsbursting;
179 uint8_t max_mpdus_inampdu;
180 uint32_t arp_ac_category;
181 uint8_t enable_phy_reg_retention;
182 uint16_t upper_brssi_thresh;
183 uint16_t lower_brssi_thresh;
184 bool enable_dtim_1chrx;
185 bool alternative_chainmask_enabled;
Sourav Mohapatra0f3b8572018-09-12 10:03:51 +0530186 bool smart_chainmask_enabled;
187 uint16_t get_rts_profile;
188 uint16_t enable_fw_log_level;
189 uint16_t enable_fw_log_type;
lifengfaa83cb2018-11-24 01:53:56 +0800190 uint8_t enable_fw_module_log_level[FW_MODULE_LOG_LEVEL_STRING_LENGTH];
191 uint8_t enable_fw_module_log_level_num;
Sourav Mohapatra0f3b8572018-09-12 10:03:51 +0530192#ifdef FEATURE_WLAN_RA_FILTERING
193 bool is_rate_limit_enabled;
194#endif
195#ifdef WLAN_FEATURE_TSF
196 uint32_t tsf_gpio_pin;
Manikandan Mohand350c192018-11-29 14:01:12 -0800197#ifdef WLAN_FEATURE_TSF_PLUS
198 uint32_t tsf_ptp_options;
Sourav Mohapatra0f3b8572018-09-12 10:03:51 +0530199#endif
Manikandan Mohand350c192018-11-29 14:01:12 -0800200#endif
201 bool lprx_enable;
202#ifdef WLAN_FEATURE_SAE
203 bool sae_enable;
204#endif
205 bool gcmp_enable;
206 uint8_t enable_tx_sch_delay;
207 uint32_t enable_secondary_rate;
Sourav Mohapatra0f3b8572018-09-12 10:03:51 +0530208#ifdef DHCP_SERVER_OFFLOAD
209 bool enable_dhcp_server_offload;
210 uint32_t dhcp_max_num_clients;
211#endif
Harprit Chhabadad59ae762019-01-08 16:40:43 -0800212 struct adaptive_dwelltime_params dwelltime_params;
Sourav Mohapatra113685f2018-08-29 14:21:55 +0530213};
214
215/**
216 * struct wlan_fwol_psoc_obj - FW offload psoc priv object
217 * @cfg: cfg items
218 */
219struct wlan_fwol_psoc_obj {
220 struct wlan_fwol_cfg cfg;
221};
222
223/**
224 * wlan_psoc_get_fwol_obj() - private API to get fwol object from psoc
225 * @psoc: psoc object
226 *
227 * Return: fwol object
228 */
229struct wlan_fwol_psoc_obj *fwol_get_psoc_obj(struct wlan_objmgr_psoc *psoc);
230
231/*
232 * fwol_cfg_on_psoc_enable() - Populate FWOL structure from CFG and INI
233 * @psoc: pointer to the psoc object
234 *
235 * Populate the FWOL CFG structure from CFG and INI values using CFG APIs
236 *
237 * Return: QDF_STATUS
238 */
239QDF_STATUS fwol_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc);
240
241/*
242 * fwol_cfg_on_psoc_disable() - Clear the CFG structure on psoc disable
243 * @psoc: pointer to the psoc object
244 *
245 * Clear the FWOL CFG structure on psoc disable
246 *
247 * Return: QDF_STATUS
248 */
249QDF_STATUS fwol_cfg_on_psoc_disable(struct wlan_objmgr_psoc *psoc);
Manikandan Mohan06d38d82018-11-26 18:36:58 -0800250
251/*
252 * fwol_init_neighbor_report_cfg() - Populate default neighbor report CFG values
253 * @psoc: pointer to the psoc object
254 * @fwol_neighbor_report_cfg: Pointer to Neighbor report config data structure
255 *
256 * Return: QDF_STATUS
257 */
258QDF_STATUS fwol_init_neighbor_report_cfg(struct wlan_objmgr_psoc *psoc,
259 struct wlan_fwol_neighbor_report_cfg
260 *fwol_neighbor_report_cfg);
Harprit Chhabadad59ae762019-01-08 16:40:43 -0800261
262/**
263 * wlan_fwol_init_adapt_dwelltime_in_cfg - initialize adaptive dwell time params
264 * @psoc: Pointer to struct wlan_objmgr_psoc context
265 * @dwelltime_params: Pointer to dwell time params
266 *
267 * This function parses initialize the adaptive dwell params from ini.
268 *
269 * Return: QDF_STATUS
270 */
271QDF_STATUS
272fwol_init_adapt_dwelltime_in_cfg(
273 struct wlan_objmgr_psoc *psoc,
274 struct adaptive_dwelltime_params *dwelltime_params);
275
276/**
277 * fwol_set_adaptive_dwelltime_config - API to set adaptive dwell params config
278 *
279 * @adaptive_dwelltime_params: adaptive_dwelltime_params structure
280 *
281 * Return: QDF Status
282 */
283QDF_STATUS
284fwol_set_adaptive_dwelltime_config(
285 struct adaptive_dwelltime_params *dwelltime_params);
Sourav Mohapatra113685f2018-08-29 14:21:55 +0530286#endif