blob: 7c54b4846fdb4799fe0fb39c38b6d3942274725f [file] [log] [blame]
Sourav Mohapatra113685f2018-08-29 14:21:55 +05301/*
Dundi Raviteja3b637092018-09-12 13:42:50 +05302 * Copyright (c) 2012 - 2018 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
51 */
52struct wlan_fwol_coex_config {
53 uint8_t btc_mode;
54 uint8_t antenna_isolation;
55 uint8_t max_tx_power_for_btc;
56 int16_t wlan_low_rssi_threshold;
57 int16_t bt_low_rssi_threshold;
58 int16_t bt_interference_low_ll;
59 int16_t bt_interference_low_ul;
60 int16_t bt_interference_medium_ll;
61 int16_t bt_interference_medium_ul;
62 int16_t bt_interference_high_ll;
63 int16_t bt_interference_high_ul;
64};
65
Manikandan Mohan9045e2e2018-11-26 16:44:19 -080066#define FWOL_THERMAL_LEVEL_MAX 4
67#define FWOL_THERMAL_THROTTLE_LEVEL_MAX 4
Dundi Raviteja47ac7092018-09-07 10:40:28 +053068/*
69 * struct wlan_fwol_thermal_temp - Thermal temperature config items
Manikandan Mohan9045e2e2018-11-26 16:44:19 -080070 * @thermal_temp_min_level: Array of temperature minimum levels
71 * @thermal_temp_max_level: Array of temperature maximum levels
72 * @thermal_mitigation_enable: Control for Thermal mitigation feature
73 * @throttle_period: Thermal throttle period value
74 * @throttle_dutycycle_level: Array of throttle duty cycle levels
Dundi Raviteja47ac7092018-09-07 10:40:28 +053075 */
76struct wlan_fwol_thermal_temp {
Manikandan Mohan9045e2e2018-11-26 16:44:19 -080077 bool thermal_mitigation_enable;
78 uint32_t throttle_period;
79 uint16_t thermal_temp_min_level[FWOL_THERMAL_LEVEL_MAX];
80 uint16_t thermal_temp_max_level[FWOL_THERMAL_LEVEL_MAX];
81 uint32_t throttle_dutycycle_level[FWOL_THERMAL_THROTTLE_LEVEL_MAX];
Dundi Raviteja47ac7092018-09-07 10:40:28 +053082};
83
Dundi Raviteja3b637092018-09-12 13:42:50 +053084/**
Dundi Raviteja85a240a2018-09-10 15:03:07 +053085 * struct wlan_fwol_ie_whitelist - Probe request IE whitelist config items
Dundi Raviteja9ab4e7b2018-09-28 14:18:28 +053086 * @ie_whitelist: IE whitelist flag
87 * @ie_bitmap_0: IE bitmap 0
88 * @ie_bitmap_1: IE bitmap 1
89 * @ie_bitmap_2: IE bitmap 2
90 * @ie_bitmap_3: IE bitmap 3
91 * @ie_bitmap_4: IE bitmap 4
92 * @ie_bitmap_5: IE bitmap 5
93 * @ie_bitmap_6: IE bitmap 6
94 * @ie_bitmap_7: IE bitmap 7
95 * @no_of_probe_req_ouis: Total number of ouis present in probe req
96 * @probe_req_voui: Stores oui values after parsing probe req ouis
Dundi Raviteja85a240a2018-09-10 15:03:07 +053097 */
98struct wlan_fwol_ie_whitelist {
99 bool ie_whitelist;
100 uint32_t ie_bitmap_0;
101 uint32_t ie_bitmap_1;
102 uint32_t ie_bitmap_2;
103 uint32_t ie_bitmap_3;
104 uint32_t ie_bitmap_4;
105 uint32_t ie_bitmap_5;
106 uint32_t ie_bitmap_6;
107 uint32_t ie_bitmap_7;
Dundi Raviteja9ab4e7b2018-09-28 14:18:28 +0530108 uint32_t no_of_probe_req_ouis;
109 uint32_t probe_req_voui[MAX_PROBE_REQ_OUIS];
Dundi Raviteja85a240a2018-09-10 15:03:07 +0530110};
111
112/**
Manikandan Mohan06d38d82018-11-26 18:36:58 -0800113 * struct wlan_fwol_neighbor_report_cfg - Neighbor report config params
114 * @enable_bitmask: Neighbor report offload bitmask control
115 * @params_bitmask: Param validity bitmask
116 * @time_offset: Neighbor report frame time offset
117 * @low_rssi_offset: Low RSSI offset
118 * @bmiss_count_trigger: Beacon miss trigger count
119 * @per_threshold_offset: PER Threshold offset
120 * @cache_timeout: Cache timeout
121 * @max_req_cap: Max request per peer
122 */
123struct wlan_fwol_neighbor_report_cfg {
124 uint32_t enable_bitmask;
125 uint32_t params_bitmask;
126 uint32_t time_offset;
127 uint32_t low_rssi_offset;
128 uint32_t bmiss_count_trigger;
129 uint32_t per_threshold_offset;
130 uint32_t cache_timeout;
131 uint32_t max_req_cap;
132};
133
134/**
Sourav Mohapatra113685f2018-08-29 14:21:55 +0530135 * struct wlan_fwol_cfg - fwol config items
Manikandan Mohan06d38d82018-11-26 18:36:58 -0800136 * @coex_config: coex config items
137 * @thermal_temp_cfg: Thermal temperature related config items
138 * @ie_whitelist_cfg: IE Whitelist related config items
139 * @neighbor_report_cfg: 11K neighbor report config
Sourav Mohapatrad9387d82018-09-07 12:28:52 +0530140 * @ani_enabled: ANI enable/disable
141 * @enable_rts_sifsbursting: Enable RTS SIFS Bursting
142 * @max_mpdus_inampdu: Max number of MPDUS
143 * @arp_ac_category: ARP AC category
144 * @enable_phy_reg_retention: Enable PHY reg retention
145 * @upper_brssi_thresh: Upper BRSSI threshold
146 * @lower_brssi_thresh: Lower BRSSI threshold
147 * @enable_dtim_1chrx: Enable/disable DTIM 1 CHRX
148 * @alternative_chainmask_enabled: Alternate chainmask
Sourav Mohapatra0f3b8572018-09-12 10:03:51 +0530149 * @smart_chainmask_enabled: Enable/disable chainmask
150 * @get_rts_profile: Set the RTS profile
151 * @enable_fw_log_level: Set the FW log level
152 * @enable_fw_log_type: Set the FW log type
lifengfaa83cb2018-11-24 01:53:56 +0800153 * @enable_fw_module_log_level: enable fw module log level
154 * @enable_fw_module_log_level_num: enablefw module log level num
Sourav Mohapatra0f3b8572018-09-12 10:03:51 +0530155 * @is_rate_limit_enabled: Enable/disable RA rate limited
156 * @tsf_gpio_pin: TSF GPIO Pin config
Manikandan Mohand350c192018-11-29 14:01:12 -0800157 * @tsf_ptp_options: TSF Plus feature options config
158 * @lprx_enable: LPRx feature enable config
159 * @sae_enable: SAE feature enable config
160 * @gcmp_enable: GCMP feature enable config
161 * @enable_tx_sch_delay: Enable TX SCH delay value config
162 * @enable_secondary_rate: Enable secondary retry rate config
Sourav Mohapatra0f3b8572018-09-12 10:03:51 +0530163 * @enable_dhcp_server_offload: DHCP Offload is enabled or not
164 * @dhcp_max_num_clients: Max number of DHCP client supported
Sourav Mohapatra113685f2018-08-29 14:21:55 +0530165 */
166struct wlan_fwol_cfg {
Sourav Mohapatrad9387d82018-09-07 12:28:52 +0530167 /* Add CFG and INI items here */
Dundi Raviteja3b637092018-09-12 13:42:50 +0530168 struct wlan_fwol_coex_config coex_config;
Dundi Raviteja47ac7092018-09-07 10:40:28 +0530169 struct wlan_fwol_thermal_temp thermal_temp_cfg;
Dundi Raviteja85a240a2018-09-10 15:03:07 +0530170 struct wlan_fwol_ie_whitelist ie_whitelist_cfg;
Manikandan Mohan06d38d82018-11-26 18:36:58 -0800171 struct wlan_fwol_neighbor_report_cfg neighbor_report_cfg;
Sourav Mohapatrad9387d82018-09-07 12:28:52 +0530172 bool ani_enabled;
173 bool enable_rts_sifsbursting;
174 uint8_t max_mpdus_inampdu;
175 uint32_t arp_ac_category;
176 uint8_t enable_phy_reg_retention;
177 uint16_t upper_brssi_thresh;
178 uint16_t lower_brssi_thresh;
179 bool enable_dtim_1chrx;
180 bool alternative_chainmask_enabled;
Sourav Mohapatra0f3b8572018-09-12 10:03:51 +0530181 bool smart_chainmask_enabled;
182 uint16_t get_rts_profile;
183 uint16_t enable_fw_log_level;
184 uint16_t enable_fw_log_type;
lifengfaa83cb2018-11-24 01:53:56 +0800185 uint8_t enable_fw_module_log_level[FW_MODULE_LOG_LEVEL_STRING_LENGTH];
186 uint8_t enable_fw_module_log_level_num;
Sourav Mohapatra0f3b8572018-09-12 10:03:51 +0530187#ifdef FEATURE_WLAN_RA_FILTERING
188 bool is_rate_limit_enabled;
189#endif
190#ifdef WLAN_FEATURE_TSF
191 uint32_t tsf_gpio_pin;
Manikandan Mohand350c192018-11-29 14:01:12 -0800192#ifdef WLAN_FEATURE_TSF_PLUS
193 uint32_t tsf_ptp_options;
Sourav Mohapatra0f3b8572018-09-12 10:03:51 +0530194#endif
Manikandan Mohand350c192018-11-29 14:01:12 -0800195#endif
196 bool lprx_enable;
197#ifdef WLAN_FEATURE_SAE
198 bool sae_enable;
199#endif
200 bool gcmp_enable;
201 uint8_t enable_tx_sch_delay;
202 uint32_t enable_secondary_rate;
Sourav Mohapatra0f3b8572018-09-12 10:03:51 +0530203#ifdef DHCP_SERVER_OFFLOAD
204 bool enable_dhcp_server_offload;
205 uint32_t dhcp_max_num_clients;
206#endif
Sourav Mohapatra113685f2018-08-29 14:21:55 +0530207};
208
209/**
210 * struct wlan_fwol_psoc_obj - FW offload psoc priv object
211 * @cfg: cfg items
212 */
213struct wlan_fwol_psoc_obj {
214 struct wlan_fwol_cfg cfg;
215};
216
217/**
218 * wlan_psoc_get_fwol_obj() - private API to get fwol object from psoc
219 * @psoc: psoc object
220 *
221 * Return: fwol object
222 */
223struct wlan_fwol_psoc_obj *fwol_get_psoc_obj(struct wlan_objmgr_psoc *psoc);
224
225/*
226 * fwol_cfg_on_psoc_enable() - Populate FWOL structure from CFG and INI
227 * @psoc: pointer to the psoc object
228 *
229 * Populate the FWOL CFG structure from CFG and INI values using CFG APIs
230 *
231 * Return: QDF_STATUS
232 */
233QDF_STATUS fwol_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc);
234
235/*
236 * fwol_cfg_on_psoc_disable() - Clear the CFG structure on psoc disable
237 * @psoc: pointer to the psoc object
238 *
239 * Clear the FWOL CFG structure on psoc disable
240 *
241 * Return: QDF_STATUS
242 */
243QDF_STATUS fwol_cfg_on_psoc_disable(struct wlan_objmgr_psoc *psoc);
Manikandan Mohan06d38d82018-11-26 18:36:58 -0800244
245/*
246 * fwol_init_neighbor_report_cfg() - Populate default neighbor report CFG values
247 * @psoc: pointer to the psoc object
248 * @fwol_neighbor_report_cfg: Pointer to Neighbor report config data structure
249 *
250 * Return: QDF_STATUS
251 */
252QDF_STATUS fwol_init_neighbor_report_cfg(struct wlan_objmgr_psoc *psoc,
253 struct wlan_fwol_neighbor_report_cfg
254 *fwol_neighbor_report_cfg);
Sourav Mohapatra113685f2018-08-29 14:21:55 +0530255#endif