1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
19 /* This file contains message handling functionality for DU cell management */
20 #include "common_def.h"
27 #include "du_app_mac_inf.h"
28 #include "du_app_rlc_inf.h"
31 #include "du_cell_mgr.h"
33 /*******************************************************************
35 * @brief Processes cells to be activated
39 * Function : duProcCellsToBeActivated
42 * - Processes cells to be activated list received in F1SetupRsp
45 * @return ROK - success
48 * ****************************************************************/
49 uint8_t duProcCellsToBeActivated(uint8_t *plmnStr, uint16_t nci, uint16_t nRPci)
52 DuCellCb *cellCb = NULLP;
53 uint8_t cfgIdx, tmpPlmn[4];
55 for(cfgIdx=0; cfgIdx<duCb.numCfgCells; cfgIdx++)
57 memset(tmpPlmn, 0, 4);
58 buildPlmnId(duCb.cfgCellLst[cfgIdx]->cellInfo.nrEcgi.plmn, tmpPlmn);
59 if(duCb.cfgCellLst[cfgIdx]->cellInfo.nrEcgi.cellId == nci &&
60 (strcmp((const char*)tmpPlmn, (const char*)plmnStr) == 0))
62 cellCb = duCb.cfgCellLst[cfgIdx];
67 DU_LOG("\nDU APP : No Cell found for NCI %d", nci);
72 cellCb->cellStatus = ACTIVATION_IN_PROGRESS;
73 cellCb->cellInfo.nrPci = nRPci;
75 duCb.actvCellLst[duCb.numActvCells++] = cellCb;
77 if(duBuildAndSendMacCellCfg(cellCb->cellId) != ROK)
79 DU_LOG("\nDU APP : macCellCfg build and send failed");
80 /* Delete cell from actvCellList */
81 duCb.actvCellLst[--(duCb.numActvCells)] = NULLP;
87 /*******************************************************************
89 * @brief Handles DU F1Setup Rsp received in F1AP
93 * Function : duProcF1SetupRsp
96 * - Handles DU F1Setup Rsp received in F1AP
98 * @params[in] Pointer to F1SetupRsp
101 ******************************************************************/
102 void duProcF1SetupRsp()
104 DU_LOG("\nDU_APP : F1 Setup Response received");
105 duCb.f1Status = TRUE; //Set F1 status as true
108 /*******************************************************************
110 * @brief Handles GNB DU Cfg Update Ack received in F1AP
114 * Function : duProcGnbDuCfgUpdAckMsg
117 * - Handles GNB DU Cfg Update Ack received in F1AP
119 * @params[in] Pointer to F1GnbDuCfgUpdAck
122 ******************************************************************/
123 void duProcGnbDuCfgUpdAckMsg()
125 DU_LOG("\nDU APP: GNB-DU config update Ack received ");
127 /*******************************************************************
129 * @brief Returns cellCb based on cell ID
133 * Function : duGetCellCb
135 * Functionality: Returns DU APP CellCb based on cell ID
137 * @params[in] F1AP_PDU_t ASN decoded F1AP message
138 * @return ROK - success
141 * ****************************************************************/
142 uint8_t duGetCellCb(uint16_t cellId, DuCellCb **cellCb)
145 for(cellIdx=0; cellIdx<duCb.numActvCells; cellIdx++)
147 if(duCb.actvCellLst[cellIdx]->cellId == cellId)
148 *cellCb = duCb.actvCellLst[cellIdx];
154 DU_LOG("\nDU APP : Cell Id %d not found in DU APP", cellId);
161 /**********************************************************************
163 **********************************************************************/