X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrrlc%2Frlc_mgr.c;h=dd6793464a55a2372a9df50e5de3be190098acde;hb=e6cf50fe5be43291899cae7a1a24af906901ceff;hp=14de3d8943389918e368148f39e08af5f8c0304d;hpb=5831bf6b3454aa200a92cd3e84209650734e4863;p=o-du%2Fl2.git diff --git a/src/5gnrrlc/rlc_mgr.c b/src/5gnrrlc/rlc_mgr.c index 14de3d894..dd6793464 100644 --- a/src/5gnrrlc/rlc_mgr.c +++ b/src/5gnrrlc/rlc_mgr.c @@ -21,8 +21,8 @@ #include "lkw.h" /* LKW defines */ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ -#include "kw_env.h" /* RLC environment options */ -#include "kw.h" /* RLC defines */ +#include "rlc_env.h" /* RLC environment options */ +#include "rlc_err.h" /* header/extern include files (.x) */ @@ -30,19 +30,24 @@ #include "lkw.x" /* LKW */ #include "ckw.x" /* CKW */ #include "kwu.x" /* KWU */ -#include "kw_err.h" -#include "kw.x" +#include "rlc_utils.h" /* RLC defines */ #include "du_app_rlc_inf.h" #include "rlc_mgr.h" -RlcUlDuUeCreateRsp rlcUlUeCreateRspOpts[] = +RlcDuUeCreateRsp rlcUeCreateRspOpts[] = { - packRlcUlDuUeCreateRsp, /* 0 - loosely coupled */ - DuProcRlcUlUeCreateRsp, /* 1 - tightly coupled */ - packRlcUlDuUeCreateRsp, /* 2 - LWLC loosely coupled */ + packRlcDuUeCreateRsp, /* 0 - loosely coupled */ + DuProcRlcUeCreateRsp, /* 1 - tightly coupled */ + packRlcDuUeCreateRsp /* 2 - LWLC loosely coupled */ }; +RlcDuUeReconfigRsp rlcUeReconfigRspOpts[] = +{ + packRlcDuUeReconfigRsp, /* 0 - loosely coupled */ + DuProcRlcUeReconfigRsp, /* 1 - tightly coupled */ + packRlcDuUeReconfigRsp /* 2 - LWLC loosely coupled */ +}; /*********************************************************** * @@ -62,32 +67,97 @@ RlcUlDuUeCreateRsp rlcUlUeCreateRspOpts[] = * -# RFAILED * *************************************************************/ -uint8_t SendRlcUlUeCreateRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp) +uint8_t SendRlcUeCreateRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp) { /* jump to specific primitive depending on configured selector */ - uint8_t ret = ROK; - RlcUeCfgRsp *ueCreateRsp = NULLP; + uint8_t ret = ROK; + RlcCb *gCb; + RlcUeCreateRsp *ueRsp = NULLP; - RLC_ALLOC_SHRABL_BUF(pst->region, pst->pool, ueCreateRsp, sizeof(RlcUeCfgRsp)); - if(!ueCreateRsp) + gCb = RLC_GET_RLCCB(pst->srcInst); + RLC_ALLOC_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCreateRsp)); + if(!ueRsp) { - DU_LOG("RLC: Memory allocation failed for ueCreateRsp at SendRlcUlUeCreateRspToDu()"); + DU_LOG("\nERROR --> RLC: Memory allocation failed for ueRsp at SendRlcUeCreateRspToDu()"); ret = RFAILED; } else { /* Mapping Old api to New Api */ - fillRlcUlUeCfgRsp(ueCreateRsp, cfgRsp); - ret = (*rlcUlUeCreateRspOpts[pst->selector])(pst, ueCreateRsp); - if(ret) + ret = fillRlcUeCreateRsp(ueRsp, cfgRsp); + if(!ret) + { + ret = (*rlcUeCreateRspOpts[pst->selector])(pst, ueRsp); + if(ret) + { + DU_LOG("\nERROR --> RLC: Failed at SendRlcUeCreateRspToDu()"); + RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCreateRsp)); + } + } + else + { + DU_LOG("\nERROR --> RLC: Failed at fillRlcUeCreateRsp() for event %d", pst->event); + RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCreateRsp)); + } + } + RLC_FREE(gCb, cfgRsp, sizeof(RlcCfgCfmInfo)); + return ret; +} /* end of SendRlcUeCreateRspToDu */ + +/*********************************************************** + * + * @brief + * + * Handler for the ue Reconfig response to DUAPP + * + * @b Description: + * + * This function reports ue Reconfig response to DUAPP + * + * @param[in] post Post structure + * @param[in] cfgRsp ue reconfig Config Response + * + * @return uint16_t + * -# ROK + * -# RFAILED + * + *************************************************************/ +uint8_t SendRlcUeReconfigRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp) +{ + /* jump to specific primitive depending on configured selector */ + uint8_t ret = ROK; + RlcCb *gCb; + RlcUeReconfigRsp *ueRsp = NULLP; + + gCb = RLC_GET_RLCCB(pst->srcInst); + RLC_ALLOC_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeReconfigRsp)); + if(!ueRsp) + { + DU_LOG("\nERROR --> RLC: Memory allocation failed for ueRsp at SendRlcUeReconfigRspToDu()"); + ret = RFAILED; + } + else + { + /* Mapping Old api to New Api */ + ret = fillRlcUeCreateRsp(ueRsp, cfgRsp); + if(!ret) + { + ret = (*rlcUeReconfigRspOpts[pst->selector])(pst, ueRsp); + if(ret) + { + DU_LOG("\nERROR --> RLC: Failed at SendRlcUeReconfigRspToDu()"); + RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeReconfigRsp)); + } + } + else { - DU_LOG("RLC: Failed at SendRlcUlUeCreateRspToDu()"); - RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueCreateRsp, sizeof(RlcUeCfgRsp)); - ret = RFAILED; + DU_LOG("\nERROR --> RLC: Failed at fillRlcUeCreateRsp() for event %d", pst->event); + RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeReconfigRsp)); } } + RLC_FREE(gCb, cfgRsp, sizeof(RlcCfgCfmInfo)); return ret; -} /* end of SendRlcUlUeCreateRspToDu */ +} /* end of SendRlcUeReconfigRspToDu */ /********************************************************************** End of file