#include "mac_utils.h"
/* function pointers for packing slot ind from mac to sch */
-MacSchUeCreateReqFunc macSchUeCreateReqOpts[] =
+MacSchAddUeConfigReqFunc macSchAddUeConfigReqOpts[] =
{
- packMacSchUeCreateReq, /* packing for loosely coupled */
- MacSchUeCreateReq, /* packing for tightly coupled */
- packMacSchUeCreateReq /* packing for light weight loosely coupled */
+ packMacSchAddUeConfigReq, /* packing for loosely coupled */
+ MacSchAddUeConfigReq, /* packing for tightly coupled */
+ packMacSchAddUeConfigReq /* packing for light weight loosely coupled */
};
-MacDuUeCfgRspFunc MacDuUeCfgRspOpts[] =
+MacDuUeCfgRspFunc macDuUeCfgRspOpts[] =
{
packDuMacUeCfgRsp, /* packing for loosely coupled */
DuProcMacUeCfgRsp, /* packing for tightly coupled */
packDuMacUeCfgRsp /* packing for light weight loosly coupled */
};
-MacSchUeReconfigReqFunc macSchUeReconfigReqOpts[] =
+MacSchModUeConfigReqFunc macSchModUeConfigReqOpts[] =
{
- packMacSchUeReconfigReq, /* packing for loosely coupled */
- MacSchUeReconfigReq, /* packing for tightly coupled */
- packMacSchUeReconfigReq /* packing for light weight loosely coupled */
+ packMacSchModUeConfigReq, /* packing for loosely coupled */
+ MacSchModUeConfigReq, /* packing for tightly coupled */
+ packMacSchModUeConfigReq /* packing for light weight loosely coupled */
};
/*******************************************************************
switch(pst->event)
{
case EVENT_MAC_UE_CREATE_REQ:
- FILL_PST_MAC_TO_SCH(schPst, EVENT_UE_CREATE_REQ_TO_SCH);
- return(*macSchUeCreateReqOpts[schPst.selector])(&schPst, schUeCfg);
+ FILL_PST_MAC_TO_SCH(schPst, EVENT_ADD_UE_CONFIG_REQ_TO_SCH);
+ return(*macSchAddUeConfigReqOpts[schPst.selector])(&schPst, schUeCfg);
case EVENT_MAC_UE_RECONFIG_REQ:
- FILL_PST_MAC_TO_SCH(schPst, EVENT_UE_RECONFIG_REQ_TO_SCH);
- return(*macSchUeReconfigReqOpts[schPst.selector])(&schPst,schUeCfg);
+ FILL_PST_MAC_TO_SCH(schPst, EVENT_MODIFY_UE_CONFIG_REQ_TO_SCH);
+ return(*macSchModUeConfigReqOpts[schPst.selector])(&schPst,schUeCfg);
default:
DU_LOG("\n Invalid Pst received %d", pst->event);
return RFAILED;
return RFAILED;
}
- schUeCfg->aggrMaxBitRate = NULL;
- if(ueCfg->maxAggrBitRate != NULL)
+ if(ueCfg->ambrCfg != NULLP)
{
- MAC_ALLOC(schUeCfg->aggrMaxBitRate, sizeof(SchAggrMaxBitRate));
- if(!schUeCfg->aggrMaxBitRate)
+ MAC_ALLOC(schUeCfg->ambrCfg, sizeof(SchAmbrCfg));
+ if(!schUeCfg->ambrCfg)
{
DU_LOG("\nMAC : Memory allocation failed in sendReconfigReqToSch");
return RFAILED;
}
- schUeCfg->aggrMaxBitRate->ulBitRate = ueCfg->maxAggrBitRate->ulBits;
- schUeCfg->aggrMaxBitRate->dlBitRate = ueCfg->maxAggrBitRate->dlBits;
+ schUeCfg->ambrCfg->ulBr = ueCfg->ambrCfg->ulBr;
+ schUeCfg->ambrCfg->dlBr = ueCfg->ambrCfg->dlBr;
}
+ else
+ schUeCfg->ambrCfg = NULLP;
/* Fill sch Lc Cfg to Add/ Mod/ Del */
ret = fillSchLcCfgList(schUeCfg, ueCfg);
if((ueCb->ueIdx == ueCfg->ueIdx) && (ueCb->crnti == ueCfg->crnti)\
&&(ueCb->state == UE_STATE_ACTIVE))
{
- DU_LOG("\n MAC : Reconfig Req received for CRNTI %d ", ueCfg->crnti);
+ DU_LOG("\n MAC : Modifying Ue config Req for CRNTI %d ", ueCfg->crnti);
ret = fillMacUeCb(ueCb, ueCfg, cellIdx);
if(ret != ROK)
{
- DU_LOG("\nMAC : Failed to modify Ue Cb at modifyUeCb()");
+ DU_LOG("\nMAC : Failed to modify MacUeCb at modifyUeCb()");
return ret;
}
else
ueCb = &macCb.macCell[cellIdx]->ueCb[ueCfg->ueIdx -1];
switch(pst->event)
{
- case EVENT_UE_CREATE_RSP_TO_MAC:
+ case EVENT_UE_CONFIG_RSP_TO_MAC:
ret = createUeCb(cellIdx, ueCb, ueCfg);
+ if(ret != ROK)
+ DU_LOG("\nMAC: AddUeConfigReq for cellIdx :%d failed in procMacUeCfgData()", cellIdx);
break;
case EVENT_UE_RECONFIG_RSP_TO_MAC:
ret = modifyUeCb(cellIdx, ueCb, ueCfg);
+ if(ret != ROK)
+ DU_LOG("\nMAC: ModifyUeConfigReq for cellIdx :%d failed at procMacUeCfgData()", cellIdx);
break;
default:
break;
/* Fill Post structure and send UE Create response*/
memset(&rspPst, 0, sizeof(Pst));
FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_UE_CREATE_RSP);
- return MacDuUeCfgRspOpts[rspPst.selector](&rspPst, cfgRsp);
+ return (*macDuUeCfgRspOpts[rspPst.selector])(&rspPst, cfgRsp);
}
/*******************************************************************
/* Fill Post structure and send UE Create response*/
memset(&rspPst, 0, sizeof(Pst));
FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_UE_RECONFIG_RSP);
- return MacDuUeCfgRspOpts[rspPst.selector](&rspPst, cfgRsp);
+ return (*macDuUeCfgRspOpts[rspPst.selector])(&rspPst, cfgRsp);
}
/*******************************************************************
GET_CELL_IDX(schCfgRsp->cellId, cellIdx);
ueCfg = getMacUeCfg(cellIdx, schCfgRsp->ueIdx);
+ if(ueCfg == NULLP)
+ {
+ DU_LOG("\nMAC : Failed to find the Mac Ue Cfg for event [%d] in MacProcSchUeCfgRsp()", pst->event);
+ ret = RFAILED;
+ }
- if(ueCfg)
+ switch(pst->event)
{
- if(schCfgRsp->rsp == RSP_NOK)
+ case EVENT_UE_CONFIG_RSP_TO_MAC:
{
- DU_LOG("\nMAC : SCH UE Config Response : FAILURE [CRNTI %d] for event %d", schCfgRsp->crnti, pst->event);
+ if(schCfgRsp->rsp != RSP_NOK)
+ {
+ DU_LOG("\nMAC: SCH UeConfigRsp for CRNTI[%d] is success in MacProcSchUeCfgRsp()", schCfgRsp->crnti);
+ if(ret == ROK)
+ {
+ ret = procMacUeCfgData(pst, ueCfg);
+ if(ret == ROK)
+ {
+ result = MAC_DU_APP_RSP_OK;
+ }
+ }
+ }
+ else
+ {
+ DU_LOG("\nMAC: SCH UeConfigRsp for CRNTI[%d] is failed in MacProcSchUeCfgRsp()", schCfgRsp->crnti);
+ }
+ ret = MacSendUeCreateRsp(result, schCfgRsp);
}
- else
+ break;
+
+ case EVENT_UE_RECONFIG_RSP_TO_MAC:
{
- DU_LOG("\nMAC : SCH UE Config Response : SUCCESS [CRNTI %d]", schCfgRsp->crnti);
- ret = procMacUeCfgData(pst, ueCfg);
- if(ret == ROK)
+ if(schCfgRsp->rsp != RSP_NOK)
{
- result = MAC_DU_APP_RSP_OK;
- }
+ DU_LOG("\nMAC: SCH UeReconfigRsp for CRNTI[%d] is success in MacProcSchUeCfgRsp()", schCfgRsp->crnti);
+ if(ret == ROK)
+ {
+ ret = procMacUeCfgData(pst, ueCfg);
+ if(ret == ROK)
+ {
+ result = MAC_DU_APP_RSP_OK;
+ }
+ }
+ }
+ else
+ {
+ DU_LOG("\nMAC: SCH UeReconfigRsp for CRNTI[%d] is failed in MacProcSchUeCfgRsp()", schCfgRsp->crnti);
+ }
+ ret = MacSendUeReconfigRsp(result, schCfgRsp);
}
- MAC_FREE(ueCfg, sizeof(MacUeCfg));
- ueCfg = NULLP;
- }
- if(pst->event == EVENT_UE_CREATE_RSP_TO_MAC)
- {
- ret = MacSendUeCreateRsp(result, schCfgRsp);
- }
- if(pst->event == EVENT_UE_RECONFIG_RSP_TO_MAC)
- {
- ret = MacSendUeReconfigRsp(result, schCfgRsp);
+ break;
+
+ default:
+ break;
}
+ MAC_FREE(ueCfg, sizeof(MacUeCfg));
+ ueCfg = NULLP;
return ret;
}
{
Pst rspPst;
- DU_LOG("\nSCH: Sending UE Create response to MAC");
-
cfgRsp->cellId = ueCfg->cellId;
cfgRsp->crnti = ueCfg->crnti;
GET_UE_IDX(ueCfg->crnti, cfgRsp->ueIdx);
/* Filling response post */
memset(&rspPst, 0, sizeof(Pst));
FILL_PST_SCH_TO_MAC(rspPst, inst);
- if(event == EVENT_UE_CREATE_REQ_TO_SCH)
+ if(event == EVENT_ADD_UE_CONFIG_REQ_TO_SCH)
{
- rspPst.event = EVENT_UE_CREATE_RSP_TO_MAC;
+ rspPst.event = EVENT_UE_CONFIG_RSP_TO_MAC;
+ DU_LOG("\nSCH: Sending UE Config response to MAC");
}
- else if(event == EVENT_UE_RECONFIG_REQ_TO_SCH)
+ else if(event == EVENT_MODIFY_UE_CONFIG_REQ_TO_SCH)
{
rspPst.event = EVENT_UE_RECONFIG_RSP_TO_MAC;
+ DU_LOG("\nSCH: Sending UE Reconfig response to MAC");
}
SchUeCfgRspOpts[rspPst.selector](&rspPst, cfgRsp);
}
/*******************************************************************
+
*
* @brief Function to fill Dl Lc Context in SCH Ue Cb
*
/*******************************************************************
*
- * @brief Hanles Ue create request from MAC
+ * @brief Function to Add Ue Config Request from MAC
*
* @details
*
- * Function : MacSchUeCreateReq
+ * Function : MacSchAddUeConfigReq
*
- * Functionality: Hanles Ue create request from MAC
+ * Functionality: Function to Add Ue config request from MAC
*
* @params[in]
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t MacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfg)
+uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfg)
{
uint8_t ueIdx, lcIdx, ret = ROK;
SchCellCb *cellCb = NULLP;
if(!ueCfg)
{
- DU_LOG("\nSCH : UE create request failed at MacSchUeCreateReq()");
+ DU_LOG("\nSCH : Adding UE Config Request failed at MacSchAddUeConfigReq()");
return RFAILED;
}
- DU_LOG("\nSCH : UE Create Request for CRNTI[%d]", ueCfg->crnti);
+ DU_LOG("\nSCH : Adding UE Config Request for CRNTI[%d]", ueCfg->crnti);
cellCb = getSchCellCb(pst->event, inst, ueCfg);
/* Search if UE already configured */
}
else
{
- DU_LOG("\n SCH : SchUeCb not found at MacSchUeCreateReq() ");
+ DU_LOG("\n SCH : SchUeCb not found at MacSchAddUeConfigReq() ");
SchSendUeCfgRspToMac(pst->event, ueCfg, inst, RSP_NOK, &cfgRsp);
return RFAILED;
}
/*******************************************************************
*
- * @brief Hanles Ue Reconfig request from MAC
+ * @brief Function to Modify Ue Config request from MAC
*
* @details
*
- * Function : MacSchUeReconfigReq
+ * Function : MacSchModUeConfigReq
*
- * Functionality: Hanles Ue Reconfig request from MAC
+ * Functionality: Function to modify Ue Config request from MAC
*
* @params[in]
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t MacSchUeReconfigReq(Pst *pst, SchUeCfg *ueCfg)
+uint8_t MacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfg)
{
uint8_t ueIdx, lcIdx, ret = ROK;
SchCellCb *cellCb = NULLP;
if(!ueCfg)
{
- DU_LOG("\nSCH : Reconfig request failed at MacSchUeReconfigReq()");
+ DU_LOG("\nSCH : Modifying Ue Config request failed at MacSchModUeConfigReq()");
return RFAILED;
}
- DU_LOG("\nSCH : Reconfig Request for CRNTI[%d]", ueCfg->crnti);
+ DU_LOG("\nSCH : Modifying Ue Config Request for CRNTI[%d]", ueCfg->crnti);
cellCb = getSchCellCb(pst->event, inst, ueCfg);
/* Search if UE already configured */
if(!ueCb)
{
- DU_LOG("\n SCH : SchUeCb not found at MacSchUeReconfigReq() ");
+ DU_LOG("\n SCH : SchUeCb not found at MacSchModUeConfigReq() ");
SchSendUeCfgRspToMac(pst->event, ueCfg, inst, RSP_NOK, &cfgRsp);
return RFAILED;
}
ServCellCfgInfo servCellCfg;
}SpCellCfg;
-typedef struct maxAggrBitRate
+typedef struct ambrCfg
{
- uint32_t ulBits;
- uint32_t dlBits;
-}MaxAggrBitRate;
+ uint32_t ulBr; /* UL Bit rate */
+ uint32_t dlBr; /* DL Bit rate */
+}AmbrCfg;
/* Single Network Slice Selection assistance Info */
typedef struct snssai
MacCellGrpCfg macCellGrpCfg;
PhyCellGrpCfg phyCellGrpCfg;
SpCellCfg spCellCfg;
- MaxAggrBitRate *maxAggrBitRate;
+ AmbrCfg *ambrCfg;
uint8_t numLcs;
LcCfg lcCfgList[MAX_NUM_LC];
UeCfgState macUeCfgState; /* InActive / Completed */
/*******************************************************************
*
- * @brief Pack and Send UE Create Request from MAC to SCH
+ * @brief Pack and Send UE Config Request from MAC to SCH
*
* @details
*
- * Function : packMacSchUeCreateReq
+ * Function : packMacSchAddUeConfigReq
*
* Functionality:
* Pack and Send UE Create Request from MAC to SCH
* RFAILED - failure
*
* ****************************************************************/
-uint8_t packMacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfg)
+uint8_t packMacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfg)
{
if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
{
/*******************************************************************
*
- * @brief Pack and Send UE Reconfig Request from MAC to SCH
+ * @brief Pack and Send Modify UE Config Request from MAC to SCH
*
* @details
*
- * Function : packMacSchUeReconfigReq
+ * Function : packMacSchModUeConfigReq
*
* Functionality:
- * Pack and Send UE Reconfig Request from MAC to SCH
+ * Pack and Send Modify UE Config Request from MAC to SCH
*
* @params[in]
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t packMacSchUeReconfigReq(Pst *pst, SchUeCfg *ueCfg)
+uint8_t packMacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfg)
{
if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
{
#define EVENT_RACH_IND_TO_SCH 5
#define EVENT_CRC_IND_TO_SCH 6
#define EVENT_DL_RLC_BO_INFO_TO_SCH 7
-#define EVENT_UE_CREATE_REQ_TO_SCH 8
-#define EVENT_UE_CREATE_RSP_TO_MAC 9
+#define EVENT_ADD_UE_CONFIG_REQ_TO_SCH 8
+#define EVENT_UE_CONFIG_RSP_TO_MAC 9
#define EVENT_SLOT_IND_TO_SCH 10
#define EVENT_SHORT_BSR 11
#define EVENT_UCI_IND_TO_SCH 12
-#define EVENT_UE_RECONFIG_REQ_TO_SCH 13
+#define EVENT_MODIFY_UE_CONFIG_REQ_TO_SCH 13
#define EVENT_UE_RECONFIG_RSP_TO_MAC 14
}SchLcCfg;
/* Aggregate max bit rate */
-typedef struct aggrMaxBitRate
+typedef struct schAmbrCfg
{
- uint32_t ulBitRate;
- uint32_t dlBitRate;
-}SchAggrMaxBitRate;
+ uint32_t ulBr; /* Ul BitRate */
+ uint32_t dlBr; /* Dl BitRate */
+}SchAmbrCfg;
/* UE configuration */
typedef struct schUeCfg
SchMacCellGrpCfg macCellGrpCfg;
SchPhyCellGrpCfg phyCellGrpCfg;
SchSpCellCfg spCellCfg;
- SchAggrMaxBitRate *aggrMaxBitRate;
+ SchAmbrCfg *ambrCfg;
uint8_t numLcs;
SchLcCfg schLcCfg[MAX_NUM_LC];
}SchUeCfg;
Pst *pst, /* Post structure */
DlRlcBoInfo *dlBoInfo)); /* DL BO Info */
-typedef uint8_t (*MacSchUeCreateReqFunc) ARGS((
+typedef uint8_t (*MacSchAddUeConfigReqFunc) ARGS((
Pst *pst, /* Post structure */
SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
Pst *pst, /* Post structure */
SrUciIndInfo *uciInd)); /* UCI IND Info */
-typedef uint8_t (*MacSchUeReconfigReqFunc) ARGS((
+typedef uint8_t (*MacSchModUeConfigReqFunc) ARGS((
Pst *pst, /* Post structure */
SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
uint8_t MacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
-uint8_t packMacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfgToSch);
-uint8_t MacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfgToSch);
+uint8_t packMacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
+uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
uint8_t packSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
uint8_t MacSchSlotInd ARGS((Pst * pst, SlotIndInfo * slotInd));
uint8_t MacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
uint8_t packMacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
uint8_t MacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
-uint8_t packMacSchUeReconfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
-uint8_t MacSchUeReconfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
+uint8_t packMacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
+uint8_t MacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
uint8_t packSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
uint8_t MacProcSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
uint8_t BuildDLRRCContainer(uint8_t rrcMsgType, RRCContainer_t *rrcContainer)
{
- uint8_t ret, idx2, bufLen;
+ uint8_t ret, bufLen;
ret =ROK;
if(rrcMsgType == RRC_SETUP)
CU_ALLOC(rrcContainer->buf, rrcContainer->size);
if(rrcContainer->buf != NULLP)
{
- memset(rrcContainer->buf, 0, encBufSize);
- for(idx2 = 0; idx2 < encBufSize; idx2++)
- {
- rrcContainer->buf[idx2] = buf[idx2];
- }
+ memset(rrcContainer->buf, 0, bufLen);
+ memcpy(rrcContainer->buf, buf, bufLen);
}
}
else if(rrcMsgType == RRC_RECONFIG)
CU_ALLOC(rrcContainer->buf, rrcContainer->size);
if(rrcContainer->buf != NULLP)
{
- memset(rrcContainer->buf, 0, encBufSize);
- for(idx2 = 0; idx2 < encBufSize; idx2++)
- {
- rrcContainer->buf[idx2] = buf[idx2];
- }
+ memset(rrcContainer->buf, 0, bufLen);
+ memcpy(rrcContainer->buf, buf, bufLen);
}
}
ueSetReq =
&f1apMsg->choice.initiatingMessage->value.choice.UEContextSetupRequest;
- elementCnt = 11;
+ elementCnt = 12;
ueSetReq->protocolIEs.list.count = elementCnt;
ueSetReq->protocolIEs.list.size = \
elementCnt * sizeof(UEContextSetupRequestIEs_t *);
ueSetReq->protocolIEs.list.array[idx]->criticality = Criticality_reject;
ueSetReq->protocolIEs.list.array[idx]->value.present = \
UEContextSetupRequestIEs__value_PR_RRCContainer;
- char buf[9]={0x00, 0x02, 0x22, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00};
+ char secModeBuf[9]={0x00, 0x02, 0x22, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00};
bufLen =9;
ueSetReq->protocolIEs.list.array[idx]->value.choice.RRCContainer.size = bufLen;
CU_ALLOC(ueSetReq->protocolIEs.list.array[idx]->value.choice.RRCContainer.buf,
DU_LOG(" F1AP : Memory allocation for BuildAndSendUeContextSetupReq failed");
break;
}
- memset(ueSetReq->protocolIEs.list.array[idx]->value.choice.RRCContainer.buf, 0, encBufSize);
- for(idx1 = 0; idx1 < encBufSize; idx1++)
- {
- ueSetReq->protocolIEs.list.array[idx]->value.choice.RRCContainer.buf[idx1] = buf[idx1];
- }
+ memset(ueSetReq->protocolIEs.list.array[idx]->value.choice.RRCContainer.buf, 0, bufLen);
+ memcpy(ueSetReq->protocolIEs.list.array[idx]->value.choice.RRCContainer.buf, secModeBuf, bufLen);
/* RRC delivery status request */
idx++;
UEContextSetupRequestIEs__value_PR_RRCDeliveryStatusRequest;
ueSetReq->protocolIEs.list.array[idx]->value.choice.RRCDeliveryStatusRequest = \
RRCDeliveryStatusRequest_true;
-
+
+ /* Bit Rate hardcoded as in reference logs */
+ idx++;
+ ueSetReq->protocolIEs.list.array[idx]->id = \
+ ProtocolIE_ID_id_GNB_DU_UE_AMBR_UL;
+ ueSetReq->protocolIEs.list.array[idx]->criticality = Criticality_ignore;
+ ueSetReq->protocolIEs.list.array[idx]->value.present = \
+ UEContextSetupRequestIEs__value_PR_BitRate;
+ char bitRateBuf[4]= {0x3B, 0x37, 0xF4, 0xCD};
+ bufLen = 4;
+ ueSetReq->protocolIEs.list.array[idx]->value.choice.BitRate.size = bufLen;
+ CU_ALLOC(ueSetReq->protocolIEs.list.array[idx]->value.choice.BitRate.buf,\
+ ueSetReq->protocolIEs.list.array[idx]->value.choice.BitRate.size);
+ if(!ueSetReq->protocolIEs.list.array[idx]->value.choice.BitRate.buf)
+ {
+ DU_LOG(" F1AP : Failed to allocate memory for Bit Rate in BuildAndSendUeContextSetupReq()");
+ break;
+ }
+ memset(ueSetReq->protocolIEs.list.array[idx]->value.choice.BitRate.buf, 0, bufLen);
+ memcpy(ueSetReq->protocolIEs.list.array[idx]->value.choice.BitRate.buf, bitRateBuf, bufLen);
+
xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
/* Encode the F1SetupRequest type as APER */
DU_FREE(ueCfg->cellGrpCfg, sizeof(CellGroupConfigRrc_t));
ueCfg->cellGrpCfg = NULLP;
}
- if(ueCfg->maxAggrBitRate)
+ if(ueCfg->ambrCfg)
{
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCfg->maxAggrBitRate, sizeof(MaxAggrBitRate));
+ memset(ueCfg->ambrCfg, 0, sizeof(AmbrCfg));
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCfg->ambrCfg, sizeof(AmbrCfg));
}
for(lcIdx = 0; lcIdx < ueCfg->numRlcLcs; lcIdx++)
{
{
uint8_t ret, ieIdx, ueIdx, lcId, cellIdx;
bool ueCbFound = false;
- uint32_t gnbCuUeF1apId, gnbDuUeF1apId;
+ uint32_t gnbCuUeF1apId, gnbDuUeF1apId, bitRateSize;
DuUeCb *duUeCb = NULLP;
UEContextSetupRequest_t *ueSetReq = NULLP;
}
break;
}
- //TODO: To handle maxAggrBitRate case,
- // Dependency: The protocolIE is not specified in ASN
-#if 0
- case ProtocolIE_ID_id_ULPDUSessionAggregateMaximumBitRate: {
+ case ProtocolIE_ID_id_GNB_DU_UE_AMBR_UL: {
/* MaximumBitRate Uplink */
bitRateSize = ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.size;
if(bitRateSize > 0)
{
- DU_ALLOC_SHRABL_BUF(duUeCb->f1UeDb->duUeCfg.maxAggrBitRate, bitRateSize);
- if(!duUeCb->f1UeDb->duUeCfg.maxAggrBitRate)
+ DU_ALLOC_SHRABL_BUF(duUeCb->f1UeDb->duUeCfg.ambrCfg, bitRateSize);
+ if(!duUeCb->f1UeDb->duUeCfg.ambrCfg)
{
DU_LOG("\nDU APP : Memory allocation failed for bitRate in procUeCtxtSetupReq");
ret = RFAILED;
}
else
{
- duUeCb->f1UeDb->duUeCfg.maxAggrBitRate->ulBits =\
- *ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.buf;
- duUeCb->f1UeDb->duUeCfg.maxAggrBitRate->dlBits = 0;
+ memset(duUeCb->f1UeDb->duUeCfg.ambrCfg, 0, sizeof(AmbrCfg));
+ memcpy(&duUeCb->f1UeDb->duUeCfg.ambrCfg->ulBr,
+ ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.BitRate.buf, bitRateSize);
+ duUeCb->f1UeDb->duUeCfg.ambrCfg->dlBr = 0;
}
}
else
ret = RFAILED;
break;
}
-#endif
default:
{
break;
RlcBearerCfg rlcLcCfg[MAX_NUM_LC];
uint8_t numMacLcs; /* Mac Ue Cfg */
LcCfg macLcCfg[MAX_NUM_LC];
- MaxAggrBitRate *maxAggrBitRate;
+ AmbrCfg *ambrCfg;
}DuUeCfg;
typedef struct f1UeContextSetup
if(slotInfo->cellId <=0 || slotInfo->cellId > MAX_NUM_CELL)
{
- DU_LOG("\nDU APP : Invalid Cell Id %d", slotInfo->cellId);
+ DU_LOG("\nDU APP : Invalid Cell Id %d in duHandleSlotInd()", slotInfo->cellId);
return RFAILED;
}
if(cellStopId->cellId <=0 || cellStopId->cellId > MAX_NUM_CELL)
{
- DU_LOG("\nDU APP : Invalid Cell Id %d", cellStopId->cellId);
+ DU_LOG("\nDU APP : Invalid Cell Id %d in duHandleStopInd()", cellStopId->cellId);
}
if(duGetCellCb(cellStopId->cellId, &cellCb) != ROK)
*
* @details
*
- * Function : getMaxAggrBitRate
+ * Function : fillAmbr
*
* Functionality: Function to copy bit Rate from ueSetupReqDb
*
- * @params[in] MaxAggrBitRate *macBitRate, MaxAggrBitRate *ueDbBitRate
+ * @params[in] AmbrCfg **macAmbr, AmbrCfg *ueDbAmbr
* @return ROK/RFAILED
*
*****************************************************************/
-uint8_t getMaxAggrBitRate(MaxAggrBitRate *macBitRate, MaxAggrBitRate *ueDbBitRate)
+uint8_t fillAmbr(AmbrCfg **macAmbr, AmbrCfg *ueDbAmbr)
{
- if(ueDbBitRate)
+ if(ueDbAmbr)
{
- if(!macBitRate)
+ if(*macAmbr == NULLP)
{
- DU_ALLOC_SHRABL_BUF(macBitRate, sizeof(MaxAggrBitRate));
- if(!macBitRate)
+ DU_ALLOC_SHRABL_BUF(*macAmbr, sizeof(AmbrCfg));
+ if(*macAmbr == NULLP)
{
- DU_LOG("\nDUAPP: Memory Alloc Failed at getMaxAggrBitRate()");
+ DU_LOG("\nDUAPP: Memory Alloc Failed at fillAmbr()");
return RFAILED;
}
}
- memcpy(macBitRate, ueDbBitRate, sizeof(MaxAggrBitRate));
+ memset(*macAmbr, 0, sizeof(AmbrCfg));
+ (*macAmbr)->ulBr = ueDbAmbr->ulBr;
+ (*macAmbr)->dlBr = ueDbAmbr->dlBr;
}
else
{
- macBitRate = NULLP;
+ *macAmbr = NULLP;
}
return ROK;
}
if(macUeCfg)
{
/* Processing one Ue at a time to MAC */
- DU_LOG("\nDU_APP: Sending Reconfig Request to MAC");
+ DU_LOG("\nDU_APP: Sending Ue Reconfig Request to MAC");
ret = (*packMacUeReconfigReqOpts[pst.selector])(&pst, macUeCfg);
if(ret == RFAILED)
{
fillDefaultMacCellGrpInfo(&macUeCfg->macCellGrpCfg);
fillDefaultPhyCellGrpInfo(&macUeCfg->phyCellGrpCfg);
fillDefaultSpCellGrpInfo(&macUeCfg->spCellCfg);
- macUeCfg->maxAggrBitRate = NULLP;
+ macUeCfg->ambrCfg = NULLP;
fillMacSrb1LcCfg(&macUeCfg->lcCfgList[0]);
macUeCfg->numLcs++;
}
fillStartSymbolAndLen(macUeCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg.numTimeDomRsrcAlloc,\
NULL, &macUeCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg);
}
- ret = getMaxAggrBitRate(macUeCfg->maxAggrBitRate, ueCfgDb->maxAggrBitRate);
+ ret = fillAmbr(&macUeCfg->ambrCfg, ueCfgDb->ambrCfg);
}
/* Filling LC Context */
if(rlcUeCfg)
{
/* Processing one Ue at a time to RLC */
- DU_LOG("\nDU_APP: Sending Reconfig Request to RLC UL");
+ DU_LOG("\nDU_APP: Sending Ue Reconfig Request to RLC UL");
ret = (*packRlcUeReconfigReqOpts[pst.selector])(&pst, rlcUeCfg);
if(ret == RFAILED)
{
fillStartSymbolAndLen(macUeCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg.numTimeDomRsrcAlloc,\
NULL, &macUeCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg);
}
- ret = getMaxAggrBitRate(macUeCfg->maxAggrBitRate, f1UeDb->duUeCfg.maxAggrBitRate);
+ ret = fillAmbr(&macUeCfg->ambrCfg, f1UeDb->duUeCfg.ambrCfg);
}
/* Filling LC Context */
for(dbIdx = 0; (dbIdx < f1UeDb->duUeCfg.numMacLcs && ret == ROK); dbIdx++)
rlcUeCfg.rlcUeCfgState = UE_RECFG_COMPLETE;
if((ret = duUpdateDuUeCbCfg(cfgRsp->ueIdx, cfgRsp->cellId)) == ROK)
BuildAndSendUeCtxtRsp(cfgRsp->ueIdx, cfgRsp->cellId);
-
}
}
else
if(ueCb)
{
cellId = duCb.actvCellLst[ueCb->f1UeDb->cellIdx]->cellId;
+ /* Send DL RRC msg for security Mode */
if(ueCb->f1UeDb->dlRrcMsg)
{
if(ueCb->f1UeDb->dlRrcMsg->rrcMsgPdu)
- {
+ {
/* Sending DL RRC Message to RLC */
ret = duBuildAndSendDlRrcMsgToRlc(cellId, ueCb->rlcUeCfg, ueCb->f1UeDb->dlRrcMsg);
if(ret == RFAILED)
{
DU_LOG("\nDU APP : Failed to send DL RRC msg in duProcUeContextSetupRequest()");
DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCb->f1UeDb->dlRrcMsg->rrcMsgPdu,\
- ueCb->f1UeDb->dlRrcMsg->rrcMsgSize);
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCb->f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg));
+ ueCb->f1UeDb->dlRrcMsg->rrcMsgSize);
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCb->f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg));
}
- }
+ }
}
-
if(ret == ROK)
{
DU_LOG("\nDU_APP: Processing Ue Context Setup Request for cellId [%d]", cellId);
if(ret == RFAILED)
DU_LOG("\nDU_APP: Failed at build ctxt setup req for MAC at duBuildAndSendUeReCfgReqToMac()");
}
-
}
else
{