merge with develop

This commit is contained in:
Bruno Mongazon-Cazavet
2023-02-24 13:52:37 +01:00
193 changed files with 7469 additions and 7565 deletions
+1 -11
View File
@@ -269,24 +269,14 @@ typedef struct m2ap_setup_resp_s {
uint8_t num_mcch_config_per_mbsfn;
// /// string holding gNB_CU_name
// char *gNB_CU_name;
// /// number of DU cells to activate
// uint16_t num_cells_to_activate; //0< num_cells_to_activate <= 512;
// /// mcc of DU cells
// //uint16_t mcc[M2AP_MAX_NB_CELLS];
uint16_t mcc;//[M2AP_MAX_NB_CELLS];
/// mnc of DU cells
//uint16_t mnc[M2AP_MAX_NB_CELLS];
uint16_t mnc;//[M2AP_MAX_NB_CELLS];
/// mnc digit length of DU cells
//uint8_t mnc_digit_length[M2AP_MAX_NB_CELLS];
uint8_t mnc_digit_length;//[M2AP_MAX_NB_CELLS];
// NR Global Cell Id
// uint64_t nr_cellid[M2AP_MAX_NB_CELLS];
// /// NRPCI
// uint16_t nrpci[M2AP_MAX_NB_CELLS];
// /// num SI messages per DU cell
// /// num SI messages
// uint8_t num_SI[M2AP_MAX_NB_CELLS];
// /// SI message containers (up to 21 messages per cell)
// uint8_t *SI_container[M2AP_MAX_NB_CELLS][21];
+21 -91
View File
@@ -85,7 +85,8 @@ extern RAN_CONTEXT_t RC;
//}
//*****end M2AP ****/
static uint32_t eNB_app_register_m2(uint32_t enb_id_start, uint32_t enb_id_end) {
static uint32_t eNB_app_register_m2(uint32_t enb_id_start, uint32_t enb_id_end)
{
uint32_t enb_id;
MessageDef *msg_p;
uint32_t register_enb_m2_pending = 0;
@@ -142,38 +143,27 @@ static uint32_t eNB_app_handle_m2ap_mbms_session_update_req(instance_t instance)
/*------------------------------------------------------------------------------*/
static uint32_t eNB_app_register(ngran_node_t node_type,uint32_t enb_id_start, uint32_t enb_id_end) {
static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end)
{
uint32_t enb_id;
MessageDef *msg_p;
uint32_t register_enb_pending = 0;
for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) {
{
if (NODE_IS_DU(node_type)) { // F1AP registration
// configure F1AP here for F1C
LOG_I(ENB_APP,"ngran_eNB_DU: Allocating ITTI message for F1AP_SETUP_REQ\n");
msg_p = itti_alloc_new_message (TASK_ENB_APP, 0, F1AP_SETUP_REQ);
RCconfig_DU_F1(msg_p, enb_id);
// S1AP registration
/* note: there is an implicit relationship between the data structure and the message name */
msg_p = itti_alloc_new_message(TASK_ENB_APP, 0, S1AP_REGISTER_ENB_REQ);
RCconfig_S1(msg_p, enb_id);
LOG_I(ENB_APP,"[eNB %d] eNB_app_register via F1AP for instance %d\n", enb_id, ENB_MODULE_ID_TO_INSTANCE(enb_id));
itti_send_msg_to_task (TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
// configure GTPu here for F1U
}
else { // S1AP registration
/* note: there is an implicit relationship between the data structure and the message name */
msg_p = itti_alloc_new_message (TASK_ENB_APP, 0, S1AP_REGISTER_ENB_REQ);
RCconfig_S1(msg_p, enb_id);
if (enb_id == 0)
RCconfig_gtpu();
if (enb_id == 0) RCconfig_gtpu();
LOG_I(ENB_APP, "default drx %d\n", ((S1AP_REGISTER_ENB_REQ(msg_p)).default_drx));
LOG_I(ENB_APP,"default drx %d\n",((S1AP_REGISTER_ENB_REQ(msg_p)).default_drx));
LOG_I(ENB_APP, "[eNB %d] eNB_app_register via S1AP for instance %d\n", enb_id, ENB_MODULE_ID_TO_INSTANCE(enb_id));
itti_send_msg_to_task(TASK_S1AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
LOG_I(ENB_APP,"[eNB %d] eNB_app_register via S1AP for instance %d\n", enb_id, ENB_MODULE_ID_TO_INSTANCE(enb_id));
itti_send_msg_to_task (TASK_S1AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
}
register_enb_pending++;
}
register_enb_pending++;
}
return register_enb_pending;
@@ -220,19 +210,18 @@ void *eNB_app_task(void *args_p) {
itti_mark_task_ready (TASK_ENB_APP);
/* Try to register each eNB */
// This assumes that node_type of all RRC instances is the same
if (EPC_MODE_ENABLED) {
register_enb_pending = eNB_app_register(RC.rrc[0]->node_type, enb_id_start, enb_id_end);
register_enb_pending = eNB_app_register(enb_id_start, enb_id_end);
}
/* Try to register each eNB with each other */
if (is_x2ap_enabled() && !NODE_IS_DU(RC.rrc[0]->node_type)) {
if (is_x2ap_enabled()) {
x2_register_enb_pending = eNB_app_register_x2 (enb_id_start, enb_id_end);
}
/* Try to register each eNB with MCE each other */
if (is_m2ap_eNB_enabled() /*&& !NODE_IS_DU(RC.rrc[0]->node_type)*/) {
//eNB_app_register_MBMS_STA(RC.rrc[0]->node_type, enb_id_start, enb_id_end);
if (is_m2ap_eNB_enabled()) {
//eNB_app_register_MBMS_STA(enb_id_start, enb_id_end);
m2_register_enb_pending = eNB_app_register_m2 (enb_id_start, enb_id_end);
//if (timer_setup (5, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,
@@ -259,7 +248,6 @@ void *eNB_app_task(void *args_p) {
break;
case S1AP_REGISTER_ENB_CNF:
AssertFatal(!NODE_IS_DU(RC.rrc[0]->node_type), "Should not have received S1AP_REGISTER_ENB_CNF\n");
if (EPC_MODE_ENABLED) {
LOG_I(ENB_APP, "[eNB %ld] Received %s: associated MME %d\n", instance, ITTI_MSG_NAME (msg_p),
S1AP_REGISTER_ENB_CNF(msg_p).nb_mme);
@@ -288,7 +276,7 @@ void *eNB_app_task(void *args_p) {
sleep(ENB_REGISTER_RETRY_DELAY);
/* Restart the registration process */
registered_enb = 0;
register_enb_pending = eNB_app_register (RC.rrc[0]->node_type,enb_id_start, enb_id_end);
register_enb_pending = eNB_app_register(enb_id_start, enb_id_end);
}
}
}
@@ -296,50 +284,6 @@ void *eNB_app_task(void *args_p) {
break;
case F1AP_SETUP_RESP:
AssertFatal(NODE_IS_DU(RC.rrc[0]->node_type), "Should not have received F1AP_REGISTER_ENB_CNF in CU/eNB\n");
LOG_I(ENB_APP, "Received %s: associated ngran_eNB_CU %s with %d cells to activate\n", ITTI_MSG_NAME (msg_p),
F1AP_SETUP_RESP(msg_p).gNB_CU_name,F1AP_SETUP_RESP(msg_p).num_cells_to_activate);
handle_f1ap_setup_resp(&F1AP_SETUP_RESP(msg_p));
DevAssert(register_enb_pending > 0);
register_enb_pending--;
/* Check if at least eNB is registered with one MME */
if (F1AP_SETUP_RESP(msg_p).num_cells_to_activate > 0) {
registered_enb++;
}
/* Check if all register eNB requests have been processed */
if (register_enb_pending == 0) {
if (registered_enb == enb_nb) {
/* If all eNB cells are registered, start L2L1 task */
MessageDef *msg_init_p;
msg_init_p = itti_alloc_new_message (TASK_ENB_APP, 0, INITIALIZE_MESSAGE);
itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p);
} else {
LOG_W(ENB_APP, " %d eNB not associated with a MME, retrying registration in %d seconds ...\n",
enb_nb - registered_enb, ENB_REGISTER_RETRY_DELAY);
/* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */
if (timer_setup (ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,
NULL, &enb_register_retry_timer_id) < 0) {
LOG_E(ENB_APP, " Can not start eNB register retry timer, use \"sleep\" instead!\n");
sleep(ENB_REGISTER_RETRY_DELAY);
/* Restart the registration process */
registered_enb = 0;
register_enb_pending = eNB_app_register (RC.rrc[0]->node_type,enb_id_start, enb_id_end);//, enb_properties_p);
}
}
}
break;
case S1AP_DEREGISTERED_ENB_IND:
if (EPC_MODE_ENABLED) {
LOG_W(ENB_APP, "[eNB %ld] Received %s: associated MME %d\n", instance, ITTI_MSG_NAME (msg_p),
@@ -356,7 +300,7 @@ void *eNB_app_task(void *args_p) {
if (TIMER_HAS_EXPIRED (msg_p).timer_id == enb_register_retry_timer_id) {
/* Restart the registration process */
registered_enb = 0;
register_enb_pending = eNB_app_register (RC.rrc[0]->node_type, enb_id_start, enb_id_end);
register_enb_pending = eNB_app_register(enb_id_start, enb_id_end);
}
if (TIMER_HAS_EXPIRED (msg_p).timer_id == x2_enb_register_retry_timer_id) {
@@ -459,20 +403,6 @@ void *eNB_app_task(void *args_p) {
case M2AP_SETUP_RESP:
LOG_I(ENB_APP,"M2AP_SETUP_RESP RESPONSE received\n");
// AssertFatal(NODE_IS_DU(RC.rrc[0]->node_type), "Should not have received F1AP_REGISTER_ENB_CNF in CU/eNB\n");
// LOG_I(ENB_APP, "Received %s: associated ngran_eNB_CU %s with %d cells to activate\n", ITTI_MSG_NAME (msg_p),
// F1AP_SETUP_RESP(msg_p).gNB_CU_name,F1AP_SETUP_RESP(msg_p).num_cells_to_activate);
//
// handle_f1ap_setup_resp(&F1AP_SETUP_RESP(msg_p));
// DevAssert(register_enb_pending > 0);
// register_enb_pending--;
// /* Check if at least eNB is registered with one MME */
// if (F1AP_SETUP_RESP(msg_p).num_cells_to_activate > 0) {
// registered_enb++;
// }
// /* Check if all register eNB requests have been processed */
// if (register_enb_pending == 0) {
@@ -495,7 +425,7 @@ void *eNB_app_task(void *args_p) {
// sleep(ENB_REGISTER_RETRY_DELAY);
// /* Restart the registration process */
// registered_enb = 0;
// register_enb_pending = eNB_app_register (RC.rrc[0]->node_type,enb_id_start, enb_id_end);//, enb_properties_p);
// register_enb_pending = eNB_app_register(enb_id_start, enb_id_end);//, enb_properties_p);
// }
// }
// }
+1263 -1494
View File
File diff suppressed because it is too large Load Diff
+2 -5
View File
@@ -101,7 +101,7 @@ typedef struct ru_config_s {
} ru_config_t;
extern void RCconfig_L1(void);
extern void RCconfig_macrlc(int macrlc_has_f1[MAX_MAC_INST]);
extern void RCconfig_macrlc(void);
extern void UE_config_stub_pnf(void);
extern int RCconfig_gtpu(void );
extern void RCConfig(void);
@@ -109,7 +109,7 @@ extern void RCConfig(void);
void enb_config_display(void);
void ru_config_display(void);
int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1);
int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc);
int RCconfig_S1(MessageDef *msg_p, uint32_t i);
void read_config_and_init(void);
@@ -119,8 +119,5 @@ int RCconfig_M2(MessageDef *msg_p, uint32_t i);
void fill_SL_configuration(RrcConfigurationReq *RRCcfg, ccparams_sidelink_t *SLconfig, int cell_idx, int cc_idx, char *config_fname);
void fill_eMTC_configuration(RrcConfigurationReq *RRCcfg, ccparams_eMTC_t *eMTCconfig, int cell_idx, int cc_idx, char *config_fname, char *brparamspath);
int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i);
void handle_f1ap_setup_resp(f1ap_setup_resp_t *resp);
#endif /* ENB_CONFIG_H_ */
/** @} */
-55
View File
@@ -1,55 +0,0 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (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.openairinterface.org/?page_id=698
*
* 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.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "COMMON/platform_types.h"
#include "common/ran_context.h"
#include "common/utils/LOG/log.h"
#include "NR_BCCH-BCH-Message.h"
#include "NR_ServingCellConfigCommon.h"
#include "NR_MIB.h"
bool sdap_data_req(protocol_ctxt_t *ctxt_p,
const ue_id_t ue_id,
const srb_flag_t srb_flag,
const rb_id_t rb_id,
const mui_t mui,
const confirm_t confirm,
const sdu_size_t sdu_buffer_size,
unsigned char *const sdu_buffer,
const pdcp_transmission_mode_t pt_mode,
const uint32_t *sourceL2Id,
const uint32_t *destinationL2Id,
const uint8_t qfi,
const bool rqi,
const int pdusession_id) {
abort();
}
int dl_rrc_message(module_id_t module_id, const f1ap_dl_rrc_message_t *dl_rrc) {
abort();
}
int rrc_gNB_generate_pcch_msg(uint32_t tmsi,
uint8_t paging_drx,
instance_t instance,
uint8_t CC_id) {
abort();
}
+3 -201
View File
@@ -142,15 +142,9 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
req->cell[i].nr_pci = servedCellInformation->nRPCI;
LOG_D(F1AP, "req->nr_pci[%d] %d \n", i, req->cell[i].nr_pci);
// LTS: FIXME data model failure: we don't KNOW if we receive a 4G or a 5G cell
// Furthermore, cell_type is not a attribute of a cell in the data structure !!!!!!!!!!
if (RC.nrrrc &&
( RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU ||
RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CUCP) )
f1ap_req(true, instance)->cell_type=CELL_MACRO_GNB;
else
f1ap_req(true, instance)->cell_type=CELL_MACRO_ENB;
// LTS: FIXME cell_type is not a attribute of a cell in the data structure !!!!!!!!!!
f1ap_req(true, instance)->cell_type = CELL_MACRO_GNB;
// FDD Cells
if (servedCellInformation->nR_Mode_Info.present==F1AP_NR_Mode_Info_PR_fDD) {
struct fdd_s *FDDs=&req->nr_mode_info[i].fdd;
@@ -558,198 +552,6 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
}
}
// c3. Cells_to_be_Deactivated_List
//
/*
if(!RC.nrrrc) {
// mandatory
// c3. Cells_to_be_Deactivated_List
asn1cSequenceAdd(cfgUpdate->protocolIEs.list, F1AP_GNBCUConfigurationUpdateIEs_t, ieC3);
ieC3->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Deactivated_List;
ieC3->criticality = F1AP_Criticality_reject;
ieC3->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Deactivated_List;
for (int i=0; i<1; i++) {
asn1cSequenceAdd(ieC3->value.choice.Cells_to_be_Deactivated_List.list,
F1AP_Cells_to_be_Deactivated_List_ItemIEs_t, cells_to_be_deactivated);
cells_to_be_deactivated->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
cells_to_be_deactivated->criticality = F1AP_Criticality_reject;
cells_to_be_deactivated->value.present = F1AP_Cells_to_be_Deactivated_List_ItemIEs__value_PR_Cells_to_be_Deactivated_List_Item;
// 3.1 cells to be Deactivated list item
F1AP_Cells_to_be_Deactivated_List_Item_t *cells_to_be_deactivated_list=
cells_to_be_deactivated->value.choice.Cells_to_be_Deactivated_List_Item;
addnRCGI(cells_to_be_deactivated_item->nRCGI, f1ap_setup_resp->cells_to_deactivate+i);
}
}
*/
// c4. GNB_CU_TNL_Association_To_Add_List
/*
asn1cSequenceAdd(cfgUpdate->protocolIEs.list, F1AP_GNBCUConfigurationUpdateIEs_t, ieC4);
ieC4->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_List;
ieC4->criticality = F1AP_Criticality_reject;
ieC4->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Add_List;
for (int i=0; i<1; i++) {
asn1cSequenceAdd(ieC4->value.choice.GNB_CU_TNL_Association_To_Add_List.list,
F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t, gnb_cu_tnl_association_to_add;
gnb_cu_tnl_association_to_add->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_Item;
gnb_cu_tnl_association_to_add->criticality = F1AP_Criticality_reject;
gnb_cu_tnl_association_to_add->value.present = F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Add_Item;
// 4.1 GNB_CU_TNL_Association_To_Add_Item
F1AP_GNB_CU_TNL_Association_To_Add_Item_t *gnb_cu_tnl_association_to_add_item=
&gnb_cu_tnl_association_to_add_item_ies->value.choice.GNB_CU_TNL_Association_To_Add_Item;
// 4.1.1 tNLAssociationTransportLayerAddress
F1AP_CP_TransportLayerAddress_t *transportLayerAddress=;
gnb_cu_tnl_association_to_add->value.choice.GNB_CU_TNL_Association_To_Add_Item;
transportLayerAddress->present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress->choice.endpoint_IP_address);
// memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
// transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
// transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
// TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
// 4.1.2 tNLAssociationUsage
gnb_cu_tnl_association_to_add_item->tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue;
}
*/
/*
// c5. GNB_CU_TNL_Association_To_Remove_List
asn1cSequenceAdd(cfgUpdate->protocolIEs.list, F1AP_GNBCUConfigurationUpdateIEs_t, ieC5);
ieC5->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_List;
ieC5->criticality = F1AP_Criticality_reject;
ieC5->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Remove_List;
for (int i=0; i<1; i++) {
asn1cSequenceAdd(ieC5->value.choice.GNB_CU_TNL_Association_To_Remove_List.list,
F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t, gnb_cu_tnl_association_to_remove);
gnb_cu_tnl_association_to_remove->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_Item;
gnb_cu_tnl_association_to_remove->criticality = F1AP_Criticality_reject;
gnb_cu_tnl_association_to_remove->value.present = F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Remove_Item;
// 4.1 GNB_CU_TNL_Association_To_Remove_Item
F1AP_GNB_CU_TNL_Association_To_Remove_Item_t *gnb_cu_tnl_association_to_remove_item=
&gnb_cu_tnl_association_to_remove->value.choice.GNB_CU_TNL_Association_To_Remove_Item;
// 4.1.1 tNLAssociationTransportLayerAddress
F1AP_CP_TransportLayerAddress_t *transportLayerAddress=
&gnb_cu_tnl_association_to_remove_item->tNLAssociationTransportLayerAddress;
transportLayerAddress->present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress->choice.endpoint_IP_address);
// memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
// transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
// transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
// TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
}
*/
/*
//mandatory
// c6. GNB_CU_TNL_Association_To_Update_List
asn1cSequenceAdd(cfgUpdate->protocolIEs.list, F1AP_GNBCUConfigurationUpdateIEs_t, ieC6);
ieC6->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_List;
ieC6->criticality = F1AP_Criticality_reject;
ieC6->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Update_List;
for (int i=0; i<1; i++) {
asn1cSequenceAdd(ieC3->value.choice.GNB_CU_TNL_Association_To_Update_List.list,
F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t, gnb_cu_tnl_association_to_update);
gnb_cu_tnl_association_to_update->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_Item;
gnb_cu_tnl_association_to_update->criticality = F1AP_Criticality_reject;
gnb_cu_tnl_association_to_update->value.present = F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Update_Item;
// 4.1 GNB_CU_TNL_Association_To_Update_Item
F1AP_GNB_CU_TNL_Association_To_Update_Item_t *gnb_cu_tnl_association_to_update_item=
&gnb_cu_tnl_association_to_update->value.choice.GNB_CU_TNL_Association_To_Update_Item;
// 4.1.1 tNLAssociationTransportLayerAddress
F1AP_CP_TransportLayerAddress_t *transportLayerAddress=
&gnb_cu_tnl_association_to_update_item.tNLAssociationTransportLayerAddress;
transportLayerAddress->present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress->choice.endpoint_IP_address);
// memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
// transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
// transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
// TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
// 4.1.2 tNLAssociationUsage
if (1) {
gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = (F1AP_TNLAssociationUsage_t *)calloc(1, sizeof(F1AP_TNLAssociationUsage_t));
*gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue;
}
}
*/
/*
// c7. Cells_to_be_Barred_List
asn1cSequenceAdd(cfgUpdate->protocolIEs.list, F1AP_GNBCUConfigurationUpdateIEs_t, ieC7);
ieC7->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Barred_List;
ieC7->criticality = F1AP_Criticality_reject;
ieC7->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Barred_List;
for (int i=0; i<1; i++) {
asn1cSequenceAdd(ieC7->value.choice.Cells_to_be_Barred_List.list,
F1AP_Cells_to_be_Barred_ItemIEs_t,cells_to_be_barred);
cells_to_be_barred->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
cells_to_be_barred->criticality = F1AP_Criticality_reject;
cells_to_be_barred->value.present = F1AP_Cells_to_be_Barred_ItemIEs__value_PR_Cells_to_be_Barred_Item;
// 7.1 cells to be Deactivated list item
F1AP_Cells_to_be_Barred_Item_t *cells_to_be_barred_item=
&cells_to_be_barred_item_ies->value.choice.Cells_to_be_Barred_Item;
// - nRCGI
addnRCGI(cells_to_be_barred_item->nRCGI, f1ap_gnb_cu_configuration_update->cells_to_activate+i);
// 7.2 cellBarred
cells_to_be_barred_item->cellBarred = F1AP_CellBarred_not_barred;
}
*/
/*
// c8. Protected_EUTRA_Resources_List
asn1cSequenceAdd(cfgUpdate->protocolIEs.list, F1AP_GNBCUConfigurationUpdateIEs_t, ieC8);
ieC8->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
ieC8->criticality = F1AP_Criticality_reject;
ieC8->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Protected_EUTRA_Resources_List;
for (int i=0; i<1; i++) {
asn1cSequenceAdd(ieC8->value.choice.Protected_EUTRA_Resources_List.list,
F1AP_Protected_EUTRA_Resources_ItemIEs_t, protected_eutra_resources);
// 8.1 SpectrumSharingGroupID
protected_eutra_resources->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
protected_eutra_resources->criticality = F1AP_Criticality_reject;
protected_eutra_resources->value.present = F1AP_Protected_EUTRA_Resources_ItemIEs__value_PR_Protected_EUTRA_Resources_Item;
((F1AP_Protected_EUTRA_Resources_Item_t *)&protected_eutra_resources->value.choice.Protected_EUTRA_Resources_Item)->spectrumSharingGroupID = 123L;
memset(&protected_eutra_resources->value.choice.Protected_EUTRA_Resources_Item,0,
sizeof(F1AP_Protected_EUTRA_Resources_Item_t));
asn1cSequenceAdd(protected_eutra_resources->value.choice.ListofEUTRACellsinGNBDUCoordination.list,
F1AP_Served_EUTRA_Cells_Information_t, served_eutra_cells_information);
memset((void *)&served_eutra_cells_information, 0, sizeof(F1AP_Served_EUTRA_Cells_Information_t));
F1AP_EUTRA_Mode_Info_t *eUTRA_Mode_Info=
&served_eutra_cells_information.eUTRA_Mode_Info;
// eUTRAFDD
eUTRA_Mode_Info->present = F1AP_EUTRA_Mode_Info_PR_eUTRAFDD;
F1AP_EUTRA_FDD_Info_t *eutra_fdd_info = (F1AP_EUTRA_FDD_Info_t *)calloc(1, sizeof(F1AP_EUTRA_FDD_Info_t));
eutra_fdd_info->uL_offsetToPointA = 123L;
eutra_fdd_info->dL_offsetToPointA = 456L;
eUTRA_Mode_Info.choice.eUTRAFDD = eutra_fdd_info;
// eUTRATDD
// eUTRA_Mode_Info.present = F1AP_EUTRA_Mode_Info_PR_eUTRATDD;
// F1AP_EUTRA_TDD_Info_t *eutra_tdd_info;
// eutra_tdd_info = (F1AP_EUTRA_TDD_Info_t *)calloc(1, sizeof(F1AP_EUTRA_TDD_Info_t));
// eutra_tdd_info->uL_offsetToPointA = 123L;
// eutra_tdd_info->dL_offsetToPointA = 456L;
// eUTRA_Mode_Info.choice.eUTRATDD = eutra_tdd_info;
OCTET_STRING_fromBuf(&served_eutra_cells_information.protectedEUTRAResourceIndication, "asdsa1d32sa1d31asd31as",
strlen("asdsa1d32sa1d31asd31as"));
}
*/
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
LOG_E(F1AP, "Failed to encode F1 gNB-CU CONFIGURATION UPDATE\n");
+1 -6
View File
@@ -123,12 +123,7 @@ void *F1AP_CU_task(void *arg) {
eth_params_t *IPaddrs;
// Hardcoded instance id!
if (RC.nrrrc &&
(RC.nrrrc[0]->node_type == ngran_gNB_CU ||
RC.nrrrc[0]->node_type == ngran_gNB_CUCP ) )
IPaddrs=&RC.nrrrc[0]->eth_params_s;
else
IPaddrs=&RC.rrc[0]->eth_params_s;
IPaddrs = &RC.nrrrc[0]->eth_params_s;
cu_task_send_sctp_init_req(0, IPaddrs->my_addr);
+7 -42
View File
@@ -39,7 +39,6 @@
#include "rrc_extern.h"
#include "rrc_eNB_UE_context.h"
#include "openair2/RRC/NR/rrc_gNB_UE_context.h"
#include "rrc_eNB_S1AP.h"
#include "rrc_eNB_GTPV1U.h"
#include "openair2/RRC/NR/rrc_gNB_NGAP.h"
@@ -959,49 +958,15 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
protocol_ctxt_t ctxt;
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, instance, ENB_FLAG_YES, rnti, 0, 0, instance);
if (f1ap_req(true, instance)->cell_type==CELL_MACRO_GNB) {
struct rrc_gNB_ue_context_s *ue_context_p =
rrc_gNB_get_ue_context(RC.nrrrc[instance], rnti);
if (ue_context_p) {
MessageDef *msg = itti_alloc_new_message(TASK_CU_F1, 0, NGAP_UE_CONTEXT_RELEASE_COMPLETE);
NGAP_UE_CONTEXT_RELEASE_COMPLETE(msg).gNB_ue_ngap_id = ue_context_p->ue_context.gNB_ue_ngap_id;
itti_send_msg_to_task(TASK_NGAP, instance, msg);
rrc_gNB_remove_ue_context(&ctxt, RC.nrrrc[instance], ue_context_p);
} else {
LOG_E(F1AP, "could not find ue_context of UE RNTI %x\n", rnti);
}
struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[instance], rnti);
if (ue_context_p) {
MessageDef *msg = itti_alloc_new_message(TASK_CU_F1, 0, NGAP_UE_CONTEXT_RELEASE_COMPLETE);
NGAP_UE_CONTEXT_RELEASE_COMPLETE(msg).gNB_ue_ngap_id = ue_context_p->ue_context.gNB_ue_ngap_id;
itti_send_msg_to_task(TASK_NGAP, instance, msg);
rrc_gNB_remove_ue_context(&ctxt, RC.nrrrc[instance], ue_context_p);
} else {
struct rrc_eNB_ue_context_s *ue_context_p =
rrc_eNB_get_ue_context(RC.rrc[instance], rnti);
if (ue_context_p) {
/* The following is normally done in the function rrc_rx_tx() */
rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_CPLT(instance,
ue_context_p->ue_context.eNB_ue_s1ap_id);
rrc_eNB_send_GTPV1U_ENB_DELETE_TUNNEL_REQ(instance, ue_context_p);
// erase data of GTP tunnels in UE context
for (int e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) {
ue_context_p->ue_context.enb_gtp_teid[e_rab] = 0;
memset(&ue_context_p->ue_context.enb_gtp_addrs[e_rab],
0, sizeof(ue_context_p->ue_context.enb_gtp_addrs[e_rab]));
ue_context_p->ue_context.enb_gtp_ebi[e_rab] = 0;
}
struct rrc_ue_s1ap_ids_s *rrc_ue_s1ap_ids =
rrc_eNB_S1AP_get_ue_ids(RC.rrc[instance], 0,
ue_context_p->ue_context.eNB_ue_s1ap_id);
if (rrc_ue_s1ap_ids)
rrc_eNB_S1AP_remove_ue_ids(RC.rrc[instance], rrc_ue_s1ap_ids);
/* trigger UE release in RRC */
rrc_eNB_remove_ue_context(&ctxt, RC.rrc[instance], ue_context_p);
} else {
LOG_E(F1AP, "could not find ue_context of UE RNTI %x\n", rnti);
}
LOG_E(F1AP, "could not find ue_context of UE RNTI %x\n", rnti);
}
pdcp_remove_UE(&ctxt);
+18 -490
View File
@@ -58,38 +58,19 @@
#include "openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.h"
int DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/* DL RRC Message Transfer */
int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
if (RC.nrrrc && RC.nrrrc[instance]->node_type == ngran_gNB_DU) {
LOG_I(F1AP, "node is gNB DU, call DU_handle_DL_NR_RRC_MESSAGE_TRANSFER \n");
return DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance, assoc_id, stream, pdu);
}
LOG_W(F1AP, "DU_handle_DL_RRC_MESSAGE_TRANSFER is a big race condition with rrc \n");
F1AP_DLRRCMessageTransfer_t *container;
F1AP_DLRRCMessageTransferIEs_t *ie;
uint64_t cu_ue_f1ap_id;
uint64_t du_ue_f1ap_id;
int executeDuplication;
sdu_size_t rrc_dl_sdu_len;
//uint64_t subscriberProfileIDforRFP;
//uint64_t rAT_FrequencySelectionPriority;
DevAssert(pdu != NULL);
if (stream != 0) {
LOG_E(F1AP, "[SCTP %d] Received F1 on stream != 0 (%d)\n",
assoc_id, stream);
return -1;
}
container = &pdu->choice.initiatingMessage->value.choice.DLRRCMessageTransfer;
/* GNB_CU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
@@ -102,8 +83,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
LOG_D(F1AP, "du_ue_f1ap_id %lu associated with UE RNTI %x \n",
du_ue_f1ap_id,
f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id));
// this should be the one transmitted via initial ul rrc message transfer
f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id)); // this should be the one transmitted via initial ul rrc message transfer
if (f1ap_du_add_cu_ue_id(instance,du_ue_f1ap_id, cu_ue_f1ap_id) < 0 ) {
LOG_E(F1AP, "Failed to find the F1AP UID \n");
@@ -138,8 +118,6 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
/* RRC Container */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_RRCContainer, true);
rrc_dl_sdu_len = ie->value.choice.RRCContainer.size;
/* optional */
/* RAT_FrequencyPriorityInformation */
if (0) {
@@ -161,359 +139,25 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
}
}
f1ap_dl_rrc_message_t dl_rrc = {
.rrc_container_length = ie->value.choice.RRCContainer.size,
.rrc_container = ie->value.choice.RRCContainer.buf,
.rnti = f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id),
.srb_id = srb_id
};
int rc = dl_rrc_message(instance, &dl_rrc);
if (rc == 0)
return 0; /* has been handled, otherwise continue below */
// decode RRC Container and act on the message type
AssertFatal(srb_id<3,"illegal srb_id\n");
protocol_ctxt_t ctxt;
ctxt.rntiMaybeUEid = f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id);
ctxt.instance = instance;
ctxt.module_id = instance;
ctxt.enb_flag = 1;
struct rrc_eNB_ue_context_s *ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt.instance], ctxt.rntiMaybeUEid);
if (srb_id == 0) {
LTE_DL_CCCH_Message_t *dl_ccch_msg=NULL;
asn_dec_rval_t dec_rval;
dec_rval = uper_decode(NULL,
&asn_DEF_LTE_DL_CCCH_Message,
(void **)&dl_ccch_msg,
ie->value.choice.RRCContainer.buf,
rrc_dl_sdu_len,0,0);
AssertFatal(dec_rval.code == RC_OK, "could not decode F1AP message\n");
switch (dl_ccch_msg->message.choice.c1.present) {
case LTE_DL_CCCH_MessageType__c1_PR_NOTHING:
LOG_I(F1AP, "Received PR_NOTHING on DL-CCCH-Message\n");
break;
case LTE_DL_CCCH_MessageType__c1_PR_rrcConnectionReestablishment:
LOG_I(F1AP,
"Logical Channel DL-CCCH (SRB0), Received RRCConnectionReestablishment\n");
break;
case LTE_DL_CCCH_MessageType__c1_PR_rrcConnectionReestablishmentReject:
LOG_I(F1AP,
"Logical Channel DL-CCCH (SRB0), Received RRCConnectionReestablishmentReject\n");
break;
case LTE_DL_CCCH_MessageType__c1_PR_rrcConnectionReject:
LOG_I(F1AP,
"Logical Channel DL-CCCH (SRB0), Received RRCConnectionReject \n");
break;
case LTE_DL_CCCH_MessageType__c1_PR_rrcConnectionSetup: {
LOG_I(F1AP,
"Logical Channel DL-CCCH (SRB0), Received RRCConnectionSetup DU_ID %lx/RNTI %x\n",
du_ue_f1ap_id,
f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id));
// Get configuration
LTE_RRCConnectionSetup_t *rrcConnectionSetup = &dl_ccch_msg->message.choice.c1.choice.rrcConnectionSetup;
AssertFatal(rrcConnectionSetup!=NULL,"rrcConnectionSetup is null\n");
LTE_RadioResourceConfigDedicated_t *radioResourceConfigDedicated = &rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated;
// get SRB logical channel information
LTE_SRB_ToAddModList_t *SRB_configList = radioResourceConfigDedicated->srb_ToAddModList;
AssertFatal(SRB_configList!=NULL,"SRB_configList is null\n");
LTE_LogicalChannelConfig_t *SRB1_logicalChannelConfig = NULL;
for (int cnt = 0; cnt < (SRB_configList)->list.count; cnt++) {
if ((SRB_configList)->list.array[cnt]->srb_Identity == 1) {
LTE_SRB_ToAddMod_t * SRB1_config = (SRB_configList)->list.array[cnt];
if (SRB1_config->logicalChannelConfig) {
if (SRB1_config->logicalChannelConfig->present ==
LTE_SRB_ToAddMod__logicalChannelConfig_PR_explicitValue) {
SRB1_logicalChannelConfig = &SRB1_config->logicalChannelConfig->choice.explicitValue;
} else {
SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue;
}
} else {
SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue;
}
}
} // for
rrc_rlc_config_asn1_req(&ctxt,
SRB_configList,
(LTE_DRB_ToAddModList_t *) NULL,
(LTE_DRB_ToReleaseList_t *) NULL
, (LTE_PMCH_InfoList_r9_t *) NULL,
0,0
);
// This should be somewhere in the f1ap_cudu_ue_inst_t
/*int macrlc_instance = 0;
rnti_t rnti = f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id);
struct rrc_eNB_ue_context_s *ue_context_p = rrc_eNB_get_ue_context(RC.rrc[macrlc_instance],rnti);
*/
eNB_RRC_UE_t *ue_p = &ue_context_p->ue_context;
AssertFatal(ue_p->Srb0.Active == 1,"SRB0 is not active\n");
memcpy((void *)ue_p->Srb0.Tx_buffer.Payload,
(void *)ie->value.choice.RRCContainer.buf,
rrc_dl_sdu_len); // ie->value.choice.RRCContainer.size
ue_p->Srb0.Tx_buffer.payload_size = rrc_dl_sdu_len;
LTE_MAC_MainConfig_t *mac_MainConfig = NULL;
if (radioResourceConfigDedicated->mac_MainConfig)
mac_MainConfig = &radioResourceConfigDedicated->mac_MainConfig->choice.explicitValue;
rrc_mac_config_req_eNB_t tmp = {0};
tmp.rnti = ctxt.rntiMaybeUEid;
tmp.physicalConfigDedicated = radioResourceConfigDedicated->physicalConfigDedicated;
tmp.mac_MainConfig = mac_MainConfig;
tmp.logicalChannelIdentity = 1;
tmp.logicalChannelConfig = SRB1_logicalChannelConfig;
rrc_mac_config_req_eNB(ctxt.instance, &tmp);
break;
} // case
default:
AssertFatal(1==0,
"Unknown message\n");
break;
}// switch case
return(0);
} else if (srb_id == 1) {
LTE_DL_DCCH_Message_t *dl_dcch_msg=NULL;
asn_dec_rval_t dec_rval;
dec_rval = uper_decode(NULL,
&asn_DEF_LTE_DL_DCCH_Message,
(void **)&dl_dcch_msg,
&ie->value.choice.RRCContainer.buf[1], // buf[0] includes the pdcp header
rrc_dl_sdu_len,0,0);
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0))
LOG_E(F1AP," Failed to decode DL-DCCH (%zu bytes)\n",dec_rval.consumed);
else
LOG_D(F1AP, "Received message: present %d and c1 present %d\n",
dl_dcch_msg->message.present, dl_dcch_msg->message.choice.c1.present);
if (dl_dcch_msg->message.present == LTE_DL_DCCH_MessageType_PR_c1) {
switch (dl_dcch_msg->message.choice.c1.present) {
case LTE_DL_DCCH_MessageType__c1_PR_NOTHING:
LOG_I(F1AP, "Received PR_NOTHING on DL-DCCH-Message\n");
return 0;
case LTE_DL_DCCH_MessageType__c1_PR_dlInformationTransfer:
LOG_I(F1AP,"Received NAS DL Information Transfer\n");
break;
case LTE_DL_DCCH_MessageType__c1_PR_csfbParametersResponseCDMA2000:
LOG_I(F1AP,"Received NAS sfbParametersResponseCDMA2000\n");
break;
case LTE_DL_DCCH_MessageType__c1_PR_handoverFromEUTRAPreparationRequest:
LOG_I(F1AP,"Received NAS andoverFromEUTRAPreparationRequest\n");
break;
case LTE_DL_DCCH_MessageType__c1_PR_mobilityFromEUTRACommand:
LOG_I(F1AP,"Received NAS mobilityFromEUTRACommand\n");
break;
case LTE_DL_DCCH_MessageType__c1_PR_rrcConnectionReconfiguration:
// handle RRCConnectionReconfiguration
LOG_I(F1AP,
"Logical Channel DL-DCCH (SRB1), Received RRCConnectionReconfiguration DU_ID %lx/RNTI %x\n",
du_ue_f1ap_id,
f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id));
LTE_RRCConnectionReconfiguration_t *rrcConnectionReconfiguration = &dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration;
if (rrcConnectionReconfiguration->criticalExtensions.present == LTE_RRCConnectionReconfiguration__criticalExtensions_PR_c1) {
if (rrcConnectionReconfiguration->criticalExtensions.choice.c1.present ==
LTE_RRCConnectionReconfiguration__criticalExtensions__c1_PR_rrcConnectionReconfiguration_r8) {
LTE_RRCConnectionReconfiguration_r8_IEs_t *rrcConnectionReconfiguration_r8 =
&rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8;
if (rrcConnectionReconfiguration_r8->mobilityControlInfo) {
LOG_I(F1AP, "Mobility Control Information is present\n");
AssertFatal(1==0,"Can't handle this yet in DU\n");
}
if (rrcConnectionReconfiguration_r8->measConfig != NULL) {
LOG_I(F1AP, "Measurement Configuration is present\n");
}
if (rrcConnectionReconfiguration_r8->radioResourceConfigDedicated) {
LOG_I(F1AP, "Radio Resource Configuration is present\n");
uint8_t DRB2LCHAN[8];
long drb_id;
int i;
LTE_DRB_ToAddModList_t *DRB_configList = rrcConnectionReconfiguration_r8->radioResourceConfigDedicated->drb_ToAddModList;
LTE_SRB_ToAddModList_t *SRB_configList = rrcConnectionReconfiguration_r8->radioResourceConfigDedicated->srb_ToAddModList;
LTE_DRB_ToReleaseList_t *DRB_ReleaseList = rrcConnectionReconfiguration_r8->radioResourceConfigDedicated->drb_ToReleaseList;
LTE_MAC_MainConfig_t *mac_MainConfig = NULL;
for (i = 0; i< 8; i++) {
DRB2LCHAN[i] = 0;
}
if (rrcConnectionReconfiguration_r8->radioResourceConfigDedicated->mac_MainConfig) {
LOG_D(F1AP, "MAC Main Configuration is present\n");
mac_MainConfig = &rrcConnectionReconfiguration_r8->radioResourceConfigDedicated->mac_MainConfig->choice.explicitValue;
/* CDRX Configuration */
if (mac_MainConfig->drx_Config == NULL) {
LOG_W(F1AP, "drx_Configuration parameter is NULL, cannot configure local UE parameters or CDRX is deactivated\n");
} else {
rrc_mac_drx_config_req_t req = {.rnti = ctxt.rntiMaybeUEid, .drx_Configuration = mac_MainConfig->drx_Config};
/* Send DRX configuration to MAC task to configure timers of local UE context */
eNB_Config_Local_DRX(instance, &req);
LOG_D(F1AP, "DRX configured in MAC Main Configuration for RRC Connection Reconfiguration\n");
}
/* End of CDRX configuration */
}
LTE_MeasGapConfig_t *measGapConfig = NULL;
struct LTE_PhysicalConfigDedicated *physicalConfigDedicated = rrcConnectionReconfiguration_r8->radioResourceConfigDedicated->physicalConfigDedicated;
rrc_rlc_config_asn1_req(
&ctxt,
SRB_configList, // NULL, //LG-RK 14/05/2014 SRB_configList,
DRB_configList,
DRB_ReleaseList, (LTE_PMCH_InfoList_r9_t *) NULL, 0, 0
);
if (SRB_configList != NULL) {
for (i = 0; (i < SRB_configList->list.count) && (i < 3); i++) {
if (SRB_configList->list.array[i]->srb_Identity == 1 ) {
ue_context_p->ue_context.Srb1.Active=1;
} else if (SRB_configList->list.array[i]->srb_Identity == 2 ) {
ue_context_p->ue_context.Srb2.Active=1;
ue_context_p->ue_context.Srb2.Srb_info.Srb_id=2;
LOG_I(F1AP, "[DU %ld] SRB2 is now active\n",ctxt.instance);
} else {
LOG_W(F1AP, "[DU %ld] invalid SRB identity %ld\n",ctxt.instance,
SRB_configList->list.array[i]->srb_Identity);
}
}
}
if (DRB_configList != NULL) {
for (i = 0; i < DRB_configList->list.count; i++) { // num max DRB (11-3-8)
if (DRB_configList->list.array[i]) {
drb_id = (int)DRB_configList->list.array[i]->drb_Identity;
LOG_I(F1AP,
"[DU %ld] Logical Channel UL-DCCH, Received RRCConnectionReconfiguration for UE rnti %lx, reconfiguring DRB %d/LCID %d\n",
ctxt.instance,
ctxt.rntiMaybeUEid,
(int)DRB_configList->list.array[i]->drb_Identity,
(int)*DRB_configList->list.array[i]->logicalChannelIdentity);
if (ue_context_p->ue_context.DRB_active[drb_id] == 0) {
ue_context_p->ue_context.DRB_active[drb_id] = 1;
if (DRB_configList->list.array[i]->logicalChannelIdentity) {
DRB2LCHAN[i] = (uint8_t) * DRB_configList->list.array[i]->logicalChannelIdentity;
}
rrc_mac_config_req_eNB_t tmp = {0};
tmp.rnti = ue_context_p->ue_context.rnti;
tmp.physicalConfigDedicated = physicalConfigDedicated;
tmp.mac_MainConfig = mac_MainConfig;
tmp.logicalChannelIdentity = DRB2LCHAN[i];
tmp.logicalChannelConfig = DRB_configList->list.array[i]->logicalChannelConfig;
tmp.measGapConfig = measGapConfig;
rrc_mac_config_req_eNB(ctxt.instance, &tmp);
}
} else { // remove LCHAN from MAC/PHY
AssertFatal(1==0,"Can't handle this yet in DU\n");
}
}
}
}
}
}
break;
case LTE_DL_DCCH_MessageType__c1_PR_rrcConnectionRelease:
// handle RRCConnectionRelease
LOG_I(F1AP, "Received RRCConnectionRelease\n");
break;
case LTE_DL_DCCH_MessageType__c1_PR_securityModeCommand:
LOG_I(F1AP, "Received securityModeCommand\n");
break;
case LTE_DL_DCCH_MessageType__c1_PR_ueCapabilityEnquiry:
LOG_I(F1AP, "Received ueCapabilityEnquiry\n");
break;
case LTE_DL_DCCH_MessageType__c1_PR_counterCheck:
case LTE_DL_DCCH_MessageType__c1_PR_loggedMeasurementConfiguration_r10:
case LTE_DL_DCCH_MessageType__c1_PR_rnReconfiguration_r10:
case LTE_DL_DCCH_MessageType__c1_PR_spare1:
case LTE_DL_DCCH_MessageType__c1_PR_spare2:
case LTE_DL_DCCH_MessageType__c1_PR_spare3:
break;
case LTE_DL_DCCH_MessageType__c1_PR_ueInformationRequest_r9:
LOG_I(F1AP, "Received ueInformationRequest_r9\n");
break;
case LTE_DL_DCCH_MessageType__c1_PR_rrcConnectionResume_r13:
LOG_I(F1AP, "Received rrcConnectionResume_r13\n");
}
}
} else if (srb_id == 2) {
}
LOG_I(F1AP, "Received DL RRC Transfer on srb_id %ld\n", srb_id);
rlc_op_status_t rlc_status;
bool ret = true;
mem_block_t *pdcp_pdu_p = NULL;
pdcp_pdu_p = get_free_mem_block(rrc_dl_sdu_len, __func__);
//LOG_I(F1AP, "PRRCContainer size %lu:", ie->value.choice.RRCContainer.size);
//for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
// printf("%02x ", ie->value.choice.RRCContainer.buf[i]);
//printf (", PDCP PDU size %d:", rrc_dl_sdu_len);
//for (int i=0;i<rrc_dl_sdu_len;i++) printf("%2x ",pdcp_pdu_p->data[i]);
//printf("\n");
if (pdcp_pdu_p != NULL) {
memset(pdcp_pdu_p->data, 0, rrc_dl_sdu_len);
memcpy(&pdcp_pdu_p->data[0], ie->value.choice.RRCContainer.buf, rrc_dl_sdu_len);
rlc_status = rlc_data_req(&ctxt
, 1
, MBMS_FLAG_NO
, srb_id
, 0
, 0
, rrc_dl_sdu_len
, pdcp_pdu_p
,NULL
,NULL
);
switch (rlc_status) {
case RLC_OP_STATUS_OK:
//LOG_I(F1AP, "Data sending request over RLC succeeded!\n");
ret=true;
break;
case RLC_OP_STATUS_BAD_PARAMETER:
LOG_W(F1AP, "Data sending request over RLC failed with 'Bad Parameter' reason!\n");
ret= false;
break;
case RLC_OP_STATUS_INTERNAL_ERROR:
LOG_W(F1AP, "Data sending request over RLC failed with 'Internal Error' reason!\n");
ret= false;
break;
case RLC_OP_STATUS_OUT_OF_RESSOURCES:
LOG_W(F1AP, "Data sending request over RLC failed with 'Out of Resources' reason!\n");
ret= false;
break;
default:
LOG_W(F1AP, "RLC returned an unknown status code after PDCP placed the order to send some data (Status Code:%d)\n", rlc_status);
ret= false;
break;
} // switch case
return ret;
} // if pdcp_pdu_p
MessageDef *msg = itti_alloc_new_message(TASK_DU_F1, 0, NR_DU_RRC_DL_INDICATION);
NRDuDlReq_t *req=&NRDuDlReq(msg);
req->rnti=f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id);
req->srb_id=srb_id;
req->buf= get_free_mem_block( ie->value.choice.RRCContainer.size, __func__);
memcpy(req->buf->data, ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
itti_send_msg_to_task(TASK_RRC_GNB, instance, msg);
return 0;
}
@@ -839,119 +483,3 @@ int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
f1ap_itti_send_sctp_data_req(false, instance, buffer, len, getCxt(DUtype, instance)->default_sctp_stream_id);
return 0;
}
/* DL NR RRC Message Transfer */
int DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
LOG_D(F1AP, "DU_handle_DL_NR_RRC_MESSAGE_TRANSFER \n");
F1AP_DLRRCMessageTransfer_t *container;
F1AP_DLRRCMessageTransferIEs_t *ie;
uint64_t cu_ue_f1ap_id;
uint64_t du_ue_f1ap_id;
int executeDuplication;
//uint64_t subscriberProfileIDforRFP;
//uint64_t rAT_FrequencySelectionPriority;
DevAssert(pdu != NULL);
container = &pdu->choice.initiatingMessage->value.choice.DLRRCMessageTransfer;
/* GNB_CU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
cu_ue_f1ap_id = ie->value.choice.GNB_CU_UE_F1AP_ID;
LOG_D(F1AP, "cu_ue_f1ap_id %lu \n", cu_ue_f1ap_id);
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
LOG_D(F1AP, "du_ue_f1ap_id %lu associated with UE RNTI %x \n",
du_ue_f1ap_id,
f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id)); // this should be the one transmitted via initial ul rrc message transfer
if (f1ap_du_add_cu_ue_id(instance,du_ue_f1ap_id, cu_ue_f1ap_id) < 0 ) {
LOG_E(F1AP, "Failed to find the F1AP UID \n");
//return -1;
}
/* optional */
/* oldgNB_DU_UE_F1AP_ID */
if (0) {
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_oldgNB_DU_UE_F1AP_ID, true);
}
/* mandatory */
/* SRBID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_SRBID, true);
uint64_t srb_id = ie->value.choice.SRBID;
LOG_D(F1AP, "srb_id %lu \n", srb_id);
/* optional */
/* ExecuteDuplication */
if (0) {
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_ExecuteDuplication, true);
executeDuplication = ie->value.choice.ExecuteDuplication;
LOG_D(F1AP, "ExecuteDuplication %d \n", executeDuplication);
}
// issue in here
/* mandatory */
/* RRC Container */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_RRCContainer, true);
// BK: need check
// create an ITTI message and copy SDU
// message_p = itti_alloc_new_message (TASK_CU_F1, RRC_MAC_CCCH_DATA_IND);
// memset (RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE);
// memcpy(RRC_MAC_CCCH_DATA_IND (message_p).sdu, ie->value.choice.RRCContainer.buf,
// ccch_sdu_len);
//LOG_I(F1AP, "%s() RRCContainer size %lu: ", __func__, ie->value.choice.RRCContainer.size);
//for (int i = 0;i < ie->value.choice.RRCContainer.size; i++)
// printf("%02x ", ie->value.choice.RRCContainer.buf[i]);
//printf("\n");
/* optional */
/* RAT_FrequencyPriorityInformation */
if (0) {
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_RAT_FrequencyPriorityInformation, true);
switch(ie->value.choice.RAT_FrequencyPriorityInformation.present) {
case F1AP_RAT_FrequencyPriorityInformation_PR_eNDC:
//subscriberProfileIDforRFP = ie->value.choice.RAT_FrequencyPriorityInformation.choice.subscriberProfileIDforRFP;
break;
case F1AP_RAT_FrequencyPriorityInformation_PR_nGRAN:
//rAT_FrequencySelectionPriority = ie->value.choice.RAT_FrequencyPriorityInformation.choice.rAT_FrequencySelectionPriority;
break;
default:
LOG_W(F1AP, "unhandled IE RAT_FrequencyPriorityInformation.present\n");
break;
}
}
f1ap_dl_rrc_message_t dl_rrc = {
.rrc_container_length = ie->value.choice.RRCContainer.size,
.rrc_container = ie->value.choice.RRCContainer.buf,
.rnti = f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id),
.srb_id = srb_id
};
int rc = dl_rrc_message(instance, &dl_rrc);
if (rc == 0)
return 0; /* has been handled, otherwise continue below */
// decode RRC Container and act on the message type
AssertFatal(srb_id<3,"illegal srb_id\n");
MessageDef *msg = itti_alloc_new_message(TASK_DU_F1, 0, NR_DU_RRC_DL_INDICATION);
NRDuDlReq_t *req=&NRDuDlReq(msg);
req->rnti=f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id);
req->srb_id=srb_id;
req->buf= get_free_mem_block( ie->value.choice.RRCContainer.size, __func__);
memcpy(req->buf->data, ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
itti_send_msg_to_task(TASK_RRC_GNB, instance, msg);
return 0;
}
+1 -8
View File
@@ -150,14 +150,7 @@ void *F1AP_DU_task(void *arg) {
} break;
case F1AP_UL_RRC_MESSAGE: // to rrc
if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_DU) {
DU_send_UL_NR_RRC_MESSAGE_TRANSFER(myInstance,
&F1AP_UL_RRC_MESSAGE(msg));
} else {
DU_send_UL_RRC_MESSAGE_TRANSFER(myInstance,
&F1AP_UL_RRC_MESSAGE(msg));
}
DU_send_UL_NR_RRC_MESSAGE_TRANSFER(myInstance, &F1AP_UL_RRC_MESSAGE(msg));
break;
case F1AP_UE_CONTEXT_SETUP_RESP:
+29 -318
View File
@@ -182,23 +182,6 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
drb_p->rlc_mode = RLC_MODE_TM;
break;
}
if (!(RC.nrrrc && RC.nrrrc[instance]->node_type == ngran_gNB_DU)) {
transport_layer_addr_t addr;
memcpy(addr.buffer, &drb_p->up_ul_tnl[0].tl_address, sizeof(drb_p->up_ul_tnl[0].tl_address));
addr.length=sizeof(drb_p->up_ul_tnl[0].tl_address)*8;
drb_p->up_dl_tnl[0].teid = newGtpuCreateTunnel(INSTANCE_DEFAULT,
f1ap_ue_context_setup_req->rnti,
drb_p->drb_id,
drb_p->drb_id,
drb_p->up_ul_tnl[0].teid,
-1, // no qfi
addr,
drb_p->up_ul_tnl[0].port,
lteDURecvCb,
NULL);
drb_p->up_dl_tnl_length++;
}
}
}
@@ -242,11 +225,7 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
LOG_W(F1AP, "can't find RRCContainer in UEContextSetupRequestIEs by id %ld \n", F1AP_ProtocolIE_ID_id_RRCContainer);
}
if (RC.nrrrc && RC.nrrrc[instance]->node_type == ngran_gNB_DU)
itti_send_msg_to_task(TASK_RRC_GNB, instance, msg_p);
else
// in 4G, race conditon is to fix
DU_send_UE_CONTEXT_SETUP_RESPONSE(instance, f1ap_ue_context_setup_req);
itti_send_msg_to_task(TASK_RRC_GNB, instance, msg_p);
return 0;
}
@@ -670,146 +649,6 @@ int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
getCxt(false, instance)->default_sctp_stream_id);
return 0;
}
/*int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
F1AP_UEContextReleaseCommand_t *container;
F1AP_UEContextReleaseCommandIEs_t *ie;
protocol_ctxt_t ctxt;
DevAssert(pdu);
container = &pdu->choice.initiatingMessage->value.choice.UEContextReleaseCommand;
// GNB_CU_UE_F1AP_ID
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseCommandIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
ctxt.rnti = f1ap_get_rnti_by_cu_id(DUtype, instance, ie->value.choice.GNB_CU_UE_F1AP_ID);
ctxt.instance = instance;
ctxt.module_id = instance;
ctxt.enb_flag = 1;
// GNB_DU_UE_F1AP_ID
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseCommandIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
const rnti_t rnti = f1ap_get_rnti_by_du_id(DUtype, instance,
ie->value.choice.GNB_DU_UE_F1AP_ID);
AssertFatal(ctxt.rnti == rnti,
"RNTI obtained through DU ID (%x) is different from CU ID (%x)\n",
rnti, ctxt.rnti);
int UE_out_of_sync = 0;
if (RC.nrrrc && RC.nrrrc[instance]->node_type == ngran_gNB_DU) {
UE_iterator(RC.nrmac[instance]->UE_info.list, UE) {
if (UE->rnti == rnti) {
UE_out_of_sync = 0;
break;
}
}
if (!UE)
LOG_E(F1AP,"Not found rnti: %x\n", rnti);
} else {
for (int n = 0; n < MAX_MOBILES_PER_ENB; ++n) {
if (RC.mac[instance]->UE_info.active[n] == true
&& rnti == UE_RNTI(instance, n)) {
UE_out_of_sync = RC.mac[instance]->UE_info.UE_sched_ctrl[n].ul_out_of_sync;
break;
}
}
}
// We don't need the Cause
// Optional RRC Container: if present, send to UE
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseCommandIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_RRCContainer, false);
if (ie && !UE_out_of_sync) {
// RRC message and UE is reachable, send message
const sdu_size_t sdu_len = ie->value.choice.RRCContainer.size;
mem_block_t *pdu_p = NULL;
pdu_p = get_free_mem_block(sdu_len, __func__);
memcpy(&pdu_p->data[0], ie->value.choice.RRCContainer.buf, sdu_len);
rlc_op_status_t rlc_status = rlc_data_req(&ctxt
, 1
, MBMS_FLAG_NO
, 1 // SRB 1 correct?
, 0
, 0
, sdu_len
, pdu_p
,NULL
,NULL
);
switch (rlc_status) {
case RLC_OP_STATUS_OK:
break;
case RLC_OP_STATUS_BAD_PARAMETER:
LOG_W(F1AP, "Data sending request over RLC failed with 'Bad Parameter' reason!\n");
break;
case RLC_OP_STATUS_INTERNAL_ERROR:
LOG_W(F1AP, "Data sending request over RLC failed with 'Internal Error' reason!\n");
break;
case RLC_OP_STATUS_OUT_OF_RESSOURCES:
LOG_W(F1AP, "Data sending request over RLC failed with 'Out of Resources' reason!\n");
break;
default:
LOG_W(F1AP, "RLC returned an unknown status code after F1AP placed "
"the order to send some data (Status Code:%d)\n", rlc_status);
break;
}
}
if (RC.nrrrc && RC.nrrrc[instance]->node_type == ngran_gNB_DU) {
// struct rrc_gNB_ue_context_s *ue_context_p;
f1ap_ue_context_release_cplt_t cplt;
cplt.rnti = ctxt.rnti;
DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance, &cplt);
return 0;
} else {
struct rrc_eNB_ue_context_s *ue_context_p;
ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt.instance], ctxt.rnti);
if (ue_context_p && !UE_out_of_sync) {
// UE exists and is in sync so we start a timer before releasing the
// connection
pthread_mutex_lock(&rrc_release_freelist);
for (uint16_t release_num = 0; release_num < NUMBER_OF_UE_MAX; release_num++) {
if (rrc_release_info.RRC_release_ctrl[release_num].flag == 0) {
if (ue_context_p->ue_context.ue_release_timer_s1 > 0)
rrc_release_info.RRC_release_ctrl[release_num].flag = 1;
else
rrc_release_info.RRC_release_ctrl[release_num].flag = 2;
rrc_release_info.RRC_release_ctrl[release_num].rnti = ctxt.rnti;
LOG_D(F1AP, "add rrc_release_info RNTI %x\n", ctxt.rnti);
// TODO: how to provide the correct MUI?
rrc_release_info.RRC_release_ctrl[release_num].rrc_eNB_mui = 0;
rrc_release_info.num_UEs++;
LOG_D(RRC,"Generate DLSCH Release send: index %d rnti %x mui %d flag %d \n",release_num,
ctxt.rnti, 0, rrc_release_info.RRC_release_ctrl[release_num].flag);
break;
}
}
pthread_mutex_unlock(&rrc_release_freelist);
ue_context_p->ue_context.ue_release_timer_s1 = 0;
} else if (ue_context_p && UE_out_of_sync) {
// UE exists and is out of sync, drop the connection
mac_eNB_rrc_ul_failure(instance, 0, 0, 0, rnti);
} else {
LOG_E(F1AP, "no ue_context for RNTI %x, acknowledging release\n", rnti);
}
// TODO send this once the connection has really been released
f1ap_ue_context_release_cplt_t cplt;
cplt.rnti = ctxt.rnti;
DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance, &cplt);
return 0;
}
}*/
int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
uint32_t assoc_id,
@@ -817,7 +656,6 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
F1AP_F1AP_PDU_t *pdu) {
F1AP_UEContextReleaseCommand_t *container;
F1AP_UEContextReleaseCommandIEs_t *ie;
protocol_ctxt_t ctxt;
/* ITTI message to NR-RRC for the case of gNB-DU */
MessageDef *msg_p; // message to NR-RRC
@@ -830,159 +668,48 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
// GNB_CU_UE_F1AP_ID
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseCommandIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
if(RC.nrrrc && RC.nrrrc[instance]->node_type == ngran_gNB_DU){
f1ap_ue_context_release_cmd->rnti = f1ap_get_rnti_by_cu_id(DUtype, instance, ie->value.choice.GNB_CU_UE_F1AP_ID);
}
else{
ctxt.rntiMaybeUEid = f1ap_get_rnti_by_cu_id(DUtype, instance, ie->value.choice.GNB_CU_UE_F1AP_ID);
ctxt.instance = instance;
ctxt.module_id = instance;
ctxt.enb_flag = 1;
}
f1ap_ue_context_release_cmd->rnti = f1ap_get_rnti_by_cu_id(DUtype, instance, ie->value.choice.GNB_CU_UE_F1AP_ID);
// GNB_DU_UE_F1AP_ID
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseCommandIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
const rnti_t rnti = f1ap_get_rnti_by_du_id(DUtype, instance,
ie->value.choice.GNB_DU_UE_F1AP_ID);
if(RC.nrrrc && RC.nrrrc[instance]->node_type == ngran_gNB_DU){
AssertFatal(f1ap_ue_context_release_cmd->rnti == rnti,
"RNTI obtained through DU ID (%x) is different from CU ID (%x)\n",
rnti, f1ap_ue_context_release_cmd->rnti);
}
else{
AssertFatal(ctxt.rntiMaybeUEid == rnti, "RNTI obtained through DU ID (%x) is different from CU ID (%lx)\n", rnti, ctxt.rntiMaybeUEid);
}
int UE_out_of_sync = 0;
if(RC.rrc && RC.rrc[instance]->node_type == ngran_eNB_DU){
for (int n = 0; n < MAX_MOBILES_PER_ENB; ++n) {
if (RC.mac[instance]->UE_info.active[n] == true
&& rnti == UE_RNTI(instance, n)) {
UE_out_of_sync = RC.mac[instance]->UE_info.UE_sched_ctrl[n].ul_out_of_sync;
break;
}
}
}
AssertFatal(f1ap_ue_context_release_cmd->rnti == rnti, "RNTI obtained through DU ID (%x) is different from CU ID (%x)\n", rnti, f1ap_ue_context_release_cmd->rnti);
// We don't need the Cause
// Optional RRC Container: if present, send to UE
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseCommandIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_RRCContainer, false);
if (ie && !UE_out_of_sync && RC.rrc && RC.rrc[instance]->node_type == ngran_eNB_DU) {
// RRC message and UE is reachable, send message
const sdu_size_t sdu_len = ie->value.choice.RRCContainer.size;
mem_block_t *pdu_p = NULL;
pdu_p = get_free_mem_block(sdu_len, __func__);
memcpy(&pdu_p->data[0], ie->value.choice.RRCContainer.buf, sdu_len);
rlc_op_status_t rlc_status = rlc_data_req(&ctxt
, 1
, MBMS_FLAG_NO
, 1 // SRB 1 correct?
, 0
, 0
, sdu_len
, pdu_p
,NULL
,NULL
);
f1ap_ue_context_release_cmd->rrc_container = malloc(ie->value.choice.RRCContainer.size);
memcpy(f1ap_ue_context_release_cmd->rrc_container, ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
switch (rlc_status) {
case RLC_OP_STATUS_OK:
break;
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseCommandIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_Cause, true);
switch (ie->value.choice.Cause.present){
case F1AP_Cause_PR_radioNetwork:
LOG_W (F1AP, "UE context release command cause is due to radioNetwork with specific code: %ld\n",ie->value.choice.Cause.choice.radioNetwork);
f1ap_ue_context_release_cmd->cause = F1AP_CAUSE_RADIO_NETWORK;
break;
case F1AP_Cause_PR_transport:
LOG_W (F1AP, "UE context release command cause is due to transport with specific code: %ld\n",ie->value.choice.Cause.choice.transport);
f1ap_ue_context_release_cmd->cause = F1AP_CAUSE_TRANSPORT;
break;
case F1AP_Cause_PR_protocol:
LOG_W (F1AP, "UE context release command cause is due to protocol with specific code: %ld\n",ie->value.choice.Cause.choice.protocol);
f1ap_ue_context_release_cmd->cause = F1AP_CAUSE_PROTOCOL;
break;
case F1AP_Cause_PR_misc:
LOG_W (F1AP, "UE context release command cause is misc with specific code: %ld \n",ie->value.choice.Cause.choice.misc);
f1ap_ue_context_release_cmd->cause = F1AP_CAUSE_MISC;
break;
default:
LOG_W(F1AP, "Unknown cause for UE context release command\n");
break;
case RLC_OP_STATUS_BAD_PARAMETER:
LOG_W(F1AP, "Data sending request over RLC failed with 'Bad Parameter' reason!\n");
break;
case RLC_OP_STATUS_INTERNAL_ERROR:
LOG_W(F1AP, "Data sending request over RLC failed with 'Internal Error' reason!\n");
break;
case RLC_OP_STATUS_OUT_OF_RESSOURCES:
LOG_W(F1AP, "Data sending request over RLC failed with 'Out of Resources' reason!\n");
break;
default:
LOG_W(F1AP, "RLC returned an unknown status code after F1AP placed "
"the order to send some data (Status Code:%d)\n", rlc_status);
break;
}
}
else if(ie && RC.nrrrc && RC.nrrrc[instance]->node_type == ngran_gNB_DU) {
f1ap_ue_context_release_cmd->rrc_container = malloc(ie->value.choice.RRCContainer.size);
memcpy(f1ap_ue_context_release_cmd->rrc_container,
ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
}
if (RC.nrrrc && RC.nrrrc[instance]->node_type == ngran_gNB_DU) {
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseCommandIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_Cause, true);
switch (ie->value.choice.Cause.present){
case F1AP_Cause_PR_radioNetwork:
LOG_W (F1AP, "UE context release command cause is due to radioNetwork with specific code: %ld\n",ie->value.choice.Cause.choice.radioNetwork);
f1ap_ue_context_release_cmd->cause = F1AP_CAUSE_RADIO_NETWORK;
break;
case F1AP_Cause_PR_transport:
LOG_W (F1AP, "UE context release command cause is due to transport with specific code: %ld\n",ie->value.choice.Cause.choice.transport);
f1ap_ue_context_release_cmd->cause = F1AP_CAUSE_TRANSPORT;
break;
case F1AP_Cause_PR_protocol:
LOG_W (F1AP, "UE context release command cause is due to protocol with specific code: %ld\n",ie->value.choice.Cause.choice.protocol);
f1ap_ue_context_release_cmd->cause = F1AP_CAUSE_PROTOCOL;
break;
case F1AP_Cause_PR_misc:
LOG_W (F1AP, "UE context release command cause is misc with specific code: %ld \n",ie->value.choice.Cause.choice.misc);
f1ap_ue_context_release_cmd->cause = F1AP_CAUSE_MISC;
break;
default:
LOG_W(F1AP, "Unknown cause for UE context release command\n");
break;
}
itti_send_msg_to_task(TASK_RRC_GNB, instance, msg_p);
return 0;
} else {
struct rrc_eNB_ue_context_s *ue_context_p;
ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt.instance], ctxt.rntiMaybeUEid);
if (ue_context_p && !UE_out_of_sync) {
// UE exists and is in sync so we start a timer before releasing the
// connection
pthread_mutex_lock(&rrc_release_freelist);
for (uint16_t release_num = 0; release_num < NUMBER_OF_UE_MAX; release_num++) {
if (rrc_release_info.RRC_release_ctrl[release_num].flag == 0) {
if (ue_context_p->ue_context.ue_release_timer_s1 > 0)
rrc_release_info.RRC_release_ctrl[release_num].flag = 1;
else
rrc_release_info.RRC_release_ctrl[release_num].flag = 2;
rrc_release_info.RRC_release_ctrl[release_num].rnti = ctxt.rntiMaybeUEid;
LOG_D(F1AP, "add rrc_release_info RNTI %lx\n", ctxt.rntiMaybeUEid);
// TODO: how to provide the correct MUI?
rrc_release_info.RRC_release_ctrl[release_num].rrc_eNB_mui = 0;
rrc_release_info.num_UEs++;
LOG_D(RRC, "Generate DLSCH Release send: index %d rnti %lx mui %d flag %d \n", release_num, ctxt.rntiMaybeUEid, 0, rrc_release_info.RRC_release_ctrl[release_num].flag);
break;
}
}
pthread_mutex_unlock(&rrc_release_freelist);
ue_context_p->ue_context.ue_release_timer_s1 = 0;
} else if (ue_context_p && UE_out_of_sync) {
// UE exists and is out of sync, drop the connection
mac_eNB_rrc_ul_failure(instance, 0, 0, 0, rnti);
} else {
LOG_E(F1AP, "no ue_context for RNTI %x, acknowledging release\n", rnti);
}
// TODO send this once the connection has really been released
f1ap_ue_context_release_cplt_t cplt;
cplt.rnti = ctxt.rntiMaybeUEid;
DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance, &cplt);
return 0;
}
itti_send_msg_to_task(TASK_RRC_GNB, instance, msg_p);
return 0;
}
int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
@@ -1199,22 +926,6 @@ int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance,
drb_p->rlc_mode = RLC_MODE_TM;
break;
}
if (!(RC.nrrrc && RC.nrrrc[instance]->node_type == ngran_gNB_DU)) {
transport_layer_addr_t addr;
memcpy(addr.buffer, &drb_p->up_ul_tnl[0].tl_address, sizeof(drb_p->up_ul_tnl[0].tl_address));
addr.length=sizeof(drb_p->up_ul_tnl[0].tl_address)*8;
drb_p->up_dl_tnl[0].teid = newGtpuCreateTunnel(INSTANCE_DEFAULT,
f1ap_ue_context_modification_req->rnti,
drb_p->drb_id,
drb_p->drb_id,
drb_p->up_ul_tnl[0].teid,
-1, // no qfi
addr,
drb_p->up_ul_tnl[0].port,
lteDURecvCb,
NULL);
drb_p->up_dl_tnl_length++;
}
}
}
/* RRC Reconfiguration Complete indicator */
+9 -28
View File
@@ -43,7 +43,6 @@
#include "OCG_extern.h"
#include "RRC/LTE/rrc_extern.h"
#include "RRC/NR/nr_rrc_extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
//#include "LAYER2/MAC/pre_processor.c"
@@ -469,25 +468,9 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
// check threshold
if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 4000) {
// note: probably ul_failure_timer should be less than UE radio link failure time(see T310/N310/N311)
if (NODE_IS_DU(RC.rrc[module_idP]->node_type)) {
MessageDef *m = itti_alloc_new_message(TASK_PHY_ENB, 0, F1AP_UE_CONTEXT_RELEASE_REQ);
F1AP_UE_CONTEXT_RELEASE_REQ(m).rnti = rnti;
F1AP_UE_CONTEXT_RELEASE_REQ(m).cause = F1AP_CAUSE_RADIO_NETWORK;
F1AP_UE_CONTEXT_RELEASE_REQ(m).cause_value = 1; // 1 = F1AP_CauseRadioNetwork_rl_failure
F1AP_UE_CONTEXT_RELEASE_REQ(m).rrc_container = NULL;
F1AP_UE_CONTEXT_RELEASE_REQ(m).rrc_container_length = 0;
itti_send_msg_to_task(TASK_DU_F1, module_idP, m);
} else {
// inform RRC of failure and clear timer
LOG_I(MAC, "UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n",
UE_id,
rnti);
mac_eNB_rrc_ul_failure(module_idP,
CC_id,
frameP,
subframeP,
rnti);
}
// inform RRC of failure and clear timer
LOG_I(MAC, "UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n", UE_id, rnti);
mac_eNB_rrc_ul_failure(module_idP, CC_id, frameP, subframeP, rnti);
UE_info->UE_sched_ctrl[UE_id].ul_failure_timer = 0;
UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync = 1;
@@ -974,14 +957,12 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
} // end for loop on UE_id
#if (!defined(PRE_SCD_THREAD))
if (!NODE_IS_DU(RC.rrc[module_idP]->node_type)) {
void rlc_tick(int, int);
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frameP, subframeP, module_idP);
rlc_tick(frameP, subframeP);
pdcp_run(&ctxt);
pdcp_mbms_run(&ctxt);
rrc_rx_tx(&ctxt, CC_id);
}
void rlc_tick(int, int);
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frameP, subframeP, module_idP);
rlc_tick(frameP, subframeP);
pdcp_run(&ctxt);
pdcp_mbms_run(&ctxt);
rrc_rx_tx(&ctxt, CC_id);
#endif
int do_fembms_si=0;
@@ -36,6 +36,9 @@
#include "nr_mac.h"
#include "common/utils/nr/nr_common.h"
#define NB_SRS_PERIOD (18)
static const uint16_t srs_period[NB_SRS_PERIOD] = { 0, 1, 2, 4, 5, 8, 10, 16, 20, 32, 40, 64, 80, 160, 320, 640, 1280, 2560};
typedef enum {
pusch_dmrs_pos0 = 0,
pusch_dmrs_pos1 = 1,
@@ -44,20 +44,6 @@ extern dci_pdu_rel15_t *def_dci_pdu_rel15;
/* Scheduler */
extern RAN_CONTEXT_t RC;
extern uint8_t nfapi_mode;
extern mac_rlc_am_muilist_t rlc_am_mui;
extern SCHEDULER_MODES global_scheduler_mode;
/*#if defined(PRE_SCD_THREAD)
extern const int cqi_to_mcs[16];
extern uint8_t rb_table[34];
#if defined(PRE_SCD_THREAD)
extern uint16_t pre_nb_rbs_required[2][MAX_NUM_CCs][NUMBER_OF_UE_MAX];
extern uint8_t dlsch_ue_select_tbl_in_use;
extern uint8_t new_dlsch_ue_select_tbl_in_use;
extern bool pre_scd_activeUE[NUMBER_OF_UE_MAX];
extern eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
#endif*/
extern const uint32_t NR_SHORT_BSR_TABLE[NR_SHORT_BSR_TABLE_SIZE];
extern const uint32_t NR_LONG_BSR_TABLE[NR_LONG_BSR_TABLE_SIZE];
+1
View File
@@ -42,6 +42,7 @@
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
#include "SCHED_NR/phy_frame_config_nr.h"
#include "openair1/PHY/defs_gNB.h"
#include "NR_MIB.h"
#include "LAYER2/NR_MAC_COMMON/nr_mac_common.h"
@@ -51,7 +51,6 @@ extern uint16_t sl_ahead;
uint8_t DELTA[4]= {2,3,4,6};
#define MAX_NUMBER_OF_SSB 64
float ssb_per_rach_occasion[8] = {0.125,0.25,0.5,1,2,4,8};
int16_t ssb_index_from_prach(module_id_t module_idP,
@@ -383,7 +383,8 @@ bool allocate_dl_retransmission(module_id_t module_id,
uint16_t *rballoc_mask,
int *n_rb_sched,
NR_UE_info_t *UE,
int current_harq_pid) {
int current_harq_pid)
{
int CC_id = 0;
gNB_MAC_INST *nr_mac = RC.nrmac[module_id];
@@ -408,21 +409,30 @@ bool allocate_dl_retransmission(module_id_t module_id,
const int tda = get_dl_tda(nr_mac, scc, slot);
AssertFatal(tda>=0,"Unable to find PDSCH time domain allocation in list\n");
if (tda == retInfo->time_domain_allocation &&
layers == retInfo->nrOfLayers) {
/* Check first whether the old TDA can be reused
* this helps allocate retransmission when TDA changes (e.g. new nrOfSymbols > old nrOfSymbols) */
NR_tda_info_t temp_tda = nr_get_pdsch_tda_info(dl_bwp, tda);
bool reuse_old_tda = (retInfo->tda_info.startSymbolIndex == temp_tda.startSymbolIndex) && (retInfo->tda_info.nrOfSymbols <= temp_tda.nrOfSymbols);
LOG_D(NR_MAC, "[UE %x] %s old TDA, %s number of layers\n",
UE->rnti,
reuse_old_tda ? "reuse" : "do not reuse",
layers == retInfo->nrOfLayers ? "same" : "different");
NR_tda_info_t *tda_info = &retInfo->tda_info;
if (reuse_old_tda && layers == retInfo->nrOfLayers) {
/* Check that there are enough resources for retransmission */
while (rbSize < retInfo->rbSize) {
rbStart += rbSize; /* last iteration rbSize was not enough, skip it */
rbSize = 0;
const int slbitmap = SL_to_bitmap(tda_info->startSymbolIndex, tda_info->nrOfSymbols);
const uint16_t slbitmap = SL_to_bitmap(retInfo->tda_info.startSymbolIndex, retInfo->tda_info.nrOfSymbols);
while (rbStart < bwpSize && (rballoc_mask[rbStart] & slbitmap) != slbitmap)
rbStart++;
if (rbStart >= bwpSize) {
LOG_D(NR_MAC, "cannot allocate retransmission for RNTI %04x: no resources\n", UE->rnti);
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] could not allocate DL retransmission: no resources\n",
UE->rnti,
frame,
slot);
return false;
}
@@ -434,7 +444,6 @@ bool allocate_dl_retransmission(module_id_t module_id,
} else {
/* the retransmission will use a different time domain allocation, check
* that we have enough resources */
NR_tda_info_t temp_tda = nr_get_pdsch_tda_info(dl_bwp, tda);
NR_pdsch_dmrs_t temp_dmrs = get_dl_dmrs_params(scc,
dl_bwp,
&temp_tda,
@@ -461,7 +470,12 @@ bool allocate_dl_retransmission(module_id_t module_id,
&new_rbSize);
if (!success || new_tbs != retInfo->tb_size) {
LOG_D(MAC, "new TBsize %d of new TDA does not match old TBS %d\n", new_tbs, retInfo->tb_size);
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] allocation of DL retransmission failed: new TBS %d of new TDA does not match old TBS %d\n",
UE->rnti,
frame,
slot,
new_tbs,
retInfo->tb_size);
return false; /* the maximum TBsize we might have is smaller than what we need */
}
@@ -485,8 +499,10 @@ bool allocate_dl_retransmission(module_id_t module_id,
&sched_ctrl->sched_pdcch,
false);
if (CCEIndex<0) {
LOG_D(MAC, "%4d.%2d could not find CCE for DL DCI retransmission RNTI %04x\n",
frame, slot, UE->rnti);
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] could not find free CCE for DL DCI retransmission\n",
UE->rnti,
frame,
slot);
return false;
}
@@ -496,8 +512,7 @@ bool allocate_dl_retransmission(module_id_t module_id,
int r_pucch = nr_get_pucch_resource(sched_ctrl->coreset, ul_bwp->pucch_Config, CCEIndex);
const int alloc = nr_acknack_scheduling(nr_mac, UE, frame, slot, r_pucch, 0);
if (alloc<0) {
LOG_D(MAC,
"could not find PUCCH for UE %04x@%d.%d\n",
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] could not find PUCCH for DL DCI retransmission\n",
UE->rnti,
frame,
slot);
@@ -579,7 +594,10 @@ void pf_dl(module_id_t module_id,
bool r = allocate_dl_retransmission(module_id, frame, slot, rballoc_mask, &n_rb_sched, UE, sched_pdsch->dl_harq_pid);
if (!r) {
LOG_D(NR_MAC, "%4d.%2d retransmission can NOT be allocated\n", frame, slot);
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] DL retransmission could not be allocated\n",
UE->rnti,
frame,
slot);
continue;
}
/* reduce max_num_ue once we are sure UE can be allocated, i.e., has CCE */
@@ -590,7 +608,10 @@ void pf_dl(module_id_t module_id,
* if the UE disconnected in L2sim, in which case the gNB is not notified
* (this can be considered a design flaw) */
if (sched_ctrl->available_dl_harq.head < 0) {
LOG_D(NR_MAC, "RNTI %04x has no free DL HARQ process, skipping\n", UE->rnti);
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] UE has no free DL HARQ process, skipping\n",
UE->rnti,
frame,
slot);
continue;
}
@@ -621,8 +642,14 @@ void pf_dl(module_id_t module_id,
0 /* tb_scaling */,
sched_pdsch->nrOfLayers) >> 3;
float coeff_ue = (float) tbs / UE->dl_thr_ue;
LOG_D(NR_MAC,"UE %04x b %d, thr_ue %f, tbs %d, coeff_ue %f\n",
UE->rnti, b, UE->dl_thr_ue, tbs, coeff_ue);
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] b %d, thr_ue %f, tbs %d, coeff_ue %f\n",
UE->rnti,
frame,
slot,
b,
UE->dl_thr_ue,
tbs,
coeff_ue);
/* Create UE_sched list for UEs eligible for new transmission*/
UE_sched[curUE].coef=coeff_ue;
UE_sched[curUE].UE=UE;
@@ -651,7 +678,10 @@ void pf_dl(module_id_t module_id,
int rbStart = 0; // start wrt BWPstart
if (sched_ctrl->available_dl_harq.head < 0) {
LOG_D(MAC, "RNTI %04x has no free HARQ process, skipping\n", iterator->UE->rnti);
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] UE has no free DL HARQ process, skipping\n",
iterator->UE->rnti,
frame,
slot);
iterator++;
continue;
}
@@ -664,7 +694,10 @@ void pf_dl(module_id_t module_id,
&sched_ctrl->sched_pdcch,
false);
if (CCEIndex<0) {
LOG_D(NR_MAC, "%4d.%2d could not find CCE for DL DCI RNTI %04x\n", frame, slot, rnti);
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] could not find free CCE for DL DCI\n",
rnti,
frame,
slot);
iterator++;
continue;
}
@@ -676,8 +709,7 @@ void pf_dl(module_id_t module_id,
const int alloc = nr_acknack_scheduling(mac, iterator->UE, frame, slot, r_pucch, 0);
if (alloc<0) {
LOG_D(NR_MAC,
"could not find PUCCH for %04x@%d.%d\n",
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] could not find PUCCH for DL DCI\n",
rnti,
frame,
slot);
@@ -35,20 +35,6 @@
#include "LAYER2/NR_MAC_COMMON/nr_mac.h"
#include "executables/softmodem-common.h"
#include "common/utils/nr/nr_common.h"
#include "NR_SCS-SpecificCarrier.h"
#include "NR_TDD-UL-DL-ConfigCommon.h"
#include "NR_FrequencyInfoUL.h"
#include "NR_RACH-ConfigGeneric.h"
#include "NR_RACH-ConfigCommon.h"
#include "NR_PUSCH-TimeDomainResourceAllocation.h"
#include "NR_PUSCH-ConfigCommon.h"
#include "NR_PUCCH-ConfigCommon.h"
#include "NR_PDSCH-TimeDomainResourceAllocation.h"
#include "NR_PDSCH-ConfigCommon.h"
#include "NR_RateMatchPattern.h"
#include "NR_RateMatchPatternLTE-CRS.h"
#include "NR_SearchSpace.h"
#include "NR_ControlResourceSet.h"
//#define UL_HARQ_PRINT
extern RAN_CONTEXT_t RC;
@@ -47,7 +47,6 @@
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
/* TODO REMOVE_DU_RRC: the RRC in the DU is a hack and should be taken out in the future */
#include "RRC/LTE/rrc_extern.h"
#include "RRC/NR/nr_rrc_extern.h"
#include "RRC/NR/rrc_gNB_UE_context.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
@@ -56,11 +55,6 @@
#include "intertask_interface.h"
#include "T.h"
#include "NR_PDCCH-ConfigCommon.h"
#include "NR_ControlResourceSet.h"
#include "NR_SearchSpace.h"
#include "nfapi_nr_interface.h"
#define ENABLE_MAC_PAYLOAD_DEBUG
#define DEBUG_gNB_SCHEDULER 1
@@ -2493,7 +2487,7 @@ void reset_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl) {
add_tail_nr_list(&sched_ctrl->available_dl_harq, harq);
}
for (int i = 0; i < NR_MAX_NB_HARQ_PROCESSES; i++) {
for (int i = 0; i < NR_MAX_HARQ_PROCESSES; i++) {
sched_ctrl->harq_processes[i].feedback_slot = -1;
sched_ctrl->harq_processes[i].round = 0;
sched_ctrl->harq_processes[i].is_waiting = false;
@@ -2512,7 +2506,7 @@ void reset_ul_harq_list(NR_UE_sched_ctrl_t *sched_ctrl) {
add_tail_nr_list(&sched_ctrl->available_ul_harq, harq);
}
for (int i = 0; i < NR_MAX_NB_HARQ_PROCESSES; i++) {
for (int i = 0; i < NR_MAX_HARQ_PROCESSES; i++) {
sched_ctrl->ul_harq_processes[i].feedback_slot = -1;
sched_ctrl->ul_harq_processes[i].round = 0;
sched_ctrl->ul_harq_processes[i].is_waiting = false;
@@ -27,7 +27,6 @@
*/
#include <softmodem-common.h>
#include "LAYER2/MAC/mac.h"
#include "NR_MAC_gNB/nr_mac_gNB.h"
#include "NR_MAC_COMMON/nr_mac_extern.h"
#include "NR_MAC_gNB/mac_proto.h"
@@ -1432,21 +1432,25 @@ static bool allocate_ul_retransmission(gNB_MAC_INST *nrmac,
const uint8_t nrOfLayers = retInfo->nrOfLayers;
LOG_D(NR_MAC,"retInfo->time_domain_allocation = %d, tda = %d\n", retInfo->time_domain_allocation, tda);
LOG_D(NR_MAC,"tbs %d\n",retInfo->tb_size);
if (tda == retInfo->time_domain_allocation &&
nrOfLayers == retInfo->nrOfLayers) {
NR_tda_info_t tda_info = nr_get_pusch_tda_info(&UE->current_UL_BWP, tda);
bool reuse_old_tda = (retInfo->tda_info.startSymbolIndex == tda_info.startSymbolIndex) && (retInfo->tda_info.nrOfSymbols <= tda_info.nrOfSymbols);
if (reuse_old_tda && nrOfLayers == retInfo->nrOfLayers) {
/* Check the resource is enough for retransmission */
const uint16_t slbitmap = SL_to_bitmap(retInfo->tda_info.startSymbolIndex, retInfo->tda_info.nrOfSymbols);
while (rbStart < bwpSize && (rballoc_mask[rbStart] & slbitmap) != slbitmap)
rbStart++;
if (rbStart + retInfo->rbSize > bwpSize) {
LOG_W(NR_MAC, "cannot allocate retransmission of RNTI %04x: no resources (rbStart %d, retInfo->rbSize %d, bwpSize %d\n", UE->rnti, rbStart, retInfo->rbSize, bwpSize);
LOG_W(NR_MAC, "[UE %04x][%4d.%2d] could not allocate UL retransmission: no resources (rbStart %d, retInfo->rbSize %d, bwpSize %d) \n",
UE->rnti,
frame,
slot,
rbStart,
retInfo->rbSize,
bwpSize);
return false;
}
LOG_D(NR_MAC, "%s(): retransmission keeping TDA %d and TBS %d\n", __func__, tda, retInfo->tb_size);
} else {
NR_tda_info_t tda_info = nr_get_pusch_tda_info(&UE->current_UL_BWP, tda);
NR_pusch_dmrs_t dmrs_info = get_ul_dmrs_params(scc,
&UE->current_UL_BWP,
&tda_info,
@@ -1472,7 +1476,12 @@ static bool allocate_ul_retransmission(gNB_MAC_INST *nrmac,
&new_tbs,
&new_rbSize);
if (!success || new_tbs != retInfo->tb_size) {
LOG_D(NR_MAC, "%s(): new TBsize %d of new TDA does not match old TBS %d\n", __func__, new_tbs, retInfo->tb_size);
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] allocation of UL retransmission failed: new TBsize %d of new TDA does not match old TBS %d \n",
UE->rnti,
frame,
slot,
new_tbs,
retInfo->tb_size);
return false; /* the maximum TBsize we might have is smaller than what we need */
}
LOG_D(NR_MAC, "%s(): retransmission with TDA %d->%d and TBS %d -> %d\n", __func__, retInfo->time_domain_allocation, tda, retInfo->tb_size, new_tbs);
@@ -1494,7 +1503,10 @@ static bool allocate_ul_retransmission(gNB_MAC_INST *nrmac,
&sched_ctrl->sched_pdcch,
false);
if (CCEIndex<0) {
LOG_D(NR_MAC, "%4d.%2d no free CCE for retransmission UL DCI UE %04x\n", frame, slot, UE->rnti);
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] no free CCE for retransmission UL DCI UE\n",
UE->rnti,
frame,
slot);
return false;
}
@@ -1594,7 +1606,10 @@ void pf_ul(module_id_t module_id,
const int tda = get_ul_tda(nrmac, scc, sched_pusch->frame, sched_pusch->slot);
bool r = allocate_ul_retransmission(nrmac, frame, slot, rballoc_mask, &n_rb_sched, UE, sched_pusch->ul_harq_pid, scc, tda);
if (!r) {
LOG_D(NR_MAC, "%4d.%2d UL retransmission UE RNTI %04x can NOT be allocated\n", frame, slot, UE->rnti);
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] UL retransmission could not be allocated\n",
UE->rnti,
frame,
slot);
continue;
}
else LOG_D(NR_MAC,"%4d.%2d UL Retransmission UE RNTI %04x to be allocated, max_num_ue %d\n",frame,slot,UE->rnti,max_num_ue);
@@ -1608,7 +1623,10 @@ void pf_ul(module_id_t module_id,
* if the UE disconnected in L2sim, in which case the gNB is not notified
* (this can be considered a design flaw) */
if (sched_ctrl->available_ul_harq.head < 0) {
LOG_D(NR_MAC, "RNTI %04x has no free UL HARQ process, skipping\n", UE->rnti);
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] has no free UL HARQ process, skipping\n",
UE->rnti,
frame,
slot);
continue;
}
@@ -1641,7 +1659,10 @@ void pf_ul(module_id_t module_id,
&sched_ctrl->sched_pdcch,
false);
if (CCEIndex<0) {
LOG_D(NR_MAC, "%4d.%2d no free CCE for UL DCI UE %04x (BSR 0)\n", frame, slot, UE->rnti);
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] no free CCE for UL DCI (BSR 0)\n",
UE->rnti,
frame,
slot);
continue;
}
@@ -1659,8 +1680,13 @@ void pf_ul(module_id_t module_id,
while (rbStart < bwpSize && (rballoc_mask[rbStart] & slbitmap) != slbitmap)
rbStart++;
if (rbStart + min_rb >= bwpSize) {
LOG_W(NR_MAC, "cannot allocate continuous UL data for RNTI %04x: no resources (rbStart %d, min_rb %d, bwpSize %d\n",
UE->rnti,rbStart,min_rb,bwpSize);
LOG_W(NR_MAC, "[UE %04x][%4d.%2d] could not allocate continuous UL data: no resources (rbStart %d, min_rb %d, bwpSize %d)\n",
UE->rnti,
frame,
slot,
rbStart,
min_rb,
bwpSize);
continue;
}
@@ -1698,8 +1724,14 @@ void pf_ul(module_id_t module_id,
/* Calculate coefficient*/
const uint32_t tbs = ul_pf_tbs[current_BWP->mcs_table][sched_pusch->mcs];
float coeff_ue = (float) tbs / UE->ul_thr_ue;
LOG_D(NR_MAC,"rnti %04x b %d, ul_thr_ue %f, tbs %d, coeff_ue %f\n",
UE->rnti, b, UE->ul_thr_ue, tbs, coeff_ue);
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] b %d, ul_thr_ue %f, tbs %d, coeff_ue %f\n",
UE->rnti,
frame,
slot,
b,
UE->ul_thr_ue,
tbs,
coeff_ue);
UE_sched[curUE].coef=coeff_ue;
UE_sched[curUE].UE=UE;
curUE++;
@@ -1721,7 +1753,10 @@ void pf_ul(module_id_t module_id,
false);
if (CCEIndex<0) {
LOG_D(NR_MAC, "%4d.%2d no free CCE for UL DCI UE %04x\n", frame, slot, iterator->UE->rnti);
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] no free CCE for UL DCI\n",
iterator->UE->rnti,
frame,
slot);
iterator++;
continue;
}
@@ -1750,7 +1785,13 @@ void pf_ul(module_id_t module_id,
max_rbSize++;
if (rbStart + min_rb >= bwpSize || max_rbSize < min_rb) {
LOG_D(NR_MAC, "cannot allocate UL data for RNTI %04x: no resources (rbStart %d, min_rb %d, bwpSize %d)\n", iterator->UE->rnti, rbStart, min_rb, bwpSize);
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] could not allocate UL data: no resources (rbStart %d, min_rb %d, bwpSize %d)\n",
iterator->UE->rnti,
frame,
slot,
rbStart,
min_rb,
bwpSize);
iterator++;
continue;
} else
+5 -10
View File
@@ -51,11 +51,8 @@
/* RRC */
#include "NR_BCCH-BCH-Message.h"
#include "NR_CellGroupConfig.h"
#include "NR_ServingCellConfigCommon.h"
#include "NR_MeasConfig.h"
/* PHY */
#include "PHY/defs_gNB.h"
#include "time_meas.h"
/* Interface */
@@ -64,8 +61,6 @@
#include "mac_rrc_ul.h"
/* MAC */
#include "LAYER2/MAC/mac.h"
#include "LAYER2/MAC/mac_proto.h"
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
#include "LAYER2/NR_MAC_COMMON/nr_mac_common.h"
#include "NR_TAG.h"
@@ -80,9 +75,11 @@
/*!\brief Maximum number of random access process */
#define NR_NB_RA_PROC_MAX 4
#define MAX_NUM_OF_SSB 64
#define MAX_NUM_NR_PRACH_PREAMBLES 64
#define MIN_NUM_PRBS_TO_SCHEDULE 5
extern const uint8_t nr_rv_round_map[4];
/*! \brief NR_list_t is a "list" (of users, HARQ processes, slices, ...).
* Especially useful in the scheduler and to keep "classes" of users. */
typedef struct {
@@ -586,7 +583,7 @@ typedef struct {
struct CSI_Report CSI_report;
bool SR;
/// information about every HARQ process
NR_UE_harq_t harq_processes[NR_MAX_NB_HARQ_PROCESSES];
NR_UE_harq_t harq_processes[NR_MAX_HARQ_PROCESSES];
/// HARQ processes that are free
NR_list_t available_dl_harq;
/// HARQ processes that await feedback
@@ -594,7 +591,7 @@ typedef struct {
/// HARQ processes that await retransmission
NR_list_t retrans_dl_harq;
/// information about every UL HARQ process
NR_UE_ul_harq_t ul_harq_processes[NR_MAX_NB_HARQ_PROCESSES];
NR_UE_ul_harq_t ul_harq_processes[NR_MAX_HARQ_PROCESSES];
/// UL HARQ processes that are free
NR_list_t available_ul_harq;
/// UL HARQ processes that await feedback
@@ -671,8 +668,6 @@ typedef struct {
bool Msg3_dcch_dtch;
bool Msg4_ACKed;
uint32_t ra_timer;
/// Sched CSI-RS: scheduling decisions
NR_gNB_UCI_STATS_t uci_statS;
float ul_thr_ue;
float dl_thr_ue;
} NR_UE_info_t;
+57 -136
View File
@@ -138,35 +138,6 @@ extern int oai_exit;
pthread_t pdcp_stats_thread_desc;
bool cu_f1u_data_req(
protocol_ctxt_t *ctxt_pP,
const srb_flag_t srb_flagP,
const rb_id_t rb_id,
const mui_t muiP,
const confirm_t confirmP,
const sdu_size_t sdu_buffer_size,
unsigned char *const sdu_buffer,
const pdcp_transmission_mode_t mode,
const uint32_t *const sourceL2Id,
const uint32_t *const destinationL2Id
) {
mem_block_t *memblock = get_free_mem_block(sdu_buffer_size, __func__);
if (memblock == NULL) {
LOG_E(RLC, "%s:%d:%s: ERROR: get_free_mem_block failed\n", __FILE__, __LINE__, __FUNCTION__);
exit(1);
}
memcpy(memblock->data,sdu_buffer, sdu_buffer_size);
// weird rb id management in 4G, not fully understand (looks bad design)
// overcomplex: if i understand, on the interface DRB start at 4 because there can be SRB 0..3
// but it would be much simpler to use absolute numbering
// instead of this "srb flag" associated to these +/-4
int ret=pdcp_data_ind(ctxt_pP,srb_flagP, false, rb_id-4, sdu_buffer_size, memblock, NULL, NULL);
if (!ret) {
LOG_E(RLC, "%s:%d:%s: ERROR: pdcp_data_ind failed\n", __FILE__, __LINE__, __FUNCTION__);
/* what to do in case of failure? for the moment: nothing */
}
return ret;
}
void *pdcp_stats_thread(void *param) {
FILE *fd;
@@ -204,31 +175,6 @@ uint64_t get_pdcp_optmask(void) {
return pdcp_params.optmask;
}
rlc_op_status_t cu_send_to_du(const protocol_ctxt_t *const ctxt,
const srb_flag_t srb_flag, const MBMS_flag_t MBMS_flag,
const rb_id_t rb_id, const mui_t mui,
confirm_t confirm, sdu_size_t size, mem_block_t *sdu,
const uint32_t *const sourceID, const uint32_t *const destID) {
MessageDef *message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, 0, GTPV1U_TUNNEL_DATA_REQ,
sizeof(gtpv1u_tunnel_data_req_t) +
size + GTPU_HEADER_OVERHEAD_MAX );
AssertFatal(message_p != NULL, "OUT OF MEMORY");
gtpv1u_tunnel_data_req_t *req=&GTPV1U_TUNNEL_DATA_REQ(message_p);
req->buffer = (uint8_t*)(req+1);
memcpy(req->buffer + GTPU_HEADER_OVERHEAD_MAX,
sdu->data,
size );
req->length = size;
req->offset = GTPU_HEADER_OVERHEAD_MAX;
req->ue_id = ctxt->rntiMaybeUEid;
req->bearer_id = rb_id+4;
LOG_D(PDCP, "%s() (drb %ld) sending message to gtp size %d\n",
__func__, rb_id, size);
extern instance_t CUuniqInstance;
itti_send_msg_to_task(TASK_GTPV1_U, CUuniqInstance, message_p);
return true;
}
//-----------------------------------------------------------------------------
/*
* If PDCP_UNIT_TEST is set here then data flow between PDCP and RLC is broken
@@ -326,7 +272,7 @@ bool pdcp_data_req(protocol_ctxt_t *ctxt_pP,
LOG_UI(PDCP, "Before rlc_data_req 1, srb_flagP: %d, rb_idP: %ld \n", srb_flagP, rb_idP);
}
rlc_status = pdcp_params.send_rlc_data_req_func(ctxt_pP, srb_flagP, NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)?MBMS_FLAG_NO:MBMS_FLAG_YES, rb_idP, muiP,
rlc_status = pdcp_params.send_rlc_data_req_func(ctxt_pP, srb_flagP, MBMS_FLAG_YES, rb_idP, muiP,
confirmP, sdu_buffer_sizeP, pdcp_pdu_p,NULL,NULL);
} else {
rlc_status = RLC_OP_STATUS_OUT_OF_RESSOURCES;
@@ -488,98 +434,73 @@ bool pdcp_data_req(protocol_ctxt_t *ctxt_pP,
"[MSG] PDCP DL %s PDU on rb_id %ld\n",(srb_flagP)? "CONTROL" : "DATA", rb_idP);
if ((pdcp_pdu_p!=NULL) && (srb_flagP == 0) && (ctxt_pP->enb_flag == 1)) {
LOG_D(PDCP, "pdcp data req on drb %ld, size %d, rnti %lx, node_type %d \n", rb_idP, pdcp_pdu_size, ctxt_pP->rntiMaybeUEid, RC.rrc ? RC.rrc[ctxt_pP->module_id]->node_type : -1);
LOG_D(PDCP, "pdcp data req on drb %ld, size %d, rnti %lx\n", rb_idP, pdcp_pdu_size, ctxt_pP->rntiMaybeUEid);
if (ctxt_pP->enb_flag == ENB_FLAG_YES && NODE_IS_DU(RC.rrc[ctxt_pP->module_id]->node_type)) {
LOG_E(PDCP, "Can't be DU, bad node type %d \n", RC.rrc[ctxt_pP->module_id]->node_type);
ret = false;
} else {
rlc_status = pdcp_params.send_rlc_data_req_func(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP,
confirmP, pdcp_pdu_size, pdcp_pdu_p,sourceL2Id,
destinationL2Id);
ret = false;
switch (rlc_status) {
case RLC_OP_STATUS_OK:
LOG_D(PDCP, "Data sending request over RLC succeeded!\n");
ret=true;
break;
rlc_status = pdcp_params.send_rlc_data_req_func(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP,
confirmP, pdcp_pdu_size, pdcp_pdu_p,sourceL2Id,
destinationL2Id);
ret = false;
switch (rlc_status) {
case RLC_OP_STATUS_OK:
LOG_D(PDCP, "Data sending request over RLC succeeded!\n");
ret=true;
break;
case RLC_OP_STATUS_BAD_PARAMETER:
LOG_W(PDCP, "Data sending request over RLC failed with 'Bad Parameter' reason!\n");
break;
case RLC_OP_STATUS_BAD_PARAMETER:
LOG_W(PDCP, "Data sending request over RLC failed with 'Bad Parameter' reason!\n");
break;
case RLC_OP_STATUS_INTERNAL_ERROR:
LOG_W(PDCP, "Data sending request over RLC failed with 'Internal Error' reason!\n");
break;
case RLC_OP_STATUS_INTERNAL_ERROR:
LOG_W(PDCP, "Data sending request over RLC failed with 'Internal Error' reason!\n");
break;
case RLC_OP_STATUS_OUT_OF_RESSOURCES:
LOG_W(PDCP, "Data sending request over RLC failed with 'Out of Resources' reason!\n");
break;
case RLC_OP_STATUS_OUT_OF_RESSOURCES:
LOG_W(PDCP, "Data sending request over RLC failed with 'Out of Resources' reason!\n");
break;
default:
LOG_W(PDCP, "RLC returned an unknown status code after PDCP placed the order to send some data (Status Code:%d)\n", rlc_status);
break;
} // switch case
} /* end if node_type is not DU */
default:
LOG_W(PDCP, "RLC returned an unknown status code after PDCP placed the order to send some data (Status Code:%d)\n", rlc_status);
break;
} // switch case
} else { // SRB
if (ctxt_pP->enb_flag == ENB_FLAG_YES && NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) {
// DL transfer
MessageDef *message_p;
// Note: the acyual task must be TASK_PDCP_ENB, but this task is not created
message_p = itti_alloc_new_message (TASK_PDCP_ENB, 0, F1AP_DL_RRC_MESSAGE);
F1AP_DL_RRC_MESSAGE (message_p).rrc_container = &pdcp_pdu_p->data[0] ;
F1AP_DL_RRC_MESSAGE (message_p).rrc_container_length = pdcp_pdu_size;
F1AP_DL_RRC_MESSAGE (message_p).gNB_CU_ue_id = 0;
F1AP_DL_RRC_MESSAGE (message_p).gNB_DU_ue_id = 0;
F1AP_DL_RRC_MESSAGE (message_p).old_gNB_DU_ue_id = 0xFFFFFFFF; // unknown
F1AP_DL_RRC_MESSAGE(message_p).rnti = ctxt_pP->rntiMaybeUEid;
F1AP_DL_RRC_MESSAGE (message_p).srb_id = rb_idP;
F1AP_DL_RRC_MESSAGE (message_p).execute_duplication = 1;
F1AP_DL_RRC_MESSAGE (message_p).RAT_frequency_priority_information.en_dc = 0;
itti_send_msg_to_task (TASK_CU_F1, ctxt_pP->module_id, message_p);
//CU_send_DL_RRC_MESSAGE_TRANSFER(ctxt_pP->module_id, message_p);
LOG_I(PDCP, "Send F1AP_DL_RRC_MESSAGE with ITTI\n");
ret=true;
} else {
rlc_status = rlc_data_req(ctxt_pP
, srb_flagP
, MBMS_FLAG_NO
, rb_idP
, muiP
, confirmP
, pdcp_pdu_size
, pdcp_pdu_p
,NULL
,NULL
);
rlc_status = rlc_data_req(ctxt_pP
, srb_flagP
, MBMS_FLAG_NO
, rb_idP
, muiP
, confirmP
, pdcp_pdu_size
, pdcp_pdu_p
,NULL
,NULL
);
switch (rlc_status) {
case RLC_OP_STATUS_OK:
LOG_D(PDCP, "Data sending request over RLC succeeded!\n");
ret=true;
break;
switch (rlc_status) {
case RLC_OP_STATUS_OK:
LOG_D(PDCP, "Data sending request over RLC succeeded!\n");
ret=true;
break;
case RLC_OP_STATUS_BAD_PARAMETER:
LOG_W(PDCP, "Data sending request over RLC failed with 'Bad Parameter' reason!\n");
ret= false;
break;
case RLC_OP_STATUS_BAD_PARAMETER:
LOG_W(PDCP, "Data sending request over RLC failed with 'Bad Parameter' reason!\n");
ret= false;
break;
case RLC_OP_STATUS_INTERNAL_ERROR:
LOG_W(PDCP, "Data sending request over RLC failed with 'Internal Error' reason!\n");
ret= false;
break;
case RLC_OP_STATUS_INTERNAL_ERROR:
LOG_W(PDCP, "Data sending request over RLC failed with 'Internal Error' reason!\n");
ret= false;
break;
case RLC_OP_STATUS_OUT_OF_RESSOURCES:
LOG_W(PDCP, "Data sending request over RLC failed with 'Out of Resources' reason!\n");
ret= false;
break;
case RLC_OP_STATUS_OUT_OF_RESSOURCES:
LOG_W(PDCP, "Data sending request over RLC failed with 'Out of Resources' reason!\n");
ret= false;
break;
default:
LOG_W(PDCP, "RLC returned an unknown status code after PDCP placed the order to send some data (Status Code:%d)\n", rlc_status);
ret= false;
break;
} // switch case
}
default:
LOG_W(PDCP, "RLC returned an unknown status code after PDCP placed the order to send some data (Status Code:%d)\n", rlc_status);
ret= false;
break;
} // switch case
}
}
-4
View File
@@ -420,10 +420,6 @@ pdcp_data_ind_func_t get_pdcp_data_ind_func(void);
//-----------------------------------------------------------------------------
int pdcp_fifo_flush_mbms_sdus ( const protocol_ctxt_t *const ctxt_pP);
int pdcp_fifo_read_input_mbms_sdus_fromtun ( const protocol_ctxt_t *const ctxt_pP);
rlc_op_status_t cu_send_to_du(const protocol_ctxt_t *const ctxt_pP,
const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP,
const rb_id_t rb_idP, const mui_t muiP,
confirm_t confirmP, sdu_size_t sdu_sizeP, mem_block_t *sdu_pP, const uint32_t *const, const uint32_t *const);
/*
* Following two types are utilized between NAS driver and PDCP
-31
View File
@@ -412,37 +412,6 @@ rb_found:
T(T_ENB_RLC_UL,
T_INT(0 /*ctxt_pP->module_id*/),
T_INT(ue->rnti), T_INT(rb_id), T_INT(size));
const ngran_node_t type = RC.rrc[0 /*ctxt_pP->module_id*/]->node_type;
AssertFatal(!NODE_IS_CU(type),
"Can't be CU, bad node type %d\n", type);
if (NODE_IS_DU(type)) {
if (is_srb == 1) {
MessageDef *msg = itti_alloc_new_message_sized(TASK_RLC_ENB, 0, F1AP_UL_RRC_MESSAGE, sizeof(*msg) + size);
F1AP_UL_RRC_MESSAGE(msg).rrc_container = (uint8_t*)(msg+1);
memcpy(F1AP_UL_RRC_MESSAGE(msg).rrc_container, buf, size);
F1AP_UL_RRC_MESSAGE(msg).rnti = ue->rnti;
F1AP_UL_RRC_MESSAGE(msg).srb_id = rb_id;
F1AP_UL_RRC_MESSAGE(msg).rrc_container_length = size;
itti_send_msg_to_task(TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(0 /*ctxt_pP->module_id*/), msg);
return;
} else {
// Fixme: very dirty workaround of incomplete F1-U implementation
instance_t DUuniqInstance=0;
MessageDef *msg = itti_alloc_new_message_sized(TASK_RLC_ENB, 0, GTPV1U_TUNNEL_DATA_REQ, sizeof(gtpv1u_tunnel_data_req_t) + size);
gtpv1u_tunnel_data_req_t *req=&GTPV1U_TUNNEL_DATA_REQ(msg);
req->buffer=(uint8_t*)(req+1);
memcpy(req->buffer,buf,size);
req->length=size;
req->offset=0;
req->ue_id=ue->rnti;
req->bearer_id=rb_id+4;
LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size);
itti_send_msg_to_task(TASK_GTPV1_U, DUuniqInstance, msg);
return;
}
}
}
memblock = get_free_mem_block(size, __func__);
+1 -3
View File
@@ -111,9 +111,7 @@ void m2ap_MCE_handle_sctp_association_resp(instance_t instance, sctp_new_associa
sctp_new_association_resp->ulp_cnx_id);
if (sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN)
//proto_agent_stop(instance);
//f1ap_handle_setup_message(instance, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
return; // exit -1 for debugging
return;
}
// go to an init func
@@ -75,7 +75,7 @@ int MCE_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id
ie->id = M2AP_ProtocolIE_ID_id_MCE_MBMS_M2AP_ID;
ie->criticality = M2AP_Criticality_reject;
ie->value.present = M2AP_SessionStartRequest_Ies__value_PR_MCE_MBMS_M2AP_ID;
//ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //?
//ie->value.choice.MCE_MBMS_M2AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie);
/* mandatory */
@@ -140,7 +140,7 @@ int MCE_send_MBMS_SESSION_START_REQUEST(instance_t instance/*, uint32_t assoc_id
// ie->id = M2AP_ProtocolIE_ID_id_TNL_Information_1;
// ie->criticality = M2AP_Criticality_reject;
// ie->value.present = M2AP_SessionStartRequest_Ies__value_PR_TNL_Information_1;
// //asn_int642INTEGER(&ie->value.choice.MBMS_Session_ID, f1ap_du_data->MBMS_Session_ID); //?
// //asn_int642INTEGER(&ie->value.choice.MBMS_Session_ID, 0);
// asn1cSeqAdd(&out->protocolIEs.list, ie);
}
@@ -258,7 +258,7 @@ int MCE_send_MBMS_SESSION_STOP_REQUEST(instance_t instance, m2ap_session_stop_re
ie->id = M2AP_ProtocolIE_ID_id_MCE_MBMS_M2AP_ID;
ie->criticality = M2AP_Criticality_reject;
ie->value.present = M2AP_SessionStopRequest_Ies__value_PR_MCE_MBMS_M2AP_ID;
ie->value.choice.MCE_MBMS_M2AP_ID = 0; /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //?
ie->value.choice.MCE_MBMS_M2AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie);
/* mandatory */
@@ -267,7 +267,7 @@ int MCE_send_MBMS_SESSION_STOP_REQUEST(instance_t instance, m2ap_session_stop_re
ie->id = M2AP_ProtocolIE_ID_id_ENB_MBMS_M2AP_ID;
ie->criticality = M2AP_Criticality_reject;
ie->value.present = M2AP_SessionStopRequest_Ies__value_PR_ENB_MBMS_M2AP_ID;
ie->value.choice.ENB_MBMS_M2AP_ID = 0;/*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //?
ie->value.choice.ENB_MBMS_M2AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie);
@@ -1437,7 +1437,7 @@ int MCE_handle_MBMS_SESSION_COUNTING_FAILURE(instance_t instance, module_id_t d
ie->id = M2AP_ProtocolIE_ID_id_MBSFN_Area_ID;
ie->criticality = M2AP_Criticality_reject;
ie->value.present = M2AP_MbmsServiceCountingRequest_Ies__value_PR_MBSFN_Area_ID;
//ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //?
//ie->value.choice.MCE_MBMS_M2AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie);
/* mandatory */
+1 -1
View File
@@ -92,7 +92,7 @@
// //ie->id = M2AP_ProtocolIE_ID_id_gNB_eNB_ID;
// //ie->criticality = M2AP_Criticality_reject;
// //ie->value.present = M2AP_M2SetupRequestIEs__value_PR_GNB_eNB_ID;
// //asn_int642INTEGER(&ie->value.choice.GNB_eNB_ID, f1ap_du_data->gNB_eNB_id);
// //asn_int642INTEGER(&ie->value.choice.GNB_eNB_ID, 0);
// //asn1cSeqAdd(&out->protocolIEs.list, ie);
//
// /* optional */
+12 -12
View File
@@ -234,7 +234,7 @@ int eNB_send_MBMS_SCHEDULING_INFORMATION_RESPONSE(instance_t instance, m2ap_mbms
// ie->id = M2AP_ProtocolIE_ID_id_MCE_MBMS_M2AP_ID;
// ie->criticality = M2AP_Criticality_reject;
// ie->value.present = M2AP_MbmsSchedulingInformationResponse_Ies__value_PR_MCE_MBMS_M2AP_ID;
// //ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //?
// //ie->value.choice.MCE_MBMS_M2AP_ID = 0;
// asn1cSeqAdd(&out->protocolIEs.list, ie);
//
// /* mandatory */
@@ -243,7 +243,7 @@ int eNB_send_MBMS_SCHEDULING_INFORMATION_RESPONSE(instance_t instance, m2ap_mbms
// ie->id = M2AP_ProtocolIE_ID_id_ENB_MBMS_M2AP_ID;
// ie->criticality = M2AP_Criticality_reject;
// ie->value.present = M2AP_MbmsSchedulingInformationResponse_Ies__value_PR_ENB_MBMS_M2AP_ID;
// //ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //?
// //ie->value.choice.MCE_MBMS_M2AP_ID = 0;
// asn1cSeqAdd(&out->protocolIEs.list, ie);
//
@@ -329,7 +329,7 @@ int eNB_send_MBMS_SESSION_START_RESPONSE(instance_t instance, m2ap_session_start
ie->id = M2AP_ProtocolIE_ID_id_MCE_MBMS_M2AP_ID;
ie->criticality = M2AP_Criticality_reject;
ie->value.present = M2AP_SessionStartResponse_Ies__value_PR_MCE_MBMS_M2AP_ID;
//ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //?
//ie->value.choice.MCE_MBMS_M2AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie);
/* mandatory */
@@ -338,7 +338,7 @@ int eNB_send_MBMS_SESSION_START_RESPONSE(instance_t instance, m2ap_session_start
ie->id = M2AP_ProtocolIE_ID_id_ENB_MBMS_M2AP_ID;
ie->criticality = M2AP_Criticality_reject;
ie->value.present = M2AP_SessionStartResponse_Ies__value_PR_ENB_MBMS_M2AP_ID;
//ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //?
//ie->value.choice.MCE_MBMS_M2AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie);
@@ -395,7 +395,7 @@ int eNB_send_MBMS_SESSION_START_FAILURE(instance_t instance, m2ap_session_start_
ie->id = M2AP_ProtocolIE_ID_id_MCE_MBMS_M2AP_ID;
ie->criticality = M2AP_Criticality_reject;
ie->value.present = M2AP_SessionStartFailure_Ies__value_PR_MCE_MBMS_M2AP_ID;
//ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //?
//ie->value.choice.MCE_MBMS_M2AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie);
@@ -493,7 +493,7 @@ int eNB_send_MBMS_SESSION_STOP_RESPONSE(instance_t instance, m2ap_session_stop_r
ie->id = M2AP_ProtocolIE_ID_id_MCE_MBMS_M2AP_ID;
ie->criticality = M2AP_Criticality_reject;
ie->value.present = M2AP_SessionStopResponse_Ies__value_PR_MCE_MBMS_M2AP_ID;
//ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //?
//ie->value.choice.MCE_MBMS_M2AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie);
/* mandatory */
@@ -502,7 +502,7 @@ int eNB_send_MBMS_SESSION_STOP_RESPONSE(instance_t instance, m2ap_session_stop_r
ie->id = M2AP_ProtocolIE_ID_id_ENB_MBMS_M2AP_ID;
ie->criticality = M2AP_Criticality_reject;
ie->value.present = M2AP_SessionStopResponse_Ies__value_PR_ENB_MBMS_M2AP_ID;
//ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //?
//ie->value.choice.MCE_MBMS_M2AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie);
@@ -579,7 +579,7 @@ int eNB_send_M2_SETUP_REQUEST(m2ap_eNB_instance_t *instance_p, m2ap_eNB_data_t*
//ie->id = M2AP_ProtocolIE_ID_id_gNB_eNB_ID;
//ie->criticality = M2AP_Criticality_reject;
//ie->value.present = M2AP_M2SetupRequestIEs__value_PR_GNB_eNB_ID;
//asn_int642INTEGER(&ie->value.choice.GNB_eNB_ID, f1ap_du_data->gNB_eNB_id);
//asn_int642INTEGER(&ie->value.choice.GNB_eNB_ID, 0);
//asn1cSeqAdd(&out->protocolIEs.list, ie);
/* optional */
@@ -1290,7 +1290,7 @@ int eNB_send_MBMS_SERVICE_COUNTING_REPORT(instance_t instance, m2ap_mbms_service
ie->id = M2AP_ProtocolIE_ID_id_MBSFN_Area_ID;
ie->criticality = M2AP_Criticality_reject;
ie->value.present = M2AP_MbmsServiceCountingResultsReport_Ies__value_PR_MBSFN_Area_ID;
//ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //?
//ie->value.choice.MCE_MBMS_M2AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie);
/* mandatory */
@@ -1299,7 +1299,7 @@ int eNB_send_MBMS_SERVICE_COUNTING_REPORT(instance_t instance, m2ap_mbms_service
ie->id = M2AP_ProtocolIE_ID_id_MBMS_Counting_Result_List;
ie->criticality = M2AP_Criticality_reject;
ie->value.present = M2AP_MbmsServiceCountingResultsReport_Ies__value_PR_MBMS_Counting_Result_List;
//ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //?
//ie->value.choice.MCE_MBMS_M2AP_ID = 0;
M2AP_MBMS_Counting_Result_List_t * m2ap_mbms_counting_result_list = &ie->value.choice.MBMS_Counting_Result_List;
M2AP_MBMS_Counting_Result_Item_t * m2ap_mbms_counting_result_item = (M2AP_MBMS_Counting_Result_Item_t*)calloc(1,sizeof(M2AP_MBMS_Counting_Result_Item_t));
@@ -1356,7 +1356,7 @@ int eNB_send_MBMS_SERVICE_COUNTING_RESP(instance_t instance, m2ap_mbms_service_c
ie->id = M2AP_ProtocolIE_ID_id_MCE_MBMS_M2AP_ID;
ie->criticality = M2AP_Criticality_reject;
ie->value.present = M2AP_MbmsServiceCountingResponse_Ies__value_PR_CriticalityDiagnostics;
//ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //?
//ie->value.choice.MCE_MBMS_M2AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie);
if (m2ap_encode_pdu(&pdu, &buffer, &len) < 0) {
@@ -1395,7 +1395,7 @@ int eNB_send_MBMS_SERVICE_COUNTING_FAILURE(instance_t instance, m2ap_mbms_servic
ie->id = M2AP_ProtocolIE_ID_id_ENB_MBMS_M2AP_ID;
ie->criticality = M2AP_Criticality_reject;
ie->value.present = M2AP_MbmsServiceCountingFailure_Ies__value_PR_CriticalityDiagnostics;
//ie->value.choice.MCE_MBMS_M2AP_ID = /*F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);*/ //?
//ie->value.choice.MCE_MBMS_M2AP_ID = 0;
asn1cSeqAdd(&out->protocolIEs.list, ie);
/* mandatory */
+19 -37
View File
@@ -67,7 +67,7 @@ static m2ap_setup_req_t * m2ap_setup_req_local = NULL;
/*------------------------------------------------------------------------------*/
static uint32_t MCE_app_register(ngran_node_t node_type,uint32_t mce_id_start, uint32_t mce_id_end) {
static uint32_t MCE_app_register(uint32_t mce_id_start, uint32_t mce_id_end) {
uint32_t mce_id;
MessageDef *msg_p;
uint32_t register_mce_pending = 0;
@@ -87,17 +87,7 @@ static uint32_t MCE_app_register(ngran_node_t node_type,uint32_t mce_id_start, u
LOG_I(ENB_APP,"[MCE %d] MCE_app_register via M3AP for instance %d\n", mce_id, ENB_MODULE_ID_TO_INSTANCE(mce_id));
itti_send_msg_to_task (TASK_M3AP, ENB_MODULE_ID_TO_INSTANCE(mce_id), msg_p);
//if (NODE_IS_DU(node_type)) { // F1AP registration
// // configure F1AP here for F1C
// LOG_I(ENB_APP,"ngran_eNB_DU: Allocating ITTI message for F1AP_SETUP_REQ\n");
// msg_p = itti_alloc_new_message (TASK_ENB_APP, 0, F1AP_SETUP_REQ);
// RCconfig_DU_F1(msg_p, enb_id);
// LOG_I(ENB_APP,"[eNB %d] eNB_app_register via F1AP for instance %d\n", enb_id, ENB_MODULE_ID_TO_INSTANCE(enb_id));
// itti_send_msg_to_task (TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
// // configure GTPu here for F1U
//}
//else { // S1AP registration
//{ // S1AP registration
// /* note: there is an implicit relationship between the data structure and the message name */
// msg_p = itti_alloc_new_message (TASK_ENB_APP, 0, S1AP_REGISTER_ENB_REQ);
// RCconfig_S1(msg_p, enb_id);
@@ -340,39 +330,37 @@ void *MCE_app_task(void *args_p) {
itti_mark_task_ready (TASK_MCE_APP);
/* Try to register each MCE */
// This assumes that node_type of all RRC instances is the same
if ( EPC_MODE_ENABLED && RC.rrc == NULL )
LOG_E(RRC, "inconsistent global variables\n");
if (EPC_MODE_ENABLED && RC.rrc ) {
register_mce_pending = MCE_app_register(RC.rrc[0]->node_type, mce_id_start, mce_id_end);
register_mce_pending = MCE_app_register(mce_id_start, mce_id_end);
}
/* Try to register each MCE with each other */
// if (is_x2ap_enabled() && !NODE_IS_DU(RC.rrc[0]->node_type)) {
// if (is_x2ap_enabled()) {
// x2_register_enb_pending = MCE_app_register_x2 (enb_id_start, enb_id_end);
// }
// MCE_app_send_MME_APP2(0);
if (is_m2ap_MCE_enabled()) {
RCconfig_MCE();
if (is_m2ap_MCE_enabled() /*&& !NODE_IS_DU(RC.rrc[0]->node_type)*/) {
RCconfig_MCE();
if (!m2ap_mbms_scheduling_information_local)
m2ap_mbms_scheduling_information_local = (m2ap_mbms_scheduling_information_t *)calloc(1, sizeof(m2ap_mbms_scheduling_information_t));
if (m2ap_mbms_scheduling_information_local)
RCconfig_m2_scheduling(m2ap_mbms_scheduling_information_local, 0);
if(!m2ap_mbms_scheduling_information_local)
m2ap_mbms_scheduling_information_local = (m2ap_mbms_scheduling_information_t*)calloc(1,sizeof(m2ap_mbms_scheduling_information_t));
if(m2ap_mbms_scheduling_information_local)
RCconfig_m2_scheduling(m2ap_mbms_scheduling_information_local,0);
if(!m2ap_setup_resp_local)
m2ap_setup_resp_local = (m2ap_setup_resp_t*)calloc(1,sizeof(m2ap_setup_resp_t));
if(m2ap_setup_resp_local)
RCconfig_m2_mcch(m2ap_setup_resp_local,0);
}
if (!m2ap_setup_resp_local)
m2ap_setup_resp_local = (m2ap_setup_resp_t *)calloc(1, sizeof(m2ap_setup_resp_t));
if (m2ap_setup_resp_local)
RCconfig_m2_mcch(m2ap_setup_resp_local, 0);
}
// /* Try to register each MCE with MCE each other */
if (is_m3ap_MCE_enabled() /*&& !NODE_IS_DU(RC.rrc[0]->node_type)*/) {
///*m3_register_mce_pending =*/
MCE_app_register_m3 (mce_id_start, mce_id_end);
}
if (is_m3ap_MCE_enabled()) {
///*m3_register_mce_pending =*/
MCE_app_register_m3(mce_id_start, mce_id_end);
}
do {
// Wait for a message
@@ -390,7 +378,6 @@ void *MCE_app_task(void *args_p) {
break;
case M3AP_REGISTER_MCE_CNF:
//AssertFatal(!NODE_IS_DU(RC.rrc[0]->node_type), "Should not have received S1AP_REGISTER_ENB_CNF\n");
LOG_I(MCE_APP, "[MCE %ld] Received %s: associated MME %d\n", instance, ITTI_MSG_NAME (msg_p),
M3AP_REGISTER_MCE_CNF(msg_p).nb_mme);
DevAssert(register_mce_pending > 0);
@@ -451,12 +438,7 @@ void *MCE_app_task(void *args_p) {
case M3AP_SETUP_RESP:
LOG_I(MCE_APP, "Received M3AP_SETUP_RESP message %s\n", ITTI_MSG_NAME (msg_p));
// //AssertFatal(NODE_IS_DU(RC.rrc[0]->node_type), "Should not have received F1AP_REGISTER_ENB_CNF in CU/MCE\n");
// //LOG_I(MCE_APP, "Received %s: associated ngran_MCE_CU %s with %d cells to activate\n", ITTI_MSG_NAME (msg_p),
// //F1AP_SETUP_RESP(msg_p).gNB_CU_name,F1AP_SETUP_RESP(msg_p).num_cells_to_activate);
//
// //handle_f1ap_setup_resp(&F1AP_SETUP_RESP(msg_p));
// handle_m3ap_setup_resp(&M3AP_SETUP_RESP(msg_p));
// DevAssert(register_mce_pending > 0);
-1
View File
@@ -40,7 +40,6 @@
#include "PHY/impl_defs_top.h"
#include "PHY/defs_eNB.h"
#include "s1ap_messages_types.h"
#include "f1ap_messages_types.h"
#include "LTE_SystemInformationBlockType2.h"
#include "rrc_messages_types.h"
#include "RRC/LTE/rrc_defs.h"
-23
View File
@@ -47,7 +47,6 @@
#include "intertask_interface.h"
#include "openair2/F1AP/f1ap_du_rrc_message_transfer.h"
extern RAN_CONTEXT_t RC;
@@ -302,28 +301,6 @@ mac_rrc_data_ind(
)
//--------------------------------------------------------------------------
{
if (NODE_IS_DU(RC.rrc[module_idP]->node_type)) {
LOG_W(RRC,"[DU %d][RAPROC] Received SDU for CCCH on SRB %ld length %d for UE id %d RNTI %x \n",
module_idP, srb_idP, sdu_lenP, UE_id, rntiP);
/* do ITTI message */
DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(
module_idP,
CC_id,
UE_id,
rntiP,
sduP,
sdu_lenP,
NULL,
0);
struct rrc_eNB_ue_context_s *ue_context_p = rrc_eNB_allocate_new_UE_context(RC.rrc[module_idP]);
ue_context_p->ue_id_rnti = rntiP;
ue_context_p->ue_context.rnti = rntiP;
ue_context_p->ue_context.random_ue_identity = rntiP;
ue_context_p->ue_context.Srb0.Active = 1;
RB_INSERT(rrc_ue_tree_s, &RC.rrc[module_idP]->rrc_ue_head, ue_context_p);
return(0);
}
//SRB_INFO *Srb_info;
protocol_ctxt_t ctxt;
sdu_size_t sdu_size = 0;
-6
View File
@@ -88,12 +88,6 @@ rrc_data_req(
message_p);
LOG_I(RRC,"sent RRC_DCCH_DATA_REQ to TASK_PDCP_ENB\n");
/* Hack: only trigger PDCP if in CU, otherwise it is triggered by RU threads
* Ideally, PDCP would not neet to be triggered like this but react to ITTI
* messages automatically */
if (ctxt_pP->enb_flag && NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type))
pdcp_run(ctxt_pP);
return true; // TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway.
}
-1
View File
@@ -742,7 +742,6 @@ typedef struct {
typedef struct eNB_RRC_INST_s {
/// southbound midhaul configuration
ngran_node_t node_type;
eth_params_t eth_params_s;
char *node_name;
uint32_t node_id;
+364 -701
View File
File diff suppressed because it is too large Load Diff
+39 -53
View File
@@ -276,15 +276,13 @@ static void rrc_M2AP_init_MBMS(
, &(RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message->pmch_InfoList_r9)
,NULL);
if (!NODE_IS_CU(RC.rrc[enb_mod_idP]->node_type)) {
rrc_rlc_config_asn1_req(&ctxt,
NULL, // LTE_SRB_ToAddModList
NULL, // LTE_DRB_ToAddModList
NULL, // DRB_ToReleaseList
&(RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message->pmch_InfoList_r9)
,0, 0
);
}
rrc_rlc_config_asn1_req(&ctxt,
NULL, // LTE_SRB_ToAddModList
NULL, // LTE_DRB_ToAddModList
NULL, // DRB_ToReleaseList
&(RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message->pmch_InfoList_r9)
,0, 0
);
//rrc_mac_config_req();
}
}
@@ -298,8 +296,6 @@ static void rrc_M2AP_init_MCCH(
){
int sync_area = 0;
// initialize RRC_eNB_INST MCCH entry
eNB_RRC_INST *rrc = RC.rrc[enb_mod_idP];
RC.rrc[enb_mod_idP]->carrier[CC_id].MCCH_MESSAGE =
malloc(RC.rrc[enb_mod_idP]->carrier[CC_id].num_mbsfn_sync_area * sizeof(uint8_t *));
@@ -353,13 +349,11 @@ static void rrc_M2AP_init_MCCH(
RC.rrc[enb_mod_idP]->carrier[CC_id].MCCH_MESS_COUNTING[sync_area].Active = 1;
}
if (NODE_IS_MONOLITHIC(rrc->node_type)) {
rrc_mac_config_req_eNB_t tmp = {0};
tmp.CC_id = CC_id;
tmp.pmch_InfoList = &RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message->pmch_InfoList_r9;
tmp.mbms_AreaConfiguration = RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message;
rrc_mac_config_req_eNB(enb_mod_idP, &tmp);
}
rrc_mac_config_req_eNB_t tmp = {0};
tmp.CC_id = CC_id;
tmp.pmch_InfoList = &RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message->pmch_InfoList_r9;
tmp.mbms_AreaConfiguration = RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message;
rrc_mac_config_req_eNB(enb_mod_idP, &tmp);
return;
}
@@ -599,18 +593,16 @@ static uint8_t rrc_M2AP_do_SIB1_MBMS_SIB13(
return(-1);
}
carrier->MBMS_flag =1;
carrier->MBMS_flag = 1;
if (NODE_IS_MONOLITHIC(rrc->node_type)) {
rrc_mac_config_req_eNB_t tmp = {0};
tmp.CC_id = CC_id;
tmp.rnti = 0xfffd;
tmp.mbsfn_SubframeConfigList = carrier->sib2->mbsfn_SubframeConfigList;
tmp.MBMS_Flag = carrier->MBMS_flag;
tmp.mbsfn_AreaInfoList = &carrier->sib13->mbsfn_AreaInfoList_r9;
tmp.FeMBMS_Flag = carrier->FeMBMS_flag;
rrc_mac_config_req_eNB(Mod_id, &tmp);
}
rrc_mac_config_req_eNB_t tmp = {0};
tmp.CC_id = CC_id;
tmp.rnti = 0xfffd;
tmp.mbsfn_SubframeConfigList = carrier->sib2->mbsfn_SubframeConfigList;
tmp.MBMS_Flag = carrier->MBMS_flag;
tmp.mbsfn_AreaInfoList = &carrier->sib13->mbsfn_AreaInfoList_r9;
tmp.FeMBMS_Flag = carrier->FeMBMS_flag;
rrc_mac_config_req_eNB(Mod_id, &tmp);
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB23 = ((enc_rval.encoded+7)/8);
@@ -856,15 +848,13 @@ static uint8_t rrc_M2AP_do_SIB23_SIB2(
return(-1);
}
carrier->MBMS_flag =1;
carrier->MBMS_flag = 1;
if (NODE_IS_MONOLITHIC(rrc->node_type)) {
rrc_mac_config_req_eNB_t tmp = {0};
tmp.CC_id = CC_id;
tmp.mbsfn_SubframeConfigList = carrier->sib2->mbsfn_SubframeConfigList;
tmp.MBMS_Flag = carrier->MBMS_flag;
rrc_mac_config_req_eNB(ctxt_pP->module_id, &tmp);
}
rrc_mac_config_req_eNB_t tmp = {0};
tmp.CC_id = CC_id;
tmp.mbsfn_SubframeConfigList = carrier->sib2->mbsfn_SubframeConfigList;
tmp.MBMS_Flag = carrier->MBMS_flag;
rrc_mac_config_req_eNB(ctxt_pP->module_id, &tmp);
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB23 = ((enc_rval.encoded+7)/8);
@@ -1001,13 +991,11 @@ static uint8_t rrc_M2AP_do_SIB23_SIB13(
return(-1);
}
if (NODE_IS_MONOLITHIC(rrc->node_type)) {
rrc_mac_config_req_eNB_t tmp = {0};
tmp.CC_id = CC_id;
tmp.mbsfn_AreaInfoList = &carrier->sib13->mbsfn_AreaInfoList_r9;
tmp.MBMS_Flag = carrier->MBMS_flag;
rrc_mac_config_req_eNB(ctxt_pP->module_id, &tmp);
}
rrc_mac_config_req_eNB_t tmp = {0};
tmp.CC_id = CC_id;
tmp.mbsfn_AreaInfoList = &carrier->sib13->mbsfn_AreaInfoList_r9;
tmp.MBMS_Flag = carrier->MBMS_flag;
rrc_mac_config_req_eNB(ctxt_pP->module_id, &tmp);
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB23 = ((enc_rval.encoded+7)/8);
@@ -1250,16 +1238,14 @@ static uint8_t rrc_M2AP_do_SIB23_SIB2_SIB13(
return(-1);
}
carrier->MBMS_flag =1;
carrier->MBMS_flag = 1;
if (NODE_IS_MONOLITHIC(rrc->node_type)) {
rrc_mac_config_req_eNB_t tmp = {0};
tmp.CC_id = CC_id;
tmp.mbsfn_SubframeConfigList = carrier->sib2->mbsfn_SubframeConfigList;
tmp.MBMS_Flag = carrier->MBMS_flag;
tmp.mbsfn_AreaInfoList = &carrier->sib13->mbsfn_AreaInfoList_r9;
rrc_mac_config_req_eNB(ctxt_pP->module_id, &tmp);
}
rrc_mac_config_req_eNB_t tmp = {0};
tmp.CC_id = CC_id;
tmp.mbsfn_SubframeConfigList = carrier->sib2->mbsfn_SubframeConfigList;
tmp.MBMS_Flag = carrier->MBMS_flag;
tmp.mbsfn_AreaInfoList = &carrier->sib13->mbsfn_AreaInfoList_r9;
rrc_mac_config_req_eNB(ctxt_pP->module_id, &tmp);
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB23 = ((enc_rval.encoded+7)/8);
-33
View File
@@ -993,39 +993,6 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
//if(ue_context_p->ue_context.reestablishment_cause == ReestablishmentCause_spare1){}
rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(&ctxt,ue_context_p);
}
if (NODE_IS_CU(RC.rrc[ctxt.module_id]->node_type)) {
struct eNB_RRC_INST_s *rrc= RC.rrc[0];
MessageDef *message_p = itti_alloc_new_message (TASK_RRC_ENB, 0, F1AP_UE_CONTEXT_SETUP_REQ);
f1ap_ue_context_setup_t *req=&F1AP_UE_CONTEXT_SETUP_REQ (message_p);
req->gNB_CU_ue_id = 0;
req->gNB_DU_ue_id = 0;
req->rnti = ue_context_p->ue_context.rnti;
req->mcc = rrc->configuration.mcc[0];
req->mnc = rrc->configuration.mnc[0];
req->mnc_digit_length = rrc->configuration.mnc_digit_length[0];
req->nr_cellid = rrc->nr_cellid;
req->srbs_to_be_setup = malloc(sizeof(f1ap_srb_to_be_setup_t));
req->srbs_to_be_setup_length = 1;
f1ap_srb_to_be_setup_t *SRBs=req->srbs_to_be_setup;
SRBs[0].srb_id=CCCH;
req->drbs_to_be_setup_length = S1AP_INITIAL_CONTEXT_SETUP_REQ (msg_p).nb_of_e_rabs;
req->drbs_to_be_setup = malloc(req->drbs_to_be_setup_length * sizeof(f1ap_drb_to_be_setup_t));
f1ap_drb_to_be_setup_t *DRBs=req->drbs_to_be_setup;
for (int i = 0; i < req->drbs_to_be_setup_length ; i++) {
DRBs[i].drb_id=S1AP_INITIAL_CONTEXT_SETUP_REQ (msg_p).e_rab_param[i].e_rab_id;
DRBs[i].rlc_mode = RLC_MODE_AM;
DRBs[i].up_ul_tnl[0].tl_address = inet_addr(rrc->eth_params_s.my_addr);
DRBs[i].up_ul_tnl[0].port=rrc->eth_params_s.my_portd;
DRBs[i].up_ul_tnl_length = 1;
DRBs[i].up_dl_tnl[0].tl_address = inet_addr(rrc->eth_params_s.remote_addr);
DRBs[i].up_dl_tnl[0].port=rrc->eth_params_s.remote_portd;
DRBs[i].up_dl_tnl_length = 1;
}
LOG_I(RRC, "Send F1AP_UE_CONTEXT_SETUP_REQ with ITTI\n");
itti_send_msg_to_task (TASK_CU_F1, 0, message_p);
}
}
return (0);
+1 -3
View File
@@ -28,7 +28,6 @@
* \email: raymond.knopp@eurecom.fr, kroempa@gmail.com
*/
#include <f1ap_du_rrc_message_transfer.h>
#include "platform_types.h"
#include "nr_rrc_defs.h"
#include "nr_rrc_extern.h"
@@ -44,7 +43,6 @@
#include "NR_BCCH-BCH-Message.h"
#include "rrc_gNB_UE_context.h"
#include <openair2/RRC/NR/MESSAGES/asn1_msg.h>
#include <openair2/F1AP/f1ap_du_rrc_message_transfer.h>
extern RAN_CONTEXT_t RC;
@@ -101,7 +99,7 @@ nr_rrc_data_req(
/* Hack: only trigger PDCP if in CU, otherwise it is triggered by RU threads
* Ideally, PDCP would not neet to be triggered like this but react to ITTI
* messages automatically */
if (ctxt_pP->enb_flag && NODE_IS_CU(RC.nrrrc[ctxt_pP->module_id]->node_type))
if (ctxt_pP->enb_flag)
pdcp_run(ctxt_pP);
return true; // TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway.
-1
View File
@@ -39,7 +39,6 @@
#include "asn1_msg.h"
#include "pdcp.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "rrc_eNB_UE_context.h"
#include "common/ran_context.h"
#define DEBUG_NR_RRC 1
+1 -7
View File
@@ -45,8 +45,6 @@
#include "mac_rrc_dl.h"
#include "cucp_cuup_if.h"
//#include "COMMON/mac_rrc_primitives.h"
#include "NR_SIB1.h"
#include "NR_RRCReconfigurationComplete.h"
#include "NR_RRCReconfiguration.h"
@@ -57,11 +55,7 @@
#include "NR_PLMN-IdentityInfo.h"
#include "NR_MCC-MNC-Digit.h"
#include "NR_NG-5G-S-TMSI.h"
//#include "MCCH-Message.h"
//#include "MBSFNAreaConfiguration-r9.h"
//#include "SCellToAddMod-r10.h"
//#include "AS-Config.h"
//#include "AS-Context.h"
#include "NR_UE-NR-Capability.h"
#include "NR_UE-MRDC-Capability.h"
#include "NR_MeasResults.h"
-2
View File
@@ -32,9 +32,7 @@
#define __OPENAIR_NR_RRC_EXTERN_H__
#include "nr_rrc_defs.h"
#include "COMMON/mac_rrc_primitives.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/RLC/rlc.h"
#include "openair2/RRC/LTE/rrc_defs.h"
#include "openair2/RRC/common.h"
#define NR_MAX_SIB_LENGTH 2976 // 3GPP TS 38.331 section 5.2.1 - The physical layer imposes a limit to the maximum size a SIB can take. The maximum SIB1 or SI message size is 2976 bits.
-4
View File
@@ -60,8 +60,6 @@
#include "NR_CellGroupConfig.h"
#include "NR_MeasResults.h"
#include "LTE_UECapabilityInformation.h"
#include "LTE_UL-DCCH-Message.h"
#include "NR_UL-CCCH-Message.h"
#include "NR_RRCSetupRequest-IEs.h"
#include "NR_RRCSetupComplete-IEs.h"
@@ -69,7 +67,6 @@
#include "NR_MIB.h"
#include "rlc.h"
#include "rrc_eNB_UE_context.h"
#include "platform_types.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
@@ -82,7 +79,6 @@
#include "UTIL/OSA/osa_defs.h"
#include "rrc_eNB_S1AP.h"
#include "rrc_gNB_NGAP.h"
#include "rrc_gNB_GTPV1U.h"