Commit 90999e5a authored by Laurent THOMAS's avatar Laurent THOMAS

Fix F1 bugs

parent 1c00e712
...@@ -337,7 +337,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ggdb2 -Wl,-rpath -Wl,${C ...@@ -337,7 +337,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ggdb2 -Wl,-rpath -Wl,${C
# set a flag for changes in the source code # set a flag for changes in the source code
# these changes are related to hardcoded path to include .h files # these changes are related to hardcoded path to include .h files
set(debugOpt "-ggdb2 -DMALLOC_CHECK_=3 -fno-delete-null-pointer-checks") set(debugOpt "-ggdb2 -DMALLOC_CHECK_=3 -fno-delete-null-pointer-checks")
set(CMAKE_C_FLAGS_DEBUG "${debugOpt} -Og") set(CMAKE_C_FLAGS_DEBUG "${debugOpt} -O0")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${debugOpt} -O2") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${debugOpt} -O2")
set(CMAKE_C_FLAGS_RELEASE "-O3") set(CMAKE_C_FLAGS_RELEASE "-O3")
...@@ -378,14 +378,13 @@ set (FIRMWARE_VERSION "No svn information") ...@@ -378,14 +378,13 @@ set (FIRMWARE_VERSION "No svn information")
add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"") add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"")
add_definitions("-DPACKAGE_VERSION=\"Branch: ${GIT_BRANCH} Abrev. Hash: ${GIT_COMMIT_HASH} Date: ${GIT_COMMIT_DATE}\"") add_definitions("-DPACKAGE_VERSION=\"Branch: ${GIT_BRANCH} Abrev. Hash: ${GIT_COMMIT_HASH} Date: ${GIT_COMMIT_DATE}\"")
add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"") add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"")
#add_definitions("-DEMIT_ASN_DEBUG=1")
# Debug related options # Debug related options
######################################### #########################################
add_boolean_option(ASN_DEBUG False "ASN1 coder/decoder Debug") add_boolean_option(ASN_EMIT_DEBUG False "ASN1 coder/decoder Debug")
add_boolean_option(EMIT_ASN_DEBUG False "ASN1 coder/decoder Debug") add_boolean_option(ASN_THREAD_SAFE True "ASN1 coder/decoder Debug")
add_boolean_option(MSG_PRINT False "print debug messages") add_boolean_option(MSG_PRINT True "print debug messages")
add_boolean_option(DISABLE_XER_PRINT False "print XER Format") add_boolean_option(DISABLE_XER_PRINT False "print XER Format")
add_boolean_option(XER_PRINT False "print XER Format") add_boolean_option(XER_PRINT False "print XER Format")
add_boolean_option(RRC_MSG_PRINT False "print RRC messages") add_boolean_option(RRC_MSG_PRINT False "print RRC messages")
...@@ -624,7 +623,7 @@ set(M2AP_C_DIR ${asn1_generated_dir}/M2AP_${M2AP_RELEASE}) ...@@ -624,7 +623,7 @@ set(M2AP_C_DIR ${asn1_generated_dir}/M2AP_${M2AP_RELEASE})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make # Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
if (${RU} STREQUAL 0) if (${RU} STREQUAL 0)
execute_process( execute_process(
COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "M2AP_" "-fno-include-deps -DEMIT_ASN_DEBUG=1" "${M2AP_C_DIR}" "${M2AP_ASN_DIR}/${M2AP_ASN_FILES}" COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "M2AP_" "-fno-include-deps " "${M2AP_C_DIR}" "${M2AP_ASN_DIR}/${M2AP_ASN_FILES}"
RESULT_VARIABLE ret) RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0) if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error") message(FATAL_ERROR "${ret}: error")
...@@ -635,7 +634,7 @@ file(GLOB M2AP_source ${M2AP_C_DIR}/*.c) ...@@ -635,7 +634,7 @@ file(GLOB M2AP_source ${M2AP_C_DIR}/*.c)
add_custom_target ( add_custom_target (
m2_flag ALL m2_flag ALL
COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "M2AP_" "-fno-include-deps -DEMIT_ASN_DEBUG=1" "${M2AP_C_DIR}" "${M2AP_ASN_DIR}/${M2AP_ASN_FILES}" COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "M2AP_" "-fno-include-deps " "${M2AP_C_DIR}" "${M2AP_ASN_DIR}/${M2AP_ASN_FILES}"
DEPENDS ${M2AP_ASN_DIR}/${M2AP_ASN_FILES} DEPENDS ${M2AP_ASN_DIR}/${M2AP_ASN_FILES}
) )
...@@ -815,7 +814,7 @@ set(F1AP_ASN_FILES ...@@ -815,7 +814,7 @@ set(F1AP_ASN_FILES
if (${RU} STREQUAL 0) if (${RU} STREQUAL 0)
set(F1AP_ASN_GENERATED_C_DIR ${asn1_generated_dir}/F1AP_${ASN1RELDIR}) set(F1AP_ASN_GENERATED_C_DIR ${asn1_generated_dir}/F1AP_${ASN1RELDIR})
execute_process( execute_process(
COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "F1AP_" "-findirect-choice -fno-include-deps -Wdebug-compiler -Wdebug-parser" ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES} COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "F1AP_" "-findirect-choice -fno-include-deps" ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}
RESULT_VARIABLE ret RESULT_VARIABLE ret
) )
......
...@@ -114,7 +114,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance, ...@@ -114,7 +114,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
ie4->criticality = F1AP_Criticality_reject; ie4->criticality = F1AP_Criticality_reject;
ie4->value.present = F1AP_UEContextSetupRequestIEs__value_PR_ServCellIndex; ie4->value.present = F1AP_UEContextSetupRequestIEs__value_PR_ServCellIndex;
ie4->value.choice.ServCellIndex = 0; ie4->value.choice.ServCellIndex = 0;
/* optional */ /* optional */
/* c5. CellULConfigured */ /* c5. CellULConfigured */
if (0) { if (0) {
...@@ -204,15 +204,14 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance, ...@@ -204,15 +204,14 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
OCTET_STRING_fromBuf(&ie9->value.choice.ResourceCoordinationTransferContainer, "asdsa1d32sa1d31asd31as", OCTET_STRING_fromBuf(&ie9->value.choice.ResourceCoordinationTransferContainer, "asdsa1d32sa1d31asd31as",
strlen("asdsa1d32sa1d31asd31as")); strlen("asdsa1d32sa1d31asd31as"));
} }
/* mandatory */
/* mandatory */
/* c10. SCell_ToBeSetup_List */ /* c10. SCell_ToBeSetup_List */
asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie10); asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie10);
ie10->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetup_List; ie10->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetup_List;
ie10->criticality = F1AP_Criticality_ignore; ie10->criticality = F1AP_Criticality_ignore;
ie10->value.present = F1AP_UEContextSetupRequestIEs__value_PR_SCell_ToBeSetup_List; ie10->value.present = F1AP_UEContextSetupRequestIEs__value_PR_SCell_ToBeSetup_List;
for (int i=0; i<0; i++) { for (int i=0; i<1; i++) {
// //
asn1cSequenceAdd(ie10->value.choice.SCell_ToBeSetup_List.list, F1AP_SCell_ToBeSetup_ItemIEs_t, scell_toBeSetup_item_ies); asn1cSequenceAdd(ie10->value.choice.SCell_ToBeSetup_List.list, F1AP_SCell_ToBeSetup_ItemIEs_t, scell_toBeSetup_item_ies);
scell_toBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetup_Item; //53 scell_toBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetup_Item; //53
...@@ -397,8 +396,8 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance, ...@@ -397,8 +396,8 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
/* 12.1.2.2 sNSSAI */ /* 12.1.2.2 sNSSAI */
{ {
/* sST */ /* sST */
OCTET_STRING_fromBuf(&DRB_Information->sNSSAI.sST, "asdsa1d32sa1d31asd31as",
strlen("asdsa1d32sa1d31asd31as")); OCTET_STRING_fromBuf(&DRB_Information->sNSSAI.sST, "1", 1);
/* OPTIONAL */ /* OPTIONAL */
/* sD */ /* sD */
......
...@@ -50,9 +50,9 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance, ...@@ -50,9 +50,9 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
F1AP_UEContextSetupRequestIEs_t *ie; F1AP_UEContextSetupRequestIEs_t *ie;
int i; int i;
DevAssert(pdu); DevAssert(pdu);
msg_p = itti_alloc_new_message(TASK_DU_F1, 0, F1AP_UE_CONTEXT_SETUP_REQ); LOG_E(F1AP, "DU_handle_UE_CONTEXT_SETUP_REQUEST() fills a ITTI message F1AP_UE_CONTEXT_SETUP_REQ but it never sends it\n");
f1ap_ue_context_setup_req_t *f1ap_ue_context_setup_req; msg_p = itti_alloc_new_message(TASK_DU_F1, 0, F1AP_UE_CONTEXT_SETUP_REQ);
f1ap_ue_context_setup_req = &F1AP_UE_CONTEXT_SETUP_REQ(msg_p); f1ap_ue_context_setup_req_t *f1ap_ue_context_setup_req = &F1AP_UE_CONTEXT_SETUP_REQ(msg_p);
container = &pdu->choice.initiatingMessage->value.choice.UEContextSetupRequest; container = &pdu->choice.initiatingMessage->value.choice.UEContextSetupRequest;
/* GNB_CU_UE_F1AP_ID */ /* GNB_CU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
...@@ -144,27 +144,29 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance, ...@@ -144,27 +144,29 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
/* correct here */ /* correct here */
f1ap_ue_context_setup_req->rrc_container = malloc(ie->value.choice.RRCContainer.size); f1ap_ue_context_setup_req->rrc_container = malloc(ie->value.choice.RRCContainer.size);
memcpy(f1ap_ue_context_setup_req->rrc_container, ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size); memcpy(f1ap_ue_context_setup_req->rrc_container, ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
// AssertFatal(0, "check configuration, send to appropriate handler\n");
protocol_ctxt_t ctxt;
// ctxt.rnti = f1ap_get_rnti_by_du_id(&f1ap_du_inst[instance], ie->value.choice.GNB_DU_UE_F1AP_ID);
ctxt.rnti = 0x1234;
ctxt.module_id = instance;
ctxt.instance = instance;
ctxt.enb_flag = 1;
if ( ie->value.choice.RRCContainer.size ) {
mem_block_t *pdcp_pdu_p = NULL;
pdcp_pdu_p = get_free_mem_block(ie->value.choice.RRCContainer.size, __func__);
memset(pdcp_pdu_p->data, 0, ie->value.choice.RRCContainer.size);
memcpy(&pdcp_pdu_p->data[0], ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
/* for rfsim */
du_rlc_data_req(&ctxt, 1, 0x00, 1, 1, 0, ie->value.choice.RRCContainer.size, pdcp_pdu_p);
} else {
LOG_E(F1AP, " RRCContainer in UEContextSetupRequestIEs size id 0\n");
}
} else { } else {
LOG_E(F1AP, "can't find RRCContainer in UEContextSetupRequestIEs by id %ld \n", F1AP_ProtocolIE_ID_id_RRCContainer); LOG_E(F1AP, "can't find RRCContainer in UEContextSetupRequestIEs by id %ld \n", F1AP_ProtocolIE_ID_id_RRCContainer);
} }
// AssertFatal(0, "check configuration, send to appropriate handler\n");
protocol_ctxt_t ctxt;
// ctxt.rnti = f1ap_get_rnti_by_du_id(&f1ap_du_inst[instance], ie->value.choice.GNB_DU_UE_F1AP_ID);
ctxt.rnti = 0x1234;
ctxt.module_id = instance;
ctxt.instance = instance;
ctxt.enb_flag = 1;
mem_block_t *pdcp_pdu_p = NULL;
pdcp_pdu_p = get_free_mem_block(ie->value.choice.RRCContainer.size, __func__);
if (pdcp_pdu_p != NULL) {
memset(pdcp_pdu_p->data, 0, ie->value.choice.RRCContainer.size);
memcpy(&pdcp_pdu_p->data[0], ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
/* for rfsim */
du_rlc_data_req(&ctxt, 1, 0x00, 1, 1, 0, ie->value.choice.RRCContainer.size, pdcp_pdu_p);
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment