Merge "O1 IP PORT configuration for CM .[Issue-Id: ODUHIGH-196]"
[o-du/l2.git] / src / cm / common_def.c
index 70c35ad..0e681d3 100644 (file)
@@ -23,7 +23,7 @@
  *
  * @details
  *
- *     Function: schAllocFreqDomRscType0
+ *     Function: freqDomRscAllocType0
  *     
  *     This function does allocation in frequency domain resource.
  *     This is a bitmap defining  non-overlapping groups of 6 PRBs in ascending order.
@@ -33,7 +33,7 @@
  *  @param[in]  freqDomain - 6 bytes of info, each bit represents a group of 6 PRB.
  *  @return   void
  **/
-void schAllocFreqDomRscType0(uint16_t startPrb, uint16_t prbSize, uint8_t *freqDomain)
+void freqDomRscAllocType0(uint16_t startPrb, uint16_t prbSize, uint8_t *freqDomain)
 {
    uint8_t remBits = prbSize; /* each bit represents 6 PRBs */
    uint8_t firstByte = 1;
@@ -107,6 +107,39 @@ void oduCpyFixBufToMsg(uint8_t *fixBuf, Buffer *mBuf, uint16_t len)
    ODU_COPY_FIX_BUF_TO_MSG(fixBuf, mBuf, 0, len, (MsgLen *)&copyLen);
 }
 
+/*******************************************************************
+ *
+ * @brief Builds PLMN ID 
+ *
+ * @details
+ *
+ *    Function : plmnBuildId
+ *
+ *    Functionality: Building the PLMN ID
+ *
+ * @params[in] PLMNID plmn
+ * @params[out] PLMNID in string format
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t buildPlmnId(Plmn plmn, uint8_t *buf)
+{
+   uint8_t mncCnt;
+   mncCnt = 2;
+   buf[0] = ((plmn.mcc[1] << 4) | (plmn.mcc[0]));
+   if(mncCnt == 2)
+   {
+      buf[1]  = ((0xf0) | (plmn.mcc[2]));
+      buf[2] = ((plmn.mnc[1] << 4) | (plmn.mnc[0]));
+   }
+   else
+   {
+      buf[1] = ((plmn.mnc[0] << 4) | (plmn.mcc[2]));
+      buf[2] = ((plmn.mnc[2] << 4) | (plmn.mnc[1]));
+   }
+   return ROK;
+}
 
 
 /**********************************************************************