diff --git a/common/utils/ocp_itti/intertask_interface.h b/common/utils/ocp_itti/intertask_interface.h index a3f447baa3fdf767bba18ce0dfe2c9aff5da3398..3a03e380a1dabceab55e420042b65797a4ae7ef3 100644 --- a/common/utils/ocp_itti/intertask_interface.h +++ b/common/utils/ocp_itti/intertask_interface.h @@ -308,6 +308,7 @@ void *rrc_enb_process_msg(void *); TASK_DEF(TASK_RLC_ENB, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_RRC_ENB_NB_IoT, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_PDCP_ENB, TASK_PRIORITY_MED, 200, NULL, NULL) \ + TASK_DEF(TASK_PDCP_GNB, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_DATA_FORWARDING, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_END_MARKER, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200, NULL,NULL)\ diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index b5cea6bdb99e2c48eafbff91e4ad92f9680ca691..d332b2fc6a87d622d1868c60cf4c8f3f88e43de3 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -736,27 +736,30 @@ static void deliver_sdu_srb(void *_ue, nr_pdcp_entity_t *entity, __FILE__, __LINE__, __FUNCTION__, ue->rnti); exit(1); - srb_found: - { - uint8_t *rrc_buffer_p = entity->is_gnb ? - itti_malloc(TASK_PDCP_ENB, TASK_RRC_GNB, size): - itti_malloc(TASK_PDCP_UE, TASK_RRC_NRUE, size); - MessageDef *message_p; - - AssertFatal(rrc_buffer_p != NULL, "OUT OF MEMORY"); - memcpy(rrc_buffer_p, buf, size); - message_p = entity->is_gnb ? - itti_alloc_new_message(TASK_PDCP_ENB, 0, NR_RRC_DCCH_DATA_IND): - itti_alloc_new_message(TASK_PDCP_UE, 0, NR_RRC_DCCH_DATA_IND); - - AssertFatal(message_p != NULL, "OUT OF MEMORY"); - NR_RRC_DCCH_DATA_IND(message_p).dcch_index = srb_id; - NR_RRC_DCCH_DATA_IND(message_p).sdu_p = rrc_buffer_p; - NR_RRC_DCCH_DATA_IND(message_p).sdu_size = size; - NR_RRC_DCCH_DATA_IND(message_p).rnti = ue->rnti; - - itti_send_msg_to_task(entity->is_gnb ? TASK_RRC_GNB : TASK_RRC_NRUE, 0, message_p); - } +srb_found: + if (entity->is_gnb) { + MessageDef *message_p = itti_alloc_new_message(TASK_PDCP_GNB, 0, F1AP_UL_RRC_MESSAGE); + AssertFatal(message_p != NULL, "OUT OF MEMORY\n"); + f1ap_ul_rrc_message_t *ul_rrc = &F1AP_UL_RRC_MESSAGE(message_p); + ul_rrc->rnti = ue->rnti; + ul_rrc->srb_id = srb_id; + ul_rrc->rrc_container = malloc(size); + AssertFatal(ul_rrc->rrc_container != NULL, "OUT OF MEMORY\n"); + memcpy(ul_rrc->rrc_container, buf, size); + ul_rrc->rrc_container_length = size; + itti_send_msg_to_task(TASK_RRC_GNB, 0, message_p); + } else { + uint8_t *rrc_buffer_p = itti_malloc(TASK_PDCP_UE, TASK_RRC_NRUE, size); + AssertFatal(rrc_buffer_p != NULL, "OUT OF MEMORY\n"); + memcpy(rrc_buffer_p, buf, size); + MessageDef *message_p = itti_alloc_new_message(TASK_PDCP_UE, 0, NR_RRC_DCCH_DATA_IND); + AssertFatal(message_p != NULL, "OUT OF MEMORY\n"); + NR_RRC_DCCH_DATA_IND(message_p).dcch_index = srb_id; + NR_RRC_DCCH_DATA_IND(message_p).sdu_p = rrc_buffer_p; + NR_RRC_DCCH_DATA_IND(message_p).sdu_size = size; + NR_RRC_DCCH_DATA_IND(message_p).rnti = ue->rnti; + itti_send_msg_to_task(TASK_RRC_NRUE, 0, message_p); + } } static void deliver_pdu_srb(void *_ue, nr_pdcp_entity_t *entity, diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 12986bca0c3adf98b153b68255c5db95e27152e5..ca3585169b7a1ea2845f5d3fce0c85fc38de88f3 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -3420,28 +3420,24 @@ void *rrc_gnb_task(void *args_p) { break; /* Messages from PDCP */ - case NR_RRC_DCCH_DATA_IND: + case F1AP_UL_RRC_MESSAGE: PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, GNB_FLAG_YES, - NR_RRC_DCCH_DATA_IND(msg_p).rnti, - msg_p->ittiMsgHeader.lte_time.frame, - msg_p->ittiMsgHeader.lte_time.slot); - LOG_D(NR_RRC,"Decoding DCCH : ue %d, inst %ld, ctxt %p, size %d\n", + F1AP_UL_RRC_MESSAGE(msg_p).rnti, + 0, + 0); + LOG_D(NR_RRC,"Decoding DCCH %d: ue %04x, inst %ld, ctxt %p, size %d\n", + F1AP_UL_RRC_MESSAGE(msg_p).srb_id, ctxt.rnti, instance, &ctxt, - NR_RRC_DCCH_DATA_IND(msg_p).sdu_size); - LOG_D(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" Received on DCCH %d %s\n", - PROTOCOL_NR_RRC_CTXT_UE_ARGS(&ctxt), - NR_RRC_DCCH_DATA_IND(msg_p).dcch_index, - msg_name_p); + F1AP_UL_RRC_MESSAGE(msg_p).rrc_container_length); rrc_gNB_decode_dcch(&ctxt, - NR_RRC_DCCH_DATA_IND(msg_p).dcch_index, - NR_RRC_DCCH_DATA_IND(msg_p).sdu_p, - NR_RRC_DCCH_DATA_IND(msg_p).sdu_size); - result = itti_free(ITTI_MSG_ORIGIN_ID(msg_p), NR_RRC_DCCH_DATA_IND(msg_p).sdu_p); - + F1AP_UL_RRC_MESSAGE(msg_p).srb_id, + F1AP_UL_RRC_MESSAGE(msg_p).rrc_container, + F1AP_UL_RRC_MESSAGE(msg_p).rrc_container_length); + free(F1AP_UL_RRC_MESSAGE(msg_p).rrc_container); break; case NGAP_DOWNLINK_NAS: