From 171e2254745287b903d6a96c973aff3e46a52e4e Mon Sep 17 00:00:00 2001 From: "Selvaraj, Sridhar" Date: Wed, 22 Jun 2016 22:33:26 +0530 Subject: [PATCH] qcacld-3.0: Check if vdev is created before LL stats query qcacld-2.0 to qcacld-3.0 propagation As part of "change iface" in HDD, host does close session (VDEV DELETE) and as part of "start ap", host invokes open session(VDEV CREATE). Link Layer(LL) stats query is received in host driver in a corner/race condition between the events "change iface" and "start ap" which leads to an exception issue in firmware since FW receives REQUEST_LINK_STATS WMI for a deleted VDEV. This fix adds a boolean variable vdev_active to vdev structure(wma_txrx_node), which is set to true once vdev is created. vdev_active is checked for TRUE before sending LL stats query to FW with WMI command. Git-commit: cf7bf99eb9a71b1043cd230aee704c44c62c98ff Change-Id: Ifcc986c3352e4e66da35b8d6c489d98dbe61401d CRs-Fixed: 987734 (cherry picked from commit b82c03d8686a57b120f991ffbb9b9801c908aac8) --- core/wma/inc/wma.h | 1 + core/wma/src/wma_dev_if.c | 3 +++ core/wma/src/wma_utils.c | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index 92deee79076e..e42c2e7da45a 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -930,6 +930,7 @@ struct wma_txrx_node { uint8_t ht_capable; A_UINT32 mhz; enum phy_ch_width chan_width; + bool vdev_active; bool vdev_up; uint64_t tsfadjust; void *addBssStaContext; diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index 24425437d514..e341ad89cd19 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -632,6 +632,7 @@ QDF_STATUS wma_vdev_detach(tp_wma_handle wma_handle, return status; } + iface->vdev_active = false; /* P2P Device */ if ((iface->type == WMI_VDEV_TYPE_AP) && (iface->sub_type == WMI_UNIFIED_VDEV_SUBTYPE_P2P_DEVICE)) { @@ -1537,6 +1538,8 @@ ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle, self_sta_req->session_id); goto end; } + wma_handle->interfaces[self_sta_req->session_id].vdev_active = true; + wma_handle->interfaces[self_sta_req->session_id].handle = txrx_vdev_handle; diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index fb92941421ed..b8f35702a0fe 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -880,6 +880,11 @@ QDF_STATUS wma_process_ll_stats_get_req return QDF_STATUS_E_FAILURE; } + if (!wma->interfaces[getReq->staId].vdev_active) { + WMA_LOGE("%s: vdev not created yet", __func__); + return QDF_STATUS_E_FAILURE; + } + cmd.req_id = getReq->reqId; cmd.param_id_mask = getReq->paramIdMask; cmd.sta_id = getReq->staId;