* ****************************************************************/
uint8_t fapiMacRxDataInd(Pst *pst, RxDataInd *rxDataInd)
{
- uint16_t pduIdx;
+ uint8_t ueId = 0;
+ uint16_t pduIdx, cellIdx = 0;
DU_LOG("\nDEBUG --> MAC : Received Rx Data indication");
/* TODO : compare the handle received in RxDataInd with handle send in PUSCH
* PDU, which is stored in raCb */
for(pduIdx = 0; pduIdx < rxDataInd->numPdus; pduIdx++)
{
- unpackRxData(rxDataInd->cellId, rxDataInd->timingInfo, &rxDataInd->pdus[pduIdx]);
+
+ GET_CELL_IDX(rxDataInd->cellId, cellIdx);
+ GET_UE_ID(rxDataInd->pdus[pduIdx].rnti, ueId);
+
+ 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);
+ }
+ else
+ {
+ unpackRxData(rxDataInd->cellId, rxDataInd->timingInfo, &rxDataInd->pdus[pduIdx]);
+ }
MAC_FREE_SHRABL_BUF(pst->region, pst->pool, rxDataInd->pdus[pduIdx].pduData,\
rxDataInd->pdus[pduIdx].pduLength);
}
ulData->slotInfo.cellId = cellId;
/* Filling pdu info */
- if(lcId == SRB1_LCID || lcId == SRB2_LCID)
- {
+ if(lcId != SRB0_LCID)
+ ulData->pduInfo[ulData->numPdu].commCh = false;
+ else
ulData->pduInfo[ulData->numPdu].commCh = true;
- }
+
ulData->pduInfo[ulData->numPdu].lcId = lcId;
ulData->pduInfo[ulData->numPdu].pduBuf = pdu;
ulData->pduInfo[ulData->numPdu].pduLen = pduLen;
* ****************************************************************/
uint8_t FapiMacUciInd(Pst *pst, UciInd *macUciInd)
{
- uint8_t pduIdx = 0;
- uint8_t ret = ROK;
- uint16_t nPdus;
- uint16_t crnti;
+ uint8_t pduIdx = 0, ret = ROK;
+ uint16_t nPdus = 0, crnti = 0;
if(macUciInd)
{
if(macUciInd->pdus[pduIdx].uci.uciPucchF0F1.srInfo.srIndPres)
{
DU_LOG("\nDEBUG --> MAC : Received SR UCI indication");
- crnti = macUciInd->pdus[pduIdx].uci.uciPucchF0F1.crnti;
- ret = buildAndSendSrInd(macUciInd, crnti);
+ crnti = macUciInd->pdus[pduIdx].uci.uciPucchF0F1.crnti;
+ ret = buildAndSendSrInd(macUciInd, crnti);
}
break;
case UCI_IND_PUCCH_F2F3F4:
struct DRBs_SetupMod_ItemIEs *drbItemIe;
drbCnt = ueCfg->numDrbSetupMod;
+
+ if(!drbCnt)
+ {
+ DU_LOG("\nINFO --> F1AP : BuildDrbToBeSetupModList(): No DRB information to avaialble to add");
+ return ROK;
+ }
+
drbSet->list.count = drbCnt;
drbSet->list.size = drbCnt * sizeof(DRBs_SetupMod_ItemIEs_t *);
DU_ALLOC(drbSet->list.array, drbSet->list.size);
ueContextModifyRes =&f1apMsg->choice.successfulOutcome->value.choice.UEContextModificationResponse;
if(ueCb->f1UeDb->actionType == UE_CTXT_MOD)
- elementCnt = 3;
+ {
+ if(ueCb->f1UeDb->duUeCfg.numDrbSetupMod)
+ elementCnt =3;
+ else
+ elementCnt =2;
+ }
if(ueCb->f1UeDb->actionType == UE_CTXT_CFG_QUERY)
elementCnt = 5;
if(ueCb->f1UeDb->actionType == UE_CTXT_RRC_RECFG_COMPLETE)
}
if((ueCb->f1UeDb->actionType == UE_CTXT_CFG_QUERY) || (ueCb->f1UeDb->actionType == UE_CTXT_MOD))
- {
- ieIdx++;
- ueContextModifyRes->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_DRBs_SetupMod_List;
- ueContextModifyRes->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
- ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.present =\
- UEContextModificationResponseIEs__value_PR_DRBs_SetupMod_List;
- if(ueCb->f1UeDb->actionType == UE_CTXT_CFG_QUERY)
+ {
+ if(ueCb->f1UeDb->duUeCfg.numDrbSetupMod)
{
- for(tnlIdx = 0; tnlIdx < duCb.numTeId; tnlIdx++)
+ ieIdx++;
+ ueContextModifyRes->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_DRBs_SetupMod_List;
+ ueContextModifyRes->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
+ ueContextModifyRes->protocolIEs.list.array[ieIdx]->value.present =\
+ UEContextModificationResponseIEs__value_PR_DRBs_SetupMod_List;
+ if(ueCb->f1UeDb->actionType == UE_CTXT_CFG_QUERY)
{
- if(duCb.upTnlCfg[tnlIdx]->ueId == ueCb->gnbDuUeF1apId)
+ for(tnlIdx = 0; tnlIdx < duCb.numTeId; tnlIdx++)
{
- memcpy(&ueCb->f1UeDb->duUeCfg.upTnlInfo[ueCb->f1UeDb->duUeCfg.numDrbSetupMod++], duCb.upTnlCfg[tnlIdx], sizeof(UpTnlCfg));
+ if(duCb.upTnlCfg[tnlIdx]->ueId == ueCb->gnbDuUeF1apId)
+ {
+ memcpy(&ueCb->f1UeDb->duUeCfg.upTnlInfo[ueCb->f1UeDb->duUeCfg.numDrbSetupMod++], duCb.upTnlCfg[tnlIdx], sizeof(UpTnlCfg));
+ }
}
}
- }
- ret = BuildDrbSetupModList(&(ueContextModifyRes->protocolIEs.list.array[ieIdx]->\
- value.choice.DRBs_SetupMod_List) , &ueCb->f1UeDb->duUeCfg);
- if(ret != ROK)
- {
- DU_LOG( "\nERROR --> F1AP : Failed to build DRB setupmod List ");
- break;
+ ret = BuildDrbSetupModList(&(ueContextModifyRes->protocolIEs.list.array[ieIdx]->\
+ value.choice.DRBs_SetupMod_List) , &ueCb->f1UeDb->duUeCfg);
+ if(ret != ROK)
+ {
+ DU_LOG( "\nERROR --> F1AP : Failed to build DRB setupmod List ");
+ break;
+ }
}
}
ret = RFAILED;
break;
}
+
+ ret = ROK;
break;
}
FreeUeContextModResp(f1apMsg);
* @return void
*
* ****************************************************************/
- void freeAperDecodeUeContextModificationReqMsg(UEContextModificationRequest_t *UeContextModifyReq )
+ void freeAperDecodeUeContextModificationReqMsg(UEContextModificationRequest_t *ueContextModifyReq )
{
uint8_t arrIdx, ieId;
- if(UeContextModifyReq->protocolIEs.list.array)
+ if(ueContextModifyReq->protocolIEs.list.array)
{
- for( arrIdx = 0 ; arrIdx<UeContextModifyReq->protocolIEs.list.count ; arrIdx++)
+ for( arrIdx = 0 ; arrIdx<ueContextModifyReq->protocolIEs.list.count ; arrIdx++)
{
- if(UeContextModifyReq->protocolIEs.list.array[arrIdx])
+ if(ueContextModifyReq->protocolIEs.list.array[arrIdx])
{
- ieId = UeContextModifyReq->protocolIEs.list.array[arrIdx]->id;
+ ieId = ueContextModifyReq->protocolIEs.list.array[arrIdx]->id;
switch(ieId)
{
case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
break;
case ProtocolIE_ID_id_DRBs_ToBeSetupMod_List:
{
- freeAperDecodeDrbToBeSetupModList(&UeContextModifyReq->protocolIEs.list.array[arrIdx]->\
+ freeAperDecodeDrbToBeSetupModList(&ueContextModifyReq->protocolIEs.list.array[arrIdx]->\
value.choice.DRBs_ToBeSetupMod_List);
break;
}
+ case ProtocolIE_ID_id_TransmissionActionIndicator:
+ break;
+ case ProtocolIE_ID_id_RRCContainer:
+ {
+ free(ueContextModifyReq->protocolIEs.list.array[arrIdx]->value.choice.RRCContainer.buf);
+ }
}
- free(UeContextModifyReq->protocolIEs.list.array[arrIdx]);
+ free(ueContextModifyReq->protocolIEs.list.array[arrIdx]);
}
}
- free(UeContextModifyReq->protocolIEs.list.array);
+ free(ueContextModifyReq->protocolIEs.list.array);
}
}
/*******************************************************************
{
DU_ALLOC(duUeCb->f1UeDb, sizeof(F1UeContextSetupDb));
duUeCb->f1UeDb->cellIdx = cellIdx;
+ duUeCb->f1UeDb->actionType = UE_CTXT_MOD;
}
break;
}
}
break;
}
+
+ case ProtocolIE_ID_id_RRCContainer:
+ {
+ /* Filling Dl RRC Msg Info */
+ DU_ALLOC_SHRABL_BUF(duUeCb->f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg));
+ if(!duUeCb->f1UeDb->dlRrcMsg)
+ {
+ DU_LOG("\nERROR --> DU APP : procF1UeContextReleaseCommand(): \
+ Memory allocation failed ");
+ ret = RFAILED;
+ }
+ else
+ {
+ duUeCb->f1UeDb->dlRrcMsgPres = true;
+ memset(duUeCb->f1UeDb->dlRrcMsg, 0, sizeof(F1DlRrcMsg));
+ ret = extractDlRrcMsg(gnbDuUeF1apId, gnbCuUeF1apId, duUeCb->f1UeDb->dlRrcMsg,\
+ &ueContextModifyReq->protocolIEs.list.array[ieIdx]->\
+ value.choice.RRCContainer);
+ }
+
+ break;
+ }
+
case ProtocolIE_ID_id_DRBs_ToBeSetupMod_List:
case ProtocolIE_ID_id_DRBs_ToBeModified_List:
{
if(duUeCb->f1UeDb)
{
- duUeCb->f1UeDb->actionType = UE_CTXT_MOD;
if(ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.present ==\
UEContextModificationRequestIEs__value_PR_DRBs_ToBeSetupMod_List)
{
}
break;
}
+ case ProtocolIE_ID_id_TransmissionActionIndicator:
+ {
+ if(duUeCb->f1UeDb)
+ {
+ if(ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.choice.TransmissionActionIndicator == TransmissionActionIndicator_stop)
+ {
+ duUeCb->f1UeDb->duUeCfg.dataTransmissionAction = STOP_TRANSMISSION;
+ }
+ else
+ {
+ duUeCb->f1UeDb->duUeCfg.dataTransmissionAction = RESTART_TRANSMISSION;
+ }
+ }
+ break;
+ }
+
+ case ProtocolIE_ID_id_RRCDeliveryStatusRequest:
+ {
+ if(duUeCb->f1UeDb->dlRrcMsg->rrcMsgPdu)
+ {
+ duUeCb->f1UeDb->dlRrcMsg->deliveryStatRpt = true;
+ }
+ break;
+ }
+
}
}