Changes for Multi-UE support and DL_MSG scheduling using K0 and K1 [Issue-ID: ODUHIGH...
[o-du/l2.git] / src / du_app / du_f1ap_msg_hdl.c
index ef4a41c..d1202d9 100644 (file)
@@ -109,6 +109,49 @@ extern StartupConfig g_cfg;
 
 DuCfgParams duCfgParam;
 
+/******************************************************************
+ *
+ * @brief Function to fetch lcId based on DRB Id
+ *
+ * @details
+ *
+ *    Function : fetchLcId
+ *
+ *    @params[in] drbId
+ *
+ *    Functionality: Function to fetch lcId based on DRB Id
+ *
+ * Returns: lcId - SUCCESS
+ *          RFAILED - FAILURE
+ *****************************************************************/
+
+uint8_t fetchLcId(uint8_t drbId)
+{
+   uint8_t cellIdx = 0, ueIdx = 0, lcIdx = 0, numLcs = 0, lcId = 0;
+
+   for(cellIdx = 0; cellIdx < MAX_NUM_CELL; cellIdx++)
+   {
+      for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
+      {
+         if(duCb.actvCellLst[cellIdx] != NULLP)
+         {
+            numLcs = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg.numLcs;
+            for(lcIdx = 0; lcIdx < numLcs; lcIdx++)
+            {
+               if(duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg.rlcLcCfg[lcIdx].rbId == drbId && \
+                  duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg.rlcLcCfg[lcIdx].rbType == RB_TYPE_DRB)
+               {
+                  lcId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg.rlcLcCfg[lcIdx].lcId;
+                  return lcId;
+               }
+            }
+         }
+      }
+   }
+   DU_LOG("\nERROR   -->  DU_APP: fetchLcId() failed for drbId %d", drbId);
+   return RFAILED;
+}
+
 /************************************************************************
  *
  * @brief Converts enum values into actual value of Poll retransmit timer