ueCfg->spCellCfg.servCellCfg.pdschServCellCfg.numHarqProcForPdsch;
}
- if(ueCfg->crnti)
- ueCb->state = UE_STATE_ACTIVE;
- else
- ueCb->state = UE_HANDIN_IN_PROGRESS;
-
/*TODO: To check the bsr value during implementation */
if(ueCfg->macCellGrpCfgPres)
{
DU_LOG("\nERROR --> MAC: Failed while filing MAC LC List at fillMacUeCb()");
}
ueCb->transmissionAction = ueCfg->transmissionAction;
+
return ret;
}
uint8_t updateMacRaCb(uint16_t cellIdx, MacUeCb *ueCb)
{
- uint8_t ueIdx;
/* Copy RA Cb */
- for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
+ if(macCb.macCell[cellIdx]->macRaCb[ueCb->ueId-1].crnti == ueCb->crnti)
{
- if(macCb.macCell[cellIdx]->macRaCb[ueIdx].crnti == ueCb->crnti)
- {
- ueCb->raCb = &macCb.macCell[cellIdx]->macRaCb[ueIdx];
- break;
- }
+ ueCb->raCb = &macCb.macCell[cellIdx]->macRaCb[ueCb->ueId-1];
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC : No RA CB found for UE ID [%d]", ueCb->ueId);
+ return RFAILED;
}
return ROK;
}
void deleteMacRaCb(uint16_t cellIdx, MacUeCb *ueCb)
{
- uint8_t ueIdx;
+ uint8_t tbIdx;
+ MacRaCbInfo *raCb = ueCb->raCb;
+ DlHarqProcCb *hqProcCb;
- for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
+ if(raCb && (raCb->crnti == ueCb->crnti))
{
- if(macCb.macCell[cellIdx]->macRaCb[ueIdx].crnti == ueCb->crnti)
+ hqProcCb = &raCb->msg4HqInfo;
+ MAC_FREE(raCb->msg4Pdu, raCb->msg4PduLen);
+ for(tbIdx = 0; tbIdx < raCb->msg4HqInfo.numTb; tbIdx++)
{
- if(macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4Pdu)
- {
- MAC_FREE(macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4Pdu, \
- macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4PduLen);
- }
- if(macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TxPdu)
- {
- MAC_FREE(macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TxPdu, \
- macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TbSize);
- }
- memset(&macCb.macCell[cellIdx]->macRaCb[ueIdx], 0, sizeof(MacRaCbInfo));
- break;
+ MAC_FREE(raCb->msg4HqInfo.tbInfo[tbIdx].tb, \
+ raCb->msg4HqInfo.tbInfo[tbIdx].tbSize);
}
+ memset(raCb, 0, sizeof(MacRaCbInfo));
}
-
}
/*******************************************************************
* ****************************************************************/
uint8_t createUeCb(uint8_t cellIdx, MacUeCb *ueCb, MacUeCfg *ueCfg)
{
- uint8_t ret =ROK;
+ uint8_t ret = ROK;
+ uint8_t hqProcIdx = 0;
if((ueCb->ueId == ueCfg->ueId) && (ueCb->crnti == ueCfg->crnti)\
&&(ueCb->state == UE_STATE_ACTIVE))
}
else
{
- if(ueCb->state == UE_STATE_ACTIVE)
+ /* Initialize all DL HARQ PROC ID to MAX NUM OF HARQ PROC */
+ for(hqProcIdx = 0; hqProcIdx < MAX_NUM_HARQ_PROC; hqProcIdx++)
{
+ ueCb->dlInfo.dlHarqEnt.harqProcCb[hqProcIdx].procId = MAX_NUM_HARQ_PROC;
+ }
+
+ /* If UE has not requested for RACH yet, it means UE context is created for a
+ * UE in handover */
+ if(macCb.macCell[cellIdx]->macRaCb[ueCb->ueId-1].crnti == ueCb->crnti)
+ {
+ ueCb->state = UE_STATE_ACTIVE;
macCb.macCell[cellIdx]->numActvUe++;
updateMacRaCb(cellIdx, ueCb);
}
+ else
+ ueCb->state = UE_HANDIN_IN_PROGRESS;
+
return ROK;
}
-
}
-
+ return ROK;
}
/*******************************************************************
}
else
{
- deleteMacRaCb(cellIdx, ueCb);
return ROK;
}
}
if(ueCfg)
{
+ /* If CRNTI = 0, MAC must allot a CRNTI to this UE. This scenario hits in
+ * case of UE in handover */
+ if(ueCfg->crnti == 0)
+ {
+ GET_CRNTI(ueCfg->crnti, ueCfg->ueId);
+ }
+
/*Storing received ueCfg in ueCfgTmpData */
ret = copyToTmpData(ueCfg);
if(ret == ROK)