CPP_OBJS=$(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(CPP_SRCS))
PLTFRM_FLAGS=
+ifeq ($(NODE),TEST_STUB)
+PLTFRM_FLAGS+=-DODU_TEST_STUB
+endif
+
lib: $(LIB_DIR)/libo1.a
include $(COM_BUILD_DIR)/compile.mak
$(LIB_DIR)/libo1.a:$(CPP_OBJS)
@echo -e "Creating Archive $(COLOR) $@ $(REVERT_COLOR)"
- $(Q)ar -cr $(LIB_DIR)/libo1.a $(CPP_OBJS)
+ $(Q)ar -cr $(LIB_DIR)/libves.a $(CPP_OBJS)
#-------------------------------------------------------------#
#Clean macros
#-------------------------------------------------------------#
clean:
@echo -e "$(COLOR_RED)Cleaning O1$(REVERT_COLOR)"
- $(Q)\rm -f $(LIB_DIR)/libo1.a $(CPP_OBJS)
+ $(Q)\rm -f $(LIB_DIR)/libves.a $(CPP_OBJS)
#**********************************************************************
# End of file
--- /dev/null
+<nacm xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-acm">
+ <enable-nacm>true</enable-nacm>
+ <read-default>permit</read-default>
+ <write-default>deny</write-default>
+ <exec-default>permit</exec-default>
+ <enable-external-groups>true</enable-external-groups>
+ <groups>
+ <group>
+ <name>sudo</name>
+ <user-name>netconf</user-name>
+ </group>
+ </groups>
+ <rule-list>
+ <name>sudo-rules</name>
+ <group>sudo</group>
+ <rule>
+ <name>allow-all-sudo</name>
+ <module-name>*</module-name>
+ <path>/</path>
+ <access-operations>*</access-operations>
+ <action>permit</action>
+ <comment>Corresponds all the rules under the sudo group as defined in O-RAN.WG4.MP.0-v05.00</comment>
+ </rule>
+ </rule-list>
+</nacm>
--- /dev/null
+module o-ran-sc-du-hello-world {
+ yang-version 1.1;
+ namespace "urn:o-ran-sc:yang:o-ran-sc-du-hello-world";
+ prefix duhw;
+
+ organization
+ "O-RAN Software Community";
+ contact
+ "www.o-ran-sc.org";
+ description
+ "This module contains the O-RAN Software Community Distributed Unit
+ API description. This schema was created to support the
+ O-RAN-SC D-Release RSAC use case.
+ This standalone model is the absolute minimum and therefore
+ called 'hello-world'.
+
+ Copyright 2021 the O-RAN Software Community.
+
+ Licensed under the Apache License, Version 2.0 (the 'License');
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an 'AS IS' BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.";
+
+ revision 2021-04-08 {
+ description
+ "Updates based on the RSAC call 2021-04-08.";
+ reference
+ "https://wiki.o-ran-sc.org/pages/viewpage.action?pageId=20878423";
+ }
+ revision 2021-03-06 {
+ description
+ "initial revision";
+ reference
+ "https://wiki.o-ran-sc.org/pages/viewpage.action?pageId=20878423";
+ }
+
+ // TypeDefinitions
+
+ typedef connection-status {
+ type enumeration {
+ enum disconnected {
+ value 0;
+ description
+ "The connection to the remote network function is not established.";
+ }
+ enum connecting {
+ value 1;
+ description
+ "The system is about to connect to the remote network function.";
+ }
+ enum connected {
+ value 2;
+ description
+ "The system is connected to the remote network function.";
+ }
+ enum disconnecting {
+ value 3;
+ description
+ "The system is about to disconnect from the remote network
+ function.";
+ }
+ enum unable-to-connect {
+ value 4;
+ description
+ "This value is reported, when the system tried several times
+ to connect and finally gave up.";
+ }
+ }
+ description
+ "A non extensible enumeration representing a connection status.";
+ }
+
+ typedef o-ru-reference {
+ type leafref {
+ path "/network-function/du-to-ru-connection/name";
+ }
+ description
+ "A reference to a remote network function representing an O-RU.";
+ }
+
+ // Abstract object classes - groupings
+
+ grouping connection-grp {
+ description
+ "An abstract object class representing a connection or link to an
+ external component.";
+ leaf name {
+ type string;
+ description
+ "It is proposed to use the network unique identifier of the remote
+ network function.
+ Note: After discussion the string was not restricted by a 'length'
+ statement of a 'pattern' statement. Please avoid leading and ending
+ spaces and consecutive spaces and any character outside of UTF-8-";
+ }
+ leaf operational-state {
+ type enumeration {
+ enum DISABLED {
+ description
+ "The resource is not functional.";
+ }
+ enum ENABLED {
+ description
+ "The resource is functional.";
+ }
+ }
+ config false;
+ description
+ "Operational state of a connection. Indicates
+ whether the resource is functional (ENABLED) or not (DISABLED).";
+ reference
+ "3GPP TS 28.625 and ITU-T X.731";
+ }
+ leaf administrative-state {
+ type enumeration {
+ enum LOCKED {
+ description
+ "LOCKED refers to a situation which is NOT considered as
+ ‘normal operation'. Therefore, the O-DU will shut down the
+ connection to the related O-RU, when the value is set to LOCKED.";
+ }
+ enum UNLOCKED {
+ description
+ "UNLOCKED refers to a situation which is considered as
+ 'normal operation'. Therefore, the O-DU will establish the
+ connection to the related O-RU, when the value is set to UNLOCKED.";
+ }
+ enum SHUTTING_DOWN {
+ description
+ "This value should not be used. At least the system
+ behavior is not defined.";
+ }
+ }
+ default "LOCKED";
+ description
+ "Administrative state of a connection.";
+ reference
+ "3GPP TS 28.625 and ITU-T X.731";
+ }
+ leaf cell-state {
+ type enumeration {
+ enum IDLE {
+ description
+ "Indicates whether the O-RU is not in use.";
+ }
+ enum INACTIVE {
+ description
+ "Indicates whether the O-RU is in use but not
+ configured to carry traffic.";
+ }
+ enum ACTIVE {
+ description
+ "Indicates whether the O-RU is in use and
+ configured to carry traffic.";
+ }
+ }
+ config false;
+ description
+ "Cell state of the O-RU instance.";
+ reference
+ "3GPP TS 28.625";
+ }
+ leaf status {
+ type connection-status;
+ default "disconnected";
+ config false;
+ description
+ "The value represents the connection status. ";
+ }
+ }
+
+ grouping network-function-grp {
+ description
+ "An abstract object class grouping the O-RAN-SC-DU parameters with
+ focus on RSAC D-release Closed-Loop use case.";
+ list du-to-ru-connection {
+ key "name";
+ description
+ "A list of connection objects to O-RAN-SC radio units.";
+ uses connection-grp;
+ }
+ }
+
+ grouping rpc-output {
+ description
+ "A generic RPC output syntax.";
+ leaf response-status {
+ type enumeration {
+ enum ok {
+ value 200;
+ description
+ "The system has successfully performed that request.";
+ }
+ enum accepted {
+ value 202;
+ description
+ "The system has received and accepted the request. It continues
+ processing the request. The final status of the processing
+ procedures are reported by a notification service. This response
+ status is typically for long running transactions.";
+ }
+ enum internal-server-error {
+ value 500;
+ description
+ "The request cannot be performed.";
+ }
+ }
+ mandatory true;
+ description
+ "The response status related to the corresponding request.
+ Its values are inspired by HTTP response status codes.";
+ reference
+ "RFC 7231 – Response Status Codes - Section 6.3.4";
+ }
+ leaf message {
+ type string;
+ description
+ "A human readable text complementary to the response status. ";
+ }
+ }
+
+ // Data nodes
+
+ container network-function {
+ description
+ "The root container for the configuration and operational data.
+ The object implements the 'network-function-grp'";
+ uses network-function-grp;
+ }
+
+ // Remote procedure calls - actions on root level
+
+ rpc connect {
+ status deprecated;
+ description
+ "An action to establish the connection to a remote network function.";
+ input {
+ leaf remote-network-function {
+ type o-ru-reference;
+ mandatory true;
+ description
+ "An reference to a remote network function - an O-RU - to which
+ a connection should be established.";
+ }
+ }
+ output {
+ uses rpc-output;
+ }
+ }
+
+ rpc disconnect {
+ status deprecated;
+ description
+ "An action to destroy the connection to a remote network function.";
+ input {
+ leaf remote-network-function {
+ type o-ru-reference;
+ mandatory true;
+ description
+ "An reference to a remote network function - an O-RU - to which
+ the connection should be destroyed.";
+ }
+ }
+ output {
+ uses rpc-output;
+ }
+ }
+}
$cd l2/build/yang
$sysrepoctl -i o-ran-sc-odu-alarm-v1.yang
$sysrepoctl -i o-ran-sc-odu-interface-v1.yang
+ $sysrepoctl -i o-ran-sc-du-hello-world.yang
4. Configure the startup IP and Port configurations for DU, CU and RIC
$cd l2/build/config
- Open the netconfConfig.xml and edit the desired MAC address, IP, Port, Username and Password for VES PNF Registration.
+ Open the netconfConfig.json and edit the desired MAC address, IP, Port, Username and Password for VES PNF Registration.
6. Configure the VES server details to send VES Events
$cd l2/build/config
- Open the vesConfig.xml and edit the desired IP, Port, Username and Password to send VES Event.
+ Open the vesConfig.json and edit the desired IP, Port, Username and Password to send VES Event.
+
+7. Configure the nacm module to provide access to new user
+
+ $cd l2/build/config
+
+ Open the nacm_config.xml and edit the desired user-name to provide the access to that user.
+
+ $sysrepocfg --import=nacm_config.xml --datastore running --module ietf-netconf-acm
+
D. How to Clean and Build:
- Install the YANG modules
- - Ubuntu :
-
+ - Ubuntu :
+
| cd <O-DU High Directory>/l2/build/yang
| sysrepoctl -i ./yang/o-ran-sc-odu-alarm-v1.yang
| sysrepoctl -i ./yang/o-ran-sc-odu-interface-v1.yang
+ | sysrepoctl -i ./yang/o-ran-sc-du-hello-world.yang
- Configure the startup IP and Port configurations for DU, CU and RIC
- - Ubuntu :
-
+ - Ubuntu :
+
| cd <O-DU High Directory>/l2/build/config
|
| Open the startup_config.xml and edit the desired IP and Port for CU, DU and RIC.
| Then load the configuration in the sysrepo running datastore using the command below
|
- | sysrepocfg --import=startup_config.xml --datastore running --module o-ran-sc-odu-interface-v1
+ | sysrepocfg --import=startup_config.xml --datastore running --module o-ran-sc-odu-interface-v1
+
+- Configure the netconf server details for VES PNF Event
+
+ - Ubuntu :
+
+ | cd <O-DU High Directory>/l2/build/config
+ |
+ | Open the netconfConfig.json and edit the desired MAC address, IP, Port, Username and Password for VES PNF Registration.
+
+- Configure the VES server details to send VES Events
+
+ - Ubuntu :
+
+ | cd <O-DU High Directory>/l2/build/config
+ |
+ | Open the vesConfig.json and edit the desired IP, Port, Username and Password to send VES Event.
+
+- Configure the nacm module to provide access to new user
+
+ - Ubuntu :
+
+ | cd <O-DU High Directory>/l2/build/config
+ |
+ | Open the nacm_config.xml and edit the desired user-name to provide the access to that user.
+ |
+ | $sysrepocfg --import=nacm_config.xml --datastore running --module ietf-netconf-acm
+
Compilation
------------
uint8_t pduIdx =0;
uint8_t lcIdx = 0;
uint8_t *txPdu =NULLP;
- uint16_t tbSize =0;
+ uint16_t tbSize =0,cellIdx=0;
MacDlData macDlData;
MacDlSlot *currDlSlot = NULLP;
DlRlcBoInfo dlBoInfo;
-
+
memset(&macDlData , 0, sizeof(MacDlData));
DU_LOG("\nDEBUG --> MAC: Received DL data for sfn=%d slot=%d numPdu= %d", \
dlData->slotInfo.sfn, dlData->slotInfo.slot, dlData->numPdu);
macDlData.pduInfo[pduIdx].dlPdu = dlData->pduInfo[pduIdx].pduBuf;
}
+ GET_CELL_IDX(dlData->cellId, cellIdx);
/* Store DL data in the scheduled slot */
- currDlSlot = &macCb.macCell[dlData->cellId -1]->dlSlot[dlData->slotInfo.slot];
- if(currDlSlot)
+ if(macCb.macCell[cellIdx] ==NULLP)
{
- if(currDlSlot->dlInfo.dlMsgAlloc)
+ DU_LOG("\nERROR --> MAC : MacProcRlcDlData(): macCell does not exists");
+ return RFAILED;
+ }
+ currDlSlot = &macCb.macCell[cellIdx]->dlSlot[dlData->slotInfo.slot];
+ if(currDlSlot->dlInfo.dlMsgAlloc)
+ {
+ tbSize = currDlSlot->dlInfo.dlMsgAlloc->dlMsgPdschCfg.codeword[0].tbSize;
+ MAC_ALLOC(txPdu, tbSize);
+ if(!txPdu)
{
- tbSize = currDlSlot->dlInfo.dlMsgAlloc->dlMsgPdschCfg.codeword[0].tbSize;
- MAC_ALLOC(txPdu, tbSize);
- if(!txPdu)
- {
- DU_LOG("\nERROR --> MAC : Memory allocation failed in MacProcRlcDlData");
- return RFAILED;
- }
- macMuxPdu(&macDlData, NULLP, txPdu, tbSize);
-
- currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPduLen = tbSize;
- currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPdu = txPdu;
+ DU_LOG("\nERROR --> MAC : Memory allocation failed in MacProcRlcDlData");
+ return RFAILED;
}
+ macMuxPdu(&macDlData, NULLP, txPdu, tbSize);
+
+ currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPduLen = tbSize;
+ currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPdu = txPdu;
}
for(lcIdx = 0; lcIdx < dlData->numLc; lcIdx++)
for(pduIdx = 0; pduIdx < dlData->numPdu; pduIdx++)
{
MAC_FREE_SHRABL_BUF(pstInfo->region, pstInfo->pool, dlData->pduInfo[pduIdx].pduBuf,\
- dlData->pduInfo[pduIdx].pduLen);
+ dlData->pduInfo[pduIdx].pduLen);
}
if(pstInfo->selector == ODU_SELECTOR_LWLC)
{
- MAC_FREE_SHRABL_BUF(pstInfo->region, pstInfo->pool, dlData, sizeof(RlcData));
+ MAC_FREE_SHRABL_BUF(pstInfo->region, pstInfo->pool, dlData, sizeof(RlcData));
}
return ROK;
}
DU_LOG("\nINFO --> MAC : Sending cell stop request to Lower Mac");
GET_CELL_IDX(cellId->cellId, cellIdx);
- slotInfo.cellId = cellId->cellId;
- slotInfo.sfn = macCb.macCell[cellIdx]->currTime.sfn;
- slotInfo.slot = macCb.macCell[cellIdx]->currTime.slot;
- sendToLowerMac(FAPI_STOP_REQUEST, 0, &slotInfo);
+ if(macCb.macCell[cellIdx])
+ {
+ slotInfo.cellId = cellId->cellId;
+ slotInfo.sfn = macCb.macCell[cellIdx]->currTime.sfn;
+ slotInfo.slot = macCb.macCell[cellIdx]->currTime.slot;
+ sendToLowerMac(FAPI_STOP_REQUEST, 0, &slotInfo);
+ }
#endif
MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cellId, \
uint16_t cellIdx = 0;
GET_CELL_IDX(slotInd.cellId, cellIdx);
-
+
+ if(macCb.macCell[cellIdx] == NULLP)
+ {
+ DU_LOG("ERROR --> MAC : macProcSlotInd(): CellId[%d] does not exist. Error occurred at SFN [%d] Slot [%d]",\
+ slotInd.cellId, slotInd.sfn, slotInd.slot);
+ return RFAILED;
+ }
/* Store current time info */
macCb.macCell[cellIdx]->currTime.cellId = slotInd.cellId;
macCb.macCell[cellIdx]->currTime.slot = slotInd.slot;
/* Filling UE delete response */
deleteRsp->cellId = cellId;
- GET_UE_IDX(crnti,deleteRsp->ueIdx);
+ GET_UE_IDX(crnti,deleteRsp->ueId);
deleteRsp->result = result;
/* Fill Post structure and send UE delete response*/
MacUeCb *ueCb = NULLP;
MacCellCb *cellCb = NULLP;
- DU_LOG("\nINFO --> MAC : UE Delete Request received for ueIdx[%d]", ueDelete->ueIdx);
+ DU_LOG("\nINFO --> MAC : UE Delete Request received for ueId[%d]", ueDelete->ueId);
if(ueDelete)
{
cellCb = macCb.macCell[cellIdx];
if(cellCb)
{
- ueCb = &cellCb->ueCb[ueDelete->ueIdx-1];
+ ueCb = &cellCb->ueCb[ueDelete->ueId-1];
if(ueCb->crnti == ueDelete->crnti)
{
ret = sendUeDelReqToSch(pst, ueDelete);
}
else
{
- DU_LOG("\nERROR --> MAC : MacProcUeDeleteReq(): Failed to find the MacUeCb of UeIdx = %d",ueDelete->ueIdx);
+ DU_LOG("\nERROR --> MAC : MacProcUeDeleteReq(): Failed to find the MacUeCb of UeIdx = %d",ueDelete->ueId);
result = CELLID_INVALID;
}
return RFAILED;
}
/* Start throughput calculation for this UE */
- gCb->rlcThpt.thptPerUe[gCb->rlcThpt.numActvUe].ueIdx = ueId;
- gCb->rlcThpt.thptPerUe[gCb->rlcThpt.numActvUe].dataVol = 0;
+ gCb->rlcThpt.thptPerUe[ueId -1].ueId = ueId;
+ gCb->rlcThpt.thptPerUe[ueId -1].dataVol = 0;
gCb->rlcThpt.numActvUe++;
-
- if((rlcChkTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_THROUGHPUT_TMR)) == FALSE)
- {
- rlcStartTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_THROUGHPUT_TMR);
- }
}
/* Validate LChId for UM and AM modes */
return RFAILED;
}
rlcDbmAddUlUeCb(gCb, cfgTmpData->ueId, cfgTmpData->cellId, cfgTmpData->ueCb);
+ cfgTmpData->ueCb->ueDeleteInfo.ueDelTmr.tmrEvnt = TMR_NONE;
}
else
{
DU_LOG("\nERROR --> RLC_DL : UeId[%u] HashList Insertion Failed",
ueCb->ueId);
}
+ memset(&gCb->rlcThpt.thptPerUe[ueCb->ueId -1], 0, sizeof(RlcThptPerUe));
+ gCb->rlcThpt.numActvUe--;
+
/* kw005.201 ccpu00117318, updating the statistics */
gCb->genSts.numUe--;
else if (tRlcCb->u.ulCb->rlcUlUdxEventType == EVENT_RLC_UE_DELETE_REQ)
{
FILL_PST_RLC_TO_DUAPP(rspPst, RLC_UL_INST, EVENT_RLC_UE_DELETE_RSP);
- if(sendRlcUeDeleteRspToDu(cfgCfm->ueId, cfgCfm->cellId, SUCCESSFUL) != ROK)
+ if(sendRlcUeDeleteRspToDu(cfgCfm->cellId, cfgCfm->ueId, SUCCESSFUL) != ROK)
{
DU_LOG("ERROR --> RLC_UL: rlcUlUdxCfgCfm(): Failed to send UE delete response ");
return RFAILED;
gCb->init.cfgDone = TRUE;
+ /* TODO : make this generic for DL and UL after support for UL throughput calculation is added */
+ if(gCb->genCfg.rlcMode == LKW_RLC_MODE_DL)
+ {
+ /* Starting timer to print throughput */
+ if((rlcChkTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_THROUGHPUT_TMR)) == FALSE)
+ {
+ DU_LOG("\nINFO --> RLC_DL : Starting Throughput timer");
+ rlcStartTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_THROUGHPUT_TMR);
+ }
+ }
+
return (LCM_REASON_NOT_APPL);
}
/* This file stores defines used at RLC interface */
uint8_t fillRlcUeCfgRsp(RlcUeCfgRsp *rlcCfgRsp, RlcCfgCfmInfo *rlcCRsp);
uint8_t SendRlcUeCfgRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp);
-uint8_t sendRlcUeDeleteRspToDu(uint8_t ueIdx, uint16_t cellId, UeDeleteResult result);
+uint8_t sendRlcUeDeleteRspToDu(uint16_t cellId, uint8_t ueId, UeDeleteResult result);
/**********************************************************************
End of file
* Functionality:
* sending UE delete response to DU
*
- * @params[in] uint8_t ueIdx, uint8_t cellId, UeDeleteResult result
+ * @params[in] uint8_t cellId, uint8_t ueIdx, UeDeleteResult result
*
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t sendRlcUeDeleteRspToDu(uint8_t ueIdx, uint16_t cellId, UeDeleteResult result)
+uint8_t sendRlcUeDeleteRspToDu(uint16_t cellId,uint8_t ueId, UeDeleteResult result)
{
Pst pst;
RlcUeDeleteRsp *ueDeleteRsp = NULLP;
else
{
ueDeleteRsp->cellId = cellId;
- ueDeleteRsp->ueIdx = ueIdx;
+ ueDeleteRsp->ueId = ueId;
ueDeleteRsp->result = result;
if(rlcSendUeDeleteRspToDu(&pst, ueDeleteRsp) == ROK)
return ROK;
}
-/* ****************************************************************
-*
-* @brief filling RLC UE delete configuration
-*
-* @details
-*
-* Function : fillRlcCfgInfo
-*
-* Functionality: filling RLC UE delete configuration
-*
-* @params[in] RlcUlUeCb *ueCb, RlcCfgInfo *rlcUeCfg
-*
-* @return void
-*
-* ****************************************************************/
-
-void fillRlcUeDelInfo(RlcUlUeCb *ueCb, RlcCfgInfo *rlcUeCfg)
-{
- uint8_t lcIdx;
-
- rlcUeCfg->ueId = ueCb->ueId;
- rlcUeCfg->cellId = ueCb->cellId;
- rlcUeCfg->numEnt = 0;
- for(lcIdx=0; lcIdx<RLC_MAX_LCH_PER_UE && rlcUeCfg->numEnt < 1; lcIdx++)
- {
- if(ueCb->lCh[lcIdx].ulRbCb != NULLP)
- {
- rlcUeCfg->entCfg[rlcUeCfg->numEnt].rbId = 0;
- rlcUeCfg->entCfg[rlcUeCfg->numEnt].rbType = 0;
- rlcUeCfg->entCfg[rlcUeCfg->numEnt].cfgType = CKW_CFG_DELETE_UE;
- rlcUeCfg->numEnt++;
- }
- }
-}
-
/*******************************************************************
*
* @brief Handles Ue delete Request from DU APP
{
uint8_t ret = ROK;
RlcCb *gRlcCb = NULLP;
- RlcCfgInfo *rlcUeCfg = NULLP;
RlcUlUeCb *ueCb = NULLP;
UeDeleteResult result=SUCCESSFUL;
- DU_LOG("\nDEBUG --> RLC: UE Delete request received. CellID[%d] UEIDX[%d]",ueDelete->cellId, ueDelete->ueIdx);
+ DU_LOG("\nDEBUG --> RLC: UE Delete request received. CellID[%d] UEID[%d]",ueDelete->cellId, ueDelete->ueId);
if(ueDelete != NULLP)
{
gRlcCb = RLC_GET_RLCCB(pst->dstInst);
- rlcDbmFetchUlUeCb(gRlcCb,ueDelete->ueIdx, ueDelete->cellId, &ueCb);
+ rlcDbmFetchUlUeCb(gRlcCb,ueDelete->ueId, ueDelete->cellId, &ueCb);
if(ueCb != NULLP)
{
if(ueDelete->cellId == ueCb->cellId)
{
- RLC_ALLOC(gRlcCb, rlcUeCfg, sizeof(RlcCfgInfo));
- if(rlcUeCfg == NULLP)
- {
- DU_LOG("\nERROR --> RLC: deleteRlcUeCb(): Failed to allocate memory");
- ret = RFAILED;
- }
- else
+ memcpy(&ueCb->ueDeleteInfo.pst, pst, sizeof(Pst));
+ if((rlcChkTmr(gRlcCb, (PTR)ueCb, EVENT_RLC_UE_DELETE_TMR)) == FALSE)
{
- memset(rlcUeCfg, 0, sizeof(RlcCfgInfo));
- fillRlcUeDelInfo(ueCb, rlcUeCfg);
- if(RlcProcCfgReq(pst, rlcUeCfg) != ROK)
- {
- DU_LOG("\nERROR --> RLC: deleteRlcUeCb(): Failed to delete UE information");
- result = INVALID_UEID;
- }
+ rlcStartTmr(gRlcCb,(PTR)ueCb, EVENT_RLC_UE_DELETE_TMR);
}
}
else
if(result != SUCCESSFUL)
{
- ret = sendRlcUeDeleteRspToDu(ueDelete->ueIdx, ueDelete->cellId, result);
+ ret = sendRlcUeDeleteRspToDu(ueDelete->cellId, ueDelete->ueId, result);
if(ret != ROK)
{
DU_LOG("\nERROR --> RLC: RlcProcUeDeleteReq():Failed to send UE Delete response to DU");
#include "kwu.x" /* KWU */
#include "rgu.x" /* RGU */
+#include "du_app_rlc_inf.h"
#include "rlc_utils.h" /* RLC defines */
#include "rlc_dl_ul_inf.h"
#include "rlc_dl.h"
#include "rlc_ul.h"
+#include "rlc_mgr.h"
+
/**
* @file gp_tmr.c
* @brief RLC Timer Module
/* private function declarations */
static Void rlcBndTmrExpiry(PTR cb);
-void rlcThptTmrExpiry(PTR cb);
/**
* @brief Handler to start timer
arg.max = RLC_MAX_THPT_TMR;
break;
}
+ case EVENT_RLC_UE_DELETE_TMR:
+ {
+ RlcUlUeCb *ulUeCb = (RlcUlUeCb*)cb;
+ RLC_TMR_CALCUATE_WAIT(arg.wait, RLC_UE_DELETE_WAIT_TIME, gCb->genCfg.timeRes);
+ arg.timers = &ulUeCb->ueDeleteInfo.ueDelTmr;
+ arg.max = RLC_MAX_UE_TMR;
+ break;
+ }
default:
{
DU_LOG("\nERROR --> RLC : rlcStartTmr: Invalid tmr Evnt [%d]", tmrEvnt);
arg.timers = &((RlcThpt *)cb)->thptTmr;
arg.max = RLC_MAX_THPT_TMR;
}
+ case EVENT_RLC_UE_DELETE_TMR:
+ {
+ arg.timers = &((RlcUlUeCb*)cb)->ueDeleteInfo.ueDelTmr;
+ arg.max = EVENT_RLC_UE_DELETE_TMR;
+ }
default:
{
DU_LOG("\nERROR --> RLC : rlcStopTmr: Invalid tmr Evnt[%d]", tmrType);
rlcThptTmrExpiry(cb);
break;
}
+ case EVENT_RLC_UE_DELETE_TMR:
+ {
+ rlcUeDeleteTmrExpiry(cb);
+ break;
+ }
default:
{
break;
{
return (((RlcThpt *)cb)->thptTmr.tmrEvnt == EVENT_RLC_THROUGHPUT_TMR);
}
+ case EVENT_RLC_UE_DELETE_TMR:
+ {
+ return (((RlcUlUeCb *)cb)->ueDeleteInfo.ueDelTmr.tmrEvnt == EVENT_RLC_UE_DELETE_TMR);
+ }
default:
{
DU_LOG("\nERROR --> RLC : rlcChkTmr: Invalid tmr Evnt [%d]", tmrEvnt);
* @brief Handler to do processing on expiry of the bind timer
*
* @details
- * This function processes the RLC bind timer expiry. If the number of
- * retries is less than the maximum retry counter, bind request is sent
+ * This function processes the RLC bind timer expiry. If the number of
+ * retries is less than the maximum retry counter, bind request is sent
* again, else an alarm is raised to the layer manager.
- *
+ *
* @param[in] cb Pointer to the Rgu sap
*
* @return Void
*/
static Void rlcBndTmrExpiry(PTR cb)
{
- RlcRguSapCb *rguSapCb;
+ RlcRguSapCb *rguSapCb;
rguSapCb = (RlcRguSapCb *) cb;
{
/* start timer to wait for bind confirm */
rlcStartTmr(RLC_GET_RLCCB(rguSapCb->pst.srcInst),
- (PTR)rguSapCb,
+ (PTR)rguSapCb,
EVENT_RLC_WAIT_BNDCFM);
-
+
/* Send bind request */
rguSapCb->retryCnt++;
RlcLiRguBndReq (&rguSapCb->pst, rguSapCb->suId, rguSapCb->spId);
/* Send alarm to the layer manager */
#ifdef LTE_L2_MEAS
rlcLmmSendAlarm(RLC_GET_RLCCB(rguSapCb->pst.srcInst),
- LCM_CATEGORY_INTERFACE,
+ LCM_CATEGORY_INTERFACE,
LCM_EVENT_BND_FAIL,
- LCM_CAUSE_TMR_EXPIRED,
- 0,
- 0,
+ LCM_CAUSE_TMR_EXPIRED,
+ 0,
+ 0,
0);
#else
rlcLmmSendAlarm(RLC_GET_RLCCB(rguSapCb->pst.srcInst),
- LCM_CATEGORY_INTERFACE,
+ LCM_CATEGORY_INTERFACE,
LCM_EVENT_BND_FAIL,
- LCM_CAUSE_TMR_EXPIRED,
+ LCM_CAUSE_TMR_EXPIRED,
0, /* suId */
0 /* ueId */);
#endif
uint16_t ueIdx;
long double tpt;
RlcThpt *rlcThptCb = (RlcThpt*)cb;
+
+ /* If cell is not up, throughput details cannot be printed */
+ if(gCellStatus != CELL_UP)
+ {
+ /* Restart timer */
+ rlcStartTmr(RLC_GET_RLCCB(rlcThptCb->inst), (PTR)rlcThptCb, EVENT_RLC_THROUGHPUT_TMR);
+ return;
+ }
- /* Print throughput */
+ /* If cell is up, print throughout for each UE attached to the cell */
DU_LOG("\n===================== DL Throughput ==============================");
DU_LOG("\nNumber of UEs : %d", rlcThptCb->numActvUe);
- for(ueIdx = 0; ueIdx < rlcThptCb->numActvUe; ueIdx++)
+ if(rlcThptCb->numActvUe)
{
- /* Spec 28.552, section 5.1.1.3 :
- * Throughput in kilobits/sec = (dataVol in kiloBits * 1000)/time in milligseconds
- *
- * Since our dataVol is in bytes, multiplying 0.008 to covert into kilobits i.e.
- * Throughput[kbits/sec] = (dataVol * 0.008 * 1000)/time in ms
- */
- tpt = (double)(rlcThptCb->thptPerUe[ueIdx].dataVol * 8)/(double)ODU_THROUGHPUT_PRINT_TIME_INTERVAL;
+ for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
+ {
+ if(rlcThptCb->thptPerUe[ueIdx].ueId)
+ {
+ /* Spec 28.552, section 5.1.1.3 :
+ * Throughput in kilobits/sec = (dataVol in kiloBits * 1000)/time in milligseconds
+ *
+ * Since our dataVol is in bytes, multiplying 0.008 to covert into kilobits i.e.
+ * Throughput[kbits/sec] = (dataVol * 0.008 * 1000)/time in ms
+ */
+ tpt = (double)(rlcThptCb->thptPerUe[ueIdx].dataVol * 8)/(double)ODU_THROUGHPUT_PRINT_TIME_INTERVAL;
- DU_LOG("\nUE Id : %d DL Tpt : %.2Lf", rlcThptCb->thptPerUe[ueIdx].ueIdx, tpt);
- rlcThptCb->thptPerUe[ueIdx].dataVol = 0;
+ DU_LOG("\nUE Id : %d DL Tpt : %.2Lf", rlcThptCb->thptPerUe[ueIdx].ueId, tpt);
+ rlcThptCb->thptPerUe[ueIdx].dataVol = 0;
+ }
+ }
}
DU_LOG("\n==================================================================");
return;
}
+/**
+*
+* @brief filling RLC UE delete configuration
+*
+* @details
+* filling RLC UE delete configuration
+*
+* @params[in] RlcUlUeCb *ueCb, RlcCfgInfo *rlcUeCfg
+*
+* @return void
+*
+*/
+
+void fillRlcUeDelInfo(RlcUlUeCb *ueCb, RlcCfgInfo *rlcUeCfg)
+{
+ uint8_t lcIdx;
+
+ rlcUeCfg->ueId = ueCb->ueId;
+ rlcUeCfg->cellId = ueCb->cellId;
+ rlcUeCfg->numEnt = 0;
+ for(lcIdx=0; lcIdx<RLC_MAX_LCH_PER_UE && rlcUeCfg->numEnt < 1; lcIdx++)
+ {
+ if(ueCb->lCh[lcIdx].ulRbCb != NULLP)
+ {
+ rlcUeCfg->entCfg[rlcUeCfg->numEnt].rbId = 0;
+ rlcUeCfg->entCfg[rlcUeCfg->numEnt].rbType = 0;
+ rlcUeCfg->entCfg[rlcUeCfg->numEnt].cfgType = CKW_CFG_DELETE_UE;
+ rlcUeCfg->numEnt++;
+ }
+ }
+}
+
+/**
+* @brief Handler to do processing on expiry of the UE delete timer
+*
+* @details
+* This function processes the RLC UE delete timer expiry.
+*
+* @param[in] cb Pointer to the RlcUlUeCb
+*
+* @return uint8_t
+*/
+
+uint8_t rlcUeDeleteTmrExpiry(PTR cb)
+{
+ RlcCb *gRlcCb = NULLP;
+ RlcCfgInfo *rlcUeCfg = NULLP;
+ RlcUlUeCb *ueCb = (RlcUlUeCb*)cb;
+
+ gRlcCb = RLC_GET_RLCCB(ueCb->ueDeleteInfo.pst.dstInst);
+ RLC_ALLOC(gRlcCb, rlcUeCfg, sizeof(RlcCfgInfo));
+ if(rlcUeCfg == NULLP)
+ {
+ DU_LOG("\nERROR --> RLC: rlcUeDeleteTmrExpiry(): Failed to allocate memory");
+ return RFAILED;
+ }
+ memset(rlcUeCfg, 0, sizeof(RlcCfgInfo));
+ fillRlcUeDelInfo(ueCb, rlcUeCfg);
+ if(RlcProcCfgReq(&ueCb->ueDeleteInfo.pst, rlcUeCfg) != ROK)
+ {
+ DU_LOG("\nERROR --> RLC: rlcUeDeleteTmrExpiry(): Failed to delete UE");
+ if(sendRlcUeDeleteRspToDu(rlcUeCfg->cellId, rlcUeCfg->ueId, INVALID_UEID) != ROK)
+ {
+ DU_LOG("ERROR --> RLC: rlcUeDeleteTmrExpiry(): Failed to send UE delete response ");
+ return RFAILED;
+ }
+ }
+ return ROK;
+}
\f
/********************************************************************30**
RlcUlRbCb *ulRbCb; /**< Pointer to Uplink RbCb */
}RlcUlLch;
+/**
+* @brief Structure to hold ue delete information
+*
+* @details
+* - pst : Pst
+* - ueDelTmr : Ue delete timer
+*/
+typedef struct rlcUeDeleteInfo
+{
+ Pst pst; /*Pst */
+ CmTimer ueDelTmr; /*Ue delete timer*/
+}RlcUeDeleteInfo;
+
/**
* @brief Structure to hold uplink information about the Cells
*
struct rlcUlUeCb
{
CmHashListEnt ueHlEnt; /**< Hash list entry for UeCb */
- CmLteRnti ueId; /*!< UE Id */
- CmLteCellId cellId; /*!< Cell Id */
- RlcUlRbCb *srbCb[RLC_MAX_SRB_PER_UE]; /**< SRB RbCbs within an UE */
- RlcUlRbCb *drbCb[RLC_MAX_DRB_PER_UE]; /**< DRB RbCbs within an UE */
- RlcUlLch lCh[RLC_MAX_LCH_PER_UE]; /**< Logical channels of an UE*/
+ CmLteRnti ueId; /*!< UE Id */
+ CmLteCellId cellId; /*!< Cell Id */
+ RlcUlRbCb *srbCb[RLC_MAX_SRB_PER_UE]; /**< SRB RbCbs within an UE */
+ RlcUlRbCb *drbCb[RLC_MAX_DRB_PER_UE]; /**< DRB RbCbs within an UE */
+ RlcUlLch lCh[RLC_MAX_LCH_PER_UE]; /**< Logical channels of an UE*/
/* kw005.201 added support for L2 Measurement */
#ifdef LTE_L2_MEAS
- uint32_t firstPacketTTI; /*!< is first packet of the burst */
- uint16_t numActRb[LKW_MAX_QCI]; /**< number of RBs Active */
- Bool isUlBurstActive; /*!<Has the Burst started for UL IP Thrpt meas */
+ uint32_t firstPacketTTI; /*!< is first packet of the burst */
+ uint16_t numActRb[LKW_MAX_QCI]; /**< number of RBs Active */
+ Bool isUlBurstActive; /*!<Has the Burst started for UL IP Thrpt meas */
#endif /* LTE_L2_MEAS */
+ RlcUeDeleteInfo ueDeleteInfo; /*!<Ue Delete Info */
};
/**
#define RLC_MAX_UM_TMR 1
#define RLC_MAX_AM_TMR 3
#define RLC_MAX_THPT_TMR 1
+#define RLC_MAX_UE_TMR 1
/* Timer events */
#define EVENT_RLC_UMUL_REASSEMBLE_TMR 1
-#define EVENT_RLC_AMUL_REASSEMBLE_TMR 2
+#define EVENT_RLC_AMUL_REASSEMBLE_TMR 2
#define EVENT_RLC_AMUL_STA_PROH_TMR 3
#define EVENT_RLC_AMDL_POLL_RETX_TMR 4
#define EVENT_RLC_WAIT_BNDCFM 5
#define EVENT_RLC_L2_TMR 6
#endif /* LTE_L2_MEAS */
#define EVENT_RLC_THROUGHPUT_TMR 7
+#define EVENT_RLC_UE_DELETE_TMR 8
+
+/* Wait time for RLC Timers */
+#define RLC_UE_DELETE_WAIT_TIME 1 /*in milliseconds */
/*******************************************************************************
* DBM Defines
typedef struct rlcThptPerUe
{
- uint16_t ueIdx;
+ uint16_t ueId;
uint64_t dataVol;
}RlcThptPerUe;
bool rlcChkTmr ARGS((RlcCb *gCb,PTR cb, S16 tmrEvnt));
+void rlcThptTmrExpiry(PTR cb);
+
+uint8_t rlcUeDeleteTmrExpiry(PTR cb);
+
#ifdef LTE_L2_MEAS
Void rlcLmmSendAlarm ARGS (( RlcCb *gCb,
uint16_t category,
uint8_t rlcUtlSendToMac(RlcCb *gCb, SuId suId, KwDStaIndInfo *staIndInfo)
{
uint8_t numPdu = 0;
- uint16_t ueIdx;
- uint16_t actvUeIdx;
+ uint16_t ueId;
RlcDlUeCb *ueCb; /* UE control block */
uint32_t count; /* Loop Counter */
uint32_t numTb; /* Number of Tbs */
{
staInd = &staIndInfo->staInd[idx];
/* Fetch Ue control block */
- GET_UE_IDX(staInd->rnti, ueIdx);
- if(ROK != rlcDbmFetchDlUeCb(gCb, ueIdx, staIndInfo->cellId,&ueCb))
+ GET_UE_IDX(staInd->rnti, ueId);
+ if(ROK != rlcDbmFetchDlUeCb(gCb, ueId, staIndInfo->cellId,&ueCb))
{
/* Fetch UeCb failed */
DU_LOG("\nERROR --> RLC_DL : rlcUtlSendToMac: UeId[%u]:ueCb not found",
continue;
}
- /* Find ueIdx for throughput calculation */
- for(actvUeIdx = 0; actvUeIdx < gCb->rlcThpt.numActvUe; actvUeIdx++)
- {
- if(gCb->rlcThpt.thptPerUe[actvUeIdx].ueIdx == ueIdx)
- break;
- }
-
/* kw002.201 Removed the allocation of RlcDatReq */
/* kw004.201 Used SSI function to initialize the variable */
memset(&datReq, 0, sizeof(RlcDatReq) );
if (rbCb && (!rlcDlUtlIsReestInProgress(rbCb)))
{
/* Cosider buffer size for throughput calculation */
- gCb->rlcThpt.thptPerUe[actvUeIdx].dataVol += staIndTb->lchStaInd[count].totBufSize;
+ if(gCb->rlcThpt.thptPerUe[ueId-1].ueId == ueId)
+ gCb->rlcThpt.thptPerUe[ueId-1].dataVol += staIndTb->lchStaInd[count].totBufSize;
staIndSz += staIndTb->lchStaInd[count].totBufSize;
datReq.pduSz = staIndTb->lchStaInd[count].totBufSize;
DU_LOG("\nDEBUG --> SCH : Received RLC BO Status indication");
cell = schCb[inst].cells[inst];
+ if(cell == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH : MacSchDlRlcBoInfo(): Cell does not exists");
+ return RFAILED;
+ }
+
GET_UE_IDX(dlBoInfo->crnti, ueIdx);
ueCb = &cell->ueCb[ueIdx-1];
lcId = dlBoInfo->lcId;
if(lcId == SRB1_LCID || lcId == SRB2_LCID || lcId == SRB3_LCID || \
- (lcId >= MIN_DRB_LCID && lcId <= MAX_DRB_LCID))
+ (lcId >= MIN_DRB_LCID && lcId <= MAX_DRB_LCID))
{
SET_ONE_BIT(ueIdx, cell->boIndBitMap);
ueCb->dlInfo.dlLcCtxt[lcId].bo = dlBoInfo->dataVolume;
slotIdx++;
if(slotIdx==cell->numSlots)
{
- DU_LOG("\nERROR --> SCH : No DL Slot available");
- return RFAILED;
+ DU_LOG("\nERROR --> SCH : No DL Slot available");
+ return RFAILED;
}
}
#endif
+
schDlSlotInfo = cell->schDlSlotInfo[slot];
+ if(schDlSlotInfo == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH : MacSchDlRlcBoInfo(): schDlSlotInfo does not exists");
+ return RFAILED;
+ }
SCH_ALLOC(schDlSlotInfo->dlMsgInfo, sizeof(DlMsgInfo));
- if(!schDlSlotInfo->dlMsgInfo)
+ if(schDlSlotInfo->dlMsgInfo == NULLP)
{
DU_LOG("\nERROR --> SCH : Memory allocation failed for dlMsgInfo");
schDlSlotInfo = NULL;
return RFAILED;
}
+
schDlSlotInfo->dlMsgInfo->crnti = dlBoInfo->crnti;
schDlSlotInfo->dlMsgInfo->ndi = 1;
schDlSlotInfo->dlMsgInfo->harqProcNum = 0;
dlBrdcstAlloc->sib1Trans = NO_SIB1;
cell = schCb[schInst].cells[schInst];
+ if(cell == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH : Cell Does not exist");
+ return RFAILED;
+ }
ssb_rep = cell->cellCfg.ssbSchCfg.ssbPeriod;
memcpy(&cell->slotInfo, slotInd, sizeof(SlotIndInfo));
dlBrdcstAlloc->ssbIdxSupported = 1;
Configuration Confirmation Informatin RLC to RRC */
typedef struct rlcCfgCfmInfo
{
- uint32_t transId; /*!< Transaction Id */
+ uint32_t transId; /*!< Transaction Id */
CmLteRnti ueId; /*!< UE ID */
CmLteCellId cellId; /*!< Cell ID */
- uint8_t numEnt; /*!< Number of entities configured */
+ uint8_t numEnt; /*!< Number of entities configured */
RlcEntCfgCfmInfo entCfgCfm[CKW_MAX_ENT_CFG]; /*!< Array of Entity cfg
confiramations */
}RlcCfgCfmInfo;
SCS_240KHZ
}SCS;
+typedef enum
+{
+ CELL_UP,
+ CELL_DOWN
+}OduCellStatus;
+
typedef struct slotIndInfo
{
uint16_t cellId;
}TDDCfg;
#endif
-
+OduCellStatus gCellStatus;
uint64_t gSlotCount;
uint64_t gDlDataRcvdCnt; /* Number of DL data received at EGTP */
typedef struct ueDelete
{
uint16_t cellId;
- uint8_t ueIdx;
+ uint8_t ueId;
uint16_t crnti;
}MacUeDelete;
typedef struct ueDeleteRsp
{
uint16_t cellId;
- uint8_t ueIdx;
+ uint8_t ueId;
UeDeleteStatus result;
}MacUeDeleteRsp;
typedef struct rlcUeDelete
{
uint16_t cellId;
- uint8_t ueIdx;
+ uint8_t ueId;
}RlcUeDelete;
typedef struct rlcUeDeleteRsp
{
uint16_t cellId;
- uint8_t ueIdx;
+ uint8_t ueId;
UeDeleteResult result;
}RlcUeDeleteRsp;
#include "du_cell_mgr.h"
#ifdef O1_ENABLE
-
+
#include "AlarmInterface.h"
-
+#include "ConfigInterface.h"
+
#endif
/*******************************************************************
{
DU_LOG("\nINFO --> DU APP : 5G-NR Cell %d is UP", cellId->cellId);
cellCb->cellStatus = ACTIVATED;
+ gCellStatus = CELL_UP;
#ifdef O1_ENABLE
DU_LOG("\nINFO --> DU APP : Raise cell UP alarm for cell id=%d", cellId->cellId);
raiseCellAlrm(CELL_UP_ALARM_ID, cellId->cellId);
+ setCellOpState(cellId->cellId, ENABLED, ACTIVE);
#endif
}
if(ret == RFAILED)
{
/*TODO : Negative case*/
- // BuildAndSendUeContextSetupRsp(ueIdx, cellId);
+ // BuildAndSendUeContextSetupRsp(cellId,ueIdx);
DU_LOG("\nERROR --> F1AP: Failed to process UE CNTXT SETUP REQ at procF1UeContextSetupReq()");
}
else
* Functionality: Constructs the UE Setup Response and sends
* it to the DU through SCTP.
*
- * @params[in]
+ * @params[in] uint8_t cellId,uint8_t ueIdx
*
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildAndSendUeContextSetupRsp(uint8_t ueIdx, uint8_t cellId)
+uint8_t BuildAndSendUeContextSetupRsp(uint8_t cellId,uint8_t ueIdx)
{
uint8_t idx, ret, cellIdx, elementCnt;
uint32_t gnbCuUeF1apId; /* gNB-CU UE F1AP Id */
* failure = RFAILED
*
* ****************************************************************/
-uint8_t BuildAndSendUeCtxtRsp(uint8_t ueIdx, uint8_t cellId)
+uint8_t BuildAndSendUeCtxtRsp(uint8_t cellId, uint8_t ueIdx)
{
uint8_t cellIdx = 0, actionType = 0;
switch(actionType)
{
case UE_CTXT_SETUP:
- BuildAndSendUeContextSetupRsp(ueIdx, cellId);
- break;
+ {
+ BuildAndSendUeContextSetupRsp(cellId,ueIdx);
+ break;
+ }
case UE_CTXT_MOD:
- BuildAndSendUeContextModResp(ueIdx, cellId);
- break;
+ {
+ BuildAndSendUeContextModRsp(cellId, ueIdx);
+ break;
+ }
default:
DU_LOG("ERROR --> F1AP: Invalid Action Type %d at BuildAndSendUeCtxtRsp()", actionType);
break;
*
* @details
*
-* Function : BuildAndSendUeContextModResp
+* Function : BuildAndSendUeContextModRsp
*
* Functionality:
* - Creating the ue context modifcation response
*
-* @params[in]
+* @params[in] uint8_t cellId,uint8_t ueIdx
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t BuildAndSendUeContextModResp(uint8_t ueIdx, uint8_t cellId)
+uint8_t BuildAndSendUeContextModRsp(uint8_t cellId,uint8_t ueIdx)
{
uint8_t ieIdx = 0;
uint8_t cellIdx =0;
* Functionality:
* - Build and Send UE Context Release Complete
*
- * @params[in]
+ * @params[in] cellId, gnbCuUeF1apId, gnbDuUeF1apId
* @return ROK - success
* RFAILED - failure
*
* *************************************************************/
-uint8_t BuildAndSendUeContextReleaseComplete(uint32_t gnbCuUeF1apId, uint32_t gnbDuUeF1apId)
+uint8_t BuildAndSendUeContextReleaseComplete(uint16_t cellId, uint32_t gnbCuUeF1apId, uint32_t gnbDuUeF1apId)
{
bool memAllocFail = false;
uint8_t ieIdx =0, ret = RFAILED, elementCnt = 0;
ret = ROK;
break;
}while(true);
-
+
+ if(ret == ROK)
+ {
+ duCb.actvCellLst[cellId-1]->cellStatus = DELETION_IN_PROGRESS;
+ ret = duSendCellDeletReq(cellId);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> F1AP: BuildAndSendUeContextReleaseComplete(): Failed to process cell\
+ Delete req for CellId");
+ }
+ }
FreeUeContextReleaseComplete(f1apMsg);
return ret;
- /*TODO: To add trigger for UE context release complete, once the operations of UE context
- * release command are done*/
}
+
/*******************************************************************
*
* @brief added free part for the memory allocated by aper_decoder
* ****************************************************************/
uint8_t procF1UeContextReleaseCommand(F1AP_PDU_t *f1apMsg)
{
- /*TODO: processing of DL RRC Msg Transfer to RLC->SCH->MAC-LOWER-MAC->PHY, if RRC container is received */
-
+ uint8_t ieIdx=0, ret=ROK, ueIdx=0;
+ uint16_t cellIdx =0;
+ bool ueIdxFound;
+ uint32_t gnbCuUeF1apId=0, gnbDuUeF1apId=0;
+ DuUeCb *duUeCb = NULLP;
+ UEContextReleaseCommand_t *ueContextReleaseCommand = NULLP;
+
+ ueContextReleaseCommand = &f1apMsg->choice.initiatingMessage->value.choice.UEContextReleaseCommand;
+
+ if(ueContextReleaseCommand->protocolIEs.list.array)
+ {
+ for(ieIdx=0; ieIdx < ueContextReleaseCommand->protocolIEs.list.count; ieIdx++)
+ {
+ if(ueContextReleaseCommand->protocolIEs.list.array[ieIdx])
+ {
+ switch(ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->id)
+ {
+ case ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
+ {
+ gnbCuUeF1apId= ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->\
+ value.choice.GNB_CU_UE_F1AP_ID;
+ break;
+ }
+
+ case ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
+ {
+ gnbDuUeF1apId = ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->\
+ value.choice.GNB_DU_UE_F1AP_ID;
+ break;
+ }
+
+ case ProtocolIE_ID_id_Cause:
+ {
+ break;
+ }
+
+ case ProtocolIE_ID_id_RRCContainer:
+ {
+ for(cellIdx = 0; cellIdx < duCb.numActvCells; cellIdx++)
+ {
+ for(ueIdx = 0; ueIdx < duCb.numUe; ueIdx++)
+ {
+ if((duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId == gnbDuUeF1apId)&&\
+ (duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId == gnbCuUeF1apId))
+ {
+ duUeCb = &duCb.actvCellLst[cellIdx]->ueCb[ueIdx];
+ DU_ALLOC(duUeCb->f1UeDb, sizeof(F1UeContextSetupDb));
+ if(duUeCb->f1UeDb)
+ {
+ memset(duUeCb->f1UeDb, 0, sizeof(F1UeContextSetupDb));
+ duUeCb->f1UeDb->actionType = UE_CTXT_RELEASE;
+ duUeCb->f1UeDb->cellIdx = cellIdx;
+ /* 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,\
+ &ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->\
+ value.choice.RRCContainer);
+ }
+
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : procF1UeContextReleaseCommand(): \
+ Memory allocation failed ");
+ ret = RFAILED;
+
+ }
+
+ ueIdxFound = true;
+ break;
+ }
+ }
+ if(ueIdxFound == true)
+ {
+ break;
+ }
+ }
+ if(!ueIdxFound)
+ {
+ DU_LOG("\nERROR --> F1AP: DuUeCb is not found at procF1UeContextSetupReq()");
+ ret = RFAILED;
+ }
+
+
+ break;
+ }
+ default :
+ DU_LOG("\nERROR --> F1AP: freeAperDecodeUeContextReleaseCommand():Invalid IE Received: %ld"\
+ ,ueContextReleaseCommand->protocolIEs.list.array[ieIdx]->id);
+ break;
+ }
+ }
+ }
+ }
+ if(ret != RFAILED)
+ {
+ duProcUeContextReleaseCommand(duUeCb);
+ }
freeAperDecodeUeContextReleaseCommand(f1apMsg);
- return ROK;
+ return ret;
}
/**************************************************************
*
uint8_t BuildAndSendULRRCMessageTransfer(DuUeCb ueCb, uint8_t lcId, uint16_t msgLen, uint8_t *rrcMsg);
uint8_t procUeReCfgCellInfo(MacUeCfg *macUeCfg, void *cellGrp);
void freeUeReCfgCellGrpInfo(MacUeCfg *macUeCfg);
-uint8_t BuildAndSendUeCtxtRsp(uint8_t ueIdx, uint8_t cellId);
+uint8_t BuildAndSendUeCtxtRsp(uint8_t cellId, uint8_t ueIdx);
uint8_t getDrbLcId(uint32_t *drbBitMap);
void freeMacLcCfg(LcCfg *lcCfg);
void freeRlcLcCfg(RlcBearerCfg *lcCfg);
int8_t getReAsmblTmr(uint8_t reAsmblTmrCfg);
int16_t getStatProhTmr(uint8_t statProhTmrCfg);
uint8_t duProcUeContextModReq(DuUeCb *ueCb);
-uint8_t BuildAndSendUeContextModResp(uint8_t ueIdx, uint8_t cellId);
+uint8_t BuildAndSendUeContextModRsp(uint8_t cellId,uint8_t ueIdx);
uint8_t duBuildAndSendUeContextModReq(uint16_t cellId, uint16_t crnti, DuUeCfg *duUeCfg);
uint8_t BuildAndSendUeContextReleaseReq(uint16_t cellId, uint8_t ueIdx);
-uint8_t BuildAndSendUeContextReleaseComplete(uint32_t gnbCuUeF1apId, uint32_t gnbDuUeF1apId);
+uint8_t BuildAndSendUeContextReleaseComplete(uint16_t cellId, uint32_t gnbCuUeF1apId, uint32_t gnbDuUeF1apId);
+uint8_t duSendCellDeletReq(uint16_t cellId);
+uint8_t duProcUeContextReleaseCommand(DuUeCb *duUeCb);
/**********************************************************************
End of file
**********************************************************************/
{
UE_CTXT_UNKNOWN,
UE_CTXT_SETUP,
- UE_CTXT_MOD
+ UE_CTXT_MOD,
+ UE_CTXT_RELEASE
}UeCtxtActionType;
/** F1AP Msg IE **/
uint8_t duSendEgtpDatInd(Buffer *mBuf);
uint8_t duHdlSchCfgComplete(Pst *pst, RgMngmt *cfm);
uint8_t duBuildAndSendMacCellStart();
-uint8_t duBuildAndSendMacCellStop();
+uint8_t duBuildAndSendMacCellStop(uint16_t cellId);
#endif
/**********************************************************************
#ifdef O1_ENABLE
#include "O1Interface.h"
+#include "ConfigInterface.h"
#endif
return ROK;
}
+#ifdef O1_ENABLE
+/*******************************************************************
+ *
+ * @brief Bring the cell Up
+ *
+ * @details
+ *
+ * Function : bringCellUp
+ *
+ * Functionality:
+ * - Bring the cell Up when requested from OAM
+ *
+ * @params[in] Cell Id
+ * @return true - success
+ * false - failure
+ *
+ * ****************************************************************/
+
+bool bringCellUp(uint16_t cellId)
+{
+ return true;
+}
+
+/*******************************************************************
+ *
+ * @brief Bring the cell Down
+ *
+ * @details
+ *
+ * Function : bringCellDown
+ *
+ * Functionality:
+ * - Bring the cell Down when requested from OAM
+ *
+ * @params[in] Cell Id
+ * @return true - success
+ * false - failure
+ *
+ * ****************************************************************/
+
+bool bringCellDown(uint16_t cellId)
+{
+ return true;
+}
+#endif
+
/*******************************************************************
*
* @brief Initializes EGTP
if(start_O1_module() != ROK)
return RFAILED;
#endif
-
//Initialize TAPA layers
if(duInit() != ROK)
{
#ifdef O1_ENABLE
#include "AlarmInterface.h"
+#include "ConfigInterface.h"
#endif
for(idx=0; idx< DEFAULT_CELLS; idx++)
{
DuCellCb *cell = NULLP;
- DU_ALLOC(cell, sizeof(DuCellCb))
+ DU_ALLOC(cell, sizeof(DuCellCb));
if(cell == NULLP)
{
- DU_LOG("\nERROR --> DU_APP : Memory Allocation failed in duProcCfgComplete");
- ret = RFAILED;
+ DU_LOG("\nERROR --> DU_APP : Memory Allocation failed in duProcCfgComplete");
+ ret = RFAILED;
}
else
{
- uint8_t idx1=0;
- memset(cell, 0, sizeof(DuCellCb));
- cell->cellId = ++cellId;
- memset(&cell->cellInfo.nrEcgi.plmn, 0, sizeof(Plmn));
- cell->cellInfo.nrEcgi.plmn.mcc[0] = PLMN_MCC0;
- cell->cellInfo.nrEcgi.plmn.mcc[1] = PLMN_MCC1;
- cell->cellInfo.nrEcgi.plmn.mcc[2] = PLMN_MCC2;
- cell->cellInfo.nrEcgi.plmn.mnc[0] = PLMN_MNC0;
- cell->cellInfo.nrEcgi.plmn.mnc[1] = PLMN_MNC1;
- cell->cellInfo.nrEcgi.cellId = NR_CELL_ID;
- cell->cellInfo.nrPci = NR_PCI;
- cell->cellInfo.fiveGsTac = DU_TAC;
- memset(&cell->cellInfo.plmn[idx1], 0, sizeof(Plmn));
- for(idx1=0; idx1<MAX_PLMN; idx1++)
- {
- cell->cellInfo.plmn[idx1].mcc[0] = PLMN_MCC0;
- cell->cellInfo.plmn[idx1].mcc[1] = PLMN_MCC1;
- cell->cellInfo.plmn[idx1].mcc[2] = PLMN_MCC2;
- cell->cellInfo.plmn[idx1].mnc[0] = PLMN_MNC0;
- cell->cellInfo.plmn[idx1].mnc[1] = PLMN_MNC1;
- }
- cell->cellInfo.maxUe = duCfgParam.maxUe;
- cell->cellStatus = CELL_OUT_OF_SERVICE;
-
- duCb.cfgCellLst[duCb.numCfgCells] = cell;
- duCb.numCfgCells++;
+ uint8_t idx1=0;
+ memset(cell, 0, sizeof(DuCellCb));
+ cell->cellId = ++cellId;
+ memset(&cell->cellInfo.nrEcgi.plmn, 0, sizeof(Plmn));
+ cell->cellInfo.nrEcgi.plmn.mcc[0] = PLMN_MCC0;
+ cell->cellInfo.nrEcgi.plmn.mcc[1] = PLMN_MCC1;
+ cell->cellInfo.nrEcgi.plmn.mcc[2] = PLMN_MCC2;
+ cell->cellInfo.nrEcgi.plmn.mnc[0] = PLMN_MNC0;
+ cell->cellInfo.nrEcgi.plmn.mnc[1] = PLMN_MNC1;
+ cell->cellInfo.nrEcgi.cellId = NR_CELL_ID;
+ cell->cellInfo.nrPci = NR_PCI;
+ cell->cellInfo.fiveGsTac = DU_TAC;
+ memset(&cell->cellInfo.plmn[idx1], 0, sizeof(Plmn));
+ for(idx1=0; idx1<MAX_PLMN; idx1++)
+ {
+ cell->cellInfo.plmn[idx1].mcc[0] = PLMN_MCC0;
+ cell->cellInfo.plmn[idx1].mcc[1] = PLMN_MCC1;
+ cell->cellInfo.plmn[idx1].mcc[2] = PLMN_MCC2;
+ cell->cellInfo.plmn[idx1].mnc[0] = PLMN_MNC0;
+ cell->cellInfo.plmn[idx1].mnc[1] = PLMN_MNC1;
+ }
+ cell->cellInfo.maxUe = duCfgParam.maxUe;
+ cell->cellStatus = CELL_OUT_OF_SERVICE;
+ gCellStatus = CELL_DOWN;
+
+ duCb.cfgCellLst[duCb.numCfgCells] = cell;
+ duCb.numCfgCells++;
}
}
if(ret != RFAILED)
* RFAILED - failure
*
* ****************************************************************/
-uint8_t duBuildAndSendMacCellStop()
+uint8_t duBuildAndSendMacCellStop(uint16_t cellId)
{
Pst pst;
- OduCellId *cellId = NULL;
-
+ uint16_t cellIdx=0;
+ OduCellId *oduCellId = NULL;
+
DU_LOG("\nINFO --> DU APP : Building and Sending cell stop request to MAC");
- /* Send Cell Stop Request to MAC */
- DU_ALLOC_SHRABL_BUF(cellId, sizeof(OduCellId));
- if(!cellId)
+ GET_CELL_IDX(cellId, cellIdx);
+ if(duCb.actvCellLst[cellIdx] != NULLP)
{
- DU_LOG("\nERROR --> DU APP : Memory alloc failed while building cell stop request");
- return RFAILED;
- }
- cellId->cellId = duCb.actvCellLst[0]->cellId;
+ /* Send Cell Stop Request to MAC */
+ DU_ALLOC_SHRABL_BUF(oduCellId, sizeof(OduCellId));
+ if(!oduCellId)
+ {
+ DU_LOG("\nERROR --> DU APP : duBuildAndSendMacCellStop(): Memory allocation failed ");
+ return RFAILED;
+ }
- /* Fill Pst */
- FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_STOP);
+ oduCellId->cellId = duCb.actvCellLst[cellIdx]->cellId;
- return (*packMacCellStopOpts[pst.selector])(&pst, cellId);
+ /* Fill Pst */
+ FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_STOP);
+
+ return (*packMacCellStopOpts[pst.selector])(&pst, oduCellId);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : duBuildAndSendMacCellStop(): cellId[%d] doesnot exists", cellId);
+ return RFAILED;
+ }
+ return ROK;
}
/*******************************************************************
#ifdef O1_ENABLE
DU_LOG("\nINFO --> DU APP : Raise cell down alarm for cell id=%d", cellId->cellId);
raiseCellAlrm(CELL_DOWN_ALARM_ID, cellId->cellId);
+ setCellOpState(cellId->cellId, DISABLED, INACTIVE);
#endif
}
macUeCfg.macUeCfgState = UE_RECFG_COMPLETE;
if((ret = duUpdateDuUeCbCfg(cfgRsp->ueIdx, cfgRsp->cellId)) == ROK)
{
- BuildAndSendUeCtxtRsp(cfgRsp->ueIdx, cfgRsp->cellId);
+ BuildAndSendUeCtxtRsp(cfgRsp->cellId, cfgRsp->ueIdx);
}
}
}
rlcUeCfg.rlcUeCfgState = UE_RECFG_COMPLETE;
if((ret = duUpdateDuUeCbCfg(cfgRsp->ueIdx, cfgRsp->cellId)) == ROK)
{
- BuildAndSendUeCtxtRsp(cfgRsp->ueIdx, cfgRsp->cellId);
+ BuildAndSendUeCtxtRsp(cfgRsp->cellId, cfgRsp->ueIdx);
}
}
}
if(ret == RFAILED)
DU_LOG("\nERROR --> DU APP : Failed to process UE Context Mod Request in DuProcRlcDlRrcMsgRsp()");
}
+ if(ueCb->f1UeDb->actionType == UE_CTXT_RELEASE)
+ {
+ ret = duBuildAndSendUeDeleteReq(dlRrcMsg->cellId);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to process UE Context Release Request in DuProcRlcDlRrcMsgRsp()");
+ }
+
+ }
}
}
else
}
else
{
- DU_LOG("INFO --> DU APP : deleteUeCfg(): MAC or RLC UE configuration state not UE_DELETE_COMPLETE");
return RFAILED;
}
}
else
{
- DU_LOG("ERROR --> DU APP : deleteUeCfg(): CellIdx[%d] is not found", cellIdx);
+ DU_LOG("\nERROR --> DU APP : deleteUeCfg(): CellIdx[%d] is not found", cellIdx);
return RFAILED;
}
return ROK;
uint8_t DuProcMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp)
{
- uint8_t ueIdx = 0,ret =ROK;
+ uint8_t ret =ROK;
uint16_t cellIdx=0;
- uint32_t gnbCuUeF1apId=0, gnbDuUeF1apId =0;
if(deleteRsp)
{
if(deleteRsp->result == SUCCESS)
{
- DU_LOG("\nINFO --> DU APP : MAC UE Delete Response : SUCCESS [UE IDX : %d]", deleteRsp->ueIdx);
+ DU_LOG("\nINFO --> DU APP : MAC UE Delete Response : SUCCESS [UE IDX : %d]", deleteRsp->ueId);
GET_CELL_IDX(deleteRsp->cellId, cellIdx);
- ueIdx = deleteRsp->ueIdx;
if(duCb.actvCellLst[cellIdx])
{
- duCb.actvCellLst[cellIdx]->ueCb[deleteRsp->ueIdx -1].macUeCfg.macUeCfgState = UE_DELETE_COMPLETE;
- gnbCuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbDuUeF1apId;
- gnbDuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbCuUeF1apId;
- if(deleteUeCfg(cellIdx, ueIdx) == ROK)
+ duCb.actvCellLst[cellIdx]->ueCb[deleteRsp->ueId -1].macUeCfg.macUeCfgState = UE_DELETE_COMPLETE;
+ if(sendUeDeleteReqToRlc(deleteRsp->cellId, deleteRsp->ueId) == RFAILED)
{
- ret = BuildAndSendUeContextReleaseComplete(gnbCuUeF1apId, gnbDuUeF1apId);
- if(ret !=ROK)
- {
- DU_LOG("\nERROR --> DU APP : DuProcMacUeDeleteRsp(): failed to send UE context release complete");
- }
+ DU_LOG("\nERROR --> DU APP : DuProcMacUeDeleteRsp():Failed to build UE delete req for RLC ");
+ ret = RFAILED;
}
}
}
else
{
DU_LOG("\nERROR --> DU APP : DuProcMacUeDeleteRsp(): MAC UE Delete Response : FAILURE [UE IDX : %d]",\
- deleteRsp->ueIdx);
+ deleteRsp->ueId);
ret = RFAILED;
}
DU_FREE_SHRABL_BUF(pst->region, pst->pool, deleteRsp, sizeof(MacUeDeleteRsp));
uint8_t DuProcRlcUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *delRsp)
{
- uint8_t ueIdx = 0, ret = ROK;
+ uint8_t ueId = 0, ret = ROK;
uint16_t cellIdx = 0;
uint32_t gnbCuUeF1apId=0, gnbDuUeF1apId =0;
if(delRsp)
{
- ueIdx = delRsp->ueIdx;
+ ueId = delRsp->ueId;
GET_CELL_IDX(delRsp->cellId, cellIdx);
if(delRsp->result == SUCCESSFUL)
{
- DU_LOG("\nINFO --> DU_APP: RLC UE Delete Response : SUCCESS [UE IDX:%d]", ueIdx);
+ DU_LOG("\nINFO --> DU_APP: RLC UE Delete Response : SUCCESS [UE IDX:%d]", ueId);
if(duCb.actvCellLst[cellIdx]!=NULLP)
{
- duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].rlcUeCfg.rlcUeCfgState = UE_DELETE_COMPLETE;
- gnbCuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbDuUeF1apId;
- gnbDuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx-1].gnbCuUeF1apId;
- if(deleteUeCfg(cellIdx, ueIdx) == ROK)
+ duCb.actvCellLst[cellIdx]->ueCb[ueId-1].rlcUeCfg.rlcUeCfgState = UE_DELETE_COMPLETE;
+ gnbCuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueId-1].gnbDuUeF1apId;
+ gnbDuUeF1apId = duCb.actvCellLst[cellIdx]->ueCb[ueId-1].gnbCuUeF1apId;
+ if(deleteUeCfg(cellIdx, ueId) == ROK)
{
- ret = BuildAndSendUeContextReleaseComplete(gnbCuUeF1apId, gnbDuUeF1apId);
- if(ret != ROK)
- {
- DU_LOG("\nERROR --> DU APP : DuProcMacUeDeleteRsp(): failed to send UE context release complete");
- }
+ ret = BuildAndSendUeContextReleaseComplete(delRsp->cellId, gnbCuUeF1apId, gnbDuUeF1apId);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> DU APP : DuProcMacUeDeleteRsp(): failed to send UE context release complete");
+ }
}
}
}
else
{
- DU_LOG("\nERROR --> DU_APP: RLC UE Delete Response : FAILED [UE IDX:%d]", ueIdx);
+ DU_LOG("\nERROR --> DU_APP: RLC UE Delete Response : FAILED [UE IDX:%d]", ueId);
ret = RFAILED;
}
DU_FREE_SHRABL_BUF(pst->region, pst->pool, delRsp, sizeof(RlcUeDeleteRsp));
* Functionality:
* sending UE Delete Req To Mac
*
-* @params[in] cellId, ueIdx, crnti
+* @params[in] cellId, ueId, crnti
* @return ROK - success
* RFAILED - failure
*
*****************************************************************/
-uint8_t sendUeDeleteReqToMac(uint16_t cellId, uint8_t ueIdx, uint16_t crnti)
+uint8_t sendUeDeleteReqToMac(uint16_t cellId, uint8_t ueId, uint16_t crnti)
{
Pst pst;
uint8_t ret=ROK;
if(ueDelete)
{
ueDelete->cellId = cellId;
- ueDelete->ueIdx = ueIdx;
+ ueDelete->ueId = ueId;
ueDelete->crnti = crnti;
FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_UE_DELETE_REQ);
- /* Processing one Ue at a time to MAC */
DU_LOG("\nDEBUG --> DU_APP: Sending UE delete Request to MAC ");
ret = (*packMacUeDeleteReqOpts[pst.selector])(&pst, ueDelete);
if(ret == RFAILED)
* Functionality:
* Sending UE Delete Req To Rlc
*
- * @params[in] cellId, ueIdx
+ * @params[in] cellId, ueId
* @return ROK - success
* RFAILED - failure
*
*****************************************************************/
-uint8_t sendUeDeleteReqToRlc(uint16_t cellId, uint8_t ueIdx)
+uint8_t sendUeDeleteReqToRlc(uint16_t cellId, uint8_t ueId)
{
uint8_t ret;
Pst pst;
if(ueDelete !=NULLP)
{
ueDelete->cellId = cellId;
- ueDelete->ueIdx = ueIdx;
+ ueDelete->ueId = ueId;
FILL_PST_DUAPP_TO_RLC(pst, RLC_UL_INST, EVENT_RLC_UE_DELETE_REQ);
ret = (*packRlcUeDeleteReqOpts[pst.selector])(&pst, ueDelete);
*
* @details
*
- * Function : duProcUeDeleteReq
+ * Function : duBuildAndSendUeDeleteReq
*
* Functionality: DU processes UE delete req from CU and sends to MAC
* and RLC
*
* ****************************************************************/
-uint8_t duProcUeDeleteReq(uint16_t cellId)
+uint8_t duBuildAndSendUeDeleteReq(uint16_t cellId)
{
uint8_t ueIdx = 0, ueId =0;
uint16_t cellIdx = 0, crnti = 0;
- DU_LOG("\nDEBUG --> DU_APP: Processing UE Delete Request ");
+ DU_LOG("\nDEBUG --> DU_APP: Processing UE Delete Request ");
GET_CELL_IDX(cellId, cellIdx);
- GET_CRNTI(crnti,ueIdx);
if(duCb.actvCellLst[cellIdx] != NULLP)
{
for(ueIdx =0;ueIdx< duCb.actvCellLst[cellIdx]->numActvUes; ueIdx++)
{
- ueId = ueIdx+1;
- if(sendUeDeleteReqToRlc(cellId, ueId) == RFAILED)
- {
- DU_LOG("\nERROR --> DU APP : duProcUeDeleteReq():Failed to build UE delete req for RLC ");
- return RFAILED;
- }
-
- GET_CRNTI(crnti,ueId);
+ crnti = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].crnti;
+ GET_UE_IDX(crnti,ueId);
if(sendUeDeleteReqToMac(cellId, ueId, crnti) == RFAILED)
{
- DU_LOG("\nERROR --> DU APP : duProcUeDeleteReq(): Failed to build UE delete req for MAC ");
+ DU_LOG("\nERROR --> DU APP : duBuildAndSendUeDeleteReq(): Failed to build UE delete req for MAC ");
return RFAILED;
}
}
}
else
{
- DU_LOG("\nERROR --> DU APP : duProcUeDeleteReq(): Cell Id is not found");
+ DU_LOG("\nERROR --> DU APP : duBuildAndSendUeDeleteReq(): Cell Id is not found");
return RFAILED;
}
if(duCb.actvCellLst[cellIdx]->cellId == deleteRsp->cellId)
{
deleteDuCellCb(duCb.actvCellLst[cellIdx]);
+ gCellStatus = CELL_DOWN;
duCb.numActvCells--;
DU_FREE(duCb.actvCellLst[cellIdx], sizeof(DuCellCb));
}
[CELL IDX : %d]", deleteRsp->cellId);
ret = RFAILED;
}
- DU_FREE_SHRABL_BUF(pst->region, pst->pool, deleteRsp, sizeof(MacUeDeleteRsp));
+ DU_FREE_SHRABL_BUF(pst->region, pst->pool, deleteRsp, sizeof(MacCellDeleteRsp));
}
else
{
*
* @details
*
- * Function : duProcCellDeleteReq
+ * Function : duSendCellDeletReq
*
* Functionality: DU process Cell Delete Req to MAC
*
*
* ****************************************************************/
-uint8_t duProcCellDeleteReq(uint16_t cellId)
+uint8_t duSendCellDeletReq(uint16_t cellId)
{
uint16_t cellIdx = 0;
-
DU_LOG("\nINFO --> DU APP : Processing Cell Delete Request ");
GET_CELL_IDX(cellId, cellIdx);
- if(duCb.actvCellLst[cellIdx] != NULLP)
+ if(duCb.actvCellLst[cellIdx] == NULLP)
{
- if(duBuildAndSendMacCellStop() == RFAILED)
- {
- DU_LOG("\nERROR --> DU APP : duProcCellDeleteReq(): Failed to process Cell delete req for cellId[%d]",cellId);
- return RFAILED;
- }
-
- if(duCb.actvCellLst[cellIdx]->numActvUes)
- {
- DU_LOG("\nERROR --> DU APP : duProcCellDeleteReq(): Active UEs present Failed to process cell Delete\
- Req for cellID[%d]", cellId);
- return RFAILED;
- }
- if(sendCellDeleteReqToMac(cellId) == RFAILED)
- {
- DU_LOG("\nERROR --> DU APP : duProcCellDeleteReq(): Failed to build and send Cell delete req for MAC for\
- cellId[%d]",cellId);
- return RFAILED;
- }
+ DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): CellId[%d] is not found", cellId);
+ return RFAILED;
}
- else
+
+ if(duCb.actvCellLst[cellIdx]->cellId != cellId)
+ {
+ DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): CellId[%d] is not found", cellId);
+ return RFAILED;
+
+ }
+
+ if(duCb.actvCellLst[cellIdx]->cellStatus != DELETION_IN_PROGRESS)
+ {
+ DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): CellStatus[%d] of cellId[%d] is not correct.\
+ Expected CellStatus is DELETION_IN_PROGRESS",duCb.actvCellLst[cellIdx]->cellStatus, cellId);
+ return RFAILED;
+ }
+
+ if(duCb.actvCellLst[cellIdx]->numActvUes)
+ {
+ DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): Active UEs still present in cellId[%d].\
+ Failed to delete cell", cellId);
+ return RFAILED;
+ }
+
+ if(duBuildAndSendMacCellStop(cellId) == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): Failed to build and send cell stop request to MAC for\
+ cellId[%d]",cellId);
+ return RFAILED;
+ }
+
+ if(sendCellDeleteReqToMac(cellId) == RFAILED)
{
- DU_LOG("\nERROR --> DU APP : duProcCellDeleteReq(): CellId[%d] is not found", cellId);
+ DU_LOG("\nERROR --> DU APP : duSendCellDeletReq(): Failed to send Cell delete req to MAC for\
+ cellId[%d]",cellId);
return RFAILED;
}
return ROK;
}
+/*******************************************************************
+*
+* @brief Du process Ue Context Release Command
+*
+* @details
+*
+* Function : duProcUeContextReleaseCommand
+*
+* Functionality: Du process Ue Context Release Command
+*
+* @params[in] DuUeCb *duUeCb
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t duProcUeContextReleaseCommand(DuUeCb *duUeCb)
+{
+ uint8_t ret =ROK, ueIdx=0;
+ uint16_t cellId=0;
+ if(duUeCb == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP : duProcUeContextReleaseCommand() : duUeCb is null");
+ return RFAILED;
+ }
+ if(duUeCb->f1UeDb == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP : duProcUeContextReleaseCommand() : f1UeDb is null");
+ return RFAILED;
+ }
+
+ cellId = duCb.actvCellLst[duUeCb->f1UeDb->cellIdx]->cellId;
+ /* Send DL RRC msg for RRC release */
+ if(duUeCb->f1UeDb->dlRrcMsg)
+ {
+ if(duUeCb->f1UeDb->dlRrcMsg->rrcMsgPdu != NULLP)
+ {
+ ret = duBuildAndSendDlRrcMsgToRlc(cellId, duCb.actvCellLst[duUeCb->f1UeDb->cellIdx]->ueCb[ueIdx].rlcUeCfg,\
+ duUeCb->f1UeDb->dlRrcMsg);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : duProcUeContextReleaseCommand() : Failed to send DL RRC msg");
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, duUeCb->f1UeDb->dlRrcMsg->rrcMsgPdu,\
+ duUeCb->f1UeDb->dlRrcMsg->rrcMsgSize);
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, duUeCb->f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg));
+ }
+ }
+ }
+ else
+ {
+ ret = duBuildAndSendUeDeleteReq(cellId);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : duProcUeContextReleaseCommand(): Failed to build and send Ue Delete request");
+ }
+ }
+ return ret;
+}
/**********************************************************************
End of file
uint8_t duBuildAndSendUeCreateReqToRlc(uint16_t cellId, uint8_t ueIdx, RlcUeCfg *duRlcUeCfg);
uint8_t duCreateUeCb(UeCcchCtxt *ueCcchCtxt, uint32_t gnbCuUeF1apId);
uint8_t duProcUlCcchInd(UlCcchIndInfo *ulCcchIndInfo);
-uint8_t duProcUeDeleteReq(uint16_t cellId);
+uint8_t duBuildAndSendUeDeleteReq(uint16_t cellId);
void deleteRlcUeCfg(RlcUeCfg *ueCfg);
void freeF1UeDb(F1UeContextSetupDb *f1UeDb);
+uint8_t sendUeDeleteReqToMac(uint16_t cellId, uint8_t ueId, uint16_t crnti);
+uint8_t sendUeDeleteReqToRlc(uint16_t cellId, uint8_t ueId);
#endif
/**********************************************************************
#include "UnixSocketClient.hpp"
#include "SessionHandler.hpp"
#include "InitConfig.hpp"
+#include "NrCellList.hpp"
StartupConfig g_cfg;
return O1::FAILURE;
}
+/*******************************************************************
+ *
+ * @brief update cell and operational state
+ *
+ * @details
+ *
+ * Function : setCellOpState
+ *
+ * Functionality:
+ * - send update of cell and operational state to it's handler
+ *
+ *
+ * @params[in] cellId, opState, cellState
+ * @return cell operational in string form
+ ******************************************************************/
+
+
+bool setCellOpState(uint16_t cellId, OpState opState, CellState cellState)
+{
+ O1_LOG("\nO1 ConfigInterface: Setting cellId = %d, opState=%d, \
+cellState=%d\n", cellId, opState, cellState);
+ return NrCellList::instance().setCellOpState(cellId, opState, \
+ cellState);
+}
/**********************************************************************
End of file
uint16_t RIC_Port;
}StartupConfig;
+typedef enum {
+ INACTIVE,
+ ACTIVE,
+ IDLE
+}CellState;
+
+typedef enum {
+ DISABLED,
+ ENABLED
+}OpState;
+
uint8_t getStartupConfig(StartupConfig *cfg);
uint8_t getStartupConfigForStub(StartupConfig *cfg);
+bool setCellOpState(uint16_t cellId, OpState opState, \
+ CellState cellState);
+#ifndef ODU_TEST_STUB
+//Defined in odu high
+bool bringCellUp(uint16_t cellId);
+bool bringCellDown(uint16_t cellId);
+#endif //ODU_TEST_STUB
#ifdef __cplusplus
}
#endif
#define ALARM_MODULE_PATH_3GPP "/_3gpp-common-fm:AlarmListGrp"
#define ALARM_MODULE_NAME_ORAN "o-ran-sc-odu-alarm-v1"
#define ALARM_MODULE_PATH_ORAN "/o-ran-sc-odu-alarm-v1:odu"
-
+#define CELL_STATE_MODULE_NAME "o-ran-sc-du-hello-world"
+#define CELL_STATE_MODULE_PATH "/o-ran-sc-du-hello-world:network-function"
+#define IETF_NACM_MODULE_NAME "ietf-netconf-acm"
+#define IETF_NACM_MODULE_PATH "/ietf-netconf-acm:nacm"
#define MAX_ALARM_ID_LEN 10
class O1
~InitConfig();
bool init(sysrepo::S_Session sess);
bool getCurrInterfaceConfig(StartupConfig & cfg);
+ bool disableNacm(sysrepo::S_Session sess);
private:
--- /dev/null
+/*******************************************************************************
+################################################################################
+# Copyright (c) [2020-2021] [HCL Technologies Ltd.] #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+*******************************************************************************/
+
+/* This file contains Cell state update handler for CLA use case. It handles
+ get and change callback for o-ran-sc-du-hello-world yang module */
+
+#include <sstream>
+#include "NrCellCb.hpp"
+#define MAX_LEN 100
+
+using namespace std;
+
+/*******************************************************************
+ *
+ * @brief override oper_get_items to handle callback
+ *
+ * @details
+ *
+ * Function : oper_get_items
+ *
+ * Functionality:
+ * - override oper_get_items to handle callback of get of
+ * o-ran-sc-du-hello-world yang module
+ *
+ *
+ * @params[in] sysrepo::S_Session session, const char *module_name,
+ * const char *path, const char *request_xpath,
+ * uint32_t request_id, libyang::S_Data_Node &parent,
+ * void *private_data
+ * @return SR_ERR_OK - success
+ * SR_ERR_OK - failure
+ ******************************************************************/
+
+int NrCellCb::oper_get_items(sysrepo::S_Session session, \
+ const char *module_name, \
+ const char *path, \
+ const char *request_xpath, \
+ uint32_t request_id, \
+ libyang::S_Data_Node &parent, \
+ void *private_data)
+{
+ O1_LOG("O1 NrCellCb : Callback called for path=%s on get request", path);
+ libyang::S_Context ctx = session->get_context();
+ libyang::S_Module mod = ctx->get_module(module_name);
+
+ //first create root of the tree then add nodes and leaves and fill data
+ parent.reset(new libyang::Data_Node(ctx, CELL_STATE_MODULE_PATH, \
+ nullptr, LYD_ANYDATA_CONSTSTRING, 0));
+ libyang::S_Data_Node connection(new libyang::Data_Node(parent, mod, \
+ "du-to-ru-connection"));
+
+ libyang::S_Data_Node name;
+ libyang::S_Data_Node operational_state;
+ libyang::S_Data_Node cell_state;
+ libyang::S_Data_Node administrative_state;
+
+ NrCellList & cellList = NrCellList::instance();
+ NrCellInfo cellInfo;
+ const NrCellList::CellOpStateMap & cellOpStateMap = cellList.getCellOpStateList();
+ //read the data from CellOpStateMap
+ std::map<uint16_t, NrCellInfo>::const_iterator it;
+ for(it = cellOpStateMap.begin(); it !=cellOpStateMap.end(); it++)
+ {
+ O1_LOG("\nO1 NrCellCb : cellId = %d, opState=%d, cellState=%d\n", \
+ it->first, (int) it->second.getOpState(), (int) it->second.getCellState());
+ name.reset(new libyang::Data_Node(connection, mod, "name", \
+ to_string(it->first).c_str()));
+ operational_state.reset(new libyang::Data_Node(connection, mod, \
+ "operational-state", \
+ cellInfo.enumToOperationalStateString(it->second.getOpState()).c_str()));
+ cell_state.reset(new libyang::Data_Node(connection, mod, "cell-state", \
+ cellInfo.enumToCellStateString(it->second.getCellState()).c_str()));
+ }
+ return SR_ERR_OK;
+}
+
+/*******************************************************************
+ *
+ * @brief print changes of given operation
+ *
+ * @details
+ *
+ * Function : oper_get_items
+ *
+ * Functionality:
+ * - print changes of given operation, old and new value
+ *
+ *
+ * @params[in] sysrepo::S_Change change
+ * @return void
+ ******************************************************************/
+
+void NrCellCb::printChange(sysrepo::S_Change change) {
+ switch(change->oper()) {
+ case SR_OP_CREATED:
+ if (nullptr != change->new_val()) {
+ O1_LOG("O1 NrCellCb : CREATED: %s", \
+ change->new_val()->to_string().c_str());
+ }
+ break;
+ case SR_OP_DELETED:
+ if (nullptr != change->old_val()) {
+ O1_LOG("O1 NrCellCb : DELETED: %s", \
+ change->old_val()->to_string().c_str());
+ }
+ break;
+ case SR_OP_MODIFIED:
+ if (nullptr != change->old_val() && nullptr != change->new_val()) {
+ O1_LOG("O1 NrCellCb : MODIFIED: old value %s :new value %s", \
+ change->old_val()->to_string().c_str(), \
+ change->new_val()->to_string().c_str());
+ }
+ break;
+ case SR_OP_MOVED:
+ if (nullptr != change->old_val() && nullptr != change->new_val()) {
+ O1_LOG("O1 NrCellCb : MOVED: %s :after %s ", \
+ change->new_val()->xpath(), \
+ change->old_val()->xpath());
+ }
+ else if (nullptr != change->new_val()) {
+ O1_LOG("O1 NrCellCb : MOVED: %s : first\n", \
+ change->new_val()->xpath());
+ }
+ break;
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief convert event type to string
+ *
+ * @details
+ *
+ * Function : evToStr
+ *
+ * Functionality:
+ * - convert event type to string
+ *
+ *
+ * @params[in] sr_event_t event
+ * @return event name in string form
+ ******************************************************************/
+
+/* Helper function for printing events. */
+const char *NrCellCb::evToStr(sr_event_t ev) {
+ switch (ev) {
+ case SR_EV_CHANGE:
+ return "change";
+ case SR_EV_DONE:
+ return "done";
+ case SR_EV_ABORT:
+ default:
+ return "abort";
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief override module_change to handle callback
+ *
+ * @details
+ *
+ * Function : module_change
+ *
+ * Functionality:
+ * - override module_change to handle callback of modification of
+ * o-ran-sc-du-hello-world yang module
+ *
+ *
+ * @params[in] sysrepo::S_Session session, const char *module_name,
+ * const char *xpath, sr_event_t event, uint32_t request_id,
+ * void *private_data
+ * @return SR_ERR_OK - success
+ * SR_ERR_OK - failure
+ ******************************************************************/
+
+int NrCellCb::module_change(sysrepo::S_Session sess, \
+ const char *module_name, \
+ const char *xpath, \
+ sr_event_t event, \
+ uint32_t request_id, \
+ void *private_data)
+{
+ char change_path[MAX_LEN];
+
+ try {
+ O1_LOG("O1 NrCellCb : Notification %s\n", evToStr(event));
+ if (SR_EV_CHANGE == event)
+ {
+ NrCellList & cellList = NrCellList::instance();
+ NrCellInfo cellInfo;
+ const NrCellList::CellOpStateMap & cellOpStateMap = cellList.getCellOpStateList();
+ snprintf(change_path, MAX_LEN, "/%s:*//.", module_name);
+ auto it = sess->get_changes_iter(change_path);
+ uint16_t cellId;
+ while (auto change = sess->get_change_next(it)) {
+ //printChange(change); //enable only for debugging
+ if(nullptr != change->new_val())
+ {
+ O1_LOG("O1 NrCellCb : Parameter value has been \
+changed val=%s\n", change->new_val()->val_to_string().c_str());
+ std::map<uint16_t, NrCellInfo>::const_iterator it;
+ for(it = cellOpStateMap.begin(); it !=cellOpStateMap.end(); it++)
+ {
+ stringstream xpath;
+ xpath << CELL_STATE_MODULE_PATH << "/du-to-ru-connection[name='" \
+ << it->first << "']/administrative-state";
+ O1_LOG("O1 NrCellCb : created xpath = %s", \
+ xpath.str().c_str());
+
+ if((change->new_val()->to_string().find(xpath.str().c_str()) != \
+ std::string::npos))
+ {
+ printChange(change);
+ string val = change->new_val()->val_to_string();
+ AdminState newVal = cellInfo.adminStateToEnum(val);
+ O1_LOG("O1 NrCellCb : Update admin state \
+cellId =%d with admin-state value=%s\n", it->first, val.c_str());
+ if(!setAdminState(it->first, newVal)) {
+ O1_LOG("O1 NrCellCb : Could not change \
+parameter value =%s\n", change->new_val()->val_to_string().c_str());
+ return SR_ERR_INTERNAL;
+ }
+ }
+ }
+ }
+ }
+ }//if evToStr(event) check
+ }
+ catch( const std::exception& e ) {
+ O1_LOG("exception : %s\n", e.what());
+ }
+ return SR_ERR_OK;
+}
+
+/*******************************************************************
+ *
+ * @brief bring cell status according to the admin state
+ *
+ * @details
+ *
+ * Function : setAdminState
+ *
+ * Functionality:
+ * - bring cell status according to the admin state
+ *
+ *
+ * @params[in] cellId, Admin state
+ * @return true - success
+ * false - failure
+ ******************************************************************/
+bool NrCellCb::setAdminState(uint16_t cellId, AdminState newAdminState)
+{
+ if(newAdminState == UNLOCKED)
+ {
+ O1_LOG("\nNrCellList : set Admin State UNLOCKED" );
+#ifndef ODU_TEST_STUB
+ return bringCellUp(cellId);
+#endif
+ }
+ else
+ {
+ O1_LOG("\nNrCellList : set Admin State LOCKED" );
+#ifndef ODU_TEST_STUB
+ return bringCellDown(cellId);
+#endif
+ }
+ return true;
+}
+
+
+/**********************************************************************
+ End of file
+**********************************************************************/
+
--- /dev/null
+/*******************************************************************************
+################################################################################
+# Copyright (c) [2020-2021] [HCL Technologies Ltd.] #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+*******************************************************************************/
+
+/* This file contains Cell state update handler for CLA use case. It handles
+ get and change callback for o-ran-sc-du-hello-world yang module */
+
+
+#ifndef __NR_CELL_CB_HPP__
+#define __NR_CELL_CB_HPP__
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include "sysrepo-cpp/Session.hpp"
+#include "ConfigInterface.h"
+#include "GlobalDefs.hpp"
+#include "Singleton.hpp"
+#include "NrCellInfo.hpp"
+#include "NrCellList.hpp"
+
+class NrCellCb : public sysrepo::Callback
+{
+
+ public:
+ int oper_get_items(sysrepo::S_Session session,\
+ const char *module_name,\
+ const char *path,\
+ const char *request_xpath,\
+ uint32_t request_id,\
+ libyang::S_Data_Node &parent,\
+ void *private_data); //override
+ int module_change(sysrepo::S_Session sess, \
+ const char *module_name, \
+ const char *xpath, \
+ sr_event_t event, \
+ uint32_t request_id, \
+ void *private_data); //override
+
+ bool setAdminState(uint16_t cellId, AdminState newAdminState);
+
+ private:
+ static void printChange(sysrepo::S_Change change);
+ const char *evToStr(sr_event_t ev);
+};
+
+#endif
+
+/**********************************************************************
+ End of file
+**********************************************************************/
--- /dev/null
+/*******************************************************************************
+################################################################################
+# Copyright (c) [2020-2021] [HCL Technologies Ltd.] #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+*******************************************************************************/
+
+/* This file contains parameters list of a cell for CLA use case*/
+
+#include "NrCellInfo.hpp"
+
+using namespace std;
+
+/*******************************************************************
+ *
+ * @brief convert admin state to enum
+ *
+ * @details
+ *
+ * Function : adminStateToEnum
+ *
+ * Functionality:
+ * - convert admin state to enum
+ *
+ *
+ * @params[in] admin state in string form
+ * @return admin state in enum form
+ ******************************************************************/
+
+AdminState NrCellInfo::adminStateToEnum(string val)
+{
+ AdminState ret=LOCKED;
+ if( val == "LOCKED")
+ ret = LOCKED;
+ else if(val == "UNLOCKED")
+ ret = UNLOCKED;
+ else if(val == "SHUTTING_DOWN")
+ ret = SHUTTING_DOWN;
+ else
+ O1_LOG("O1 NrCellInfo : %s admin state not handled\n", \
+ val.c_str());
+
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief convert enum of cell state to string
+ *
+ * @details
+ *
+ * Function : enumToCellStateString
+ *
+ * Functionality:
+ * - convert enum of cell state to string
+ *
+ *
+ * @params[in] enum of cell state
+ * @return cell state in string form
+ ******************************************************************/
+
+
+string NrCellInfo::enumToCellStateString(CellState val)
+{
+ string ret = "IDLE";
+ switch(val)
+ {
+ case INACTIVE:
+ ret = "INACTIVE";
+ break;
+ case ACTIVE:
+ ret = "ACTIVE";
+ break;
+ case IDLE:
+ ret = "IDLE";
+ break;
+ default :
+ O1_LOG("O1 NrCellInfo : %d cell state not handled\n", val);
+
+ }
+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief convert enum of operational state to string
+ *
+ * @details
+ *
+ * Function : enumToOperationalStateString
+ *
+ * Functionality:
+ * - convert enum of operational state to string
+ *
+ *
+ * @params[in] enum of operational state
+ * @return cell operational in string form
+ ******************************************************************/
+
+string NrCellInfo::enumToOperationalStateString(OpState val)
+{
+ string ret = "DISABLED";
+ switch(val)
+ {
+ case DISABLED:
+ ret = "DISABLED";
+ break;
+ case ENABLED:
+ ret = "ENABLED";
+ break;
+ default :
+ O1_LOG("O1 NrCellInfo : %d operational state not handled\n", val);
+
+ }
+ return ret;
+}
+
+/**********************************************************************
+ End of file
+**********************************************************************/
+
--- /dev/null
+/*******************************************************************************
+################################################################################
+# Copyright (c) [2020-2021] [HCL Technologies Ltd.] #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+*******************************************************************************/
+
+/* This file contains parameters list of a cell for CLA use case*/
+
+#ifndef __NR_CELL_INFO_HPP__
+#define __NR_CELL_INFO_HPP__
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include "sysrepo-cpp/Session.hpp"
+#include "ConfigInterface.h"
+#include "GlobalDefs.hpp"
+#include "Singleton.hpp"
+#include "NrCellInfo.hpp"
+
+
+typedef enum AdminState{
+ LOCKED,
+ UNLOCKED,
+ SHUTTING_DOWN
+}adminState;
+
+class NrCellInfo
+{
+ public:
+ inline void setCellId(uint16_t id) { mCellId = id;}
+ inline void setOpState(OpState state) { mOpState = state;}
+ inline void setCellState( CellState state) { mCellState = state;}
+ inline uint16_t getCellId() const {return mCellId;}
+ inline OpState getOpState() const { return mOpState;}
+ inline CellState getCellState() const { return mCellState;}
+
+ string enumToOperationalStateString(OpState val);
+ string enumToCellStateString(CellState val);
+ AdminState adminStateToEnum(string val);
+
+ private:
+ uint16_t mCellId;
+ OpState mOpState;
+ CellState mCellState;
+};
+
+#endif
+
+/**********************************************************************
+ End of file
+**********************************************************************/
--- /dev/null
+/*******************************************************************************
+################################################################################
+# Copyright (c) [2020-2021] [HCL Technologies Ltd.] #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+*******************************************************************************/
+
+/* This file contains List of the Cell and it's parameters values for CLA
+ use case*/
+
+#include <sstream>
+#include "NrCellList.hpp"
+#define MAX_LEN 100
+
+using namespace std;
+
+/*******************************************************************
+ *
+ * @brief update cell and operational state in the map
+ *
+ * @details
+ *
+ * Function : setCellOpState
+ *
+ * Functionality:
+ * - update cell and operational state in the map using cellId
+ * as key
+ *
+ *
+ * @params[in] cellId, opState, cellState
+ * @return true - success
+ * false - failure
+ ******************************************************************/
+
+
+bool NrCellList::setCellOpState(uint16_t cellId, \
+ OpState opState, \
+ CellState cellState)
+{
+ O1_LOG("\nO1 NrCellList : Setting cellId = %d, opState=%d, \
+cellState=%d\n", cellId, opState, cellState);
+ NrCellInfo cellInfo ;
+ cellInfo.setCellId( cellId);
+ cellInfo.setOpState(opState);
+ cellInfo.setCellState (cellState);
+ mCellOpStateMap[cellId] = cellInfo;
+ return true;
+}
+
+/*******************************************************************
+ *
+ * @brief provide the cell list
+ *
+ * @details
+ *
+ * Function : getCellOpStateList
+ *
+ * Functionality:
+ * - provide the cell list
+ *
+ *
+ * @params[in] na
+ * @return map of cell - success
+ ******************************************************************/
+
+const std::map<uint16_t, NrCellInfo> & NrCellList::getCellOpStateList()
+{
+ return mCellOpStateMap;
+}
+/**********************************************************************
+ End of file
+**********************************************************************/
+
--- /dev/null
+/*******************************************************************************
+################################################################################
+# Copyright (c) [2020-2021] [HCL Technologies Ltd.] #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+*******************************************************************************/
+
+/* This file contains List of the Cell and it's parameters values for CLA
+ use case*/
+
+#ifndef __NR_CELL_LIST_HPP__
+#define __NR_CELL_LIST_HPP__
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <map>
+#include "sysrepo-cpp/Session.hpp"
+#include "ConfigInterface.h"
+#include "GlobalDefs.hpp"
+#include "Singleton.hpp"
+#include "NrCellInfo.hpp"
+
+class NrCellList : public Singleton<NrCellList>
+{
+ public:
+ friend Singleton<NrCellList>;
+ typedef std::map<uint16_t, NrCellInfo> CellOpStateMap;
+
+ bool setCellOpState(uint16_t cellId, OpState opState, \
+ CellState cellState);
+ const std::map<uint16_t, NrCellInfo> & getCellOpStateList();
+
+
+ private:
+ std::map<uint16_t, NrCellInfo> mCellOpStateMap;
+};
+
+#endif
+
+/**********************************************************************
+ End of file
+**********************************************************************/
#include "sysrepo.h"
#include "SessionHandler.hpp"
#include "InitConfig.hpp"
-#include <iostream>
+#include "NrCellCb.hpp"
using namespace std;
/* Default constructor */
subscrb->oper_get_items_subscribe(ALARM_MODULE_NAME_ORAN, \
ALARM_MODULE_PATH_ORAN, \
alarmOranCb);
+
+ sysrepo::S_Callback nrCellCb(new NrCellCb());
+
+ subscrb->oper_get_items_subscribe(CELL_STATE_MODULE_NAME, \
+ CELL_STATE_MODULE_PATH, \
+ nrCellCb);
+ subscrb->module_change_subscribe(CELL_STATE_MODULE_NAME, nrCellCb);
+
+
return true;
}