Sourav Mohapatra | 113685f | 2018-08-29 14:21:55 +0530 | [diff] [blame] | 1 | /* |
Harprit Chhabada | d59ae76 | 2019-01-08 16:40:43 -0800 | [diff] [blame^] | 2 | * Copyright (c) 2012 - 2019 The Linux Foundation. All rights reserved. |
Sourav Mohapatra | 113685f | 2018-08-29 14:21:55 +0530 | [diff] [blame] | 3 | * |
| 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 Thilagaraj | 3cf0f65 | 2018-10-29 16:40:35 +0530 | [diff] [blame] | 30 | #include "cfg_ucfg_api.h" |
Dundi Raviteja | 9ab4e7b | 2018-09-28 14:18:28 +0530 | [diff] [blame] | 31 | |
Sourav Mohapatra | 113685f | 2018-08-29 14:21:55 +0530 | [diff] [blame] | 32 | #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 Raviteja | 3b63709 | 2018-09-12 13:42:50 +0530 | [diff] [blame] | 39 | * 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 | */ |
| 52 | struct 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 Mohan | 9045e2e | 2018-11-26 16:44:19 -0800 | [diff] [blame] | 66 | #define FWOL_THERMAL_LEVEL_MAX 4 |
| 67 | #define FWOL_THERMAL_THROTTLE_LEVEL_MAX 4 |
Dundi Raviteja | 47ac709 | 2018-09-07 10:40:28 +0530 | [diff] [blame] | 68 | /* |
| 69 | * struct wlan_fwol_thermal_temp - Thermal temperature config items |
Manikandan Mohan | 9045e2e | 2018-11-26 16:44:19 -0800 | [diff] [blame] | 70 | * @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 Raviteja | 47ac709 | 2018-09-07 10:40:28 +0530 | [diff] [blame] | 75 | */ |
| 76 | struct wlan_fwol_thermal_temp { |
Manikandan Mohan | 9045e2e | 2018-11-26 16:44:19 -0800 | [diff] [blame] | 77 | 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 Raviteja | 47ac709 | 2018-09-07 10:40:28 +0530 | [diff] [blame] | 82 | }; |
| 83 | |
Dundi Raviteja | 3b63709 | 2018-09-12 13:42:50 +0530 | [diff] [blame] | 84 | /** |
Dundi Raviteja | 85a240a | 2018-09-10 15:03:07 +0530 | [diff] [blame] | 85 | * struct wlan_fwol_ie_whitelist - Probe request IE whitelist config items |
Dundi Raviteja | 9ab4e7b | 2018-09-28 14:18:28 +0530 | [diff] [blame] | 86 | * @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 Raviteja | 85a240a | 2018-09-10 15:03:07 +0530 | [diff] [blame] | 97 | */ |
| 98 | struct 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 Raviteja | 9ab4e7b | 2018-09-28 14:18:28 +0530 | [diff] [blame] | 108 | uint32_t no_of_probe_req_ouis; |
| 109 | uint32_t probe_req_voui[MAX_PROBE_REQ_OUIS]; |
Dundi Raviteja | 85a240a | 2018-09-10 15:03:07 +0530 | [diff] [blame] | 110 | }; |
| 111 | |
| 112 | /** |
Manikandan Mohan | 06d38d8 | 2018-11-26 18:36:58 -0800 | [diff] [blame] | 113 | * 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 | */ |
| 123 | struct 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 Mohapatra | 113685f | 2018-08-29 14:21:55 +0530 | [diff] [blame] | 135 | * struct wlan_fwol_cfg - fwol config items |
Manikandan Mohan | 06d38d8 | 2018-11-26 18:36:58 -0800 | [diff] [blame] | 136 | * @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 Mohapatra | d9387d8 | 2018-09-07 12:28:52 +0530 | [diff] [blame] | 140 | * @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 Mohapatra | 0f3b857 | 2018-09-12 10:03:51 +0530 | [diff] [blame] | 149 | * @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 |
lifeng | faa83cb | 2018-11-24 01:53:56 +0800 | [diff] [blame] | 153 | * @enable_fw_module_log_level: enable fw module log level |
| 154 | * @enable_fw_module_log_level_num: enablefw module log level num |
Sourav Mohapatra | 0f3b857 | 2018-09-12 10:03:51 +0530 | [diff] [blame] | 155 | * @is_rate_limit_enabled: Enable/disable RA rate limited |
| 156 | * @tsf_gpio_pin: TSF GPIO Pin config |
Manikandan Mohan | d350c19 | 2018-11-29 14:01:12 -0800 | [diff] [blame] | 157 | * @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 Mohapatra | 0f3b857 | 2018-09-12 10:03:51 +0530 | [diff] [blame] | 163 | * @enable_dhcp_server_offload: DHCP Offload is enabled or not |
| 164 | * @dhcp_max_num_clients: Max number of DHCP client supported |
Harprit Chhabada | d59ae76 | 2019-01-08 16:40:43 -0800 | [diff] [blame^] | 165 | * @dwelltime_params: adaptive dwell time parameters |
Sourav Mohapatra | 113685f | 2018-08-29 14:21:55 +0530 | [diff] [blame] | 166 | */ |
| 167 | struct wlan_fwol_cfg { |
Sourav Mohapatra | d9387d8 | 2018-09-07 12:28:52 +0530 | [diff] [blame] | 168 | /* Add CFG and INI items here */ |
Dundi Raviteja | 3b63709 | 2018-09-12 13:42:50 +0530 | [diff] [blame] | 169 | struct wlan_fwol_coex_config coex_config; |
Dundi Raviteja | 47ac709 | 2018-09-07 10:40:28 +0530 | [diff] [blame] | 170 | struct wlan_fwol_thermal_temp thermal_temp_cfg; |
Dundi Raviteja | 85a240a | 2018-09-10 15:03:07 +0530 | [diff] [blame] | 171 | struct wlan_fwol_ie_whitelist ie_whitelist_cfg; |
Manikandan Mohan | 06d38d8 | 2018-11-26 18:36:58 -0800 | [diff] [blame] | 172 | struct wlan_fwol_neighbor_report_cfg neighbor_report_cfg; |
Sourav Mohapatra | d9387d8 | 2018-09-07 12:28:52 +0530 | [diff] [blame] | 173 | bool ani_enabled; |
| 174 | bool enable_rts_sifsbursting; |
| 175 | uint8_t max_mpdus_inampdu; |
| 176 | uint32_t arp_ac_category; |
| 177 | uint8_t enable_phy_reg_retention; |
| 178 | uint16_t upper_brssi_thresh; |
| 179 | uint16_t lower_brssi_thresh; |
| 180 | bool enable_dtim_1chrx; |
| 181 | bool alternative_chainmask_enabled; |
Sourav Mohapatra | 0f3b857 | 2018-09-12 10:03:51 +0530 | [diff] [blame] | 182 | bool smart_chainmask_enabled; |
| 183 | uint16_t get_rts_profile; |
| 184 | uint16_t enable_fw_log_level; |
| 185 | uint16_t enable_fw_log_type; |
lifeng | faa83cb | 2018-11-24 01:53:56 +0800 | [diff] [blame] | 186 | uint8_t enable_fw_module_log_level[FW_MODULE_LOG_LEVEL_STRING_LENGTH]; |
| 187 | uint8_t enable_fw_module_log_level_num; |
Sourav Mohapatra | 0f3b857 | 2018-09-12 10:03:51 +0530 | [diff] [blame] | 188 | #ifdef FEATURE_WLAN_RA_FILTERING |
| 189 | bool is_rate_limit_enabled; |
| 190 | #endif |
| 191 | #ifdef WLAN_FEATURE_TSF |
| 192 | uint32_t tsf_gpio_pin; |
Manikandan Mohan | d350c19 | 2018-11-29 14:01:12 -0800 | [diff] [blame] | 193 | #ifdef WLAN_FEATURE_TSF_PLUS |
| 194 | uint32_t tsf_ptp_options; |
Sourav Mohapatra | 0f3b857 | 2018-09-12 10:03:51 +0530 | [diff] [blame] | 195 | #endif |
Manikandan Mohan | d350c19 | 2018-11-29 14:01:12 -0800 | [diff] [blame] | 196 | #endif |
| 197 | bool lprx_enable; |
| 198 | #ifdef WLAN_FEATURE_SAE |
| 199 | bool sae_enable; |
| 200 | #endif |
| 201 | bool gcmp_enable; |
| 202 | uint8_t enable_tx_sch_delay; |
| 203 | uint32_t enable_secondary_rate; |
Sourav Mohapatra | 0f3b857 | 2018-09-12 10:03:51 +0530 | [diff] [blame] | 204 | #ifdef DHCP_SERVER_OFFLOAD |
| 205 | bool enable_dhcp_server_offload; |
| 206 | uint32_t dhcp_max_num_clients; |
| 207 | #endif |
Harprit Chhabada | d59ae76 | 2019-01-08 16:40:43 -0800 | [diff] [blame^] | 208 | struct adaptive_dwelltime_params dwelltime_params; |
Sourav Mohapatra | 113685f | 2018-08-29 14:21:55 +0530 | [diff] [blame] | 209 | }; |
| 210 | |
| 211 | /** |
| 212 | * struct wlan_fwol_psoc_obj - FW offload psoc priv object |
| 213 | * @cfg: cfg items |
| 214 | */ |
| 215 | struct wlan_fwol_psoc_obj { |
| 216 | struct wlan_fwol_cfg cfg; |
| 217 | }; |
| 218 | |
| 219 | /** |
| 220 | * wlan_psoc_get_fwol_obj() - private API to get fwol object from psoc |
| 221 | * @psoc: psoc object |
| 222 | * |
| 223 | * Return: fwol object |
| 224 | */ |
| 225 | struct wlan_fwol_psoc_obj *fwol_get_psoc_obj(struct wlan_objmgr_psoc *psoc); |
| 226 | |
| 227 | /* |
| 228 | * fwol_cfg_on_psoc_enable() - Populate FWOL structure from CFG and INI |
| 229 | * @psoc: pointer to the psoc object |
| 230 | * |
| 231 | * Populate the FWOL CFG structure from CFG and INI values using CFG APIs |
| 232 | * |
| 233 | * Return: QDF_STATUS |
| 234 | */ |
| 235 | QDF_STATUS fwol_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc); |
| 236 | |
| 237 | /* |
| 238 | * fwol_cfg_on_psoc_disable() - Clear the CFG structure on psoc disable |
| 239 | * @psoc: pointer to the psoc object |
| 240 | * |
| 241 | * Clear the FWOL CFG structure on psoc disable |
| 242 | * |
| 243 | * Return: QDF_STATUS |
| 244 | */ |
| 245 | QDF_STATUS fwol_cfg_on_psoc_disable(struct wlan_objmgr_psoc *psoc); |
Manikandan Mohan | 06d38d8 | 2018-11-26 18:36:58 -0800 | [diff] [blame] | 246 | |
| 247 | /* |
| 248 | * fwol_init_neighbor_report_cfg() - Populate default neighbor report CFG values |
| 249 | * @psoc: pointer to the psoc object |
| 250 | * @fwol_neighbor_report_cfg: Pointer to Neighbor report config data structure |
| 251 | * |
| 252 | * Return: QDF_STATUS |
| 253 | */ |
| 254 | QDF_STATUS fwol_init_neighbor_report_cfg(struct wlan_objmgr_psoc *psoc, |
| 255 | struct wlan_fwol_neighbor_report_cfg |
| 256 | *fwol_neighbor_report_cfg); |
Harprit Chhabada | d59ae76 | 2019-01-08 16:40:43 -0800 | [diff] [blame^] | 257 | |
| 258 | /** |
| 259 | * wlan_fwol_init_adapt_dwelltime_in_cfg - initialize adaptive dwell time params |
| 260 | * @psoc: Pointer to struct wlan_objmgr_psoc context |
| 261 | * @dwelltime_params: Pointer to dwell time params |
| 262 | * |
| 263 | * This function parses initialize the adaptive dwell params from ini. |
| 264 | * |
| 265 | * Return: QDF_STATUS |
| 266 | */ |
| 267 | QDF_STATUS |
| 268 | fwol_init_adapt_dwelltime_in_cfg( |
| 269 | struct wlan_objmgr_psoc *psoc, |
| 270 | struct adaptive_dwelltime_params *dwelltime_params); |
| 271 | |
| 272 | /** |
| 273 | * fwol_set_adaptive_dwelltime_config - API to set adaptive dwell params config |
| 274 | * |
| 275 | * @adaptive_dwelltime_params: adaptive_dwelltime_params structure |
| 276 | * |
| 277 | * Return: QDF Status |
| 278 | */ |
| 279 | QDF_STATUS |
| 280 | fwol_set_adaptive_dwelltime_config( |
| 281 | struct adaptive_dwelltime_params *dwelltime_params); |
Sourav Mohapatra | 113685f | 2018-08-29 14:21:55 +0530 | [diff] [blame] | 282 | #endif |