diff options
| author | Arif Hussain <arifhussain@codeaurora.org> | 2017-10-31 13:12:04 -0700 |
|---|---|---|
| committer | snandini <snandini@codeaurora.org> | 2017-11-01 06:39:01 -0700 |
| commit | 6daf6e15ce6044fcaeb532904dffb896020b33e0 (patch) | |
| tree | c89bf7860da84b2090e92269637be60275067c04 | |
| parent | f2d009aea5aec5cf5dfdb49838ff97d3616f53fd (diff) | |
qcacld-3.0: Fix check to avoid multiple vdev for same session
In function ol_txrx_vdev_handle wma_vdev_attach, along with
vdev_active check for is_vdev_valid to find if vdev already
present or not.
Change-Id: I39cc6d27037a8fec29cd6114067b2dab9a964ab0
CRs-Fixed: 2135737
| -rw-r--r-- | core/wma/src/wma_dev_if.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index 9fc1ff89c0b2..4fa8527830e3 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -668,7 +668,6 @@ QDF_STATUS wma_vdev_detach(tp_wma_handle wma_handle, if (iface->type == WMI_VDEV_TYPE_STA) wma_pno_stop(wma_handle, vdev_id); - iface->vdev_active = false; /* P2P Device */ if ((iface->type == WMI_VDEV_TYPE_AP) && (iface->sub_type == WMI_UNIFIED_VDEV_SUBTYPE_P2P_DEVICE)) { @@ -683,6 +682,9 @@ QDF_STATUS wma_vdev_detach(tp_wma_handle wma_handle, pdel_sta_self_req_param, generateRsp); } + if (QDF_IS_STATUS_SUCCESS(status)) + iface->vdev_active = false; + return status; send_fail_rsp: @@ -1134,14 +1136,24 @@ bool wma_is_vdev_valid(uint32_t vdev_id) { tp_wma_handle wma_handle = cds_get_context(QDF_MODULE_ID_WMA); - if (NULL == wma_handle) + if (!wma_handle) { + WMA_LOGD("%s: vdev_id: %d, null wma_handle", __func__, vdev_id); return false; + } /* No of interface are allocated based on max_bssid value */ - if (vdev_id >= wma_handle->max_bssid) + if (vdev_id >= wma_handle->max_bssid) { + WMA_LOGD("%s: vdev_id: %d is invalid, max_bssid: %d", + __func__, vdev_id, wma_handle->max_bssid); return false; + } + + WMA_LOGD("%s: vdev_id: %d, vdev_active: %d, is_vdev_valid %d", + __func__, vdev_id, wma_handle->interfaces[vdev_id].vdev_active, + wma_handle->interfaces[vdev_id].is_vdev_valid); - return wma_handle->interfaces[vdev_id].vdev_active; + return wma_handle->interfaces[vdev_id].vdev_active || + wma_handle->interfaces[vdev_id].is_vdev_valid; } /** @@ -1976,9 +1988,10 @@ ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle, WMA_LOGE("%s: Failed to get mac", __func__); goto end; } - if (wma_handle->interfaces[self_sta_req->session_id].vdev_active) { - WMA_LOGE("%s: vdev %d already active", - __func__, self_sta_req->session_id); + + vdev_id = self_sta_req->session_id; + if (wma_is_vdev_valid(vdev_id)) { + WMA_LOGE("%s: vdev %d already active", __func__, vdev_id); goto end; } @@ -1998,8 +2011,6 @@ ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle, goto end; } - vdev_id = self_sta_req->session_id; - txrx_vdev_type = wma_get_txrx_vdev_type(self_sta_req->type); if (wlan_op_mode_unknown == txrx_vdev_type) { |
