Commit b37050ac authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/F1_interop_ACC_n78' into integration_2022_wk25

parents 644422eb 304c92c6
......@@ -251,7 +251,6 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
if (number_dl_pdu>0)
oai_nfapi_dl_tti_req(DL_req);
}
stop_meas(&gNB->schedule_response_stats);
}
......@@ -46,6 +46,8 @@ MESSAGE_DEF(F1AP_DL_RRC_MESSAGE , MESSAGE_PRIORITY_MED, f1ap_dl_rrc
//MESSAGE_DEF(F1AP_INITIAL_CONTEXT_SETUP_REQ , MESSAGE_PRIORITY_MED, f1ap_initial_context_setup_req_t , f1ap_initial_context_setup_req )
MESSAGE_DEF(F1AP_UE_CONTEXT_SETUP_REQ, MESSAGE_PRIORITY_MED, f1ap_ue_context_setup_t, f1ap_ue_context_setup_req)
MESSAGE_DEF(F1AP_UE_CONTEXT_SETUP_RESP, MESSAGE_PRIORITY_MED, f1ap_ue_context_setup_t, f1ap_ue_context_setup_resp)
MESSAGE_DEF(F1AP_UE_CONTEXT_MODIFICATION_REQ, MESSAGE_PRIORITY_MED, f1ap_ue_context_setup_t, f1ap_ue_context_modification_req)
MESSAGE_DEF(F1AP_UE_CONTEXT_MODIFICATION_RESP, MESSAGE_PRIORITY_MED, f1ap_ue_context_setup_t, f1ap_ue_context_modification_resp)
......
......@@ -39,15 +39,15 @@
#define F1AP_INITIAL_UL_RRC_MESSAGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_initial_ul_rrc_message
#define F1AP_UL_RRC_MESSAGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ul_rrc_message
#define F1AP_UE_CONTEXT_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_setup_req
#define F1AP_UE_CONTEXT_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_setup_resp
#define F1AP_UE_CONTEXT_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_setup_resp
#define F1AP_UE_CONTEXT_RELEASE_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_release_resp
#define F1AP_UE_CONTEXT_MODIFICATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_modification_req
#define F1AP_UE_CONTEXT_MODIFICATION_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_modification_resp
#define F1AP_UE_CONTEXT_MODIFICATION_FAIL(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_modification_fail
#define F1AP_DL_RRC_MESSAGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_dl_rrc_message
#define F1AP_UE_CONTEXT_RELEASE_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_release_req
#define F1AP_UE_CONTEXT_RELEASE_CMD(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_release_req
#define F1AP_UE_CONTEXT_MODIFICATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_modification_req
/* Length of the transport layer address string
* 160 bits / 8 bits by char.
......@@ -345,6 +345,35 @@ typedef struct f1ap_rb_failed_to_be_setup_s {
long rb_id;
} f1ap_rb_failed_to_be_setup_t;
typedef struct cu_to_du_rrc_information_s {
uint8_t * cG_ConfigInfo;
uint32_t cG_ConfigInfo_length;
uint8_t * uE_CapabilityRAT_ContainerList;
uint32_t uE_CapabilityRAT_ContainerList_length;
uint8_t * measConfig;
uint32_t measConfig_length;
}cu_to_du_rrc_information_t;
typedef struct du_to_du_rrc_information_s {
uint8_t * cellGroupConfig;
uint8_t cellGroupConfig_length;
uint8_t * measGapConfig;
uint8_t measGapConfig_length;
uint8_t * requestedP_MaxFR1;
uint8_t requestedP_MaxFR1_length;
}du_to_cu_rrc_information_t;
typedef enum QoS_information_e {
NG_RAN_QoS = 0,
EUTRAN_QoS = 1,
} QoS_information_t;
typedef enum ReconfigurationCompl_e {
RRCreconf_info_not_present = 0,
RRCreconf_failure = 1,
RRCreconf_success = 2,
} ReconfigurationCompl_t;
typedef struct f1ap_ue_context_setup_s {
uint32_t gNB_CU_ue_id; // BK: need to replace by use from rnti
uint32_t gNB_DU_ue_id;
......@@ -357,40 +386,27 @@ typedef struct f1ap_ue_context_setup_s {
uint8_t servCellIndex;
uint8_t *cellULConfigured;
uint32_t servCellId;
uint8_t *cu_to_du_rrc_information;
cu_to_du_rrc_information_t *cu_to_du_rrc_information;
uint8_t cu_to_du_rrc_information_length;
uint8_t *du_to_cu_rrc_information;
uint8_t du_to_cu_rrc_information_length;
f1ap_drb_to_be_setup_t *drbs_to_be_setup; // BK: need to replace by s1ap_initial_context_setup_req
uint8_t drbs_to_be_setup_length; // BK: need to replace by s1ap_initial_context_setup_req
//uint8_t *du_to_cu_rrc_information;
du_to_cu_rrc_information_t *du_to_cu_rrc_information;
uint32_t du_to_cu_rrc_information_length;
f1ap_drb_to_be_setup_t *drbs_to_be_setup;
uint8_t drbs_to_be_setup_length;
f1ap_drb_to_be_setup_t *drbs_to_be_modified;
uint8_t drbs_to_be_modified_length;
QoS_information_t QoS_information_type;
uint8_t drbs_failed_to_be_setup_length;
f1ap_rb_failed_to_be_setup_t *drbs_failed_to_be_setup;
f1ap_srb_to_be_setup_t *srbs_to_be_setup;
uint8_t srbs_to_be_setup_length;
uint8_t srbs_failed_to_be_setup_length;
f1ap_rb_failed_to_be_setup_t *srbs_failed_to_be_setup;
s1ap_initial_context_setup_req_t *s1ap_initial_context_setup_req;
// coniatner for the rrc_eNB_generate_SecurityModeCommand message
ReconfigurationCompl_t ReconfigComplOutcome;
uint8_t *rrc_container;
int rrc_container_length;
} f1ap_ue_context_setup_t;
typedef struct f1ap_ue_context_setup_resp_s {
uint32_t gNB_CU_ue_id; // BK: need to replace by use from rnti
uint32_t gNB_DU_ue_id;
uint16_t rnti;
uint8_t du_to_cu_rrc_information[1024 /*Arbitrarily big enough*/];
uint32_t du_to_cu_rrc_information_length;
f1ap_drb_to_be_setup_t *drbs_setup; // BK: need to replace by s1ap_initial_context_setup_req
uint8_t drbs_setup_length; // BK: need to replace by s1ap_initial_context_setup_req
f1ap_srb_to_be_setup_t *srbs_setup;
uint8_t srbs_setup_length;
uint8_t srbs_failed_to_be_setup_length;
f1ap_rb_failed_to_be_setup_t *srbs_failed_to_be_setup;
uint8_t drbs_failed_to_be_setup_length;
f1ap_rb_failed_to_be_setup_t *drbs_failed_to_be_setup;
} f1ap_ue_context_setup_resp_t;
typedef enum F1ap_Cause_e {
F1AP_CAUSE_NOTHING, /* No components present */
F1AP_CAUSE_RADIO_NETWORK,
......
......@@ -27,4 +27,5 @@ MESSAGE_DEF(GTPV1U_ENB_END_MARKER_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_end
MESSAGE_DEF(GTPV1U_ENB_END_MARKER_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_ind_t, Gtpv1uEndMarkerInd)
MESSAGE_DEF(GTPV1U_REQ, MESSAGE_PRIORITY_MED, Gtpv1uReq, gtpv1uReq)
MESSAGE_DEF(GTPV1U_GNB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_gnb_tunnel_data_req_t, NRGtpv1uTunnelDataReq)
MESSAGE_DEF(GTPV1U_GNB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_gnb_tunnel_data_req_t, NRGtpv1uTunnelDataReq)
MESSAGE_DEF(GTPV1U_DU_BUFFER_REPORT_REQ, MESSAGE_PRIORITY_MED, gtpv1u_DU_buffer_report_req_t, NRGtpv1uBufferReportReq)
......@@ -39,6 +39,8 @@
#define GTPV1U_GNB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uTunnelDataReq
#define GTPV1U_DU_BUFFER_REPORT_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uBufferReportReq
#define GTPV1U_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF
typedef struct gtpv1u_enb_create_x2u_tunnel_req_s {
......@@ -213,4 +215,10 @@ typedef struct gtpv1u_gnb_tunnel_data_req_s {
pdusessionid_t pdusession_id;
} gtpv1u_gnb_tunnel_data_req_t;
typedef struct gtpv1u_DU_buffer_report_req_s {
uint32_t buffer_availability;
rnti_t rnti;
pdusessionid_t pdusession_id;
} gtpv1u_DU_buffer_report_req_t;
#endif /* GTPV1_U_MESSAGES_TYPES_H_ */
......@@ -180,6 +180,12 @@ void *F1AP_CU_task(void *arg) {
&F1AP_UE_CONTEXT_SETUP_REQ(received_msg));
break;
case F1AP_UE_CONTEXT_MODIFICATION_REQ:
LOG_I(F1AP, "CU Task received F1AP_UE_CONTEXT_MODIFICATION_REQ\n");
CU_send_UE_CONTEXT_MODIFICATION_REQUEST(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
&F1AP_UE_CONTEXT_MODIFICATION_REQ(received_msg));
break;
case F1AP_UE_CONTEXT_RELEASE_CMD: // from rrc
LOG_I(F1AP, "CU Task Received F1AP_UE_CONTEXT_RELEASE_CMD\n");
CU_send_UE_CONTEXT_RELEASE_COMMAND(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
......
......@@ -72,7 +72,8 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
/*
* UE Context Modification (gNB-CU initiated)
*/
int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance);
int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance,
f1ap_ue_context_setup_t *f1ap_ue_context_modification_req);
int CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
......
......@@ -78,6 +78,10 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu) {
case F1AP_ProcedureCode_id_UEContextSetup:
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextSetup\n", __func__);
break;
case F1AP_ProcedureCode_id_UEContextModification:
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextModification\n", __func__);
break;
// case F1AP_ProcedureCode_id_InitialContextSetup:
// res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
......@@ -123,6 +127,10 @@ static int f1ap_decode_successful_outcome(F1AP_F1AP_PDU_t *pdu) {
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextSetup\n", __func__);
break;
case F1AP_ProcedureCode_id_UEContextModification:
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextModification\n", __func__);
break;
default:
LOG_E(F1AP,"Unknown procedure ID (%d) for successfull outcome message\n",
(int)pdu->choice.successfulOutcome->procedureCode);
......
......@@ -40,7 +40,7 @@
#define ENB_NAME "Eurecom ENB"
#define ENB_NAME_FORMAT (ENB_NAME" %u")
#define F1AP_PORT_NUMBER (30923)
#define F1AP_PORT_NUMBER (38472)
#define F1AP_SCTP_PPID (62)
#endif /* F1AP_DEFAULT_VALUES_H_ */
......@@ -172,7 +172,20 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
MCC_MNC_TO_PLMNID(cell->mcc, cell->mnc, cell->mnc_digit_length, &servedPLMN_item->pLMN_Identity);
// // /* - CHOICE NR-MODE-Info */
F1AP_NR_Mode_Info_t *nR_Mode_Info= &served_cell_information->nR_Mode_Info;
F1AP_ProtocolExtensionContainer_154P34_t *p_154P34=calloc(1,sizeof(* p_154P34));
servedPLMN_item->iE_Extensions = (struct F1AP_ProtocolExtensionContainer *)p_154P34;
asn1cSequenceAdd(p_154P34->list, F1AP_ServedPLMNs_ItemExtIEs_t , served_plmns_itemExtIEs);
served_plmns_itemExtIEs->criticality = F1AP_Criticality_ignore;
served_plmns_itemExtIEs->id = F1AP_ProtocolIE_ID_id_TAISliceSupportList;
served_plmns_itemExtIEs->extensionValue.present = F1AP_ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList;
F1AP_SliceSupportList_t *slice_support_list = &served_plmns_itemExtIEs->extensionValue.choice.SliceSupportList;
asn1cSequenceAdd(slice_support_list->list, F1AP_SliceSupportItem_t, SliceSupport_item);
INT8_TO_OCTET_STRING(1,&SliceSupport_item->sNSSAI.sST);
asn1cCalloc(SliceSupport_item->sNSSAI.sD, tmp);
INT24_TO_OCTET_STRING(10203,tmp);
//INT24_TO_OCTET_STRING(1,tmp);
if (f1ap_req(false, instance)->fdd_flag) { // FDD
nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_fDD;
asn1cCalloc(nR_Mode_Info->choice.fDD, fDD_Info);
......
......@@ -810,6 +810,13 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instanceP,
sdu2P,
sdu2_lenP);
}
/* mandatory */
/* c6. Transaction ID (integer value) */
asn1cSequenceAdd(out->protocolIEs.list, F1AP_InitialULRRCMessageTransferIEs_t, ie6);
ie6->id = F1AP_ProtocolIE_ID_id_TransactionID;
ie6->criticality = F1AP_Criticality_ignore;
ie6->value.present = F1AP_F1SetupRequestIEs__value_PR_TransactionID;
ie6->value.choice.TransactionID = F1AP_get_next_transaction_identifier(f1ap_req(false, instanceP)->gNB_DU_id, f1ap_req(false, instanceP)->gNB_DU_id);
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
......
......@@ -126,7 +126,7 @@ void *F1AP_DU_task(void *arg) {
LOG_I(F1AP, "DU Task Received F1AP_SETUP_REQ\n");
f1ap_setup_req_t *msgSetup=&F1AP_SETUP_REQ(msg);
createF1inst(false, myInstance, msgSetup);
getCxt(DUtype, myInstance)->gtpInst=du_create_gtpu_instance_to_cu(msgSetup->CU_f1_ip_address.ipv4_address,
getCxt(DUtype, myInstance)->gtpInst=du_create_gtpu_instance_to_cu(msgSetup->CU_f1_ip_address.ipv4_address, //"172.21.6.9", //"172.21.10.9",//"172.21.9.5", //msgSetup->CU_f1_ip_address.ipv4_address, //"192.168.18.91"
msgSetup->CUport,
msgSetup->DU_f1_ip_address.ipv4_address,
msgSetup->DUport);
......@@ -175,7 +175,7 @@ void *F1AP_DU_task(void *arg) {
break;
case F1AP_UL_RRC_MESSAGE: // to rrc
LOG_I(F1AP, "DU Task Received F1AP_UL_RRC_MESSAGE\n");
LOG_D(F1AP, "DU Task Received F1AP_UL_RRC_MESSAGE\n");
if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_DU) {
DU_send_UL_NR_RRC_MESSAGE_TRANSFER(myInstance,
......@@ -191,6 +191,11 @@ void *F1AP_DU_task(void *arg) {
DU_send_UE_CONTEXT_SETUP_RESPONSE(myInstance, &F1AP_UE_CONTEXT_SETUP_RESP(msg));
break;
case F1AP_UE_CONTEXT_MODIFICATION_RESP:
LOG_I(F1AP, "DU task received itti message from RRC for F1AP_UE_CONTEXT_MODIFICATION_RESP message generation \n");
DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(myInstance, &F1AP_UE_CONTEXT_MODIFICATION_RESP(msg));
break;
case F1AP_UE_CONTEXT_RELEASE_REQ: // from MAC
LOG_I(F1AP, "DU Task Received F1AP_UE_CONTEXT_RELEASE_REQ\n");
DU_send_UE_CONTEXT_RELEASE_REQUEST(myInstance,
......
......@@ -74,7 +74,7 @@ int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance);
int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, f1ap_ue_context_setup_t *resp);
int DU_send_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance);
......
......@@ -33,7 +33,7 @@
#include "f1ap_common.h"
#include "f1ap_encoder.h"
int asn1_encoder_xer_print = 1;
int asn1_encoder_xer_print = 0;
int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length) {
ssize_t encoded;
......
......@@ -50,7 +50,7 @@ f1ap_message_processing_t f1ap_messages_processing[][3] = {
{ DU_handle_gNB_CU_CONFIGURATION_UPDATE, CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE, CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE }, /* gNBCUConfigurationUpdate */
{ DU_handle_UE_CONTEXT_SETUP_REQUEST, CU_handle_UE_CONTEXT_SETUP_RESPONSE, 0 }, /* UEContextSetup */
{ DU_handle_UE_CONTEXT_RELEASE_COMMAND, CU_handle_UE_CONTEXT_RELEASE_COMPLETE, 0 }, /* UEContextRelease */
{ 0, 0, 0 }, /* UEContextModification */
{ DU_handle_UE_CONTEXT_MODIFICATION_REQUEST, CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE, 0 }, /* UEContextModification */
{ 0, 0, 0 }, /* UEContextModificationRequired */
{ 0, 0, 0 }, /* UEMobilityCommand */
{ CU_handle_UE_CONTEXT_RELEASE_REQUEST, 0, 0 }, /* UEContextReleaseRequest */
......
......@@ -32,7 +32,7 @@ void f1ap_itti_send_sctp_data_req(bool isCu, instance_t instance, uint8_t *buffe
sctp_data_req->buffer = buffer;
sctp_data_req->buffer_length = buffer_length;
sctp_data_req->stream = stream;
LOG_I(F1AP, "Sending ITTI message to SCTP Task\n");
LOG_D(F1AP, "Sending ITTI message to SCTP Task\n");
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
}
......
......@@ -1955,9 +1955,38 @@ int RCconfig_NR_DU_F1(MessageDef *msg_p, uint32_t i) {
f1Setup->measurement_timing_information[k] = "0";
f1Setup->ranac[k] = 0;
f1Setup->mib[k] = rrc->carrier.MIB;
f1Setup->sib1[k] = rrc->carrier.SIB1;
f1Setup->mib_length[k] = rrc->carrier.sizeof_MIB;
f1Setup->sib1_length[k] = rrc->carrier.sizeof_SIB1;
NR_BCCH_DL_SCH_Message_t *bcch_message = NULL;
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
&asn_DEF_NR_BCCH_DL_SCH_Message,
(void **)&bcch_message,
(const void *)rrc->carrier.SIB1,
rrc->carrier.sizeof_SIB1);
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
LOG_E(RRC,"SIB1 decode error\n");
// free the memory
SEQUENCE_free( &asn_DEF_NR_BCCH_DL_SCH_Message, bcch_message, 1 );
exit(1);
}
NR_SIB1_t *bcch_SIB1 = bcch_message->message.choice.c1->choice.systemInformationBlockType1;
f1Setup->sib1[k] = calloc(1,rrc->carrier.sizeof_SIB1);
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_SIB1,
NULL,
(void *)bcch_SIB1,
f1Setup->sib1[k],
NR_MAX_SIB_LENGTH/8);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
//if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
LOG_I(NR_RRC, "SIB1 container to be integrated in F1 Setup request:\n");
xer_fprint(stdout, &asn_DEF_NR_SIB1,(void *)bcch_message->message.choice.c1->choice.systemInformationBlockType1 );
//}
f1Setup->sib1_length[k] = (enc_rval.encoded+7)/8;
break;
}
}
......
......@@ -24,3 +24,4 @@
*/
long nr_get_Pcmax(module_id_t mod_id);
/** @}*/
......@@ -1530,6 +1530,11 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
if (ra->Msg4_frame == frameP && ra->Msg4_slot == slotP ) {
if (nr_mac_rrc_check_RRCSetup(module_idP, ra->rnti) <= 0){
ra->Msg4_frame++;
return;
}
uint8_t time_domain_assignment = 0;
uint8_t mcsIndex = 0;
......
......@@ -1915,7 +1915,6 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot)
UE->CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup) {
pucch_Config = UE->CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup;
}
else continue;
if (!pucch_Config->schedulingRequestResourceToAddModList)
continue;
......
......@@ -36,6 +36,7 @@
#include <openair2/UTIL/OPT/opt.h>
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
extern void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_sched_ctrl_t *sched_ctrl);
int get_dci_format(NR_UE_sched_ctrl_t *sched_ctrl) {
......
......@@ -274,9 +274,8 @@ static void do_pdcp_data_ind(
if (rb != NULL) {
rb->recv_pdu(rb, (char *)sdu_buffer->data, sdu_buffer_size);
} else {
LOG_E(PDCP, "%s:%d:%s: fatal: no RB found (rb_id %ld, srb_flag %d)\n",
LOG_E(PDCP, "%s:%d:%s: no RB found (rb_id %ld, srb_flag %d)\n",
__FILE__, __LINE__, __FUNCTION__, rb_id, srb_flagP);
exit(1);
}
nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
......
......@@ -77,14 +77,15 @@ nr_rlc_entity_t *new_nr_rlc_entity_am(
ret->sn_modulus = 1 << ret->sn_field_length;
ret->window_size = ret->sn_modulus / 2;
ret->common.recv_pdu = nr_rlc_entity_am_recv_pdu;
ret->common.buffer_status = nr_rlc_entity_am_buffer_status;
ret->common.generate_pdu = nr_rlc_entity_am_generate_pdu;
ret->common.recv_sdu = nr_rlc_entity_am_recv_sdu;
ret->common.set_time = nr_rlc_entity_am_set_time;
ret->common.discard_sdu = nr_rlc_entity_am_discard_sdu;
ret->common.reestablishment = nr_rlc_entity_am_reestablishment;
ret->common.delete = nr_rlc_entity_am_delete;
ret->common.recv_pdu = nr_rlc_entity_am_recv_pdu;
ret->common.buffer_status = nr_rlc_entity_am_buffer_status;
ret->common.generate_pdu = nr_rlc_entity_am_generate_pdu;
ret->common.recv_sdu = nr_rlc_entity_am_recv_sdu;
ret->common.set_time = nr_rlc_entity_am_set_time;
ret->common.discard_sdu = nr_rlc_entity_am_discard_sdu;
ret->common.reestablishment = nr_rlc_entity_am_reestablishment;
ret->common.delete = nr_rlc_entity_am_delete;
ret->common.available_tx_space = nr_rlc_entity_am_available_tx_space;
ret->common.deliver_sdu = deliver_sdu;
ret->common.deliver_sdu_data = deliver_sdu_data;
......@@ -127,14 +128,15 @@ nr_rlc_entity_t *new_nr_rlc_entity_um(
ret->sn_modulus = 1 << ret->sn_field_length;
ret->window_size = ret->sn_modulus / 2;
ret->common.recv_pdu = nr_rlc_entity_um_recv_pdu;
ret->common.buffer_status = nr_rlc_entity_um_buffer_status;
ret->common.generate_pdu = nr_rlc_entity_um_generate_pdu;
ret->common.recv_sdu = nr_rlc_entity_um_recv_sdu;
ret->common.set_time = nr_rlc_entity_um_set_time;
ret->common.discard_sdu = nr_rlc_entity_um_discard_sdu;
ret->common.reestablishment = nr_rlc_entity_um_reestablishment;
ret->common.delete = nr_rlc_entity_um_delete;
ret->common.recv_pdu = nr_rlc_entity_um_recv_pdu;
ret->common.buffer_status = nr_rlc_entity_um_buffer_status;
ret->common.generate_pdu = nr_rlc_entity_um_generate_pdu;
ret->common.recv_sdu = nr_rlc_entity_um_recv_sdu;
ret->common.set_time = nr_rlc_entity_um_set_time;
ret->common.discard_sdu = nr_rlc_entity_um_discard_sdu;
ret->common.reestablishment = nr_rlc_entity_um_reestablishment;
ret->common.delete = nr_rlc_entity_um_delete;
ret->common.available_tx_space = nr_rlc_entity_um_available_tx_space;
ret->common.deliver_sdu = deliver_sdu;
ret->common.deliver_sdu_data = deliver_sdu_data;
......@@ -158,14 +160,15 @@ nr_rlc_entity_t *new_nr_rlc_entity_tm(
ret->tx_maxsize = tx_maxsize;
ret->common.recv_pdu = nr_rlc_entity_tm_recv_pdu;
ret->common.buffer_status = nr_rlc_entity_tm_buffer_status;
ret->common.generate_pdu = nr_rlc_entity_tm_generate_pdu;
ret->common.recv_sdu = nr_rlc_entity_tm_recv_sdu;
ret->common.set_time = nr_rlc_entity_tm_set_time;
ret->common.discard_sdu = nr_rlc_entity_tm_discard_sdu;
ret->common.reestablishment = nr_rlc_entity_tm_reestablishment;
ret->common.delete = nr_rlc_entity_tm_delete;
ret->common.recv_pdu = nr_rlc_entity_tm_recv_pdu;
ret->common.buffer_status = nr_rlc_entity_tm_buffer_status;
ret->common.generate_pdu = nr_rlc_entity_tm_generate_pdu;
ret->common.recv_sdu = nr_rlc_entity_tm_recv_sdu;
ret->common.set_time = nr_rlc_entity_tm_set_time;
ret->common.discard_sdu = nr_rlc_entity_tm_discard_sdu;
ret->common.reestablishment = nr_rlc_entity_tm_reestablishment;
ret->common.delete = nr_rlc_entity_tm_delete;
ret->common.available_tx_space = nr_rlc_entity_tm_available_tx_space;
ret->common.deliver_sdu = deliver_sdu;
ret->common.deliver_sdu_data = deliver_sdu_data;
......
......@@ -50,6 +50,8 @@ typedef struct nr_rlc_entity_t {
void (*delete)(struct nr_rlc_entity_t *entity);
int (*available_tx_space)(struct nr_rlc_entity_t *entity);
/* callbacks provided to the RLC module */
void (*deliver_sdu)(void *deliver_sdu_data, struct nr_rlc_entity_t *entity,
char *buf, int size);
......
......@@ -1910,3 +1910,9 @@ void nr_rlc_entity_am_delete(nr_rlc_entity_t *_entity)
clear_entity(entity);
free(entity);
}
int nr_rlc_entity_am_available_tx_space(nr_rlc_entity_t *_entity)
{
nr_rlc_entity_am_t *entity = (nr_rlc_entity_am_t *)_entity;
return entity->tx_maxsize - entity->tx_size;
}
......@@ -99,5 +99,6 @@ void nr_rlc_entity_am_set_time(nr_rlc_entity_t *entity, uint64_t now);
void nr_rlc_entity_am_discard_sdu(nr_rlc_entity_t *_entity, int sdu_id);
void nr_rlc_entity_am_reestablishment(nr_rlc_entity_t *_entity);
void nr_rlc_entity_am_delete(nr_rlc_entity_t *entity);
int nr_rlc_entity_am_available_tx_space(nr_rlc_entity_t *entity);
#endif /* _NR_RLC_ENTITY_AM_H_ */
......@@ -174,3 +174,9 @@ void nr_rlc_entity_tm_delete(nr_rlc_entity_t *_entity)
clear_entity(entity);
free(entity);
}
int nr_rlc_entity_tm_available_tx_space(nr_rlc_entity_t *_entity)
{
nr_rlc_entity_tm_t *entity = (nr_rlc_entity_tm_t *)_entity;
return entity->tx_maxsize - entity->tx_size;
}
......@@ -51,5 +51,6 @@ void nr_rlc_entity_tm_set_time(nr_rlc_entity_t *entity, uint64_t now);
void nr_rlc_entity_tm_discard_sdu(nr_rlc_entity_t *_entity, int sdu_id);
void nr_rlc_entity_tm_reestablishment(nr_rlc_entity_t *_entity);
void nr_rlc_entity_tm_delete(nr_rlc_entity_t *entity);
int nr_rlc_entity_tm_available_tx_space(nr_rlc_entity_t *entity);
#endif /* _NR_RLC_ENTITY_TM_H_ */
......@@ -695,3 +695,9 @@ void nr_rlc_entity_um_delete(nr_rlc_entity_t *_entity)
clear_entity(entity);
free(entity);
}
int nr_rlc_entity_um_available_tx_space(nr_rlc_entity_t *_entity)
{
nr_rlc_entity_um_t *entity = (nr_rlc_entity_um_t *)_entity;
return entity->tx_maxsize - entity->tx_size;
}
......@@ -75,5 +75,6 @@ void nr_rlc_entity_um_set_time(nr_rlc_entity_t *entity, uint64_t now);
void nr_rlc_entity_um_discard_sdu(nr_rlc_entity_t *_entity, int sdu_id);
void nr_rlc_entity_um_reestablishment(nr_rlc_entity_t *_entity);
void nr_rlc_entity_um_delete(nr_rlc_entity_t *entity);
int nr_rlc_entity_um_available_tx_space(nr_rlc_entity_t *entity);
#endif /* _NR_RLC_ENTITY_UM_H_ */
......@@ -101,6 +101,7 @@ void nr_drb_config(struct NR_RLC_Config *rlc_Config, NR_RLC_Config_PR rlc_config
switch (rlc_config_pr){
case NR_RLC_Config_PR_um_Bi_Directional:
// RLC UM Bi-directional Bearer configuration
LOG_I(RLC, "RLC UM Bi-directional Bearer configuration selected \n");
rlc_Config->choice.um_Bi_Directional = calloc(1, sizeof(*rlc_Config->choice.um_Bi_Directional));
rlc_Config->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength = calloc(1, sizeof(*rlc_Config->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength));
*rlc_Config->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength = NR_SN_FieldLengthUM_size12;
......@@ -213,10 +214,12 @@ tbs_size_t mac_rlc_data_req(
}
if (rb != NULL) {
LOG_D(RLC, "MAC PDU to get created for channel_idP:%d \n", channel_idP);
rb->set_time(rb, nr_rlc_current_time);
maxsize = tb_sizeP;
ret = rb->generate_pdu(rb, buffer_pP, maxsize);
} else {
LOG_D(RLC, "MAC PDU failed to get created for channel_idP:%d \n", channel_idP);
ret = 0;
}
......@@ -394,6 +397,35 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP,
return RLC_OP_STATUS_OK;
}
int nr_rlc_get_available_tx_space(
const rnti_t rntiP,
const logical_chan_id_t channel_idP)
{
nr_rlc_ue_t *ue;
nr_rlc_entity_t *rb;
int ret;
nr_rlc_manager_lock(nr_rlc_ue_manager);
ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, rntiP);
switch (channel_idP) {
case 1 ... 3: rb = ue->srb[channel_idP - 1]; break;
case 4 ... 8: rb = ue->drb[channel_idP - 4]; break;
default: rb = NULL; break;
}
if (rb != NULL) {
ret = rb->available_tx_space(rb);
} else {
LOG_E(RLC, "[%s] Radio Bearer (channel ID %d) is NULL for UE with rntiP %x\n", __FUNCTION__, channel_idP, rntiP);
ret = -1;
}
nr_rlc_manager_unlock(nr_rlc_ue_manager);
return ret;
}
int rlc_module_init(int enb_flag)
{
static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
......
......@@ -46,4 +46,8 @@ void nr_rlc_bearer_init(NR_RLC_BearerConfig_t *RLC_BearerConfig, NR_RLC_BearerCo
void nr_drb_config(struct NR_RLC_Config *rlc_Config, NR_RLC_Config_PR rlc_config_pr);
void nr_rlc_bearer_init_ul_spec(struct NR_LogicalChannelConfig *mac_LogicalChannelConfig);
\ No newline at end of file
void nr_rlc_bearer_init_ul_spec(struct NR_LogicalChannelConfig *mac_LogicalChannelConfig);
int nr_rlc_get_available_tx_space(
const rnti_t rntiP,
const logical_chan_id_t channel_idP);
......@@ -1065,3 +1065,15 @@ void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
sdu_sizeP,
sdu_pP, NULL, NULL);
}
/* HACK to be removed: nr_rlc_get_available_tx_space is needed by
* openair3/ocp-gtpu/gtp_itf.cpp which is compiled in lte-softmodem
* so let's put a dummy nr_rlc_get_available_tx_space here
*/
int nr_rlc_get_available_tx_space(
const rnti_t rntiP,
const logical_chan_id_t channel_idP)
{
abort();
return 0;
}
......@@ -306,6 +306,14 @@ int8_t nr_mac_rrc_bwp_switch_req(const module_id_t module_idP,
return 0;
}
int8_t nr_mac_rrc_check_RRCSetup(const module_id_t Mod_idP,
const rnti_t rnti) {
struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[Mod_idP], rnti);
char payload_size = ue_context_p->ue_context.Srb0.Tx_buffer.payload_size;
return payload_size;
}
int8_t nr_mac_rrc_data_ind(const module_id_t module_idP,
const int CC_id,
const frame_t frameP,
......
......@@ -1950,7 +1950,7 @@ NR_RLC_BearerConfig_t *get_DRB_RLC_BearerConfig(long lcChannelId, long drbId, NR
return rlc_BearerConfig;
}
void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup, int use_rlc_um_for_drb, uint8_t configure_srb, uint8_t bearer_id_start, uint8_t nb_bearers_to_setup, long *priority ) {
void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup, int use_rlc_um_for_drb, uint8_t configure_srb, uint8_t bearer_id_start, uint8_t nb_bearers_to_setup, long *priority) {
cellGroupConfig->cellGroupId = 0;
cellGroupConfig->rlc_BearerToReleaseList = NULL;
......
......@@ -447,7 +447,8 @@ typedef struct {
NR_BCCH_BCH_Message_t mib;
NR_BCCH_BCH_Message_t *mib_DU;
NR_BCCH_DL_SCH_Message_t *siblock1_DU;
NR_SIB1_t *siblock1_DU;
//NR_BCCH_DL_SCH_Message_t *siblock1_DU;
NR_SIB1_t *sib1;
NR_SIB2_t *sib2;
NR_SIB3_t *sib3;
......
......@@ -120,7 +120,7 @@ rrc_gNB_generate_SecurityModeCommand(
rrc_gNB_ue_context_t *const ue_context_pP
);
uint8_t
uint8_t
rrc_gNB_get_next_transaction_identifier(
module_id_t gnb_mod_idP
);
......@@ -163,6 +163,12 @@ nr_rrc_data_req(
const pdcp_transmission_mode_t modeP
);
int8_t nr_mac_rrc_check_RRCSetup(
const module_id_t Mod_idP,
const rnti_t rnti
);
int
nr_rrc_mac_remove_ue(module_id_t mod_idP,
rnti_t rntiP);
......@@ -209,7 +215,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release(
void
rrc_gNB_generate_dedicatedRRCReconfiguration(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *ue_context_pP);
rrc_gNB_ue_context_t *ue_context_pP,
NR_CellGroupConfig_t *cell_groupConfig_from_DU);
rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP,
const NR_SRB_ToAddModList_t * const srb2add_listP,
......
This diff is collapsed.
......@@ -307,7 +307,6 @@ nr_rrc_pdcp_config_security(
//uint8_t *k_kdf = NULL;
static int print_keys= 1;
/* Derive the keys from kgnb */
if (SRB_configList != NULL) {
nr_derive_key_up_enc(ue_context_pP->ue_context.ciphering_algorithm,
......@@ -1050,7 +1049,46 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(
// TEST
// ue_context_p->ue_context.pdusession[0].status = PDU_SESSION_STATUS_DONE;
// rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(&ctxt, ue_context_p, 0);
rrc_gNB_generate_dedicatedRRCReconfiguration(&ctxt, ue_context_p);
if(!NODE_IS_CU(RC.nrrrc[ctxt.module_id]->node_type)){
rrc_gNB_generate_dedicatedRRCReconfiguration(&ctxt, ue_context_p, NULL);
}
else{
/*Generate a UE context modification request message towards the DU to instruct the DU
*for SRB2 and DRB configuration and get the updates on master cell group config from the DU*/
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_MODIFICATION_REQ);
f1ap_ue_context_setup_t *req=&F1AP_UE_CONTEXT_MODIFICATION_REQ (message_p);
req->rnti = ue_context_p->ue_context.rnti;
req->mcc = RC.nrrrc[ctxt.module_id]->configuration.mcc[0];
req->mnc = RC.nrrrc[ctxt.module_id]->configuration.mnc[0];
req->mnc_digit_length = RC.nrrrc[ctxt.module_id]->configuration.mnc_digit_length[0];
req->nr_cellid = RC.nrrrc[ctxt.module_id]->nr_cellid;
/*Instruction towards the DU for SRB2 configuration*/
req->srbs_to_be_setup = malloc(1*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 = 2;
SRBs[0].lcid = 2;
/*Instruction towards the DU for DRB configuration and tunnel creation*/
gtpv1u_gnb_create_tunnel_req_t create_tunnel_req;
memset(&create_tunnel_req, 0, sizeof(gtpv1u_gnb_create_tunnel_req_t));
req->drbs_to_be_setup = malloc(1*sizeof(f1ap_drb_to_be_setup_t));
req->drbs_to_be_setup_length = 1;
f1ap_drb_to_be_setup_t *DRBs=req->drbs_to_be_setup;
LOG_D(RRC, "Length of DRB list:%d \n", req->drbs_to_be_setup_length);
DRBs[0].drb_id = 1;
DRBs[0].rlc_mode = RLC_MODE_AM;
DRBs[0].up_ul_tnl[0].tl_address = inet_addr(RC.nrrrc[ctxt.module_id]->eth_params_s.my_addr);
DRBs[0].up_ul_tnl[0].port=RC.nrrrc[ctxt.module_id]->eth_params_s.my_portd;
DRBs[0].up_ul_tnl_length = 1;
DRBs[0].up_dl_tnl[0].tl_address = inet_addr(RC.nrrrc[ctxt.module_id]->eth_params_s.remote_addr);
DRBs[0].up_dl_tnl[0].port=RC.nrrrc[ctxt.module_id]->eth_params_s.remote_portd;
DRBs[0].up_dl_tnl_length = 1;
itti_send_msg_to_task (TASK_CU_F1, ctxt.module_id, message_p);
}
return(0);
}
}
......
......@@ -80,7 +80,6 @@ typedef struct {
uint8_t kgnb[32];
} ue_sa_security_key_t;
typedef enum fgs_protocol_discriminator_e {
/* Protocol discriminator identifier for 5GS Mobility Management */
FGS_MOBILITY_MANAGEMENT_MESSAGE = 0x7E,
......
......@@ -70,8 +70,8 @@
/* Convert an integer on 16 bits to the given bUFFER */
#define INT16_TO_BUFFER(x, buf) \
do { \
(buf)[0] = (x) >> 8; \
(buf)[1] = (x); \
(buf)[0] = ((x) >> 8) & 0xff; \
(buf)[1] = (x) & 0xff; \
} while(0)
/* Convert an array of char containing vALUE to x */
......@@ -84,9 +84,9 @@ do { \
/* Convert an integer on 24 bits to the given bUFFER */
#define INT24_TO_BUFFER(x, buf) \
do { \
(buf)[0] = (x) >> 16; \
(buf)[1] = (x) >> 8; \
(buf)[2] = (x); \
(buf)[0] = ((x) >> 16) & 0xff;\
(buf)[1] = ((x) >> 8) & 0xff; \
(buf)[2] = (x) & 0xff; \
} while(0)
/* Convert an array of char containing vALUE to x */
......@@ -101,10 +101,10 @@ do { \
/* Convert an integer on 32 bits to the given bUFFER */
#define INT32_TO_BUFFER(x, buf) \
do { \
(buf)[0] = (x) >> 24; \
(buf)[1] = (x) >> 16; \
(buf)[2] = (x) >> 8; \
(buf)[3] = (x); \
(buf)[0] = ((x) >> 24) & 0xff;\
(buf)[1] = ((x) >> 16) & 0xff;\
(buf)[2] = ((x) >> 8) & 0xff; \
(buf)[3] = (x) & 0xff; \
} while(0)
/* Convert an array of char containing vALUE to x */
......
This diff is collapsed.
......@@ -43,6 +43,11 @@ typedef struct openAddr_s {
instance_t originInstance;
} openAddr_t;
typedef struct extensionHeader_s{
uint8_t buffer[500];
uint8_t length;
}extensionHeader_t;
// the init function create a gtp instance and return the gtp instance id
// the parameter originInstance will be sent back in each message from gtp to the creator
void gtpv1uReceiver(int h);
......
......@@ -339,4 +339,7 @@ log_config :
ngap_log_level ="debug";
f1ap_log_level ="debug";
};
<<<<<<< HEAD
=======
>>>>>>> origin/develop
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