ueCbLcCfg->lcp = lcCfg->dlLcCfg.lcp;
ueCbLcCfg->lcState = SCH_LC_STATE_ACTIVE;
ueCbLcCfg->bo = 0;
+ if(lcCfg->drbQos)
+ {
+ ueCbLcCfg->pduSessionId = lcCfg->drbQos->pduSessionId;
+ }
+ if(lcCfg->snssai)
+ {
+ if(ueCbLcCfg->snssai == NULLP)/*In CONFIG_MOD case, no need to allocate SNSSAI memory*/
+ {
+ SCH_ALLOC(ueCbLcCfg->snssai, sizeof(Snssai));
+ }
+ memcpy(ueCbLcCfg->snssai, lcCfg->snssai,sizeof(Snssai));
+ }
}
/*******************************************************************
ueCbLcCfg->pbr = lcCfg->ulLcCfg.pbr;
ueCbLcCfg->bsd = lcCfg->ulLcCfg.bsd;
+ if(lcCfg->drbQos)
+ {
+ ueCbLcCfg->pduSessionId = lcCfg->drbQos->pduSessionId;
+ }
+ if(lcCfg->snssai)
+ {
+ /*In CONFIG_MOD case, no need to allocate SNSSAI memory again*/
+ if(ueCbLcCfg->snssai == NULLP)
+ {
+ SCH_ALLOC(ueCbLcCfg->snssai, sizeof(Snssai));
+ }
+ memcpy(ueCbLcCfg->snssai, lcCfg->snssai,sizeof(Snssai));
+ }
}
/*******************************************************************
memcpy(&ulInfo->ulLcCtxt[lcIdx], &ulInfo->ulLcCtxt[lcIdx+1], sizeof(SchUlLcCtxt));
memset(&ulInfo->ulLcCtxt[lcIdx+1], 0, sizeof(SchUlLcCtxt));
}
+ /*Leakage of Last Index*/
+ /*Last index of ulLcCtxt(before deletion) should be void*/
+ if(ulInfo->ulLcCtxt[ulInfo->numUlLc].snssai != NULLP)
+ {
+ DU_LOG("ERROR --> SCH: updateSchUlCb Last index:%d (Before Deletion) memory is leaking",\
+ ulInfo->numUlLc);
+ SCH_FREE(ulInfo->ulLcCtxt[ulInfo->numUlLc].snssai, sizeof(Snssai));
+ }
+ else
+ {
+ DU_LOG("INFO --> SCH: updateSchUlCb Last index:%d (before deletion) memory is freed successfully",\
+ ulInfo->numUlLc);
+
+ }
}
/*******************************************************************
memcpy(&dlInfo->dlLcCtxt[lcIdx], &dlInfo->dlLcCtxt[lcIdx+1], sizeof(SchDlLcCtxt));
memset(&dlInfo->dlLcCtxt[lcIdx+1], 0, sizeof(SchDlLcCtxt));
}
+ /*Leakage of Last Index*/
+ /*Last index of ulLcCtxt(before deletion) should be void*/
+ if(dlInfo->dlLcCtxt[dlInfo->numDlLc].snssai != NULLP)
+ {
+ DU_LOG("ERROR --> SCH: updateSchDlCb Last index:%d (before deletion) memory is leaking: Delete the S-NSSAI memory",\
+ dlInfo->numDlLc);
+ SCH_FREE(dlInfo->dlLcCtxt[dlInfo->numDlLc].snssai, sizeof(Snssai));
+ }
+ else
+ {
+ DU_LOG("INFO --> SCH: updateSchDlCb Last index:%d (before deletion) memory is freed successfully",\
+ dlInfo->numDlLc);
+ }
}
/*******************************************************************
memcpy(&ueCb->ueCfg.spCellCfg , &ueCfg->spCellCfg, sizeof(SchSpCellCfg));
ueCb->ueCfg.spCellCfgPres = true;
dlDataToUlAck = ueCfg->spCellCfg.servCellCfg.initUlBwp.pucchCfg.dlDataToUlAck;
- if(dlDataToUlAck)
+ if(ueCb->cellCb)
{
- BuildK0K1Table(ueCb->cellCb, &ueCb->ueCfg.spCellCfg.servCellCfg.initDlBwp.k0K1InfoTbl, false, pdschCfg,\
- ueCfg->spCellCfg.servCellCfg.initDlBwp.pdschCfg, dlDataToUlAck->dlDataToUlAckListCount,\
- dlDataToUlAck->dlDataToUlAckList);
+ if(dlDataToUlAck)
+ {
+ BuildK0K1Table(ueCb->cellCb, &ueCb->ueCfg.spCellCfg.servCellCfg.initDlBwp.k0K1InfoTbl, false, pdschCfg,\
+ ueCfg->spCellCfg.servCellCfg.initDlBwp.pdschCfg, dlDataToUlAck->dlDataToUlAckListCount,\
+ dlDataToUlAck->dlDataToUlAckList);
+ BuildK2InfoTable(ueCb->cellCb, ueCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg.timeDomRsrcAllocList,\
+ ueCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg.numTimeDomRsrcAlloc,\
+ NULLP, &ueCb->ueCfg.spCellCfg.servCellCfg.initUlBwp.k2InfoTbl);
+ }
}
}
if(ueCfg->schLcCfg[lcIdx].configType == CONFIG_MOD)
{
fillSchUlLcCtxt(&ueCb->ulInfo.ulLcCtxt[ueLcIdx], &ueCfg->schLcCfg[lcIdx]);
- fillSchDlLcCtxt(&ueCb->dlInfo.dlLcCtxt[ueLcIdx], &ueCfg->schLcCfg[lcIdx]);
break;
}
- if(ueCfg->schLcCfg[ueLcIdx].configType == CONFIG_DEL)
+ /*BUG: ueCfg using lcIdx (Looping around numLCs in ueCfg whereas
+ * ueLcIdx Loops around numUlLc in SCH UL DB*/
+ if(ueCfg->schLcCfg[lcIdx].configType == CONFIG_DEL)
{
memset(&ueCb->ulInfo.ulLcCtxt[ueLcIdx], 0, sizeof(SchUlLcCtxt));
ueCb->ulInfo.numUlLc--;
- updateSchUlCb(ueLcIdx, &ueCb->ulInfo); //moving arr elements one idx ahead
+ updateSchUlCb(ueLcIdx, &ueCb->ulInfo); //moving arr elements one idx ahead
+
+ break;
+ }
+ }
+ }/*End of inner for loop */
+
+ for(ueLcIdx = 0; ueLcIdx < ueCb->dlInfo.numDlLc; ueLcIdx++) //searching for Lc to be Mod
+ {
+ if(ueCb->dlInfo.dlLcCtxt[ueLcIdx].lcId == ueCfg->schLcCfg[lcIdx].lcId)
+ {
+ if(ueCfg->schLcCfg[lcIdx].configType == CONFIG_MOD)
+ {
+ fillSchDlLcCtxt(&ueCb->dlInfo.dlLcCtxt[ueLcIdx], &ueCfg->schLcCfg[lcIdx]);
+ break;
+ }
+ if(ueCfg->schLcCfg[lcIdx].configType == CONFIG_DEL)
+ {
memset(&ueCb->dlInfo.dlLcCtxt[ueLcIdx], 0, sizeof(SchDlLcCtxt));
ueCb->dlInfo.numDlLc--;
updateSchDlCb(ueLcIdx, &ueCb->dlInfo); //moving arr elements one idx ahead
}
SCH_FREE(ueCfg->schLcCfg[lcIdx].drbQos, sizeof(SchDrbQosInfo));
- SCH_FREE(ueCfg->schLcCfg[lcIdx].snssai, sizeof(SchSnssai));
+ SCH_FREE(ueCfg->schLcCfg[lcIdx].snssai, sizeof(Snssai));
}/* End of outer for loop */
return ROK;
/* Update pusch in cell */
for(idx=startSymb; idx<symbLen; idx++)
{
- cellCb->schUlSlotInfo[puschSlot]->assignedPrb[idx] = startRb + numRb;
+ //cellCb->schUlSlotInfo[puschSlot]->assignedPrb[idx] = startRb + numRb;
}
schUlSlotInfo = cellCb->schUlSlotInfo[puschSlot];
* ****************************************************************/
void deleteSchUeCb(SchUeCb *ueCb)
{
- uint8_t timeDomRsrcIdx;
+ uint8_t timeDomRsrcIdx = 0, ueLcIdx = 0;
SchPucchCfg *pucchCfg = NULLP;
SchPdschConfig *pdschCfg = NULLP;
SCH_FREE(ueCb->ueCfg.spCellCfg.servCellCfg.bwpInactivityTmr, sizeof(uint8_t));
deleteSchPdschServCellCfg(&ueCb->ueCfg.spCellCfg.servCellCfg.pdschServCellCfg);
}
+ /*Need to Free the memory allocated for S-NSSAI*/
+ for(ueLcIdx = 0; ueLcIdx < ueCb->ulInfo.numUlLc; ueLcIdx++)
+ {
+ SCH_FREE(ueCb->ulInfo.ulLcCtxt[ueLcIdx].snssai, sizeof(Snssai));
+ }
+ for(ueLcIdx = 0; ueLcIdx < ueCb->dlInfo.numDlLc; ueLcIdx++)
+ {
+ SCH_FREE(ueCb->dlInfo.dlLcCtxt[ueLcIdx].snssai, sizeof(Snssai));
+ }
memset(ueCb, 0, sizeof(SchUeCb));
}
}
* ****************************************************************/
void deleteSchCellCb(SchCellCb *cellCb)
{
- uint8_t idx=0;
+ uint8_t sliceIdx=0, slotIdx=0;
if(cellCb->schDlSlotInfo)
{
- for(idx=0; idx<cellCb->numSlots; idx++)
+ for(slotIdx=0; slotIdx<cellCb->numSlots; slotIdx++)
{
- if(cellCb->schDlSlotInfo[idx])
- {
- SCH_FREE(cellCb->schDlSlotInfo[idx], sizeof(SchDlSlotInfo));
- }
+ SCH_FREE(cellCb->schDlSlotInfo[slotIdx], sizeof(SchDlSlotInfo));
}
SCH_FREE(cellCb->schDlSlotInfo, cellCb->numSlots *sizeof(SchDlSlotInfo*));
}
if(cellCb->schUlSlotInfo)
{
- for(idx=0; idx<cellCb->numSlots; idx++)
+ for(slotIdx=0; slotIdx<cellCb->numSlots; slotIdx++)
{
- if(cellCb->schUlSlotInfo[idx])
- {
- SCH_FREE(cellCb->schUlSlotInfo[idx], sizeof(SchUlSlotInfo));
- }
+ SCH_FREE(cellCb->schUlSlotInfo[slotIdx], sizeof(SchUlSlotInfo));
}
SCH_FREE(cellCb->schUlSlotInfo, cellCb->numSlots * sizeof(SchUlSlotInfo*));
}
+
+ if(cellCb->cellCfg.snssai)
+ {
+ for(sliceIdx=0; sliceIdx<cellCb->cellCfg.numSliceSupport; sliceIdx++)
+ {
+ SCH_FREE(cellCb->cellCfg.snssai[sliceIdx], sizeof(Snssai));
+ }
+ SCH_FREE(cellCb->cellCfg.snssai, cellCb->cellCfg.numSliceSupport*sizeof(Snssai*));
+ }
+ SCH_FREE(cellCb->cellCfg.rrmPolicy, sizeof(SchRrmPolicy));
memset(cellCb, 0, sizeof(SchCellCb));
}