1 /* 2 * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. 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: service_ready_util.h 20 * 21 * Public APIs to access (ext)service ready data from psoc object 22 */ 23 #ifndef _SERVICE_READY_UTIL_H_ 24 #define _SERVICE_READY_UTIL_H_ 25 26 #include "wlan_objmgr_psoc_obj.h" 27 #include "service_ready_param.h" 28 #include "target_if.h" 29 30 /** 31 * init_deinit_chainmask_table_alloc() 32 * - allocate chainmask table capability list. 33 * @service_ext_param: pointer to server ext param. 34 * 35 * Allocates capability list based on num_valid_chainmasks for that table. 36 * 37 * Return: QDF Status. 38 */ 39 QDF_STATUS init_deinit_chainmask_table_alloc( 40 struct wlan_psoc_host_service_ext_param *service_ext_param); 41 42 /** 43 * init_deinit_chainmask_table_free() 44 * -free chainmask table capability list. 45 * @service_ext_param: pointer to server ext param. 46 * 47 * free capability list based on num_valid_chainmasks for that table. 48 * 49 * Return: QDF Status. 50 */ 51 QDF_STATUS init_deinit_chainmask_table_free( 52 struct wlan_psoc_host_service_ext_param *service_ext_param); 53 54 /** 55 * init_deinit_populate_service_bitmap() - populate service bitmap 56 * @wmi_handle: wmi handle 57 * @event: event buffer received from FW 58 * @service_bitmap: service bitmap information 59 * 60 * API to populate service bit map 61 * 62 * Return: zero on successful population of service bitmap or failure flag 63 */ 64 int init_deinit_populate_service_bitmap(void *wmi_handle, uint8_t *event, 65 uint32_t *service_bitmap); 66 67 /** 68 * init_deinit_populate_fw_version_cmd() - populate FW version 69 * @wmi_handle: wmi handle 70 * @event: event buffer received from FW 71 * 72 * API to populate FW version 73 * 74 * Return: zero on successful population of fw_version command or failure flag 75 */ 76 int init_deinit_populate_fw_version_cmd(void *wmi_handle, uint8_t *event); 77 78 /** 79 * init_deinit_populate_target_cap() - populate target cap 80 * @wmi_handle: wmi handle 81 * @event: event buffer received from FW 82 * @cap: target capability info object 83 * 84 * API to populate target cap 85 * 86 * Return: zero on successful population of target cap or failure flag 87 */ 88 int init_deinit_populate_target_cap(void *wmi_handle, uint8_t *event, 89 struct wlan_psoc_target_capability_info *cap); 90 91 /** 92 * init_deinit_populate_service_ready_ext_param() - populate service ready ext 93 * parameter 94 * @handle: WMI handle pointer 95 * @evt: event buffer received from FW 96 * @param: service ext param object 97 * 98 * API to populate service ready ext param 99 * 100 * Return: zero on successful parsing of service ready ext parameter or failure 101 */ 102 int init_deinit_populate_service_ready_ext_param(void *handle, uint8_t *evt, 103 struct wlan_psoc_host_service_ext_param *param); 104 105 /** 106 * init_deinit_populate_chainmask_tables() - populate chainmaks tables 107 * @handle: WMI handle pointer 108 * @evt: event buffer received from FW 109 * @param: chainmaks_table object 110 * 111 * API to populate chainmaks tables 112 * 113 * Return: zero on successful parsing of chainmaks tables or failure flag 114 */ 115 int init_deinit_populate_chainmask_tables(void *handle, uint8_t *evt, 116 struct wlan_psoc_host_chainmask_table *param); 117 118 /** 119 * init_deinit_populate_mac_phy_capability() - populate mac phy capability 120 * @handle: WMI handle pointer 121 * @evt: event buffer received from FW 122 * @hw_cap: hw_mode_caps object 123 * @info: tgt_info object 124 * 125 * API to populate mac phy capability 126 * 127 * Return: zero on successful population of mac physical capability or failure 128 */ 129 int init_deinit_populate_mac_phy_capability(void *handle, uint8_t *evt, 130 struct wlan_psoc_host_hw_mode_caps *hw_cap, struct tgt_info *info); 131 132 /** 133 * init_deinit_populate_hw_mode_capability() - populate hw mode capability 134 * @wmi_handle: WMI handle pointer 135 * @event: event buffer received from FW 136 * @tgt_hdl: target_psoc_info object 137 * 138 * API to populate hw mode capability 139 * 140 * Return: zero on successful parsing of hw mode capability or failure 141 */ 142 int init_deinit_populate_hw_mode_capability(void *wmi_handle, 143 uint8_t *event, struct target_psoc_info *tgt_hdl); 144 145 /** 146 * init_deinit_populate_dbr_ring_cap() - populate dbr ring capability 147 * @psoc: PSOC object 148 * @handle: WMI handle pointer 149 * @event: event buffer received from FW 150 * @info: tgt_info object 151 * 152 * API to populate dbr ring capability 153 * 154 * Return: zero on successful parsing of dbr ring capability or failure 155 */ 156 int init_deinit_populate_dbr_ring_cap(struct wlan_objmgr_psoc *psoc, 157 void *handle, uint8_t *event, 158 struct tgt_info *info); 159 160 /** 161 * init_deinit_populate_spectral_bin_scale_params() - populate Spectral scaling 162 * @psoc: PSOC object 163 * @handle: WMI handle pointer 164 * @event: event buffer received from FW 165 * @info: tgt_info object 166 * 167 * API to populate Spectral bin scaling parameters 168 * 169 * Return: zero on successful parsing of scaling params or failure 170 */ 171 int init_deinit_populate_spectral_bin_scale_params( 172 struct wlan_objmgr_psoc *psoc, 173 void *handle, uint8_t *event, 174 struct tgt_info *info); 175 176 /** 177 * init_deinit_dbr_ring_cap_free() - free dbr ring capability 178 * @tgt_psoc_info: target psoc info object 179 * 180 * API to free dbr ring capability 181 * 182 * Return: QDF_STATUS 183 */ 184 QDF_STATUS init_deinit_dbr_ring_cap_free( 185 struct target_psoc_info *tgt_psoc_info); 186 187 /** 188 * init_deinit_spectral_scaling_params_free() - free Spectral scaling params 189 * @tgt_psoc_info: target psoc info object 190 * 191 * API to free Spectral scaling params 192 * 193 * Return: QDF_STATUS 194 */ 195 QDF_STATUS init_deinit_spectral_scaling_params_free( 196 struct target_psoc_info *tgt_psoc_info); 197 198 /** 199 * init_deinit_populate_phy_reg_cap() - populate phy reg capability 200 * @psoc: PSOC object 201 * @wmi_handle: WMI handle pointer 202 * @event: event buffer received from FW 203 * @info: tgt_info object 204 * @service_ready: service ready determiner 205 * 206 * API to populate phy reg capability 207 * 208 * Return: zero on successful parsing of physical reg capability or failure flag 209 */ 210 int init_deinit_populate_phy_reg_cap(struct wlan_objmgr_psoc *psoc, 211 void *wmi_handle, uint8_t *event, 212 struct tgt_info *info, bool service_ready); 213 214 /** 215 * init_deinit_validate_160_80p80_fw_caps() - validate 160 80p80 fw caps 216 * @psoc: PSOC object 217 * @tgt_info: target_psoc_info object 218 * 219 * API to validate 160 80p80 fw caps 220 * 221 * Return: SUCCESS on successful validation of 160 80p80 forward caps or Failure 222 */ 223 QDF_STATUS init_deinit_validate_160_80p80_fw_caps( 224 struct wlan_objmgr_psoc *psoc, 225 struct target_psoc_info *tgt_info); 226 227 /** 228 * init_deinit_chainmask_config() - config chainmask 229 * @psoc: PSOC object 230 * @tgt_info: target_psoc_info object 231 * 232 * API to config chainmask 233 * 234 * Return: none 235 */ 236 void init_deinit_chainmask_config( 237 struct wlan_objmgr_psoc *psoc, 238 struct target_psoc_info *tgt_info); 239 240 /** 241 * init_deinit_is_service_ext_msg() - check service ext message 242 * @psoc: PSOC object 243 * @tgt_info: target_psoc_info object 244 * 245 * API to check whether service ext message is enabled 246 * 247 * Return: SUCCESS on successful check of service_ext message or Failure 248 */ 249 QDF_STATUS init_deinit_is_service_ext_msg( 250 struct wlan_objmgr_psoc *psoc, 251 struct target_psoc_info *tgt_info); 252 /** 253 * init_deinit_is_preferred_hw_mode_supported() - check support of preferred 254 * hw mode 255 * @psoc: PSOC object 256 * @tgt_info: target_psoc_info object 257 * 258 * API to check whether preferred hardware mode is enabled 259 * 260 * Return: True on support of preferred hardware support or False 261 */ 262 bool init_deinit_is_preferred_hw_mode_supported( 263 struct wlan_objmgr_psoc *psoc, 264 struct target_psoc_info *tgt_info); 265 266 /** 267 * init_deinit_wakeup_host_wait() - wakeup host wait 268 * @psoc: PSOC object 269 * @tgt_info: target_psoc_info object 270 * 271 * API to wakeup FW ready wait queue 272 * 273 * Return: None 274 */ 275 void init_deinit_wakeup_host_wait( 276 struct wlan_objmgr_psoc *psoc, 277 struct target_psoc_info *tgt_info); 278 279 #endif /* _SERVICE_READY_UTIL_H_*/ 280