Commit 549e72d0 authored by Robert Schmidt's avatar Robert Schmidt

Trigger UL RRC Message through ITTI Message

parent c75fd52e
...@@ -248,10 +248,8 @@ typedef struct f1ap_initial_ul_rrc_message_s { ...@@ -248,10 +248,8 @@ typedef struct f1ap_initial_ul_rrc_message_s {
} f1ap_initial_ul_rrc_message_t; } f1ap_initial_ul_rrc_message_t;
typedef struct f1ap_ul_rrc_message_s { typedef struct f1ap_ul_rrc_message_s {
uint32_t gNB_CU_ue_id;
uint32_t gNB_DU_ue_id;
uint16_t rnti; uint16_t rnti;
uint8_t srb_id; uint8_t srb_id;
uint8_t *rrc_container; uint8_t *rrc_container;
int rrc_container_length; int rrc_container_length;
} f1ap_ul_rrc_message_t; } f1ap_ul_rrc_message_t;
......
...@@ -581,25 +581,19 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -581,25 +581,19 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
} }
int DU_send_UL_RRC_MESSAGE_TRANSFER(const protocol_ctxt_t* const ctxt_pP, int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance, const f1ap_ul_rrc_message_t *msg) {
const rb_id_t rb_idP, const rnti_t rnti = msg->rnti;
const sdu_size_t sdu_sizeP,
const uint8_t *sdu_pP
) {
rnti_t rnti = ctxt_pP->rnti;
F1AP_F1AP_PDU_t pdu; F1AP_F1AP_PDU_t pdu;
F1AP_ULRRCMessageTransfer_t *out; F1AP_ULRRCMessageTransfer_t *out;
F1AP_ULRRCMessageTransferIEs_t *ie; F1AP_ULRRCMessageTransferIEs_t *ie;
uint8_t *buffer; uint8_t *buffer = NULL;
uint32_t len; uint32_t len;
LOG_I(F1AP, "[DU %d] %s: size %d UE RNTI %x in SRB %d\n", LOG_I(F1AP, "[DU %d] %s: size %d UE RNTI %x in SRB %d\n",
ctxt_pP->module_id, __func__, sdu_sizeP, rnti, rb_idP); instance, __func__, msg->rrc_container_length, rnti, msg->srb_id);
/* Create */ /* Create */
/* 0. Message Type */ /* 0. Message Type */
...@@ -618,8 +612,6 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(const protocol_ctxt_t* const ctxt_pP, ...@@ -618,8 +612,6 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(const protocol_ctxt_t* const ctxt_pP,
ie->criticality = F1AP_Criticality_reject; ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID; ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID;
instance_t instance = ctxt_pP->module_id;
ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(&f1ap_du_inst[instance], rnti); ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(&f1ap_du_inst[instance], rnti);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
...@@ -639,7 +631,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(const protocol_ctxt_t* const ctxt_pP, ...@@ -639,7 +631,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(const protocol_ctxt_t* const ctxt_pP,
ie->id = F1AP_ProtocolIE_ID_id_SRBID; ie->id = F1AP_ProtocolIE_ID_id_SRBID;
ie->criticality = F1AP_Criticality_reject; ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_SRBID; ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_SRBID;
ie->value.choice.SRBID = rb_idP; ie->value.choice.SRBID = msg->srb_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
// issue in here // issue in here
...@@ -649,13 +641,13 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(const protocol_ctxt_t* const ctxt_pP, ...@@ -649,13 +641,13 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(const protocol_ctxt_t* const ctxt_pP,
ie->id = F1AP_ProtocolIE_ID_id_RRCContainer; ie->id = F1AP_ProtocolIE_ID_id_RRCContainer;
ie->criticality = F1AP_Criticality_reject; ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_RRCContainer; ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_RRCContainer;
OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, (const char *)sdu_pP, sdu_sizeP); OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer,
(const char *) msg->rrc_container,
msg->rrc_container_length);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
if (rb_idP == 1 || rb_idP == 2) { if (msg->srb_id == 1 || msg->srb_id == 2) {
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context( struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[instance], rnti);
RC.rrc[ctxt_pP->module_id],
rnti);
LTE_UL_DCCH_Message_t* ul_dcch_msg=NULL; LTE_UL_DCCH_Message_t* ul_dcch_msg=NULL;
...@@ -664,7 +656,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(const protocol_ctxt_t* const ctxt_pP, ...@@ -664,7 +656,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(const protocol_ctxt_t* const ctxt_pP,
&asn_DEF_LTE_UL_DCCH_Message, &asn_DEF_LTE_UL_DCCH_Message,
(void**)&ul_dcch_msg, (void**)&ul_dcch_msg,
&ie->value.choice.RRCContainer.buf[1], // buf[0] includes the pdcp header &ie->value.choice.RRCContainer.buf[1], // buf[0] includes the pdcp header
sdu_sizeP,0,0); msg->rrc_container_length, 0, 0);
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0))
LOG_E(F1AP, " Failed to decode UL-DCCH (%zu bytes)\n",dec_rval.consumed); LOG_E(F1AP, " Failed to decode UL-DCCH (%zu bytes)\n",dec_rval.consumed);
...@@ -693,7 +685,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(const protocol_ctxt_t* const ctxt_pP, ...@@ -693,7 +685,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(const protocol_ctxt_t* const ctxt_pP,
case LTE_UL_DCCH_MessageType__c1_PR_rrcConnectionSetupComplete: case LTE_UL_DCCH_MessageType__c1_PR_rrcConnectionSetupComplete:
LOG_I(F1AP, "[MSG] RRC UL rrcConnectionSetupComplete \n"); LOG_I(F1AP, "[MSG] RRC UL rrcConnectionSetupComplete \n");
if(!ue_context_p){ if(!ue_context_p){
LOG_E(F1AP, "Did not find the UE context associated with UE RNTOI %x, ue_context_p is NULL\n", ctxt_pP->rnti); LOG_E(F1AP, "Did not find the UE context associated with UE RNTOI %x, ue_context_p is NULL\n", rnti);
}else { }else {
LOG_I(F1AP, "Processing RRCConnectionSetupComplete UE %x\n", rnti); LOG_I(F1AP, "Processing RRCConnectionSetupComplete UE %x\n", rnti);
ue_context_p->ue_context.Status = RRC_CONNECTED; ue_context_p->ue_context.Status = RRC_CONNECTED;
......
...@@ -39,14 +39,8 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -39,14 +39,8 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu); F1AP_F1AP_PDU_t *pdu);
int DU_send_UL_RRC_MESSAGE_TRANSFER(const protocol_ctxt_t* const ctxt_p, int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance, const f1ap_ul_rrc_message_t *msg);
const rb_id_t rb_id,
const sdu_size_t sdu_size,
const uint8_t *sdu_p);
/*
instance_t instance,
f1ap_ul_rrc_message_t *f1ap_ul_rrc);
*/
int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP, int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
int CC_idP, int CC_idP,
int UE_id, int UE_id,
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "f1ap_handlers.h" #include "f1ap_handlers.h"
#include "f1ap_du_interface_management.h" #include "f1ap_du_interface_management.h"
#include "f1ap_du_ue_context_management.h" #include "f1ap_du_ue_context_management.h"
#include "f1ap_du_rrc_message_transfer.h"
#include "f1ap_du_task.h" #include "f1ap_du_task.h"
#include "proto_agent.h" #include "proto_agent.h"
...@@ -176,9 +177,8 @@ void *F1AP_DU_task(void *arg) { ...@@ -176,9 +177,8 @@ void *F1AP_DU_task(void *arg) {
case F1AP_UL_RRC_MESSAGE: // from rrc case F1AP_UL_RRC_MESSAGE: // from rrc
LOG_I(F1AP, "DU Task Received F1AP_UL_RRC_MESSAGE\n"); LOG_I(F1AP, "DU Task Received F1AP_UL_RRC_MESSAGE\n");
AssertFatal (1 == 0, "Should not be here!\n" ); DU_send_UL_RRC_MESSAGE_TRANSFER(ITTI_MESSAGE_GET_INSTANCE(received_msg),
//DU_send_UL_RRC_MESSAGE_TRANSFER(ITTI_MESSAGE_GET_INSTANCE(received_msg), &F1AP_UL_RRC_MESSAGE(received_msg));
// &F1AP_UL_RRC_MESSAGE(received_msg));
break; break;
case F1AP_UE_CONTEXT_RELEASE_REQ: // from MAC case F1AP_UE_CONTEXT_RELEASE_REQ: // from MAC
......
...@@ -619,11 +619,12 @@ void rlc_data_ind ( ...@@ -619,11 +619,12 @@ void rlc_data_ind (
case ngran_eNB_DU: case ngran_eNB_DU:
case ngran_gNB_DU: case ngran_gNB_DU:
if (srb_flagP == 1) { if (srb_flagP == 1) {
/* TODO do ITTI message */ MessageDef *msg = itti_alloc_new_message(TASK_RLC_ENB, F1AP_UL_RRC_MESSAGE);
DU_send_UL_RRC_MESSAGE_TRANSFER(ctxt_pP, F1AP_UL_RRC_MESSAGE(msg).rnti = ctxt_pP->rnti;
rb_idP, F1AP_UL_RRC_MESSAGE(msg).srb_id = rb_idP;
sdu_sizeP, F1AP_UL_RRC_MESSAGE(msg).rrc_container = sdu_pP->data;
sdu_pP->data); F1AP_UL_RRC_MESSAGE(msg).rrc_container_length = sdu_sizeP;
itti_send_msg_to_task(TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(ctxt_pP->module_id), msg);
} }
else else
proto_agent_send_pdcp_data_ind ( proto_agent_send_pdcp_data_ind (
......
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