diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index a067e6083e..febb1cf343 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -144,8 +144,8 @@ nr_rrc_data_ind_ccch( //------------------------------------------------------------------------------ { rb_id_t DCCH_index = Srb_id; - LOG_I(RRC, "[UE %x] Frame %d: received a CCCH %ld message on SRB %d with Size %d from gNB %d\n", - ctxt_pP->module_id, ctxt_pP->frame, DCCH_index,Srb_id,sdu_sizeP, ctxt_pP->eNB_index); + LOG_I(RRC, "[UE %x] Frame %d: received a CCCH %ld message on SRB %ld with Size %d from gNB %d\n", + ctxt_pP->module_id, ctxt_pP->frame, DCCH_index, Srb_id, sdu_sizeP, ctxt_pP->eNB_index); { MessageDef *message_p; // Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling). @@ -502,7 +502,7 @@ uint64_t pdcp_module_init(uint64_t _pdcp_optmask) } return pdcp_optmask ; } -static int liuyu=0; + static void deliver_sdu_drb(protocol_ctxt_t *ctxt_pP,void *_ue, nr_pdcp_entity_t *entity, char *buf, int size) { @@ -515,32 +515,10 @@ static void deliver_sdu_drb(protocol_ctxt_t *ctxt_pP,void *_ue, nr_pdcp_entity_t int i; if (1) { //(IS_SOFTMODEM_NOS1){ - #if 0 - log_dump(PDCP,buf,size,LOG_DUMP_CHAR," PDCP Received SDU:\n"); - if (size > 4700) - { - LOG_I(PDCP,"maybe ip data \n"); - } - else - { - LOG_I(PDCP,"send to gNB RRC \n"); - - if(liuyu==2) - liuyu=1; - if(liuyu==0) - nr_rrc_data_ind_ccch( ctxt_pP, 1, size, buf); - if(liuyu==1) - nr_rrc_data_ind( ctxt_pP, 1, size, buf); - - liuyu++; - - } - #else len = write(nas_sock_fd[0], buf, size); if (len != size) { LOG_E(PDCP, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__); } - #endif } else{ for (i = 0; i < 5; i++) { @@ -628,24 +606,19 @@ static void deliver_sdu_srb(protocol_ctxt_t *ctxt_pP, void *_ue, nr_pdcp_entity_ { /* Implementation to be added */ - nr_pdcp_ue_t *ue = _ue; - MessageDef *message_p; - uint8_t *gtpu_buffer_p; - int srb_id; - int i; + // nr_pdcp_ue_t *ue = _ue; + // MessageDef *message_p; + // uint8_t *gtpu_buffer_p; + // int srb_id; if (ccch_or_dcch == 0) { - nr_rrc_data_ind_ccch( ctxt_pP, 1, size, buf); + nr_rrc_data_ind_ccch( ctxt_pP, 1, size, (uint8_t *)buf); ccch_or_dcch = 1; } else { - nr_rrc_data_ind( ctxt_pP, 1, size, buf); + nr_rrc_data_ind( ctxt_pP, 1, size, (uint8_t *)buf); } - - return; } - - static void deliver_pdu_srb(void *_ue, nr_pdcp_entity_t *entity, char *buf, int size, int sdu_id) { @@ -793,7 +766,7 @@ boolean_t pdcp_data_ind( if (NODE_IS_DU(RC.nrrrc[0]->node_type) && (srb_flagP == 0)) { LOG_D(RLC, "call proto_agent_send_pdcp_data_ind() \n"); nr_pdcp_params.pdcp_data_ind_func(ctxt_pP, srb_flagP, 0, rb_id, sdu_buffer_size, sdu_buffer, NULL, NULL); - return; + return 1; } nr_pdcp_manager_lock(nr_pdcp_ue_manager); diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index adcc8a7b35..d20086d1d0 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -822,7 +822,7 @@ static void srb_add_drb_am(int rnti, struct NR_DRB_ToAddMod *s, NR_RLC_BearerCon struct NR_RLC_Config *r = rlc_BearerConfig->rlc_Config; struct NR_LogicalChannelConfig *l = rlc_BearerConfig->mac_LogicalChannelConfig; int srb_id = 1; - int channel_id = 1;//rlc_BearerConfig->logicalChannelIdentity; + // int channel_id = 1;//rlc_BearerConfig->logicalChannelIdentity; int logical_channel_group; int t_status_prohibit; @@ -962,7 +962,7 @@ static void srb_add_drb_um(int rnti, struct NR_DRB_ToAddMod *s, NR_RLC_BearerCon struct NR_RLC_Config *r = rlc_BearerConfig->rlc_Config; struct NR_LogicalChannelConfig *l = rlc_BearerConfig->mac_LogicalChannelConfig; int srb_id = 1; - int channel_id = rlc_BearerConfig->logicalChannelIdentity; + // int channel_id = rlc_BearerConfig->logicalChannelIdentity; int logical_channel_group; int sn_field_length; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 143c17fc54..c25b70382c 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -390,24 +390,27 @@ rrc_gNB_generate_RRCSetup( case ngran_gNB_CU: // create an ITTI message /* TODO: F1 IDs ar missing in RRC */ - // message_p = itti_alloc_new_message (TASK_RRC_GNB, F1AP_DL_RRC_MESSAGE); - // F1AP_DL_RRC_MESSAGE (message_p).rrc_container = (uint8_t *)ue_p->Srb0.Tx_buffer.Payload; - // F1AP_DL_RRC_MESSAGE (message_p).rrc_container_length = ue_p->Srb0.Tx_buffer.payload_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 = ue_p->rnti; - // F1AP_DL_RRC_MESSAGE (message_p).srb_id = CCCH; - // 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); - // LOG_D(NR_RRC, "Send F1AP_DL_RRC_MESSAGE with ITTI\n"); + if(0) { + message_p = itti_alloc_new_message (TASK_RRC_GNB, F1AP_DL_RRC_MESSAGE); + F1AP_DL_RRC_MESSAGE (message_p).rrc_container = (uint8_t *)ue_p->Srb0.Tx_buffer.Payload; + F1AP_DL_RRC_MESSAGE (message_p).rrc_container_length = ue_p->Srb0.Tx_buffer.payload_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 = ue_p->rnti; + F1AP_DL_RRC_MESSAGE (message_p).srb_id = CCCH; + 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); + LOG_D(NR_RRC, "Send F1AP_DL_RRC_MESSAGE with ITTI\n"); + } + // for rfsim, send RRCSetup messgae in SRB1 nr_rrc_data_req(ctxt_pP, DCCH, rrc_gNB_mui++, SDU_CONFIRM_NO, ue_p->Srb0.Tx_buffer.payload_size, - ue_p->Srb0.Tx_buffer.Payload, + (uint8_t *)ue_p->Srb0.Tx_buffer.Payload, PDCP_TRANSMISSION_MODE_CONTROL); break; @@ -462,7 +465,7 @@ rrc_gNB_generate_RRCSetup( rrc_gNB_mui++, SDU_CONFIRM_NO, ue_p->Srb0.Tx_buffer.payload_size, - ue_p->Srb0.Tx_buffer.Payload, + (uint8_t *)ue_p->Srb0.Tx_buffer.Payload, PDCP_TRANSMISSION_MODE_CONTROL); #endif } @@ -668,7 +671,6 @@ rrc_gNB_generate_defaultRRCReconfiguration( struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList = NULL; NR_DedicatedNAS_Message_t *dedicatedNAS_Message = NULL; - MessageDef *message_p; uint8_t xid = rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id); @@ -773,21 +775,6 @@ rrc_gNB_generate_defaultRRCReconfiguration( ue_context_pP->ue_context.rnti); switch (RC.nrrrc[ctxt_pP->module_id]->node_type) { case ngran_gNB_CU: - // create an ITTI message - // F1AP_DL_RRC_MESSAGE - // message_p = itti_alloc_new_message (TASK_RRC_GNB, F1AP_DL_RRC_MESSAGE); - // F1AP_DL_RRC_MESSAGE (message_p).rrc_container = buffer; - // F1AP_DL_RRC_MESSAGE (message_p).rrc_container_length = 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 = ue_context_pP->ue_context.rnti; - // F1AP_DL_RRC_MESSAGE (message_p).srb_id = DCCH; - // 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); - // LOG_I(NR_RRC, "send RRCReconfiguration to F1AP by F1AP_DL_RRC_MESSAGE \n"); - nr_rrc_data_req(ctxt_pP, DCCH, rrc_gNB_mui++, @@ -807,6 +794,7 @@ rrc_gNB_generate_defaultRRCReconfiguration( case ngran_gNB: { #ifdef ITTI_SIM + MessageDef *message_p; uint8_t *message_buffer; message_buffer = itti_malloc (TASK_RRC_GNB, TASK_RRC_UE_SIM, size); memcpy (message_buffer, buffer, size); @@ -2451,7 +2439,7 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) { itti_send_msg_to_task (TASK_CU_F1, GNB_MODULE_ID_TO_INSTANCE(j), msg_p); break; } else {// setup_req mcc/mnc match rrc internal list element - LOG_W(NR_RRC,"[Inst %d] No matching MCC/MNC: rrc->mcc/f1_setup_req->mcc %d/%d rrc->mnc/f1_setup_req->mnc %d/%d rrc->nr_cellid/f1_setup_req->nr_cellid %d/%d \n", + LOG_W(NR_RRC,"[Inst %d] No matching MCC/MNC: rrc->mcc/f1_setup_req->mcc %d/%d rrc->mnc/f1_setup_req->mnc %d/%d rrc->nr_cellid/f1_setup_req->nr_cellid %ld/%ld \n", j, rrc->configuration.mcc[0], f1_setup_req->mcc[i], rrc->configuration.mnc[0], f1_setup_req->mnc[i], rrc->nr_cellid, f1_setup_req->nr_cellid[i]); @@ -2806,7 +2794,6 @@ rrc_gNB_generate_UECapabilityEnquiry( { uint8_t buffer[100]; uint8_t size; - MessageDef *message_p; T(T_ENB_RRC_UE_CAPABILITY_ENQUIRY, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); @@ -2820,21 +2807,6 @@ rrc_gNB_generate_UECapabilityEnquiry( size); switch (RC.nrrrc[ctxt_pP->module_id]->node_type) { case ngran_gNB_CU: - // create an ITTI message - // F1AP_DL_RRC_MESSAGE - // message_p = itti_alloc_new_message (TASK_RRC_GNB, F1AP_DL_RRC_MESSAGE); - // F1AP_DL_RRC_MESSAGE (message_p).rrc_container = buffer; - // F1AP_DL_RRC_MESSAGE (message_p).rrc_container_length = 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 = ue_context_pP->ue_context.rnti; - // F1AP_DL_RRC_MESSAGE (message_p).srb_id = DCCH; - // 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); - // LOG_D(NR_RRC, "Send F1AP_DL_RRC_MESSAGE with ITTI\n"); - nr_rrc_data_req( ctxt_pP, DCCH, @@ -2869,6 +2841,7 @@ rrc_gNB_generate_UECapabilityEnquiry( rrc_gNB_mui, size); #ifdef ITTI_SIM + MessageDef *message_p; uint8_t *message_buffer; message_buffer = itti_malloc (TASK_RRC_GNB, TASK_RRC_UE_SIM, size); memcpy (message_buffer, buffer, size);