uint8_t MacProcSchStatsRsp(Pst *pst, SchStatsRsp *schStatsRsp);
uint8_t MacProcSchStatsInd(Pst *pst, SchStatsInd *schStatsInd);
+uint8_t MacProcSchStatsDeleteRsp(Pst *pst, SchStatsDeleteRsp *schStatsDeleteRsp);
+
#endif
/**********************************************************************
End of file
packDuMacStatsRsp /* packing for light weight loosly coupled */
};
+MacDuStatsDeleteRspFunc macDuStatsDeleteRspOpts[] =
+{
+ packDuMacStatsDeleteRsp, /* packing for loosely coupled */
+ DuProcMacStatsDeleteRsp, /* packing for tightly coupled */
+ packDuMacStatsDeleteRsp /* packing for light weight loosly coupled */
+};
/**
* @brief Layer Manager Configuration request handler for Scheduler
return ret;
}
+/**
+ * @brief Fill and send statistics delete response to DU APP
+ *
+ * @details
+ *
+ * Function : MacSendStatsDeleteRspToDuApp
+ *
+ * Fill and send statistics delete response to DU APP
+ *
+ * @param[in] Response
+ * @param[in] Cause of response
+ * @return int
+ * -# ROK
+ **/
+uint8_t MacSendStatsDeleteRspToDuApp(uint64_t subscriptionId, MacRsp result, CauseOfResult status)
+{
+ uint8_t ret = ROK;
+ Pst pst;
+ MacStatsDeleteRsp *macStatsDeleteRsp = NULLP;
+
+ DU_LOG("\nINFO --> MAC : MacSendStatsDeleteRspToDuApp: Sending Delete Statistics Response to DU APP");
+
+ MAC_ALLOC_SHRABL_BUF(macStatsDeleteRsp, sizeof(MacStatsDeleteRsp));
+ if(macStatsDeleteRsp == NULLP)
+ {
+ DU_LOG("\nERROR --> MAC : Failed to allocate memory in MacSendStatsDeleteRspToDuApp");
+ ret = RFAILED;
+ }
+ else
+ {
+ macStatsDeleteRsp->subscriptionId= subscriptionId;
+ macStatsDeleteRsp->result = result;
+ macStatsDeleteRsp->status = status;
+ memset(&pst, 0, sizeof(Pst));
+ FILL_PST_MAC_TO_DUAPP(pst, EVENT_MAC_STATS_DELETE_RSP);
+ if(((*macDuStatsDeleteRspOpts[pst.selector])(&pst, macStatsDeleteRsp))!= ROK)
+ {
+ DU_LOG("\nERROR --> MAC : Failed to send statistics delete response to DU APP");
+ MAC_FREE_SHRABL_BUF(MAC_MEM_REGION, MAC_POOL, macStatsDeleteRsp, sizeof(MacStatsDeleteRsp));
+ ret = RFAILED;
+ }
+ }
+
+ return ret;
+}
+
+/**
+ * @brief Mac process the statistics delete rsp received from sch.
+ *
+ * @details
+ *
+ * Function : MacProcSchStatsDeleteRsp
+ *
+ * This function process the statistics delete response received from sch
+ *
+ * @param[in] Pst *pst
+ * @param[in] SchStatsDeleteRsp *schStatsDeleteRsp
+ * @return int
+ * -# ROK
+ **/
+uint8_t MacProcSchStatsDeleteRsp(Pst *pst, SchStatsDeleteRsp *schStatsDeleteRsp)
+{
+ uint8_t ret = RFAILED;
+
+ if(schStatsDeleteRsp)
+ {
+ if(schStatsDeleteRsp->rsp == RSP_OK)
+ ret = MacSendStatsDeleteRspToDuApp(schStatsDeleteRsp->subscriptionId,MAC_DU_APP_RSP_OK,schStatsDeleteRsp->cause);
+ else
+ ret = MacSendStatsDeleteRspToDuApp(schStatsDeleteRsp->subscriptionId,MAC_DU_APP_RSP_NOK,schStatsDeleteRsp->cause);
+
+ }
+ MAC_FREE(schStatsDeleteRsp, sizeof(SchStatsDeleteRsp));
+ return ret;
+}
+
+/**
+ * @brief Mac process the statistics delete Req received from DUAPP
+ *
+ * @details
+ *
+ * Function : MacProcStatsDeleteReq
+ *
+ * Functionality: Process the statistics delete request from duapp
+ * @param[in] Pst *pst
+ * @param[in] StatsDeleteReq *statsReq
+ * @return int
+ * -# ROK
+ **/
+
+uint8_t MacProcStatsDeleteReq(Pst *pst, MacStatsDeleteReq *macStatsDeleteReq)
+{
+ Pst schPst;
+ uint8_t ret = RFAILED;
+ SchStatsDeleteReq *schStatsDeleteReq = NULLP;
+
+ DU_LOG("\nINFO --> MAC : Received Statistics delete Request from DU_APP");
+
+ if(macStatsDeleteReq == NULLP)
+ {
+ DU_LOG("\nERROR --> MAC : MacProcStatsDeleteReq(): Received Null pointer");
+ return RFAILED;
+ }
+
+ MAC_ALLOC(schStatsDeleteReq, sizeof(SchStatsDeleteReq));
+ if(schStatsDeleteReq == NULLP)
+ {
+ DU_LOG("\nERROR --> MAC : MacProcStatsDeleteReq: Failed to allocate memory");
+ }
+ else
+ {
+ schStatsDeleteReq->subscriptionId = macStatsDeleteReq->subscriptionId;
+ FILL_PST_MAC_TO_SCH(schPst, EVENT_STATISTICS_DELETE_REQ_TO_SCH);
+ ret = SchMessageRouter(&schPst, (void *)schStatsDeleteReq);
+ }
+
+ if(ret != ROK)
+ {
+ MAC_FREE(schStatsDeleteReq, sizeof(SchStatsDeleteReq));
+ ret = MacSendStatsDeleteRspToDuApp(macStatsDeleteReq->subscriptionId , MAC_DU_APP_RSP_NOK, RESOURCE_UNAVAILABLE);
+ }
+
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, macStatsDeleteReq, sizeof(MacStatsDeleteReq));
+ return ret;
+}
+
/**********************************************************************
End of file
**********************************************************************/
{
/* Process Statistics Request */
unpackMacStatsReq(MacProcStatsReq, pst, mBuf);
+ break;
+ }
+
+ case EVENT_MAC_STATS_DELETE_REQ:
+ {
+ /* Process Statistics Delete Request */
+ unpackMacStatsDeleteReq(MacProcStatsDeleteReq, pst, mBuf);
+ break;
}
+
default:
RG_FREE_MSG(mBuf);
break;
case EVENT_MAC_STATISTICS_REQ:
strcpy(message,"EVENT_MAC_STATISTICS_REQ");
break;
+ case EVENT_MAC_STATS_DELETE_REQ:
+ strcpy(message,"EVENT_MAC_STATS_DELETE_REQ");
+ break;
default:
strcpy(message,"Invalid Event");
break;
strcpy(message,"EVENT_STATISTICS_IND_TO_MAC");
break;
}
+ case EVENT_STATISTICS_DELETE_RSP_TO_MAC:
+ {
+ strcpy(message,"EVENT_STATISTICS_DELETE_RSP_TO_MAC");
+ break;
+ }
default:
strcpy(message,"Invalid Event");
break;
MacProcSchStatsInd(pst, (SchStatsInd *)msg);
break;
}
+ case EVENT_STATISTICS_DELETE_RSP_TO_MAC:
+ {
+ MacProcSchStatsDeleteRsp(pst, (SchStatsDeleteRsp *)msg);
+ break;
+ }
default:
{
return RFAILED;
return SchSendStatsIndToMac(grpInfo->schInst, &statsInd);
}
+/*******************************************************************
+ *
+ * @brief Fill and send Statistics Delete Response to MAC
+ *
+ * @details
+ *
+ * Function : SchSendStatsDeleteRspToMac
+ *
+ * Functionality: Fill and send Statistics Delete Response to MAC
+ *
+ * @params[in]
+ * Statistics Delete Request from MAC
+ * Statistics Delete result
+ * Cause of response
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t SchSendStatsDeleteRspToMac(SchStatsDeleteReq *statsDeleteReq, SchMacRsp rsp, CauseOfResult cause)
+{
+ Pst rspPst;
+ uint8_t ret = ROK;
+ SchStatsDeleteRsp *schStatsDeleteRsp;
+
+ DU_LOG("\nINFO --> SCH : Filling Statistics Delete Response");
+ SCH_ALLOC(schStatsDeleteRsp, sizeof(SchStatsDeleteRsp));
+ if(schStatsDeleteRsp == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH : Failed to allocate memory in SchSendStatsDeleteRspToMac()");
+ return RFAILED;
+ }
+
+ schStatsDeleteRsp->subscriptionId=statsDeleteReq->subscriptionId;
+ schStatsDeleteRsp->rsp=rsp;
+ schStatsDeleteRsp->cause=cause;
+ /* Filling response post */
+ memset(&rspPst, 0, sizeof(Pst));
+ FILL_PST_SCH_TO_MAC(rspPst, inst);
+ rspPst.event = EVENT_STATISTICS_DELETE_RSP_TO_MAC;
+
+ ret = MacMessageRouter(&rspPst, (void *)schStatsDeleteRsp);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> SCH : SchSendStatsDeleteRspToMac(): Failed to send Statistics Response");
+ return ret;
+ }
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Delete statistics information
+ *
+ * @details
+ *
+ * Function : deleteStatsInfo
+ *
+ * Functionality:
+ * Delete statistics information
+ *
+ * @params[in]
+ * Instance
+ * Subscription id
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t deleteStatsInfo(Inst inst, uint64_t subscriptionId)
+{
+ bool statsFound=false;
+ uint8_t idx=0, statsGrpIdx=0;
+ SchStatsGrp *statsGrpInfo=NULLP;
+
+ if(schCb[inst].statistics.numOfStatsCfgd)
+ {
+ for(idx=0;idx<schCb[inst].statistics.numOfStatsCfgd; idx++)
+ {
+ for(statsGrpIdx=0;statsGrpIdx<schCb[inst].statistics.statsInfoList[idx].numStatsGroup; statsGrpIdx++)
+ {
+ statsGrpInfo = &schCb[inst].statistics.statsInfoList[idx].statsGrpList[statsGrpIdx];
+ if(statsGrpInfo->subscriptionId ==subscriptionId)
+ {
+ SCH_FREE(statsGrpInfo->kpiStats.dlTotalPrbUsage, sizeof(TotalPrbUsage));
+ SCH_FREE(statsGrpInfo->kpiStats.ulTotalPrbUsage, sizeof(TotalPrbUsage));
+ if(schChkTmr((PTR)statsGrpInfo, EVENT_STATISTICS_TMR) == true)
+ {
+ schStopTmr(&schCb[inst], (PTR)statsGrpInfo, EVENT_STATISTICS_TMR);
+ }
+ memset(statsGrpInfo, 0, sizeof(SchStatsGrp));
+ statsFound = true;
+ }
+ }
+ }
+ }
+
+ if(statsFound ==false)
+ {
+ DU_LOG("\nERROR --> SCH : SchProcStatsDeleteReq(): Statistics information is not present");
+ return RFAILED;
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Processes Statistics Delete Request from MAC
+ *
+ * @details
+ *
+ * Function : SchProcStatsDeleteReq
+ *
+ * Functionality:
+ * This function process the statistics delete request from MAC:
+ *
+ * @params[in] Post structure
+ * Statistics Delete Request from MAC
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t SchProcStatsDeleteReq(Pst *pst, SchStatsDeleteReq *statsDeleteReq)
+{
+ uint8_t ret =ROK;
+ Inst inst = pst->dstInst - SCH_INST_START;
+
+ DU_LOG("\nINFO --> SCH : Received Statistics Delete Request from MAC");
+
+ if(statsDeleteReq == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH : SchProcStatsDeleteReq(): Received Null pointer");
+ return RFAILED;
+ }
+
+ ret = deleteStatsInfo(inst, statsDeleteReq->subscriptionId);
+ if(ret == ROK)
+ {
+ SchSendStatsDeleteRspToMac(statsDeleteReq, RSP_OK, SUCCESSFUL);
+ }
+ else
+ {
+ SchSendStatsDeleteRspToMac(statsDeleteReq, RSP_NOK, STATS_ID_NOT_FOUND);
+ }
+ SCH_FREE(statsDeleteReq, sizeof(SchStatsDeleteReq));
+
+ return ret;
+} /* End of SchProcStatsDeleteReq */
+
/**********************************************************************
End of file
**********************************************************************/
uint8_t SchProcStatsReq(Pst *pst, SchStatsReq *statsReq);
uint8_t SchSendStatsIndToMac(Inst inst, SchStatsInd *statsInd);
uint8_t schCalcAndSendGrpStats(SchStatsGrp *grpInfo);
-
+uint8_t SchProcStatsDeleteReq(Pst *pst, SchStatsDeleteReq *statsDeleteReq);
/**********************************************************************
End of file
**********************************************************************/
strcpy(message,"EVENT_STATISTICS_REQ_TO_SCH");
break;
}
+ case EVENT_STATISTICS_DELETE_REQ_TO_SCH:
+ {
+ strcpy(message,"EVENT_STATISTICS_DELETE_REQ_TO_SCH");
+ break;
+ }
default:
strcpy(message,"Invalid Event");
break;
SchProcStatsReq(pst, (SchStatsReq *)msg);
break;
}
+ case EVENT_STATISTICS_DELETE_REQ_TO_SCH:
+ {
+ SchProcStatsDeleteReq(pst, (SchStatsDeleteReq *)msg);
+ break;
+ }
default:
{
DU_LOG("\nERROR --> SCH : SchMessageRouter(): Invalid event [%d] received", pst->event);
RESOURCE_UNAVAILABLE,
SLICE_NOT_FOUND,
DUPLICATE_ENTRY,
- PARAM_INVALID
+ PARAM_INVALID,
+ STATS_ID_NOT_FOUND
}CauseOfResult ;
typedef enum
return RFAILED;
}
+/*******************************************************************
+*
+* @brief Packs and Sends Statistics Delete Request from DUAPP to MAC
+*
+* @details
+*
+* Function : packDuMacStatsDeleteReq
+*
+* Functionality:
+* Packs and Sends statistics Delete Request from DUAPP to MAC
+*
+*
+* @params[in] Post structure pointer
+* StatsDeleteReq pointer
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t packDuMacStatsDeleteReq(Pst *pst, MacStatsDeleteReq *statsDeleteReq)
+{
+ Buffer *mBuf = NULLP;
+
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacStatsDeleteReq");
+ return RFAILED;
+ }
+ /* pack the address of the structure */
+ CMCHKPK(oduPackPointer,(PTR)statsDeleteReq, mBuf);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacStatsDeleteReq");
+ return RFAILED;
+ }
+ return ODU_POST_TASK(pst,mBuf);
+}
+
+/*******************************************************************
+*
+* @brief Unpacks Statistics Delete Request received from DU APP
+*
+* @details
+*
+* Function : unpackMacStatsDeleteReq
+*
+* Functionality:
+* Unpacks Statistics Delete Request received from DU APP
+*
+* @params[in] Pointer to Handler
+* Post structure pointer
+* Message Buffer
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t unpackMacStatsDeleteReq(DuMacStatsDeleteReqFunc func, Pst *pst, Buffer *mBuf)
+{
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ MacStatsDeleteReq *statsDeleteReq;
+
+ /* unpack the address of the structure */
+ CMCHKUNPK(oduUnpackPointer, (PTR *)&statsDeleteReq, mBuf);
+ ODU_PUT_MSG_BUF(mBuf);
+ return (*func)(pst, statsDeleteReq);
+ }
+ else
+ {
+ /* Nothing to do for other selectors */
+ DU_LOG("\nERROR --> DU APP : Only LWLC supported for Statistics Delete Request ");
+ ODU_PUT_MSG_BUF(mBuf);
+ }
+
+ return RFAILED;
+}
+
+/*******************************************************************
+*
+* @brief Packs and Sends Statistics Delete Response from MAC to DUAPP
+*
+* @details
+*
+* Function : packDuMacStatsDeleteRsp
+*
+* Functionality:
+* Packs and Sends Statistics Delete Response from MAC to DUAPP
+*
+*
+* @params[in] Post structure pointer
+* StatsDeleteRsp pointer
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t packDuMacStatsDeleteRsp(Pst *pst, MacStatsDeleteRsp *statsRsp)
+{
+ Buffer *mBuf = NULLP;
+
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacStatsDeleteRsp");
+ return RFAILED;
+ }
+ /* pack the address of the structure */
+ CMCHKPK(oduPackPointer,(PTR)statsRsp, mBuf);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacStatsDeleteRsp");
+ return RFAILED;
+ }
+ return ODU_POST_TASK(pst,mBuf);
+}
+
+/*******************************************************************
+*
+* @brief Unpacks Statistics Delete Response received from MAC
+*
+* @details
+*
+* Function : unpackDuMacStatsDeleteRsp
+*
+* Functionality:
+* Unpacks Statistics Delete Response received from MAC
+*
+* @params[in] Pointer to Handler
+* Post structure pointer
+* Message Buffer
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t unpackDuMacStatsDeleteRsp(MacDuStatsDeleteRspFunc func, Pst *pst, Buffer *mBuf)
+{
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ MacStatsDeleteRsp *statsRsp;
+
+ /* unpack the address of the structure */
+ CMCHKUNPK(oduUnpackPointer, (PTR *)&statsRsp, mBuf);
+ ODU_PUT_MSG_BUF(mBuf);
+ return (*func)(pst, statsRsp);
+ }
+ else
+ {
+ /* Nothing to do for other selectors */
+ DU_LOG("\nERROR --> DU APP : Only LWLC supported for Statistics Delete Response ");
+ ODU_PUT_MSG_BUF(mBuf);
+ }
+
+ return RFAILED;
+}
+
/**********************************************************************
End of file
**********************************************************************/
#define EVENT_MAC_STATISTICS_REQ 229
#define EVENT_MAC_STATISTICS_RSP 230
#define EVENT_MAC_STATISTICS_IND 231
+#define EVENT_MAC_STATS_DELETE_REQ 232
+#define EVENT_MAC_STATS_DELETE_RSP 233
#define BSR_PERIODIC_TIMER_SF_10 10
#define BSR_RETX_TIMER_SF_320 320
MacStats measuredStatsList[MAX_NUM_STATS];
}MacStatsInd;
+typedef struct macStatsDeleteReq
+{
+ uint64_t subscriptionId;
+}MacStatsDeleteReq;
+
+typedef struct macStatsDeleteRsp
+{
+ uint64_t subscriptionId;
+ MacRsp result;
+ CauseOfResult status;
+}MacStatsDeleteRsp;
+
/****************** FUNCTION POINTERS ********************************/
/* DL broadcast req from DU APP to MAC*/
Pst *pst,
MacStatsInd *statsInd));
+/* Statitics Delete Request from DU APP to MAC */
+typedef uint8_t (*DuMacStatsDeleteReqFunc) ARGS((
+ Pst *pst,
+ MacStatsDeleteReq *statsDeleteReq));
+
+/* Statistics Delete Response from MAC to DU APP */
+typedef uint8_t (*MacDuStatsDeleteRspFunc) ARGS((
+ Pst *pst,
+ MacStatsDeleteRsp *statsDeleteRsp));
+
/******************** FUNCTION DECLARATIONS ********************************/
uint8_t packMacCellUpInd(Pst *pst, OduCellId *cellId);
uint8_t unpackMacCellUpInd(DuMacCellUpInd func, Pst *pst, Buffer *mBuf);
uint8_t packDuMacStatsInd(Pst *pst, MacStatsInd *statsRsp);
uint8_t DuProcMacStatsInd(Pst *pst, MacStatsInd *statsRsp);
uint8_t unpackDuMacStatsInd(MacDuStatsIndFunc func, Pst *pst, Buffer *mBuf);
+
+uint8_t packDuMacStatsDeleteReq(Pst *pst, MacStatsDeleteReq *statsDeleteReq);
+uint8_t MacProcStatsDeleteReq(Pst *pst, MacStatsDeleteReq *statsDeleteReq);
+uint8_t unpackMacStatsDeleteReq(DuMacStatsDeleteReqFunc func, Pst *pst, Buffer *mBuf);
+
+uint8_t packDuMacStatsDeleteRsp(Pst *pst, MacStatsDeleteRsp *statsDeleteRsp);
+uint8_t DuProcMacStatsDeleteRsp(Pst *pst, MacStatsDeleteRsp *statsDeleteRsp);
+uint8_t unpackDuMacStatsDeleteRsp(MacDuStatsDeleteRspFunc func, Pst *pst, Buffer *mBuf);
+
#endif
#define EVENT_STATISTICS_REQ_TO_SCH 35
#define EVENT_STATISTICS_RSP_TO_MAC 36
#define EVENT_STATISTICS_IND_TO_MAC 37
+#define EVENT_STATISTICS_DELETE_REQ_TO_SCH 38
+#define EVENT_STATISTICS_DELETE_RSP_TO_MAC 39
/*macros*/
#define MAX_SSB_IDX 1 /* forcing it as 1 for now. Right value is 64 */
SchStats measuredStatsList[MAX_NUM_STATS];
}SchStatsInd;
+typedef struct schStatsDeleteReq
+{
+ uint64_t subscriptionId;
+}SchStatsDeleteReq;
+
+typedef struct schStatsDeleteRsp
+{
+ uint64_t subscriptionId;
+ SchMacRsp rsp;
+ CauseOfResult cause;
+}SchStatsDeleteRsp;
/* function declarations */
uint8_t MacMessageRouter(Pst *pst, void *msg);
memset(&duCb.e2apDb.tnlAssoc, 0, MAX_TNL_ASSOCIATION*sizeof(TNLAssociation));
memset(&ricParams, 0, sizeof(DuSctpDestCb));
}
+
+/*******************************************************************
+ *
+ * @brief Extract statistics received from DU layers and delete
+ * Ric subscription info
+ *
+ * @details
+ *
+ * Function :e2ProcStatsDeleteRsp
+ *
+ * Functionality: Extract statistics received from DU layers
+ * and delete ric subscription iformation form db
+ *
+ * @params[in] Statistics delete rsp from MAC
+ * @return ROK-success
+ * RFAILED-failure
+ *
+ * ****************************************************************/
+uint8_t e2ProcStatsDeleteRsp(MacStatsDeleteRsp *statsDeleteRsp)
+{
+ RanFunction *ranFuncDb = NULLP;
+ CmLList *ricSubscriptionNode = NULLP;
+ RicSubscription *ricSubscriptionInfo = NULLP;
+ E2FailureCause failureCause;
+
+ /* Fetch RAN Function and Subscription DB using subscription Id received
+ * in statistics delete response */
+ if(fetchSubsInfoFromSubsId(statsDeleteRsp->subscriptionId, &ranFuncDb, &ricSubscriptionNode, &ricSubscriptionInfo) != ROK)
+ {
+ DU_LOG("\nERROR --> E2AP : extractStatsMeasurement: Failed to fetch subscriprtion details");
+ return RFAILED;
+ }
+
+ deleteRicSubscriptionNode(ricSubscriptionNode);
+#if 0
+ /* TODO */
+ if(statsDeleteRsp->result == MAC_DU_APP_RSP_NOK && statsDeleteRsp->status == STATS_ID_NOT_FOUND)
+ {
+ failureCause->causeType =E2_RIC_REQUEST;
+ failureCause->cause = E2_REQUEST_INFORMATION_UNAVAILABLE;
+ BuildAndSendRicSubscriptionDeleteFailure(ricSubscriptionInfo->ranFuncId, ricSubscriptionInfo->requestId, failureCause);
+ }
+ else
+ {
+ BuildAndSendRicSubscriptionDeleteResponse(ricSubscriptionInfo->ranFuncId, ricSubscriptionInfo->requestId);
+ }
+#endif
+ return ROK;
+}
+
/**********************************************************************
End of file
**********************************************************************/
void deleteActionSequence(ActionInfo *action);
void deleteMeasuredValueList(CmLListCp *measuredValueList);
void removeE2NodeInformation();
+void encodeSubscriptionId(uint64_t *subscriptionId, uint16_t ranFuncId, RicRequestId ricReqId);
+uint8_t e2ProcStatsDeleteRsp(MacStatsDeleteRsp *statsDeleteRsp);
+
/**********************************************************************
End of file
**********************************************************************/
break;
}
- //TODO : Send statistics delete request to MAC
+ if(BuildAndSendStatsDeleteReq(ricSubsDb) != ROK)
+ {
+ DU_LOG("\nERROR --> E2AP : Failed to build and send ric subscription delete req to du layers");
+ }
break;
}
strcpy(message,"EVENT_MAC_STATISTICS_IND");
break;
}
+ case EVENT_MAC_STATS_DELETE_RSP:
+ {
+ strcpy(message,"EVENT_MAC_STATS_DELETE_RSP");
+ break;
+ }
default:
{
strcpy(message,"Invalid Event");
ret = unpackDuMacStatsInd(DuProcMacStatsInd, pst, mBuf);
break;
}
+ case EVENT_MAC_STATS_DELETE_RSP:
+ {
+ ret = unpackDuMacStatsDeleteRsp(DuProcMacStatsDeleteRsp, pst, mBuf);
+ break;
+ }
default:
{
DU_LOG("\nERROR --> DU_APP : Invalid event received at duActvTsk from ENTMAC");
uint16_t getTransId();
uint8_t cmPkLrgSchCfgReq(Pst * pst,RgMngmt * cfg);
uint8_t sendCellDeleteReqToMac(uint16_t cellId);
+uint8_t BuildAndSendStatsDeleteReq(RicSubscription *ricSubscriptionInfo);
packMacCellCfgReq packMacCellCfgOpts[] =
{
packDuMacStatsReq /* Light weight-loose coupling */
};
+DuMacStatsDeleteReqFunc packMacStatsDeleteReqOpts[]=
+{
+ packDuMacStatsDeleteReq, /* Loose Coupling */
+ MacProcStatsDeleteReq, /* Tight Coupling */
+ packDuMacStatsDeleteReq /* Light weight-loose coupling */
+};
+
/**************************************************************************
* @brief Function to fill configs required by RLC
*
return ret;
}
+/*******************************************************************
+ *
+ * @brief Process statistics delete response from MAC
+ *
+ * @details
+ *
+ * Function : DuProcMacStatsDeleteRsp
+ *
+ * Functionality: Processes statistics delete response
+ * from MAC.
+
+ * @params[in]
+ * Pst Information
+ * Mac stats delete rsp
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t DuProcMacStatsDeleteRsp(Pst *pst, MacStatsDeleteRsp *statsDeleteRsp)
+{
+ uint8_t ret = RFAILED;
+ DU_LOG("\nINFO --> DU_APP : DuProcMacStatsDeleteRsp: Received Statistics Response from MAC");
+
+ if(statsDeleteRsp)
+ {
+ if((ret = e2ProcStatsDeleteRsp(statsDeleteRsp)) != ROK)
+ {
+ DU_LOG("\nINFO --> DU_APP : Failed in %s at line %d", __func__, __LINE__);
+ }
+ DU_FREE_SHRABL_BUF(pst->region, pst->pool, statsDeleteRsp, sizeof(MacStatsDeleteRsp));
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU_APP : DuProcMacStatsDeleteRsp: Received NULL Pointer");
+ }
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Send Statistics delete req to MAC
+ *
+ * @details
+ *
+ * Function : BuildAndSendStatsDeleteReqToMac()
+ *
+ * Functionality: Send Statistics delete req To Mac
+ *
+ * @params[in]
+ * Subscription Info
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildAndSendStatsDeleteReqToMac(RicSubscription *ricSubscriptionInfo)
+{
+ Pst pst;
+ MacStatsDeleteReq *macStatsDelete = NULLP;
+
+ /* Fill MAC statistics delete */
+ DU_ALLOC_SHRABL_BUF(macStatsDelete, sizeof(MacStatsDeleteReq));
+ if(macStatsDelete == NULLP)
+ {
+ DU_LOG("\nERROR --> DU_APP : Memory allocation failed for macStatsDelete in BuildAndSendStatsDeleteReqToMac");
+ return RFAILED;
+ }
+
+ /* Generate subscription ID using RIC Request ID and RAN Function ID */
+ encodeSubscriptionId(&macStatsDelete->subscriptionId, ricSubscriptionInfo->ranFuncId, ricSubscriptionInfo->requestId);
+
+ DU_LOG("\nDEBUG --> DU_APP: Sending Statistics delete req to MAC ");
+ FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_STATS_DELETE_REQ);
+
+ if( (*packMacStatsDeleteReqOpts[pst.selector])(&pst, macStatsDelete) != ROK)
+ {
+ DU_LOG("\nERROR --> DU_APP: Failed to send Statistics delete req to MAC");
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, macStatsDelete, sizeof(MacStatsDeleteReq));
+ return RFAILED;
+ }
+
+ return ROK;
+}
+
+
+/*******************************************************************
+ *
+ * @brief Statistics delete to DU layers
+ *
+ * @details
+ *
+ * Function : BuildAndSendStatsDeleteReq()
+ *
+ * Functionality: Statistics delete to DU layers
+ *
+ * @params[in] Subscription Info
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildAndSendStatsDeleteReq(RicSubscription *ricSubscriptionInfo)
+{
+ /* Build and sent subscription information to MAC in Statistics delete */
+ if(BuildAndSendStatsDeleteReqToMac(ricSubscriptionInfo) != ROK)
+ {
+ DU_LOG("\nERROR --> DU_APP : Failed at BuildAndSendStatsDeleteReqToMac()");
+ return RFAILED;
+ }
+ return ROK;
+}
+
/**********************************************************************
End of file
**********************************************************************/
uint8_t BuildAndSendE2NodeConfigUpdateAck(DuDb *duDb, uint8_t transId, E2NodeConfigList *e2NodeList);
uint8_t BuildAndSendConnectionUpdate(uint32_t duId);
uint8_t BuildAndSendE2ConnectionUpdate(uint32_t duId, E2Connection connectionInfo);
+uint8_t BuildAndSendRicSubscriptionDeleteRequest(uint32_t duId, RicSubscription *ricSubsDb);
/**********************************************************************
End of file
**********************************************************************/