Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
Change-Id: Id9acede67ae3b9c968c2e42e469725b54462d922
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
/* UE Cb */
typedef struct macUeCb
{
/* UE Cb */
typedef struct macUeCb
{
- uint16_t ueId; /* UE Id calculated from CRNTI */
- uint8_t duUeF1apId; /* UE ID assigned by DU APP */
+ uint16_t ueId; /* UE Id from DU APP */
uint16_t crnti; /* UE CRNTI */
MacCellCb *cellCb; /* Pointer to cellCb to whihc this UE belongs */
UeState state; /* Is UE active ? */
uint16_t crnti; /* UE CRNTI */
MacCellCb *cellCb; /* Pointer to cellCb to whihc this UE belongs */
UeState state; /* Is UE active ? */
MacUlSlot ulSlot[MAX_SLOTS];
uint16_t numActvUe;
MacUeCfg *ueCfgTmpData[MAX_NUM_UE];
MacUlSlot ulSlot[MAX_SLOTS];
uint16_t numActvUe;
MacUeCfg *ueCfgTmpData[MAX_NUM_UE];
- MacUeCb hoUeCb[MAX_NUM_UE];
MacUeCb ueCb[MAX_NUM_UE];
MacCellCfg macCellCfg;
SlotTimingInfo currTime;
MacUeCb ueCb[MAX_NUM_UE];
MacCellCfg macCellCfg;
SlotTimingInfo currTime;
if(macCb.macCell[cellIdx] && macCb.macCell[cellIdx]->ueCb[ueId -1].transmissionAction == STOP_TRANSMISSION)
{
if(macCb.macCell[cellIdx] && macCb.macCell[cellIdx]->ueCb[ueId -1].transmissionAction == STOP_TRANSMISSION)
{
- DU_LOG("\nINFO --> MAC : UL data transmission not allowed for UE %d", macCb.macCell[cellIdx]->ueCb[ueId -1].duUeF1apId);
+ DU_LOG("\nINFO --> MAC : UL data transmission not allowed for UE %d", macCb.macCell[cellIdx]->ueCb[ueId -1].ueId);
uint8_t ret = ROK;
schUeCfg->cellId = ueCfg->cellId;
uint8_t ret = ROK;
schUeCfg->cellId = ueCfg->cellId;
- schUeCfg->duUeF1apId = ueCfg->duUeF1apId;
+ schUeCfg->ueId = ueCfg->ueId;
schUeCfg->crnti = ueCfg->crnti;
schUeCfg->dataTransmissionInfo = ueCfg->transmissionAction;
/* Copy MAC cell group config */
schUeCfg->crnti = ueCfg->crnti;
schUeCfg->dataTransmissionInfo = ueCfg->transmissionAction;
/* Copy MAC cell group config */
}
/* Check if UE already configured */
}
/* Check if UE already configured */
- if(ueCfg->crnti)
- ueCb = &macCb.macCell[cellIdx]->ueCb[ueCfg->ueId -1];
- else
- ueCb = &macCb.macCell[cellIdx]->hoUeCb[ueCfg->duUeF1apId -1];
+ ueCb = &macCb.macCell[cellIdx]->ueCb[ueCfg->ueId -1];
}
memcpy(tmpData, ueCfg, sizeof(MacUeCfg));
GET_CELL_IDX(ueCfg->cellId, cellIdx);
}
memcpy(tmpData, ueCfg, sizeof(MacUeCfg));
GET_CELL_IDX(ueCfg->cellId, cellIdx);
- macCb.macCell[cellIdx]->ueCfgTmpData[ueCfg->duUeF1apId-1] = tmpData;
+ macCb.macCell[cellIdx]->ueCfgTmpData[ueCfg->ueId-1] = tmpData;
/* Filling UE Config response */
memset(cfgRsp, 0, sizeof(MacUeCfgRsp));
cfgRsp->cellId = schCfgRsp->cellId;
/* Filling UE Config response */
memset(cfgRsp, 0, sizeof(MacUeCfgRsp));
cfgRsp->cellId = schCfgRsp->cellId;
- cfgRsp->duUeF1apId = schCfgRsp->duUeF1apId;
+ cfgRsp->ueId = schCfgRsp->ueId;
cfgRsp->result = result;
/* Fill Post structure and send UE Create response*/
cfgRsp->result = result;
/* Fill Post structure and send UE Create response*/
/* Filling UE Config response */
memset(cfgRsp, 0, sizeof(MacUeCfgRsp));
cfgRsp->cellId = schCfgRsp->cellId;
/* Filling UE Config response */
memset(cfgRsp, 0, sizeof(MacUeCfgRsp));
cfgRsp->cellId = schCfgRsp->cellId;
- cfgRsp->duUeF1apId = schCfgRsp->duUeF1apId;
+ cfgRsp->ueId = schCfgRsp->ueId;
cfgRsp->result = result;
/* Fill Post structure and send UE Create response*/
cfgRsp->result = result;
/* Fill Post structure and send UE Create response*/
*
* ****************************************************************/
*
* ****************************************************************/
-MacUeCfg *getMacUeCfg(uint16_t cellIdx, uint8_t duUeF1apId)
+MacUeCfg *getMacUeCfg(uint16_t cellIdx, uint8_t ueId)
{
MacUeCfg *ueCfg = NULLP;
if(macCb.macCell[cellIdx])
{
{
MacUeCfg *ueCfg = NULLP;
if(macCb.macCell[cellIdx])
{
- ueCfg = macCb.macCell[cellIdx]->ueCfgTmpData[duUeF1apId-1];
+ ueCfg = macCb.macCell[cellIdx]->ueCfgTmpData[ueId-1];
#endif
GET_CELL_IDX(schCfgRsp->cellId, cellIdx);
#endif
GET_CELL_IDX(schCfgRsp->cellId, cellIdx);
- ueCfg = getMacUeCfg(cellIdx, schCfgRsp->duUeF1apId);
+ ueCfg = getMacUeCfg(cellIdx, schCfgRsp->ueId);
if(ueCfg == NULLP)
{
DU_LOG("\nERROR --> MAC : Failed to find the Mac Ue Cfg for event [%d] in MacProcSchUeCfgRsp()", pst->event);
if(ueCfg == NULLP)
{
DU_LOG("\nERROR --> MAC : Failed to find the Mac Ue Cfg for event [%d] in MacProcSchUeCfgRsp()", pst->event);
ueCb = &cell->ueCb[ueId-1];
if(ueCb->ueCfg.dataTransmissionAction == STOP_DATA_TRANSMISSION)
{
ueCb = &cell->ueCb[ueId-1];
if(ueCb->ueCfg.dataTransmissionAction == STOP_DATA_TRANSMISSION)
{
- DU_LOG("INFO --> SCH : DL Data transmission not allowed for UE %d", ueCb->ueCfg.duUeF1apId);
+ DU_LOG("INFO --> SCH : DL Data transmission not allowed for UE %d", ueCb->ueCfg.ueId);
if(ueCb->ueCfg.dataTransmissionAction == STOP_DATA_TRANSMISSION)
{
if(ueCb->ueCfg.dataTransmissionAction == STOP_DATA_TRANSMISSION)
{
- DU_LOG("\nINFO --> SCH: UL Data transmission not allowed for UE %d", ueCb->ueCfg.duUeF1apId);
+ DU_LOG("\nINFO --> SCH: UL Data transmission not allowed for UE %d", ueCb->ueCfg.ueId);
}
if(ueCb->ueCfg.dataTransmissionAction == STOP_DATA_TRANSMISSION)
{
}
if(ueCb->ueCfg.dataTransmissionAction == STOP_DATA_TRANSMISSION)
{
- DU_LOG("\nINFO --> SCH: UL Data transmission not allowed for UE %d", ueCb->ueCfg.duUeF1apId);
+ DU_LOG("\nINFO --> SCH: UL Data transmission not allowed for UE %d", ueCb->ueCfg.ueId);
return ROK;
}
if(uciInd->numSrBits)
return ROK;
}
if(uciInd->numSrBits)
typedef struct schUeCfgCb
{
uint16_t cellId;
typedef struct schUeCfgCb
{
uint16_t cellId;
uint16_t crnti;
bool macCellGrpCfgPres;
SchMacCellGrpCfg macCellGrpCfg;
uint16_t crnti;
bool macCellGrpCfgPres;
SchMacCellGrpCfg macCellGrpCfg;
uint8_t ssbStartSymbArr[SCH_MAX_SSB_BEAM]; /*!<start symbol per SSB beam */
SchRaReq *raReq[MAX_NUM_UE]; /*!< Pending RA request */
SchRaCb raCb[MAX_NUM_UE]; /*!< RA Cb */
uint8_t ssbStartSymbArr[SCH_MAX_SSB_BEAM]; /*!<start symbol per SSB beam */
SchRaReq *raReq[MAX_NUM_UE]; /*!< Pending RA request */
SchRaCb raCb[MAX_NUM_UE]; /*!< RA Cb */
- SchUeCb hoUeCb[MAX_NUM_UE]; /*!<List of UE being handed-in to this DU */
uint16_t numActvUe; /*!<Number of active UEs */
uint32_t actvUeBitMap; /*!<Bit map to find active UEs */
uint32_t boIndBitMap; /*!<Bit map to indicate UEs that have recevied BO */
uint16_t numActvUe; /*!<Number of active UEs */
uint32_t actvUeBitMap; /*!<Bit map to find active UEs */
uint32_t boIndBitMap; /*!<Bit map to indicate UEs that have recevied BO */
Pst rspPst;
cfgRsp->cellId = ueCfg->cellId;
Pst rspPst;
cfgRsp->cellId = ueCfg->cellId;
- cfgRsp->duUeF1apId = ueCfg->duUeF1apId;
+ cfgRsp->ueId = ueCfg->ueId;
cfgRsp->crnti = ueCfg->crnti;
cfgRsp->rsp = result;
cfgRsp->crnti = ueCfg->crnti;
cfgRsp->rsp = result;
bool isLcIdValid = FALSE;
ueCb->ueCfg.cellId = ueCfg->cellId;
bool isLcIdValid = FALSE;
ueCb->ueCfg.cellId = ueCfg->cellId;
- ueCb->ueCfg.duUeF1apId = ueCfg->duUeF1apId;
+ ueCb->ueCfg.ueId = ueCfg->ueId;
ueCb->ueCfg.crnti = ueCfg->crnti;
ueCb->ueCfg.dataTransmissionAction = ueCfg->dataTransmissionInfo;
if(ueCfg->macCellGrpCfgPres == true)
ueCb->ueCfg.crnti = ueCfg->crnti;
ueCb->ueCfg.dataTransmissionAction = ueCfg->dataTransmissionInfo;
if(ueCfg->macCellGrpCfgPres == true)
* ****************************************************************/
uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfg)
{
* ****************************************************************/
uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfg)
{
- uint8_t ueId, lcIdx, ret = ROK;
+ uint8_t lcIdx = 0, ret = ROK;
SchCellCb *cellCb = NULLP;
SchUeCb *ueCb = NULLP;
SchUeCfgRsp cfgRsp;
SchCellCb *cellCb = NULLP;
SchUeCb *ueCb = NULLP;
SchUeCfgRsp cfgRsp;
cellCb = getSchCellCb(pst->event, inst, ueCfg);
/* Search if UE already configured */
cellCb = getSchCellCb(pst->event, inst, ueCfg);
/* Search if UE already configured */
- if(ueCfg->crnti)
- {
- GET_UE_ID(ueCfg->crnti, ueId);
- ueCb = &cellCb->ueCb[ueId -1];
- }
- else
- ueCb = &cellCb->hoUeCb[ueCfg->duUeF1apId - 1];
+ ueCb = &cellCb->ueCb[ueCfg->ueId - 1];
if((ueCb->crnti == ueCfg->crnti) && (ueCb->state == SCH_UE_STATE_ACTIVE))
{
if((ueCb->crnti == ueCfg->crnti) && (ueCb->state == SCH_UE_STATE_ACTIVE))
{
/* Fill received Ue Configuration in UeCb */
memset(ueCb, 0, sizeof(SchUeCb));
/* Fill received Ue Configuration in UeCb */
memset(ueCb, 0, sizeof(SchUeCb));
+ ueCb->ueId = ueCfg->ueId;
ueCb->crnti = ueCfg->crnti;
if(ueCb->crnti)
ueCb->state = SCH_UE_STATE_ACTIVE;
ueCb->crnti = ueCfg->crnti;
if(ueCb->crnti)
ueCb->state = SCH_UE_STATE_ACTIVE;
{
uint16_t cellId;
uint8_t ueId;
{
uint16_t cellId;
uint8_t ueId;
uint16_t crnti;
bool macCellGrpCfgPres;
MacCellGrpCfg macCellGrpCfg;
uint16_t crnti;
bool macCellGrpCfgPres;
MacCellGrpCfg macCellGrpCfg;
typedef struct ueCfgRsp
{
uint16_t cellId;
typedef struct ueCfgRsp
{
uint16_t cellId;
MacRsp result;
uint8_t numSRBFailed; /* valid values : 0 to MAX_NUM_SRB */
SRBFailInfo *failedSRBlisti;
MacRsp result;
uint8_t numSRBFailed; /* valid values : 0 to MAX_NUM_SRB */
SRBFailInfo *failedSRBlisti;
typedef struct schUeCfg
{
uint16_t cellId;
typedef struct schUeCfg
{
uint16_t cellId;
uint16_t crnti;
bool macCellGrpCfgPres;
SchMacCellGrpCfg macCellGrpCfg;
uint16_t crnti;
bool macCellGrpCfgPres;
SchMacCellGrpCfg macCellGrpCfg;
typedef struct schUeCfgRsp
{
uint16_t cellId;
typedef struct schUeCfgRsp
{
uint16_t cellId;
uint16_t crnti;
SchMacRsp rsp;
SchFailureCause cause;
uint16_t crnti;
SchMacRsp rsp;
SchFailureCause cause;
- duUeCb = &duCb.actvCellLst[cellIdx]->hoUeCb[ueIdx];
+ duUeCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx];
duUeCb->f1UeDb = NULL;
duUeCb->gnbCuUeF1apId = gnbCuUeF1apId;
duUeCb->gnbDuUeF1apId = gnbDuUeF1apId;
duUeCb->f1UeDb = NULL;
duUeCb->gnbCuUeF1apId = gnbCuUeF1apId;
duUeCb->gnbDuUeF1apId = gnbDuUeF1apId;
MacCellCfg *duMacCellCfg;
CellStatus cellStatus; /* Cell status */
uint32_t numActvUes; /* Total Active UEs */
MacCellCfg *duMacCellCfg;
CellStatus cellStatus; /* Cell status */
uint32_t numActvUes; /* Total Active UEs */
- DuUeCb ueCb[MAX_NUM_UE]; /* UE context created after RRC setup */
- uint32_t numHoUes; /* Number of UE handover in progress */
- DuUeCb hoUeCb[MAX_NUM_UE]; /* UE context created before RACH for UE being handover to this DU */
+ DuUeCb ueCb[MAX_NUM_UE]; /* Stores UE context */
SlotInfo currSlotInfo;
}DuCellCb;
SlotInfo currSlotInfo;
}DuCellCb;
bool lcIdFound = false;
MacUeCfg *duMacDb = NULLP;
bool lcIdFound = false;
MacUeCfg *duMacDb = NULLP;
- macUeCfg->cellId = cellId;
- if(crnti)
- {
- GET_UE_ID(crnti, macUeCfg->ueId);
- macUeCfg->crnti = crnti;
- }
- macUeCfg->duUeF1apId = gnbDuUef1apId;
+ macUeCfg->cellId = cellId;
+ macUeCfg->ueId = gnbDuUef1apId;
+ macUeCfg->crnti = crnti;
* ****************************************************************/
uint8_t DuProcMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp)
{
* ****************************************************************/
uint8_t DuProcMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp)
{
- uint8_t ret = ROK, ueIdx = 0, ueId = 0;
- DuUeCb *ueCb = NULLP;
+ uint8_t ret = ROK;
+ uint16_t cellIdx;
+ GET_CELL_IDX(cfgRsp->cellId, cellIdx);
if(cfgRsp->result == MAC_DU_APP_RSP_OK)
{
if(pst->event == EVENT_MAC_UE_CREATE_RSP)
{
if(cfgRsp->result == MAC_DU_APP_RSP_OK)
{
if(pst->event == EVENT_MAC_UE_CREATE_RSP)
{
- DU_LOG("\nINFO --> DU APP : MAC UE Create Response : SUCCESS [DU UE F1AP ID : %d]", cfgRsp->duUeF1apId);
-
- for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
- {
- if(duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[ueIdx].gnbDuUeF1apId == cfgRsp->duUeF1apId)
- {
- ueCb = &duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[ueIdx];
- ueCb->macUeCfg.macUeCfgState = UE_CREATE_COMPLETE;
- break;
- }
- }
- if(!ueCb)
+ DU_LOG("\nINFO --> DU APP : MAC UE Create Response : SUCCESS [DU UE F1AP ID : %d]", cfgRsp->ueId);
+
+ if(duCb.actvCellLst[cellIdx] &&
+ (duCb.actvCellLst[cellIdx]->ueCb[cfgRsp->ueId -1].gnbDuUeF1apId == cfgRsp->ueId))
- if(duCb.actvCellLst[cfgRsp->cellId -1]->hoUeCb[cfgRsp->duUeF1apId-1].gnbDuUeF1apId == cfgRsp->duUeF1apId)
- {
- ueCb = &duCb.actvCellLst[cfgRsp->cellId -1]->hoUeCb[cfgRsp->duUeF1apId-1];
- ueCb->macUeCfg.macUeCfgState = UE_CREATE_COMPLETE;
- //TODO : in next gerrit
- //BuildAndSendUeCtxtRsp(cfgRsp->cellId, cfgRsp->ueId);
- }
- }
+ duCb.actvCellLst[cellIdx]->ueCb[cfgRsp->ueId -1].macUeCfg.macUeCfgState = UE_CREATE_COMPLETE;
+ /* TODO : IF UE state is HANDIN_IN_PROGRESS, then send UE Context Setup Response */
+ }
}
else if(pst->event == EVENT_MAC_UE_RECONFIG_RSP)
{
}
else if(pst->event == EVENT_MAC_UE_RECONFIG_RSP)
{
- DU_LOG("\nINFO --> DU APP : MAC UE Reconfig Response : SUCCESS [DU UE F1AP ID : %d]", cfgRsp->duUeF1apId);
- for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
- {
- if(duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[ueIdx].gnbDuUeF1apId == cfgRsp->duUeF1apId)
- {
- ueCb = &duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[ueIdx];
- ueCb->macUeCfg.macUeCfgState = UE_RECFG_COMPLETE;
- break;
- }
- }
-
- if(ueCb)
+ DU_LOG("\nINFO --> DU APP : MAC UE Reconfig Response : SUCCESS [DU UE F1AP ID : %d]", cfgRsp->ueId);
+ if(duCb.actvCellLst[cellIdx] &&
+ (duCb.actvCellLst[cellIdx]->ueCb[cfgRsp->ueId -1].gnbDuUeF1apId == cfgRsp->ueId))
- GET_UE_ID(ueCb->crnti, ueId);
- if((ret = duUpdateDuUeCbCfg(ueId, cfgRsp->cellId)) == ROK)
- {
- BuildAndSendUeCtxtRsp(cfgRsp->cellId, ueId);
+ duCb.actvCellLst[cellIdx]->ueCb[cfgRsp->ueId -1].macUeCfg.macUeCfgState = UE_RECFG_COMPLETE;
+ if((ret = duUpdateDuUeCbCfg(cfgRsp->ueId, cfgRsp->cellId)) == ROK)
+ {
+ BuildAndSendUeCtxtRsp(cfgRsp->cellId, cfgRsp->ueId);
- DU_LOG("\nERROR --> DU APP : MAC UE CFG Response for EVENT[%d]: FAILURE [DU UE F1AP ID : %d]", pst->event, cfgRsp->duUeF1apId);
+ DU_LOG("\nERROR --> DU APP : MAC UE CFG Response for EVENT[%d]: FAILURE [DU UE F1AP ID : %d]", pst->event, cfgRsp->ueId);
if(pst->event == EVENT_MAC_UE_RECONFIG_RSP)
{
//TODO: Send the failure case in Ue Context Setup Response
if(pst->event == EVENT_MAC_UE_RECONFIG_RSP)
{
//TODO: Send the failure case in Ue Context Setup Response