#include "mac_sch_interface.h"
#include "sch.h"
#include "sch_utils.h"
+#ifdef NR_DRX
+#include "sch_drx.h"
+#endif
/* local defines */
SchUeCfgRspFunc SchUeCfgRspOpts[] =
{
memcpy(&ueCb->ueCfg.macCellGrpCfg , &ueCfg->macCellGrpCfg, sizeof(SchMacCellGrpCfg));
ueCb->ueCfg.macCellGrpCfgPres = true;
+#ifdef NR_DRX
+ if(ueCfg->macCellGrpCfg.drxCfgPresent == true)
+ {
+ if(ueCb->ueDrxInfoPres == false)
+ {
+ ueCb->ueDrxInfoPres = true;
+ /* intialize the drxUeCb */
+ schInitDrxUeCb(ueCb);
+
+ /* intialize the Dl drxHarqCb */
+ for(idx =0; idx<ueCb->dlHqEnt.numHqPrcs; idx++)
+ {
+ schInitDrxHarqCb(&ueCb->dlHqEnt.procs[idx].dlDrxHarqCb);
+ }
+ /* intialize the Ul drxHarqCb */
+ for(idx =0; idx<ueCb->ulHqEnt.numHqPrcs; idx++)
+ {
+ schInitDrxHarqCb(&ueCb->ulHqEnt.procs[idx].ulDrxHarqCb);
+ }
+ /* convert all the drx configuration recived in ms/subms into number of slots and store into the drxUeCb */
+ schFillDrxUeCb(ueCb->cellCb->cellCfg.numerology, ueCfg->macCellGrpCfg.drxCfg, &ueCb->drxUeCb);
+ /* Calculate the onduration timer and short cycle timer (if shortcycle configuration is present) as soon as we
+ * recived ueCfg request */
+ schAddUeInOndurationList(ueCb->cellCb, ueCb, 0);
+
+ }
+ else
+ {
+ /* convert all the drx configuration recived in ms/subms into number
+ * of slots and store into the drxUeCb */
+ schFillDrxUeCb(ueCb->cellCb->cellCfg.numerology, ueCfg->macCellGrpCfg.drxCfg, &ueCb->drxUeCb);
+
+ /* Recalculate/Restart timer based on their presence */
+ schDrxUeReCfgTimer(ueCb->cellCb, ueCb);
+ }
+ }
+#endif
}
+#ifdef NR_DRX
+ if(ueCfg->drxConfigIndicatorRelease == true)
+ {
+ if(ueCb->ueDrxInfoPres == true)
+ {
+ schDeleteUeDrxInfo(ueCb->cellCb, ueCb);
+ ueCb->ueDrxInfoPres = false;
+ }
+ }
+#endif
+
if(ueCfg->phyCellGrpCfgPres == true)
{
memcpy(&ueCb->ueCfg.phyCellGrpCfg , &ueCfg->phyCellGrpCfg, sizeof(SchPhyCellGrpCfg));
* ****************************************************************/
void deleteSchUeCb(SchUeCb *ueCb)
{
- uint8_t timeDomRsrcIdx = 0, ueLcIdx = 0;
+ uint8_t timeDomRsrcIdx = 0, ueLcIdx = 0, idx =0;
SchPucchCfg *pucchCfg = NULLP;
SchPdschConfig *pdschCfg = NULLP;
if(ueCb)
{
+ if(ueCb->hqDlmap)
+ {
+ for (idx = 0; idx<ueCb->cellCb->numSlots; idx++)
+ {
+ if(ueCb->hqDlmap[idx])
+ {
+ cmLListDeleteLList(&ueCb->hqDlmap[idx]->hqList);
+ SCH_FREE(ueCb->hqDlmap[idx], sizeof(SchHqDlMap));
+ }
+ }
+ SCH_FREE(ueCb->hqDlmap, sizeof(SchHqDlMap*)*(ueCb->cellCb->numSlots));
+ }
+
+ if(ueCb->hqUlmap)
+ {
+ for (idx = 0; idx<ueCb->cellCb->numSlots; idx++)
+ {
+ if(ueCb->hqUlmap[idx])
+ {
+ cmLListDeleteLList(&ueCb->hqUlmap[idx]->hqList);
+ SCH_FREE(ueCb->hqUlmap[idx], sizeof(SchHqUlMap));
+ }
+ }
+ SCH_FREE(ueCb->hqUlmap, sizeof(SchHqUlMap*)*(ueCb->cellCb->numSlots));
+ }
+
SCH_FREE(ueCb->ueCfg.ambrCfg, sizeof(SchAmbrCfg));
if(ueCb->ueCfg.spCellCfgPres)
{
SCH_FREE(ueCb->ulInfo.ulLcCtxt[ueLcIdx].snssai, sizeof(Snssai));
SCH_FREE(ueCb->dlInfo.dlLcCtxt[ueLcIdx].snssai, sizeof(Snssai));
}
-
+#ifdef NR_DRX
+ if(ueCb->ueDrxInfoPres)
+ {
+ /* Removing all the calculated drx configuration timer list */
+ schDeleteUeDrxInfo(ueCb->cellCb, ueCb);
+ ueCb->ueDrxInfoPres = false;
+ }
+#endif
memset(ueCb, 0, sizeof(SchUeCb));
}
}
* RFAILED - failure
*
* ****************************************************************/
-uint8_t SchSendCellDeleteRspToMac(SchCellDelete *ueDelete, Inst inst, SchMacRsp result)
+uint8_t SchSendCellDeleteRspToMac(SchCellDeleteReq *ueDelete, Inst inst, SchMacRsp result)
{
Pst rspPst;
uint8_t ret=0;
*
* ****************************************************************/
-uint8_t MacSchCellDeleteReq(Pst *pst, SchCellDelete *cellDelete)
+uint8_t MacSchCellDeleteReq(Pst *pst, SchCellDeleteReq *cellDelete)
{
uint8_t cellIdx=0, ret = RFAILED;
Inst inst = pst->dstInst - SCH_INST_START;