1 /* 2 * Copyright (c) 2017-2018 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_dbr_ring_cap_free() - free dbr ring capability 162 * @tgt_psoc_info: target psoc info object 163 * 164 * API to free dbr ring capability 165 * 166 * Return: QDF_STATUS 167 */ 168 QDF_STATUS init_deinit_dbr_ring_cap_free( 169 struct target_psoc_info *tgt_psoc_info); 170 171 /** 172 * init_deinit_populate_phy_reg_cap() - populate phy reg capability 173 * @psoc: PSOC object 174 * @wmi_handle: WMI handle pointer 175 * @event: event buffer received from FW 176 * @info: tgt_info object 177 * @service_ready: service ready determiner 178 * 179 * API to populate phy reg capability 180 * 181 * Return: zero on successful parsing of physical reg capability or failure flag 182 */ 183 int init_deinit_populate_phy_reg_cap(struct wlan_objmgr_psoc *psoc, 184 void *wmi_handle, uint8_t *event, 185 struct tgt_info *info, bool service_ready); 186 187 /** 188 * init_deinit_validate_160_80p80_fw_caps() - validate 160 80p80 fw caps 189 * @psoc: PSOC object 190 * @tgt_info: target_psoc_info object 191 * 192 * API to validate 160 80p80 fw caps 193 * 194 * Return: SUCCESS on successful validation of 160 80p80 forward caps or Failure 195 */ 196 QDF_STATUS init_deinit_validate_160_80p80_fw_caps( 197 struct wlan_objmgr_psoc *psoc, 198 struct target_psoc_info *tgt_info); 199 200 /** 201 * init_deinit_chainmask_config() - config chainmask 202 * @psoc: PSOC object 203 * @tgt_info: target_psoc_info object 204 * 205 * API to config chainmask 206 * 207 * Return: none 208 */ 209 void init_deinit_chainmask_config( 210 struct wlan_objmgr_psoc *psoc, 211 struct target_psoc_info *tgt_info); 212 213 /** 214 * init_deinit_is_service_ext_msg() - check service ext message 215 * @psoc: PSOC object 216 * @tgt_info: target_psoc_info object 217 * 218 * API to check whether service ext message is enabled 219 * 220 * Return: SUCCESS on successful check of service_ext message or Failure 221 */ 222 QDF_STATUS init_deinit_is_service_ext_msg( 223 struct wlan_objmgr_psoc *psoc, 224 struct target_psoc_info *tgt_info); 225 /** 226 * init_deinit_is_preferred_hw_mode_supported() - check support of preferred 227 * hw mode 228 * @psoc: PSOC object 229 * @tgt_info: target_psoc_info object 230 * 231 * API to check whether preferred hardware mode is enabled 232 * 233 * Return: True on support of preferred hardware support or False 234 */ 235 bool init_deinit_is_preferred_hw_mode_supported( 236 struct wlan_objmgr_psoc *psoc, 237 struct target_psoc_info *tgt_info); 238 239 /** 240 * init_deinit_wakeup_host_wait() - wakeup host wait 241 * @psoc: PSOC object 242 * @tgt_info: target_psoc_info object 243 * 244 * API to wakeup FW ready wait queue 245 * 246 * Return: None 247 */ 248 void init_deinit_wakeup_host_wait( 249 struct wlan_objmgr_psoc *psoc, 250 struct target_psoc_info *tgt_info); 251 252 #endif /* _SERVICE_READY_UTIL_H_*/ 253