blob: 62351e0a47e85d9092e4b2365c34a63c49cb4c99 [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
Dundi Raviteja9ab4e7b2018-09-28 14:18:28 +053030#include "cfg_ie_whitelist.h"
31
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
Dundi Raviteja47ac7092018-09-07 10:40:28 +053066/*
67 * struct wlan_fwol_thermal_temp - Thermal temperature config items
Dundi Raviteja9ab4e7b2018-09-28 14:18:28 +053068 * @thermal_temp_min_level0: Thermal temperature minimum level 0
69 * @thermal_temp_max_level0: Thermal temperature maximum level 0
70 * @thermal_temp_min_level1: Thermal temperature minimum level 1
71 * @thermal_temp_max_level1: Thermal temperature maximum level 1
72 * @thermal_temp_min_level2: Thermal temperature minimum level 2
73 * @thermal_temp_max_level2: Thermal temperature maximum level 2
74 * @thermal_temp_min_level3: Thermal temperature minimum level 3
75 * @thermal_temp_max_level3: Thermal temperature maximum level 3
Dundi Raviteja47ac7092018-09-07 10:40:28 +053076 */
77struct wlan_fwol_thermal_temp {
78 uint16_t thermal_temp_min_level0;
79 uint16_t thermal_temp_max_level0;
80 uint16_t thermal_temp_min_level1;
81 uint16_t thermal_temp_max_level1;
82 uint16_t thermal_temp_min_level2;
83 uint16_t thermal_temp_max_level2;
84 uint16_t thermal_temp_min_level3;
85 uint16_t thermal_temp_max_level3;
86};
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/**
Sourav Mohapatra113685f2018-08-29 14:21:55 +0530117 * struct wlan_fwol_cfg - fwol config items
Dundi Raviteja3b637092018-09-12 13:42:50 +0530118 * coex_config: coex config items
Dundi Raviteja47ac7092018-09-07 10:40:28 +0530119 * thermal_temp_cfg: Thermal temperature related config items
Dundi Raviteja85a240a2018-09-10 15:03:07 +0530120 * ie_whitelist_cfg: IE Whitelist related config items
Sourav Mohapatrad9387d82018-09-07 12:28:52 +0530121 * @ani_enabled: ANI enable/disable
122 * @enable_rts_sifsbursting: Enable RTS SIFS Bursting
123 * @max_mpdus_inampdu: Max number of MPDUS
124 * @arp_ac_category: ARP AC category
125 * @enable_phy_reg_retention: Enable PHY reg retention
126 * @upper_brssi_thresh: Upper BRSSI threshold
127 * @lower_brssi_thresh: Lower BRSSI threshold
128 * @enable_dtim_1chrx: Enable/disable DTIM 1 CHRX
129 * @alternative_chainmask_enabled: Alternate chainmask
Sourav Mohapatra0f3b8572018-09-12 10:03:51 +0530130 * @smart_chainmask_enabled: Enable/disable chainmask
131 * @get_rts_profile: Set the RTS profile
132 * @enable_fw_log_level: Set the FW log level
133 * @enable_fw_log_type: Set the FW log type
134 * @is_rate_limit_enabled: Enable/disable RA rate limited
135 * @tsf_gpio_pin: TSF GPIO Pin config
136 * @enable_dhcp_server_offload: DHCP Offload is enabled or not
137 * @dhcp_max_num_clients: Max number of DHCP client supported
Sourav Mohapatra113685f2018-08-29 14:21:55 +0530138 */
139struct wlan_fwol_cfg {
Sourav Mohapatrad9387d82018-09-07 12:28:52 +0530140 /* Add CFG and INI items here */
Dundi Raviteja3b637092018-09-12 13:42:50 +0530141 struct wlan_fwol_coex_config coex_config;
Dundi Raviteja47ac7092018-09-07 10:40:28 +0530142 struct wlan_fwol_thermal_temp thermal_temp_cfg;
Dundi Raviteja85a240a2018-09-10 15:03:07 +0530143 struct wlan_fwol_ie_whitelist ie_whitelist_cfg;
Sourav Mohapatrad9387d82018-09-07 12:28:52 +0530144 bool ani_enabled;
145 bool enable_rts_sifsbursting;
146 uint8_t max_mpdus_inampdu;
147 uint32_t arp_ac_category;
148 uint8_t enable_phy_reg_retention;
149 uint16_t upper_brssi_thresh;
150 uint16_t lower_brssi_thresh;
151 bool enable_dtim_1chrx;
152 bool alternative_chainmask_enabled;
Sourav Mohapatra0f3b8572018-09-12 10:03:51 +0530153 bool smart_chainmask_enabled;
154 uint16_t get_rts_profile;
155 uint16_t enable_fw_log_level;
156 uint16_t enable_fw_log_type;
157#ifdef FEATURE_WLAN_RA_FILTERING
158 bool is_rate_limit_enabled;
159#endif
160#ifdef WLAN_FEATURE_TSF
161 uint32_t tsf_gpio_pin;
162#endif
163#ifdef DHCP_SERVER_OFFLOAD
164 bool enable_dhcp_server_offload;
165 uint32_t dhcp_max_num_clients;
166#endif
Sourav Mohapatra113685f2018-08-29 14:21:55 +0530167};
168
169/**
170 * struct wlan_fwol_psoc_obj - FW offload psoc priv object
171 * @cfg: cfg items
172 */
173struct wlan_fwol_psoc_obj {
174 struct wlan_fwol_cfg cfg;
175};
176
177/**
178 * wlan_psoc_get_fwol_obj() - private API to get fwol object from psoc
179 * @psoc: psoc object
180 *
181 * Return: fwol object
182 */
183struct wlan_fwol_psoc_obj *fwol_get_psoc_obj(struct wlan_objmgr_psoc *psoc);
184
185/*
186 * fwol_cfg_on_psoc_enable() - Populate FWOL structure from CFG and INI
187 * @psoc: pointer to the psoc object
188 *
189 * Populate the FWOL CFG structure from CFG and INI values using CFG APIs
190 *
191 * Return: QDF_STATUS
192 */
193QDF_STATUS fwol_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc);
194
195/*
196 * fwol_cfg_on_psoc_disable() - Clear the CFG structure on psoc disable
197 * @psoc: pointer to the psoc object
198 *
199 * Clear the FWOL CFG structure on psoc disable
200 *
201 * Return: QDF_STATUS
202 */
203QDF_STATUS fwol_cfg_on_psoc_disable(struct wlan_objmgr_psoc *psoc);
204#endif