valgrind memory leak fixes
[o-du/l2.git] / src / 5gnrmac / mac_cfg_hdl.c
index 2293082..3fbd355 100644 (file)
@@ -29,6 +29,9 @@
 #include "lwr_mac.h"
 #include "lwr_mac_fsm.h"
 #include "mac_utils.h"
+#include "lwr_mac_phy.h"
+
+uint8_t ssbPeriodicity[6] = {5, 10, 20, 40, 80, 160};
 
 uint8_t MacSchCellCfgReq(Pst *pst, MacCellCfg  *macCellCfg);
 
@@ -121,7 +124,7 @@ uint8_t MacProcCellCfgReq(Pst *pst, MacCellCfg *macCellCfg)
    uint8_t ret = ROK;
    MacCellCb     *macCellCb;
 
-   memset(&cfmPst, 0, sizeof(Pst));
+   memset((uint8_t *)&cfmPst, 0, sizeof(Pst));
 
    MAC_ALLOC(macCellCb, sizeof(MacCellCb));
    if(macCellCb == NULLP)
@@ -169,9 +172,6 @@ uint8_t MacProcCellCfgReq(Pst *pst, MacCellCfg *macCellCfg)
       MAC_FREE_SHRABL_BUF(pst->region, pst->pool, macCellCfg->sib1Cfg.sib1Pdu, macCellCfg->sib1Cfg.sib1PduLen);
       MAC_FREE_SHRABL_BUF(pst->region, pst->pool, macCellCfg ,sizeof(MacCellCfg));
    }
-#ifdef INTEL_WLS
-   LwrMacEnqueueWlsBlock();
-#endif
    return ret;
 } /* end of MacProcCellCfgReq */
 
@@ -193,19 +193,21 @@ uint8_t MacSchCellCfgReq(Pst *pst, MacCellCfg *macCellCfg)
 {
    SchCellCfg schCellCfg;
    Pst        cfgPst;
-   uint8_t    ret;
+   uint8_t    ret =0;
 
    memset(&cfgPst, 0, sizeof(Pst));
+   memset(&schCellCfg, 0, sizeof(SchCellCfg));
    schCellCfg.cellId = macCellCfg->cellId;
    schCellCfg.phyCellId = macCellCfg->phyCellId;
    schCellCfg.bandwidth = macCellCfg->dlCarrCfg.bw;
+   schCellCfg.numerology = macCellCfg->numerology;
    schCellCfg.dupMode = macCellCfg->dupType;
 
    /* fill ssb scheduler parameters */
    schCellCfg.ssbSchCfg.ssbPbchPwr = macCellCfg->ssbCfg.ssbPbchPwr;
    schCellCfg.ssbSchCfg.scsCommon = macCellCfg->ssbCfg.scsCmn;
    schCellCfg.ssbSchCfg.ssbOffsetPointA = macCellCfg->ssbCfg.ssbOffsetPointA;
-   schCellCfg.ssbSchCfg.ssbPeriod = macCellCfg->ssbCfg.ssbPeriod;
+   schCellCfg.ssbSchCfg.ssbPeriod = ssbPeriodicity[macCellCfg->ssbCfg.ssbPeriod];
    schCellCfg.ssbSchCfg.ssbSubcOffset = macCellCfg->ssbCfg.ssbScOffset;
    for(uint8_t idx=0; idx<SSB_MASK_SIZE; idx++)
    {
@@ -346,7 +348,11 @@ uint8_t MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm)
    if(schCellCfgCfm->rsp == RSP_OK)
    {
       cellId = &schCellCfgCfm->cellId;
+#ifdef INTEL_TIMER_MODE
+      sendToLowerMac(UL_IQ_SAMPLE, 0, (void *)cellId);
+#else
       sendToLowerMac(CONFIG_REQUEST, 0, (void *)cellId);
+#endif
    }
    else
    {