JIRA ID:[ODUHIGH-296]-Dl Data Changes from DUAPP to RLC
[o-du/l2.git] / src / cm / du_app_rlc_inf.c
index d85e02f..5878def 100644 (file)
@@ -624,13 +624,87 @@ uint8_t unpackRlcUlUserDataToDu(RlcUlUserDataToDuFunc func, Pst *pst, Buffer *mB
    else
    {
       /* Nothing to do for other selectors */
-      DU_LOG("\nERROR  --> DU APP: Only LWLC supported for UL User data transfer ");
+      DU_LOG("\nERROR  --> RLC UL: Only LWLC supported for UL User data transfer ");
       ODU_PUT_MSG_BUF(mBuf);
    }
 
    return RFAILED;
 }
 
+/*******************************************************************
+ *
+ * @brief Pack and send DL user data from DUAPP to RLC
+ *
+ * @details
+ *
+ *    Function : packRlcDlUserDataToRlc
+ *
+ *    Functionality:
+ *       Pack and send DL User Data from DUAPP to RLC
+ *
+ * @params[in] Post structure
+ *             DL user data
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t packRlcDlUserDataToRlc(Pst *pst, RlcDlUserDataInfo *dlUserData)
+{
+   Buffer *mBuf = NULLP;
+
+   if(pst->selector == ODU_SELECTOR_LWLC)
+   {
+      if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+      {
+         DU_LOG("\nERROR  -->  RLC DL: Memory allocation failed at packRlcDlUserDataToRlc");
+         return RFAILED;
+      }
+      /* pack the address of the structure */
+      CMCHKPK(oduPackPointer,(PTR)dlUserData, mBuf);
+      return ODU_POST_TASK(pst,mBuf);
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  RLC DL: Only LWLC supported for packRlcUlUserDataToDu");
+   }
+   return RFAILED;
+}
+
+/*******************************************************************
+ *
+ * @brief Unpack DL user data received at RLC from DUAPP
+ *
+ * @details
+ *
+ *    Function : unpackRlcDlUserDataToRlc
+ *
+ *    Functionality:
+ *      Unpack DL user data received at RLC from DUAPP
+ *
+ * @params[in]
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t unpackRlcDlUserDataToRlc(DuRlcDlUserDataToRlcFunc func, Pst *pst, Buffer *mBuf)
+{
+   if(pst->selector == ODU_SELECTOR_LWLC)
+   {
+      RlcDlUserDataInfo *dlUserData;
+      /* unpack the address of the structure */
+      CMCHKUNPK(oduUnpackPointer, (PTR *)&dlUserData, mBuf);
+      ODU_PUT_MSG_BUF(mBuf);
+      return (*func)(pst, dlUserData);
+   }
+   else
+   {
+      /* Nothing to do for other selectors */
+      DU_LOG("\nERROR  --> RLC DL: Only LWLC supported for UL User data transfer ");
+      ODU_PUT_MSG_BUF(mBuf);
+   }
+
+   return RFAILED;
+}
 /**********************************************************************
          End of file
 ***********************************************************************/