wlan: Sessionize Link Layer Stats to support multiple interfaces.

This commit ensures that the proper mapping of the interface and the
station index is done to ensure that appropriate statistics per interface
are obtained.

Change-Id: I676137b60c3313bdd5bf91ce03ec17d73dae041e
CRs-Fixed:  689878
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 6bb584d..80807ee 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -1415,10 +1415,11 @@
  */
 static void hdd_link_layer_stats_ind_callback ( void *pCtx,
                                                 int indType,
-                                                void *pRsp )
+                                                void *pRsp, u8  *macAddr)
 {
-    hdd_adapter_t *pAdapter = (hdd_adapter_t *)pCtx;
-    hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
+    hdd_context_t *pHddCtx = (hdd_context_t *)pCtx;
+    hdd_adapter_t *pAdapter = NULL;
+    tpSirLLStatsResults linkLayerStatsResults = (tpSirLLStatsResults)pRsp;
     int status;
 
     status = wlan_hdd_validate_context(pHddCtx);
@@ -1430,24 +1431,33 @@
         return;
     }
 
+
+
+    pAdapter = hdd_get_adapter_by_macaddr(pHddCtx, macAddr);
+    if (NULL == pAdapter)
+    {
+        hddLog(VOS_TRACE_LEVEL_ERROR,
+                FL(" MAC address %pM does not exist with host"),
+                macAddr);
+        return;
+    }
+
     VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
-            "%s: Link Layer Indication indType: %d", __func__, indType);
+            "%s: Interface: %s LLStats indType: %d", __func__,
+            pAdapter->dev->name, indType);
+
     switch (indType)
     {
     case SIR_HAL_LL_STATS_RESULTS_RSP:
         {
-            tpSirLLStatsResults linkLayerStatsResults =
-                (tpSirLLStatsResults)pRsp;
-
-
             hddLog(VOS_TRACE_LEVEL_INFO,
                     FL("RESPONSE SIR_HAL_LL_STATS_RESULTS_RSP") );
             hddLog(VOS_TRACE_LEVEL_INFO,
                     "LL_STATS RESULTS RESPONSE paramID = 0x%x",
                     linkLayerStatsResults->paramId);
             hddLog(VOS_TRACE_LEVEL_INFO,
-                    "LL_STATS RESULTS RESPONSE ifaceId = %u",
-                    linkLayerStatsResults->ifaceId);
+               "LL_STATS RESULTS RESPONSE ifaceId = %u MAC: %pM",
+               linkLayerStatsResults->ifaceId, macAddr);
             hddLog(VOS_TRACE_LEVEL_INFO,
                     "LL_STATS RESULTS RESPONSE respId = %u",
                     linkLayerStatsResults->respId);
@@ -1563,18 +1573,14 @@
         nla_get_u32(
             tb_vendor[QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_CONFIG_AGGRESSIVE_STATS_GATHERING]);
 
-    /* staId 0 in Firmware is reserved for Broadcast/Multicast data.
-     * Hence the interface staId start from 1. Hence the staId matching the
-     * interface in the firmware is sessionId + 1.
-     */
-    linkLayerStatsSetReq.staId = pAdapter->sessionId + 1;
+    vos_mem_copy(linkLayerStatsSetReq.macAddr,
+               pAdapter->macAddressCurrent.bytes, sizeof(v_MACADDR_t));
 
 
     hddLog(VOS_TRACE_LEVEL_INFO,
-           "LL_STATS_SET reqId = %d",
-           linkLayerStatsSetReq.reqId);
+           "LL_STATS_SET reqId = %d", linkLayerStatsSetReq.reqId);
     hddLog(VOS_TRACE_LEVEL_INFO,
-            "LL_STATS_SET staId = %d", linkLayerStatsSetReq.staId);
+            "LL_STATS_SET MAC = %pM", linkLayerStatsSetReq.macAddr);
     hddLog(VOS_TRACE_LEVEL_INFO,
             "LL_STATS_SET mpduSizeThreshold = %d",
             linkLayerStatsSetReq.mpduSizeThreshold);
@@ -1584,9 +1590,7 @@
 
     if (eHAL_STATUS_SUCCESS != sme_SetLinkLayerStatsIndCB(
                                pHddCtx->hHal,
-                               pAdapter->sessionId,
-                               hdd_link_layer_stats_ind_callback,
-                               pAdapter))
+                               hdd_link_layer_stats_ind_callback))
     {
         hddLog(VOS_TRACE_LEVEL_ERROR, "%s:"
            "sme_SetLinkLayerStatsIndCB Failed", __func__);
@@ -1697,16 +1701,13 @@
         nla_get_u32( tb_vendor[
             QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_CONFIG_REQ_MASK]);
 
-    /* staId 0 in Firmware is reserved for Broadcast/Multicast data.
-     * Hence the interface staId start from 1. Hence the staId matching the
-     * interface in the firmware is sessionId + 1.
-     */
-    linkLayerStatsGetReq.staId = pAdapter->sessionId + 1;
+    vos_mem_copy(linkLayerStatsGetReq.macAddr,
+               pAdapter->macAddressCurrent.bytes, sizeof(v_MACADDR_t));
 
     hddLog(VOS_TRACE_LEVEL_INFO,
            "LL_STATS_GET reqId = %d", linkLayerStatsGetReq.reqId);
     hddLog(VOS_TRACE_LEVEL_INFO,
-           "LL_STATS_GET staId = %d", linkLayerStatsGetReq.staId);
+           "LL_STATS_GET MAC = %pM", linkLayerStatsGetReq.macAddr);
     hddLog(VOS_TRACE_LEVEL_INFO,
            "LL_STATS_GET paramIdMask = %d",
            linkLayerStatsGetReq.paramIdMask);
@@ -1805,16 +1806,13 @@
     // Shall take the request Id if the Upper layers pass. 1 For now.
     linkLayerStatsClearReq.reqId = 1;
 
-    /* staId 0 in Firmware is reserved for Broadcast/Multicast data.
-     * Hence the interface staId start from 1. Hence the staId matching the
-     * interface in the firmware is sessionId + 1.
-     */
-    linkLayerStatsClearReq.staId = pAdapter->sessionId + 1;
+    vos_mem_copy(linkLayerStatsClearReq.macAddr,
+               pAdapter->macAddressCurrent.bytes, sizeof(v_MACADDR_t));
 
     hddLog(VOS_TRACE_LEVEL_INFO,
             "LL_STATS_CLEAR reqId = %d", linkLayerStatsClearReq.reqId);
     hddLog(VOS_TRACE_LEVEL_INFO,
-            "LL_STATS_CLEAR staId = %d", linkLayerStatsClearReq.staId);
+            "LL_STATS_CLEAR MAC = %pM", linkLayerStatsClearReq.macAddr);
     hddLog(VOS_TRACE_LEVEL_INFO,
             "LL_STATS_CLEAR statsClearReqMask = 0x%X",
             linkLayerStatsClearReq.statsClearReqMask);
diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h
index 25e4c9c..c865ba2 100644
--- a/CORE/MAC/inc/sirApi.h
+++ b/CORE/MAC/inc/sirApi.h
@@ -4769,7 +4769,7 @@
 typedef struct
 {
   u32 reqId;
-  u8  staId;
+  tSirMacAddr  macAddr;
   u32 mpduSizeThreshold;
   u32 aggressiveStatisticsGathering;
 }tSirLLStatsSetReq, *tpSirLLStatsSetReq;
@@ -4777,14 +4777,14 @@
 typedef struct
 {
   u32 reqId;
-  u8  staId;
+  tSirMacAddr  macAddr;
   u32 paramIdMask;
 }tSirLLStatsGetReq, *tpSirLLStatsGetReq;
 
 typedef struct
 {
   u32  reqId;
-  u8   staId;
+  tSirMacAddr  macAddr;
   u32  statsClearReqMask;
   u8   stopReq;
 }tSirLLStatsClearReq, *tpSirLLStatsClearReq;
diff --git a/CORE/SME/inc/smeInternal.h b/CORE/SME/inc/smeInternal.h
index 5380ff8..f0cae3a 100644
--- a/CORE/SME/inc/smeInternal.h
+++ b/CORE/SME/inc/smeInternal.h
@@ -148,7 +148,7 @@
 #ifdef WLAN_FEATURE_LINK_LAYER_STATS
    /* HDD callback to be called after receiving Link Layer Stats Results IND from FW */
    void(*pLinkLayerStatsIndCallback)(void *callbackContext,
-                                     int indType, void *pRsp);
+                                     int indType, void *pRsp, tANI_U8 *macAddr );
    void *pLinkLayerStatsCallbackContext;
 #endif
 #ifdef WLAN_FEATURE_EXTSCAN
diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h
index 3320095..2f4a60b 100644
--- a/CORE/SME/inc/sme_Api.h
+++ b/CORE/SME/inc/sme_Api.h
@@ -157,18 +157,16 @@
     \fn sme_SetLinkLayerStatsIndCB
     \brief  API to trigger Link Layer stats result indications from from FW
     \param  hHal - The handle returned by macOpen.
-    \param  sessionId - session ID
     \param  callbackRoutine - HDD callback which needs to be invoked after
             getting get Link Layer Statistics results from FW
-    \param  callbackContext - pAdapter context
     \return eHalStatus
   ---------------------------------------------------------------------------*/
 eHalStatus
 sme_SetLinkLayerStatsIndCB
 (
-    tHalHandle hHal, tANI_U8 sessionId,
-    void (*callbackRoutine) (void *callbackCtx, int indType, void *pRsp),
-    void *callbackContext
+    tHalHandle hHal,
+    void (*callbackRoutine) (void *callbackCtx, int indType, void *pRsp,
+            tANI_U8 *macAddr)
 );
 
 
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c
index 553a3c6..5a943ad 100644
--- a/CORE/SME/src/sme_common/sme_Api.c
+++ b/CORE/SME/src/sme_common/sme_Api.c
@@ -10748,15 +10748,6 @@
     tSirLLStatsClearReq *pClearStatsReq;
 
 
-    VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO,
-                  "reqId = %u", pLinkLayerStatsClear->reqId);
-    VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO,
-              "staId = %u", pLinkLayerStatsClear->staId);
-    VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO,
-              "statsClearReqMask = 0x%X",
-              pLinkLayerStatsClear->statsClearReqMask);
-    VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO,
-              "stopReq = %u", pLinkLayerStatsClear->stopReq);
 
     pClearStatsReq = vos_mem_malloc(sizeof(*pClearStatsReq));
     if ( !pClearStatsReq)
@@ -10805,9 +10796,9 @@
   ---------------------------------------------------------------------------*/
 eHalStatus sme_SetLinkLayerStatsIndCB
 (
-    tHalHandle hHal, tANI_U8 sessionId,
-    void (*callbackRoutine) (void *callbackCtx, int indType, void *pRsp),
-    void *callbackContext
+    tHalHandle hHal,
+    void (*callbackRoutine) (void *callbackCtx, int indType, void *pRsp,
+     tANI_U8  *macAddr)
 )
 {
     tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
@@ -10818,7 +10809,6 @@
         if (NULL != callbackRoutine)
         {
            pMac->sme.pLinkLayerStatsIndCallback = callbackRoutine;
-           pMac->sme.pLinkLayerStatsCallbackContext = callbackContext;
         }
         sme_ReleaseGlobalLock( &pMac->sme );
     }
diff --git a/CORE/WDA/src/wlan_qct_wda.c b/CORE/WDA/src/wlan_qct_wda.c
index 08a1047..2fd483d 100644
--- a/CORE/WDA/src/wlan_qct_wda.c
+++ b/CORE/WDA/src/wlan_qct_wda.c
@@ -13533,7 +13533,6 @@
      case  WDI_LL_STATS_RESULTS_IND:
      {
          void *pLinkLayerStatsInd;
-         void *pCallbackContext;
          tpAniSirGlobal pMac;
 
          VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO,
@@ -13549,7 +13548,8 @@
          }
 
          pLinkLayerStatsInd =
-            (void *)wdiLowLevelInd->wdiIndicationData.pLinkLayerStatsResults;
+            (void *)wdiLowLevelInd->
+            wdiIndicationData.wdiLinkLayerStatsResults.pLinkLayerStatsResults;
          if (NULL == pLinkLayerStatsInd)
          {
             VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
@@ -13568,13 +13568,17 @@
             return;
          }
 
-         pCallbackContext = pMac->sme.pLinkLayerStatsCallbackContext;
-         /*call hdd callback with Link Layer Statistics*/
+         /* call hdd callback with Link Layer Statistics.
+          * vdev_id/ifacId in link_stats_results will be
+          * used to retrieve the correct HDD context
+          */
          if (pMac->sme.pLinkLayerStatsIndCallback)
          {
-            pMac->sme.pLinkLayerStatsIndCallback(pCallbackContext,
+            pMac->sme.pLinkLayerStatsIndCallback(pMac->pAdapter,
                 WDA_LINK_LAYER_STATS_RESULTS_RSP,
-               pLinkLayerStatsInd);
+               pLinkLayerStatsInd,
+               wdiLowLevelInd->
+               wdiIndicationData.wdiLinkLayerStatsResults.macAddr);
          }
          else
          {
diff --git a/CORE/WDI/CP/inc/wlan_qct_wdi.h b/CORE/WDI/CP/inc/wlan_qct_wdi.h
index 16b59df..95c5fdd 100644
--- a/CORE/WDI/CP/inc/wlan_qct_wdi.h
+++ b/CORE/WDI/CP/inc/wlan_qct_wdi.h
@@ -824,6 +824,14 @@
 } WDI_ChAvoidIndType;
 #endif /* FEATURE_WLAN_CH_AVOID */
 
+#ifdef WLAN_FEATURE_LINK_LAYER_STATS
+typedef struct
+{
+    void *pLinkLayerStatsResults;
+    wpt_macAddr  macAddr;
+}  WDI_LinkLayerStatsResults;
+
+#endif
 /*---------------------------------------------------------------------------
   WDI_LowLevelIndType
     Inidcation type and information about the indication being carried
@@ -895,7 +903,7 @@
 
 #ifdef WLAN_FEATURE_LINK_LAYER_STATS
     /*Link Layer Statistics from FW*/
-    void *pLinkLayerStatsResults;
+    WDI_LinkLayerStatsResults   wdiLinkLayerStatsResults;
 #endif
 #ifdef WLAN_FEATURE_EXTSCAN
     /*EXTSCAN Results from FW*/
@@ -5780,7 +5788,7 @@
 typedef struct
 {
    wpt_uint32  reqId;
-   wpt_uint8   staId;
+   wpt_macAddr macAddr;
    wpt_uint32  mpduSizeThreshold;
    wpt_uint32  aggressiveStatisticsGathering;
 }WDI_LLStatsSetReqType;
@@ -5788,17 +5796,18 @@
 typedef struct
 {
    wpt_uint32  reqId;
-   wpt_uint8   staId;
+   wpt_macAddr macAddr;
    wpt_uint32  paramIdMask;
 }WDI_LLStatsGetReqType;
 
 typedef struct
 {
    wpt_uint32  reqId;
-   wpt_uint8   staId;
+   wpt_macAddr macAddr;
    wpt_uint32  statsClearReqMask;
    wpt_uint8   stopReq;
 }WDI_LLStatsClearReqType;
+
 #endif /* WLAN_FEATURE_LINK_LAYER_STATS */
 
 
diff --git a/CORE/WDI/CP/inc/wlan_qct_wdi_i.h b/CORE/WDI/CP/inc/wlan_qct_wdi_i.h
index 26968c4..3f2469a 100644
--- a/CORE/WDI/CP/inc/wlan_qct_wdi_i.h
+++ b/CORE/WDI/CP/inc/wlan_qct_wdi_i.h
@@ -956,6 +956,21 @@
   eHalStatus   halStatus;
 }WPT_PACK_POST WDI_PostAssocRspInfoType;
 
+#ifdef WLAN_FEATURE_LINK_LAYER_STATS
+/*---------------------------------------------------------------------------
+  WDI_LLStatsResultsType
+---------------------------------------------------------------------------*/
+typedef WPT_PACK_PRE struct
+{
+   wpt_uint32 param_id;
+   wpt_uint8  iface_id;
+   wpt_uint32 resp_id;
+   wpt_uint32 more_result_to_follow;
+   wpt_uint8  result[1];
+}WPT_PACK_POST WDI_LLstatsResultsType;
+
+#endif
+
 /*--------------------------------------------------------------------------- 
    WLAN DAL FSM Event Info Type 
  ---------------------------------------------------------------------------*/
diff --git a/CORE/WDI/CP/inc/wlan_qct_wdi_sta.h b/CORE/WDI/CP/inc/wlan_qct_wdi_sta.h
index 063ed89..565cd50 100644
--- a/CORE/WDI/CP/inc/wlan_qct_wdi_sta.h
+++ b/CORE/WDI/CP/inc/wlan_qct_wdi_sta.h
@@ -395,6 +395,25 @@
 );
 
 /**
+ @brief WDI_STATableGetStaMacAddr - get station MAC address
+
+ @param  pWDICtx:  WDI Context pointer
+         ucSTAIdx:  station index
+         pStaAddr: output station MAC address
+
+ @see
+ @return Result of the function call
+*/
+
+WDI_Status
+WDI_STATableGetStaMacAddr
+(
+    WDI_ControlBlockType*  pWDICtx,
+    wpt_uint8              ucSTAIdx,
+    wpt_macAddr*           staMacAddr
+);
+
+/**
  @brief WDI_STATableSetStaAddr - set station address
  
  @param  pWDICtx:  WDI Context pointer
diff --git a/CORE/WDI/CP/src/wlan_qct_wdi.c b/CORE/WDI/CP/src/wlan_qct_wdi.c
index 4e96ba5..50c0745 100644
--- a/CORE/WDI/CP/src/wlan_qct_wdi.c
+++ b/CORE/WDI/CP/src/wlan_qct_wdi.c
@@ -29931,6 +29931,8 @@
 )
 {
     void *pLinkLayerStatsInd;
+    WDI_LLstatsResultsType *halLLStatsResults;
+    wpt_macAddr  macAddr;
     WDI_LowLevelIndType wdiInd;
     /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
@@ -29953,7 +29955,30 @@
     /* Fill in the indication parameters */
     wdiInd.wdiIndicationType = WDI_LL_STATS_RESULTS_IND;
 
-    wdiInd.wdiIndicationData.pLinkLayerStatsResults = pLinkLayerStatsInd;
+    wdiInd.wdiIndicationData.wdiLinkLayerStatsResults.pLinkLayerStatsResults
+           = pLinkLayerStatsInd;
+
+    halLLStatsResults = (WDI_LLstatsResultsType *) pLinkLayerStatsInd;
+
+
+   /* Need to fill in the MAC address */
+   if ( WDI_STATUS_SUCCESS !=
+         WDI_STATableGetStaMacAddr(pWDICtx,
+                                halLLStatsResults->iface_id,
+                                &macAddr))
+   {
+     VOS_TRACE( VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_ERROR,
+                 " ifaceId: %u does not exist in the WDI Station Table",
+                 halLLStatsResults->iface_id);
+
+     return WDI_STATUS_E_FAILURE;
+   }
+   wpalMemoryCopy(wdiInd.wdiIndicationData.wdiLinkLayerStatsResults.macAddr,
+                    macAddr, WDI_MAC_ADDR_LEN);
+
+   VOS_TRACE( VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_INFO,
+      "ifaceId: %u, macAddr: %pM \n", halLLStatsResults->iface_id,
+           wdiInd.wdiIndicationData.wdiLinkLayerStatsResults.macAddr);
 
     /* Notify UMAC */
     if (pWDICtx->wdiLowLevelIndCB)
@@ -30833,9 +30858,22 @@
   }
 
 
+  /* Need to fill in the self STA Index */
+  if ( WDI_STATUS_SUCCESS !=
+  WDI_STATableFindStaidByAddr(pWDICtx,
+                              pwdiLLStatsSetReqParams->macAddr,
+                              &halLLStatsSetParams.sta_id))
+  {
+    VOS_TRACE( VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_ERROR,
+                MAC_ADDRESS_STR
+                ": This station does not exist in the WDI Station Table",
+                MAC_ADDR_ARRAY(pwdiLLStatsSetReqParams->macAddr));
+
+    wpalMemoryFree(pSendBuffer);
+    return WDI_STATUS_E_FAILURE;
+  }
 
   halLLStatsSetParams.req_id = pwdiLLStatsSetReqParams->reqId;
-  halLLStatsSetParams.sta_id = pwdiLLStatsSetReqParams->staId;
   halLLStatsSetParams.mpdu_size_threshold =
       pwdiLLStatsSetReqParams->mpduSizeThreshold;
   halLLStatsSetParams.aggressive_statistics_gathering =
@@ -30959,9 +30997,22 @@
      WDI_ASSERT(0);
      return WDI_STATUS_E_FAILURE;
   }
+  /* Need to fill in the self STA Index */
+  if ( WDI_STATUS_SUCCESS !=
+  WDI_STATableFindStaidByAddr(pWDICtx,
+                              pwdiLLStatsGetReqParams->macAddr,
+                &halLLStatsGetParams.sta_id))
+  {
+    VOS_TRACE( VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_ERROR,
+                MAC_ADDRESS_STR
+                ": This station does not exist in the WDI Station Table",
+                MAC_ADDR_ARRAY(pwdiLLStatsGetReqParams->macAddr));
+
+    wpalMemoryFree(pSendBuffer);
+    return WDI_STATUS_E_FAILURE;
+  }
 
   halLLStatsGetParams.req_id = pwdiLLStatsGetReqParams->reqId;
-  halLLStatsGetParams.sta_id = pwdiLLStatsGetReqParams->staId;
   halLLStatsGetParams.param_id_mask = pwdiLLStatsGetReqParams->paramIdMask;
 
   VOS_TRACE( VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_INFO,
@@ -31082,9 +31133,22 @@
      WDI_ASSERT(0);
      return WDI_STATUS_E_FAILURE;
   }
+  /* Need to fill in the self STA Index */
+  if ( WDI_STATUS_SUCCESS !=
+  WDI_STATableFindStaidByAddr(pWDICtx,
+                              pwdiLLStatsClearReqParams->macAddr,
+                &halLLStatsClearParams.sta_id))
+  {
+    VOS_TRACE( VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_ERROR,
+                MAC_ADDRESS_STR
+                ": This station does not exist in the WDI Station Table",
+                MAC_ADDR_ARRAY(pwdiLLStatsClearReqParams->macAddr));
+
+    wpalMemoryFree(pSendBuffer);
+    return WDI_STATUS_E_FAILURE;
+  }
 
   halLLStatsClearParams.req_id = pwdiLLStatsClearReqParams->reqId;
-  halLLStatsClearParams.sta_id = pwdiLLStatsClearReqParams->staId;
   halLLStatsClearParams.stats_clear_req_mask =
                     pwdiLLStatsClearReqParams->statsClearReqMask;
   halLLStatsClearParams.stop_req = pwdiLLStatsClearReqParams->stopReq;
@@ -31161,7 +31225,7 @@
     }
     else
     {
-        VOS_TRACE( VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_INFO,
+        VOS_TRACE( VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_ERROR,
                  "%s: WDILowLevelIndCb is null", __func__);
         WDI_ASSERT(0);
         return WDI_STATUS_E_FAILURE;
diff --git a/CORE/WDI/CP/src/wlan_qct_wdi_sta.c b/CORE/WDI/CP/src/wlan_qct_wdi_sta.c
index 68c5f47..8f0190c 100644
--- a/CORE/WDI/CP/src/wlan_qct_wdi_sta.c
+++ b/CORE/WDI/CP/src/wlan_qct_wdi_sta.c
@@ -637,6 +637,35 @@
 }/*WDI_STATableGetStaAddr*/
 
 /**
+ @brief WDI_STATableGetStaMacAddr - get station MAC address
+
+ @param  pWDICtx:  WDI Context pointer
+         ucSTAIdx:  station index
+         pStaAddr: output station MAC address
+
+ @see
+ @return Result of the function call
+*/
+WDI_Status
+WDI_STATableGetStaMacAddr
+(
+    WDI_ControlBlockType*  pWDICtx,
+    wpt_uint8              ucSTAIdx,
+    wpt_macAddr*           staMacAddr
+)
+{
+    WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable;
+    if ((ucSTAIdx < pWDICtx->ucMaxStations) && (pSTATable[ucSTAIdx].valid))
+    {
+        wpalMemoryCopy(staMacAddr, pSTATable[ucSTAIdx].staAddr,
+                WDI_MAC_ADDR_LEN);
+        return WDI_STATUS_SUCCESS;
+    }
+    else
+        return WDI_STATUS_E_FAILURE;
+}/*WDI_STATableGetStaMacAddr*/
+
+/**
  @brief WDI_STATableSetStaAddr - set station address
  
  @param  pWDICtx:  WDI Context pointer