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;