X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Flwr_mac_upr_inf.c;h=64255f92d2a61f962d5baa51573a83af6d57a35a;hb=def50dc175cebc67238db5f1acd5ff322a2279bd;hp=46b7a42810592dab32f9d72186471deb626596a5;hpb=b490cd1231cfcc837e8bfccc40c6bb106dceef7c;p=o-du%2Fl2.git diff --git a/src/5gnrmac/lwr_mac_upr_inf.c b/src/5gnrmac/lwr_mac_upr_inf.c index 46b7a4281..64255f92d 100644 --- a/src/5gnrmac/lwr_mac_upr_inf.c +++ b/src/5gnrmac/lwr_mac_upr_inf.c @@ -15,9 +15,62 @@ # limitations under the License. # ################################################################################ *******************************************************************************/ - +#include "common_def.h" #include "lwr_mac_upr_inf.h" +/******************************************************************* + * + * @brief Packs and Sends CRC Ind to MAC + * + * @details + * + * Function : packCrcInd + * + * Functionality: + * Packs and Sends CRC Ind to MAC + * + * @params[in] Post structure pointer + * CRC indication + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t packCrcInd(Pst *pst, CrcInd *crcInd) +{ + if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC)) + { + return ROK; + } + return RFAILED; +} + +/******************************************************************* + * + * @brief Packs and Sends Rx Data Ind to MAC + * + * @details + * + * Function : packRxDataInd + * + * Functionality: + * Packs and Sends Rx data Ind to MAC + * + * @params[in] Post structure pointer + * Rx Data indication + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t packRxDataInd(Pst *pst, RxDataInd *rxDataInd) +{ + if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC)) + { + return ROK; + } + return RFAILED; +} + + /******************************************************************* * * @brief Packs and Sends RACH Ind to MAC @@ -35,18 +88,15 @@ * RFAILED - failure * * ****************************************************************/ -uint16_t packRachInd(Pst *pst, RachInd *rachInd) +uint8_t packRachInd(Pst *pst, RachInd *rachInd) { - if((pst->selector == MAC_SELECTOR_LC) || (pst->selector == MAC_SELECTOR_LWLC)) + if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC)) { return ROK; } - else - { - return RFAILED; - } + return RFAILED; } - + /******************************************************************* * * @brief Loose coupled packing of slot indication @@ -64,21 +114,21 @@ uint16_t packRachInd(Pst *pst, RachInd *rachInd) * RFAILED - failure * * ****************************************************************/ -S16 packLcSlotInd (Pst *pst, SlotIndInfo *slotInd) +uint8_t packLcSlotInd (Pst *pst, SlotIndInfo *slotInd) { Buffer *mBuf = NULLP; - if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) + if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) { - RETVALUE(RFAILED); + return RFAILED; } - + /* pack SFN and slot value */ - CMCHKPK(SPkU16,slotInd->sfn, mBuf); - CMCHKPK(SPkU16,slotInd->slot, mBuf); - - RETVALUE(SPstTsk(pst,mBuf)); + CMCHKPK(oduUnpackUInt16,slotInd->sfn, mBuf); + CMCHKPK(oduUnpackUInt16,slotInd->slot, mBuf); + + return ODU_POST_TASK(pst,mBuf); } - + /******************************************************************* * * @brief Light weight loose coupled packing of slot indication @@ -96,11 +146,66 @@ S16 packLcSlotInd (Pst *pst, SlotIndInfo *slotInd) * RFAILED - failure * * ****************************************************************/ -S16 packLwlcSlotInd (Pst *pst, SlotIndInfo *slotInd) +uint8_t packLwlcSlotInd (Pst *pst, SlotIndInfo *slotInd) { return ROK; } +/******************************************************************* + * + * @brief Packs and Sends Stop Ind to MAC + * + * @details + * + * Function : packStopInd + * + * Functionality: + * Packs and Sends Stop Ind to MAC + * + * @params[in] Post structure pointer + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t packStopInd(Pst *pst, uint16_t cellId) +{ + if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC)) + { + return ROK; + } + else + { + return RFAILED; + } +} + +/******************************************************************* + * + * @brief Packs and Sends UCI Ind to MAC + * + * @details + * + * Function : packMacUciInd + * + * Functionality: + * Packs and Sends Uci Ind to MAC + * + * @params[in] Post structure pointer + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t packMacUciInd(Pst *pst, UciInd *uciInd) +{ + if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC)) + { + return ROK; + } + else + { + return RFAILED; + } +} /********************************************************************** - End of file -**********************************************************************/ + End of file + **********************************************************************/