diff options
| author | Yeshwanth Sriram Guntuka <ysriramg@codeaurora.org> | 2018-07-11 16:29:21 +0530 |
|---|---|---|
| committer | nshrivas <nshrivas@codeaurora.org> | 2018-07-25 06:27:40 -0700 |
| commit | 612e39686b3827e647a3cc57cf40220f9eabfd1f (patch) | |
| tree | f9fe18454cbc50c56ec6f6c850aa2eca87fd9885 | |
| parent | 908d3ffb76f73b64029fd3f13468c396597466aa (diff) | |
qcacmn: Check for target ready before sending wmi command
SAP stop is in progress when FW down event is received
from platform driver. Vdev_stop command is not sent to
firmware due to target ready check but same check is not
present for self peer_delete command. This results in
assert in firmware since vdev_stop command is not received
before self peer_delete command.
Fix is to check if target is ready before sending wmi
command.
Change-Id: I91fa6aaffe4f35b446a3c8748f168e83620bf4b0
CRs-Fixed: 2277544
| -rw-r--r-- | wmi/inc/wmi_unified_api.h | 9 | ||||
| -rw-r--r-- | wmi/inc/wmi_unified_priv.h | 1 | ||||
| -rw-r--r-- | wmi/src/wmi_unified.c | 8 |
3 files changed, 18 insertions, 0 deletions
diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index 8c98fe836152..1592ce5876d6 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -1613,4 +1613,13 @@ QDF_STATUS wmi_unified_offload_11k_cmd(void *wmi_hdl, */ QDF_STATUS wmi_unified_invoke_neighbor_report_cmd(void *wmi_hdl, struct wmi_invoke_neighbor_report_params *params); +/** + * wmi_register_tgt_ready_cb() - Register target ready check callback + * with wmi_handle + * @wmi_handle: wmi handle + * @cb: Callback to check target ready + * + * Return: None + */ +void wmi_register_tgt_ready_cb(wmi_unified_t wmi_handle, bool (*cb)(void)); #endif /* _WMI_UNIFIED_API_H_ */ diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index 5394bbdfb8ba..8ecd32c83a96 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -1323,6 +1323,7 @@ struct wmi_unified { uint32_t vdev_param[wmi_vdev_param_max]; uint32_t services[wmi_services_max]; #endif + bool (*is_target_ready)(void); }; #ifdef WMI_NON_TLV_SUPPORT /* ONLY_NON_TLV_TARGET:TLV attach dummy function defintion for case when diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index d9f128dbba10..4ee9d67da8e5 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -1283,6 +1283,9 @@ QDF_STATUS wmi_unified_cmd_send(wmi_unified_t wmi_handle, wmi_buf_t buf, QDF_STATUS status; uint16_t htc_tag = 0; + if (wmi_handle->is_target_ready && !wmi_handle->is_target_ready()) + return QDF_STATUS_E_FAILURE; + if (wmi_get_runtime_pm_inprogress(wmi_handle)) { htc_tag = (A_UINT16)wmi_handle->ops->wmi_set_htc_tx_tag( @@ -2129,6 +2132,11 @@ wmi_stop(wmi_unified_t wmi_handle) return 0; } +void wmi_register_tgt_ready_cb(wmi_unified_t wmi_handle, bool (*cb)(void)) +{ + wmi_handle->is_target_ready = cb; +} + #ifdef WMI_NON_TLV_SUPPORT /** * API to flush all the previous packets associated with the wmi endpoint |
