Sourav Mohapatra | 113685f | 2018-08-29 14:21:55 +0530 | [diff] [blame] | 1 | /* |
Dundi Raviteja | 3b63709 | 2018-09-12 13:42:50 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012 - 2018 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 | |
| 30 | #define fwol_alert(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_FWOL, params) |
| 31 | #define fwol_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_FWOL, params) |
| 32 | #define fwol_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_FWOL, params) |
| 33 | #define fwol_info(params...) QDF_TRACE_INFO(QDF_MODULE_ID_FWOL, params) |
| 34 | #define fwol_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_FWOL, params) |
| 35 | |
| 36 | /** |
Dundi Raviteja | 3b63709 | 2018-09-12 13:42:50 +0530 | [diff] [blame] | 37 | * struct wlan_fwol_three_antenna_btc - Three antenna BTC config items |
| 38 | * @btc_mode: Config BTC mode |
| 39 | * @antenna_isolation: Antenna isolation |
| 40 | * @max_tx_power_for_btc: Max wlan tx power in co-ex scenario |
| 41 | * @wlan_low_rssi_threshold: Wlan low rssi threshold for BTC mode switching |
| 42 | * @bt_low_rssi_threshold: BT low rssi threshold for BTC mode switching |
| 43 | * @bt_interference_low_ll: Lower limit of low level BT interference |
| 44 | * @bt_interference_low_ul: Upper limit of low level BT interference |
| 45 | * @bt_interference_medium_ll: Lower limit of medium level BT interference |
| 46 | * @bt_interference_medium_ul: Upper limit of medium level BT interference |
| 47 | * @bt_interference_high_ll: Lower limit of high level BT interference |
| 48 | * @bt_interference_high_ul: Upper limit of high level BT interference |
| 49 | */ |
| 50 | struct wlan_fwol_coex_config { |
| 51 | uint8_t btc_mode; |
| 52 | uint8_t antenna_isolation; |
| 53 | uint8_t max_tx_power_for_btc; |
| 54 | int16_t wlan_low_rssi_threshold; |
| 55 | int16_t bt_low_rssi_threshold; |
| 56 | int16_t bt_interference_low_ll; |
| 57 | int16_t bt_interference_low_ul; |
| 58 | int16_t bt_interference_medium_ll; |
| 59 | int16_t bt_interference_medium_ul; |
| 60 | int16_t bt_interference_high_ll; |
| 61 | int16_t bt_interference_high_ul; |
| 62 | }; |
| 63 | |
Dundi Raviteja | 47ac709 | 2018-09-07 10:40:28 +0530 | [diff] [blame] | 64 | /* |
| 65 | * struct wlan_fwol_thermal_temp - Thermal temperature config items |
| 66 | * thermal_temp_min_level0: Thermal temperature minimum level 0 |
| 67 | * thermal_temp_max_level0: Thermal temperature maximum level 0 |
| 68 | * thermal_temp_min_level1: Thermal temperature minimum level 1 |
| 69 | * thermal_temp_max_level1: Thermal temperature maximum level 1 |
| 70 | * thermal_temp_min_level2: Thermal temperature minimum level 2 |
| 71 | * thermal_temp_max_level2: Thermal temperature maximum level 2 |
| 72 | * thermal_temp_min_level3: Thermal temperature minimum level 3 |
| 73 | * thermal_temp_max_level3: Thermal temperature maximum level 3 |
| 74 | */ |
| 75 | struct wlan_fwol_thermal_temp { |
| 76 | uint16_t thermal_temp_min_level0; |
| 77 | uint16_t thermal_temp_max_level0; |
| 78 | uint16_t thermal_temp_min_level1; |
| 79 | uint16_t thermal_temp_max_level1; |
| 80 | uint16_t thermal_temp_min_level2; |
| 81 | uint16_t thermal_temp_max_level2; |
| 82 | uint16_t thermal_temp_min_level3; |
| 83 | uint16_t thermal_temp_max_level3; |
| 84 | }; |
| 85 | |
Dundi Raviteja | 3b63709 | 2018-09-12 13:42:50 +0530 | [diff] [blame] | 86 | /** |
Dundi Raviteja | 85a240a | 2018-09-10 15:03:07 +0530 | [diff] [blame] | 87 | * struct wlan_fwol_ie_whitelist - Probe request IE whitelist config items |
| 88 | * ie_whitelist: IE whitelist flag |
| 89 | * ie_bitmap_0: IE bitmap 0 |
| 90 | * ie_bitmap_1: IE bitmap 1 |
| 91 | * ie_bitmap_2: IE bitmap 2 |
| 92 | * ie_bitmap_3: IE bitmap 3 |
| 93 | * ie_bitmap_4: IE bitmap 4 |
| 94 | * ie_bitmap_5: IE bitmap 5 |
| 95 | * ie_bitmap_6: IE bitmap 6 |
| 96 | * ie_bitmap_7: IE bitmap 7 |
| 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; |
| 108 | }; |
| 109 | |
| 110 | /** |
Sourav Mohapatra | 113685f | 2018-08-29 14:21:55 +0530 | [diff] [blame] | 111 | * struct wlan_fwol_cfg - fwol config items |
Dundi Raviteja | 3b63709 | 2018-09-12 13:42:50 +0530 | [diff] [blame] | 112 | * coex_config: coex config items |
Dundi Raviteja | 47ac709 | 2018-09-07 10:40:28 +0530 | [diff] [blame] | 113 | * thermal_temp_cfg: Thermal temperature related config items |
Dundi Raviteja | 85a240a | 2018-09-10 15:03:07 +0530 | [diff] [blame] | 114 | * ie_whitelist_cfg: IE Whitelist related config items |
Sourav Mohapatra | d9387d8 | 2018-09-07 12:28:52 +0530 | [diff] [blame^] | 115 | * @ani_enabled: ANI enable/disable |
| 116 | * @enable_rts_sifsbursting: Enable RTS SIFS Bursting |
| 117 | * @max_mpdus_inampdu: Max number of MPDUS |
| 118 | * @arp_ac_category: ARP AC category |
| 119 | * @enable_phy_reg_retention: Enable PHY reg retention |
| 120 | * @upper_brssi_thresh: Upper BRSSI threshold |
| 121 | * @lower_brssi_thresh: Lower BRSSI threshold |
| 122 | * @enable_dtim_1chrx: Enable/disable DTIM 1 CHRX |
| 123 | * @alternative_chainmask_enabled: Alternate chainmask |
Sourav Mohapatra | 113685f | 2018-08-29 14:21:55 +0530 | [diff] [blame] | 124 | */ |
| 125 | struct wlan_fwol_cfg { |
Sourav Mohapatra | d9387d8 | 2018-09-07 12:28:52 +0530 | [diff] [blame^] | 126 | /* Add CFG and INI items here */ |
Dundi Raviteja | 3b63709 | 2018-09-12 13:42:50 +0530 | [diff] [blame] | 127 | struct wlan_fwol_coex_config coex_config; |
Dundi Raviteja | 47ac709 | 2018-09-07 10:40:28 +0530 | [diff] [blame] | 128 | struct wlan_fwol_thermal_temp thermal_temp_cfg; |
Dundi Raviteja | 85a240a | 2018-09-10 15:03:07 +0530 | [diff] [blame] | 129 | struct wlan_fwol_ie_whitelist ie_whitelist_cfg; |
Sourav Mohapatra | d9387d8 | 2018-09-07 12:28:52 +0530 | [diff] [blame^] | 130 | bool ani_enabled; |
| 131 | bool enable_rts_sifsbursting; |
| 132 | uint8_t max_mpdus_inampdu; |
| 133 | uint32_t arp_ac_category; |
| 134 | uint8_t enable_phy_reg_retention; |
| 135 | uint16_t upper_brssi_thresh; |
| 136 | uint16_t lower_brssi_thresh; |
| 137 | bool enable_dtim_1chrx; |
| 138 | bool alternative_chainmask_enabled; |
Sourav Mohapatra | 113685f | 2018-08-29 14:21:55 +0530 | [diff] [blame] | 139 | }; |
| 140 | |
| 141 | /** |
| 142 | * struct wlan_fwol_psoc_obj - FW offload psoc priv object |
| 143 | * @cfg: cfg items |
| 144 | */ |
| 145 | struct wlan_fwol_psoc_obj { |
| 146 | struct wlan_fwol_cfg cfg; |
| 147 | }; |
| 148 | |
| 149 | /** |
| 150 | * wlan_psoc_get_fwol_obj() - private API to get fwol object from psoc |
| 151 | * @psoc: psoc object |
| 152 | * |
| 153 | * Return: fwol object |
| 154 | */ |
| 155 | struct wlan_fwol_psoc_obj *fwol_get_psoc_obj(struct wlan_objmgr_psoc *psoc); |
| 156 | |
| 157 | /* |
| 158 | * fwol_cfg_on_psoc_enable() - Populate FWOL structure from CFG and INI |
| 159 | * @psoc: pointer to the psoc object |
| 160 | * |
| 161 | * Populate the FWOL CFG structure from CFG and INI values using CFG APIs |
| 162 | * |
| 163 | * Return: QDF_STATUS |
| 164 | */ |
| 165 | QDF_STATUS fwol_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc); |
| 166 | |
| 167 | /* |
| 168 | * fwol_cfg_on_psoc_disable() - Clear the CFG structure on psoc disable |
| 169 | * @psoc: pointer to the psoc object |
| 170 | * |
| 171 | * Clear the FWOL CFG structure on psoc disable |
| 172 | * |
| 173 | * Return: QDF_STATUS |
| 174 | */ |
| 175 | QDF_STATUS fwol_cfg_on_psoc_disable(struct wlan_objmgr_psoc *psoc); |
| 176 | #endif |