From aa8f2dffccc24b9efb7f761478379da676dc0aee Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Fri, 11 Jan 2019 20:02:26 +0530 Subject: [PATCH] qcacld-3.0: Find Session Id by BSSID while handling TSM Stats rsp Currently, value of staIndex in dph hash table is not getting updated after roaming. But diver invokes pe_find_session_by_sta_id to get PE session to handle eWNI_SME_GET_TSM_STATS_RSP. Due to a different value of staIndex and staid, session lookup fails for StaId. This results in failure of IOCTL command "GETTSMSTATS" after roaming. Fix is to use bssid instead of sta id to find session in lim_send_sme_pe_ese_tsm_rsp. Change-Id: I42745c864ac0292dbcaae05f62a00a141705d431 CRs-Fixed: 2381668 --- core/mac/inc/sir_api.h | 1 + core/mac/src/pe/lim/lim_send_sme_rsp_messages.c | 5 ++--- core/wma/src/wma_features.c | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index a3989b890157..bd83dc544e17 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -828,6 +828,7 @@ typedef struct sAniGetTsmStatsRsp { * Per STA stats request must * contain valid */ + struct qdf_mac_addr bssid; /* bssid to get the tsm stats for */ tAniTrafStrmMetrics tsmMetrics; void *tsmStatsReq; /* tsm stats request backup */ } tAniGetTsmStatsRsp, *tpAniGetTsmStatsRsp; diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c index 1c6f44e1a2f0..3ceaecc1449c 100644 --- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c @@ -1638,9 +1638,8 @@ void lim_send_sme_pe_ese_tsm_rsp(struct mac_context *mac, struct pe_session *pPeSessionEntry = NULL; /* Get the Session Id based on Sta Id */ - pPeSessionEntry = - pe_find_session_by_sta_id(mac, pPeStats->staId, &sessionId); - + pPeSessionEntry = pe_find_session_by_bssid(mac, pPeStats->bssid.bytes, + &sessionId); /* Fill the Session Id */ if (NULL != pPeSessionEntry) { /* Fill the Session Id */ diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 2373e039af45..99b6a6a8c119 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -3171,6 +3171,7 @@ QDF_STATUS wma_process_tsm_stats_req(tp_wma_handle wma_handler, return QDF_STATUS_E_NOMEM; } pTsmRspParams->staId = pStats->staId; + qdf_copy_macaddr(&pTsmRspParams->bssid, &pStats->bssId); pTsmRspParams->rc = QDF_STATUS_E_FAILURE; pTsmRspParams->tsmStatsReq = pStats; pTsmMetric = &pTsmRspParams->tsmMetrics;