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( 65 wmi_unified_t wmi_handle, uint8_t *event, 66 uint32_t *service_bitmap); 67 68 /** 69 * init_deinit_populate_fw_version_cmd() - populate FW version 70 * @wmi_handle: wmi handle 71 * @event: event buffer received from FW 72 * 73 * API to populate FW version 74 * 75 * Return: zero on successful population of fw_version command or failure flag 76 */ 77 int 78 init_deinit_populate_fw_version_cmd(wmi_unified_t wmi_handle, uint8_t *event); 79 80 /** 81 * init_deinit_populate_target_cap() - populate target cap 82 * @wmi_handle: wmi handle 83 * @event: event buffer received from FW 84 * @cap: target capability info object 85 * 86 * API to populate target cap 87 * 88 * Return: zero on successful population of target cap or failure flag 89 */ 90 int init_deinit_populate_target_cap( 91 wmi_unified_t wmi_handle, uint8_t *event, 92 struct wlan_psoc_target_capability_info *cap); 93 94 /** 95 * init_deinit_populate_service_ready_ext_param() - populate service ready ext 96 * parameter 97 * @handle: WMI handle pointer 98 * @evt: event buffer received from FW 99 * @param: service ext param object 100 * 101 * API to populate service ready ext param 102 * 103 * Return: zero on successful parsing of service ready ext parameter or failure 104 */ 105 int init_deinit_populate_service_ready_ext_param( 106 wmi_unified_t handle, uint8_t *evt, 107 struct wlan_psoc_host_service_ext_param *param); 108 109 /** 110 * init_deinit_populate_service_ready_ext2_param() - populate service ready ext2 111 * parameter 112 * @handle: WMI handle pointer 113 * @evt: event buffer received from FW 114 * @info: Target info handle 115 * 116 * API to populate service ready ext2 param 117 * 118 * Return: zero on successful parsing of service ready ext parameter or failure 119 */ 120 int init_deinit_populate_service_ready_ext2_param( 121 wmi_unified_t handle, uint8_t *evt, 122 struct tgt_info *info); 123 124 /** 125 * init_deinit_populate_chainmask_tables() - populate chainmaks tables 126 * @handle: WMI handle pointer 127 * @evt: event buffer received from FW 128 * @param: chainmaks_table object 129 * 130 * API to populate chainmaks tables 131 * 132 * Return: zero on successful parsing of chainmaks tables or failure flag 133 */ 134 int init_deinit_populate_chainmask_tables( 135 wmi_unified_t handle, uint8_t *evt, 136 struct wlan_psoc_host_chainmask_table *param); 137 138 /** 139 * init_deinit_populate_mac_phy_capability() - populate mac phy capability 140 * @handle: WMI handle pointer 141 * @evt: event buffer received from FW 142 * @hw_cap: hw_mode_caps object 143 * @info: tgt_info object 144 * 145 * API to populate mac phy capability 146 * 147 * Return: zero on successful population of mac physical capability or failure 148 */ 149 int init_deinit_populate_mac_phy_capability( 150 wmi_unified_t handle, uint8_t *evt, 151 struct wlan_psoc_host_hw_mode_caps *hw_cap, struct tgt_info *info); 152 153 /** 154 * init_deinit_populate_hw_mode_capability() - populate hw mode capability 155 * @wmi_handle: WMI handle pointer 156 * @event: event buffer received from FW 157 * @tgt_hdl: target_psoc_info object 158 * 159 * API to populate hw mode capability 160 * 161 * Return: zero on successful parsing of hw mode capability or failure 162 */ 163 int init_deinit_populate_hw_mode_capability( 164 wmi_unified_t wmi_handle, 165 uint8_t *event, struct target_psoc_info *tgt_hdl); 166 167 /** 168 * init_deinit_populate_dbr_ring_cap() - populate dbr ring capability 169 * @psoc: PSOC object 170 * @handle: WMI handle pointer 171 * @event: event buffer received from FW 172 * @info: tgt_info object 173 * 174 * API to populate dbr ring capability 175 * 176 * Return: zero on successful parsing of dbr ring capability or failure 177 */ 178 int init_deinit_populate_dbr_ring_cap(struct wlan_objmgr_psoc *psoc, 179 wmi_unified_t handle, uint8_t *event, 180 struct tgt_info *info); 181 182 /** 183 * init_deinit_populate_dbr_ring_cap_ext2() - populate dbr ring capability 184 * from ext2 event 185 * @psoc: PSOC object 186 * @handle: WMI handle pointer 187 * @event: event buffer received from FW 188 * @info: tgt_info object 189 * 190 * API to populate dbr ring capability 191 * 192 * Return: zero on successful parsing of dbr ring capability or failure 193 */ 194 int init_deinit_populate_dbr_ring_cap_ext2(struct wlan_objmgr_psoc *psoc, 195 wmi_unified_t handle, uint8_t *event, 196 struct tgt_info *info); 197 198 /** 199 * init_deinit_populate_spectral_bin_scale_params() - populate Spectral scaling 200 * @psoc: PSOC object 201 * @handle: WMI handle pointer 202 * @event: event buffer received from FW 203 * @info: tgt_info object 204 * 205 * API to populate Spectral bin scaling parameters 206 * 207 * Return: zero on successful parsing of scaling params or failure 208 */ 209 int init_deinit_populate_spectral_bin_scale_params( 210 struct wlan_objmgr_psoc *psoc, 211 wmi_unified_t handle, uint8_t *event, 212 struct tgt_info *info); 213 214 /** 215 * init_deinit_dbr_ring_cap_free() - free dbr ring capability 216 * @tgt_psoc_info: target psoc info object 217 * 218 * API to free dbr ring capability 219 * 220 * Return: QDF_STATUS 221 */ 222 QDF_STATUS init_deinit_dbr_ring_cap_free( 223 struct target_psoc_info *tgt_psoc_info); 224 225 /** 226 * init_deinit_spectral_scaling_params_free() - free Spectral scaling params 227 * @tgt_psoc_info: target psoc info object 228 * 229 * API to free Spectral scaling params 230 * 231 * Return: QDF_STATUS 232 */ 233 QDF_STATUS init_deinit_spectral_scaling_params_free( 234 struct target_psoc_info *tgt_psoc_info); 235 236 /** 237 * init_deinit_populate_phy_reg_cap() - populate phy reg capability 238 * @psoc: PSOC object 239 * @wmi_handle: WMI handle pointer 240 * @event: event buffer received from FW 241 * @info: tgt_info object 242 * @service_ready: service ready determiner 243 * 244 * API to populate phy reg capability 245 * 246 * Return: zero on successful parsing of physical reg capability or failure flag 247 */ 248 int init_deinit_populate_phy_reg_cap(struct wlan_objmgr_psoc *psoc, 249 wmi_unified_t wmi_handle, uint8_t *event, 250 struct tgt_info *info, 251 bool service_ready); 252 253 /** 254 * init_deinit_validate_160_80p80_fw_caps() - validate 160 80p80 fw caps 255 * @psoc: PSOC object 256 * @tgt_info: target_psoc_info object 257 * 258 * API to validate 160 80p80 fw caps 259 * 260 * Return: SUCCESS on successful validation of 160 80p80 forward caps or Failure 261 */ 262 QDF_STATUS init_deinit_validate_160_80p80_fw_caps( 263 struct wlan_objmgr_psoc *psoc, 264 struct target_psoc_info *tgt_info); 265 266 /** 267 * init_deinit_chainmask_config() - config chainmask 268 * @psoc: PSOC object 269 * @tgt_info: target_psoc_info object 270 * 271 * API to config chainmask 272 * 273 * Return: none 274 */ 275 void init_deinit_chainmask_config( 276 struct wlan_objmgr_psoc *psoc, 277 struct target_psoc_info *tgt_info); 278 279 /** 280 * init_deinit_is_service_ext_msg() - check service ext message 281 * @psoc: PSOC object 282 * @tgt_info: target_psoc_info object 283 * 284 * API to check whether service ext message is enabled 285 * 286 * Return: SUCCESS on successful check of service_ext message or Failure 287 */ 288 QDF_STATUS init_deinit_is_service_ext_msg( 289 struct wlan_objmgr_psoc *psoc, 290 struct target_psoc_info *tgt_info); 291 /** 292 * init_deinit_is_preferred_hw_mode_supported() - check support of preferred 293 * hw mode 294 * @psoc: PSOC object 295 * @tgt_info: target_psoc_info object 296 * 297 * API to check whether preferred hardware mode is enabled 298 * 299 * Return: True on support of preferred hardware support or False 300 */ 301 bool init_deinit_is_preferred_hw_mode_supported( 302 struct wlan_objmgr_psoc *psoc, 303 struct target_psoc_info *tgt_info); 304 305 /** 306 * init_deinit_wakeup_host_wait() - wakeup host wait 307 * @psoc: PSOC object 308 * @tgt_info: target_psoc_info object 309 * 310 * API to wakeup FW ready wait queue 311 * 312 * Return: None 313 */ 314 void init_deinit_wakeup_host_wait( 315 struct wlan_objmgr_psoc *psoc, 316 struct target_psoc_info *tgt_info); 317 318 #endif /* _SERVICE_READY_UTIL_H_*/ 319