Commit ce856777 authored by Xue Song's avatar Xue Song

modify some issues

parent f3c922b1
...@@ -378,33 +378,7 @@ rrc_gNB_generate_RRCSetup( ...@@ -378,33 +378,7 @@ rrc_gNB_generate_RRCSetup(
PROTOCOL_NR_RRC_CTXT_UE_FMT" RRC_gNB --- MAC_CONFIG_REQ (SRB1) ---> MAC_gNB\n", PROTOCOL_NR_RRC_CTXT_UE_FMT" RRC_gNB --- MAC_CONFIG_REQ (SRB1) ---> MAC_gNB\n",
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP)); PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP));
// rrc_mac_config_req_eNB( ctxt_pP->module_id, // rrc_mac_config_req_eNB
// ue_context_pP->ue_context.primaryCC_id,
// 0,0,0,0,0, 0,
// ue_context_pP->ue_context.rnti,
// NULL,
// NULL,
// NULL,
// ue_context_pP->ue_context.physicalConfigDedicated,
// NULL,
// NULL,
// ue_context_pP->ue_context.mac_MainConfig,
// 1,
// SRB1_logicalChannelConfig,
// ue_context_pP->ue_context.measGapConfig,
// NULL,
// NULL,
// NULL,
// 0, NULL, NULL, NULL,
// 0, NULL, NULL,
// NULL,
// 0,
// NULL,
// NULL,
// NULL,
// NULL,
// NULL,
// NULL);
MSC_LOG_TX_MESSAGE( MSC_LOG_TX_MESSAGE(
MSC_RRC_GNB, MSC_RRC_GNB,
...@@ -462,6 +436,14 @@ rrc_gNB_generate_RRCReject( ...@@ -462,6 +436,14 @@ rrc_gNB_generate_RRCReject(
PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating NR_RRCReject (bytes %d)\n", PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating NR_RRCReject (bytes %d)\n",
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP), PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP),
ue_p->Srb0.Tx_buffer.payload_size); ue_p->Srb0.Tx_buffer.payload_size);
#ifdef ITTI_SIM
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RRC_GNB_SIM, GNB_RRC_CCCH_DATA_IND);
GNB_RRC_CCCH_DATA_IND (message_p).sdu = (uint8_t*)ue_p->Srb0.Tx_buffer.Payload;
GNB_RRC_CCCH_DATA_IND (message_p).size = ue_p->Srb0.Tx_buffer.payload_size;
itti_send_msg_to_task (TASK_RRC_UE_SIM, ctxt_pP->instance, message_p);
#endif
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -479,18 +461,13 @@ rrc_gNB_process_RRCSetupComplete( ...@@ -479,18 +461,13 @@ rrc_gNB_process_RRCSetupComplete(
LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel UL-DCCH, " "processing NR_RRCSetupComplete from UE (SRB1 Active)\n", LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel UL-DCCH, " "processing NR_RRCSetupComplete from UE (SRB1 Active)\n",
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP)); PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP));
ue_context_pP->ue_context.Srb1.Active = 1; ue_context_pP->ue_context.Srb1.Active = 1;
ue_context_pP->ue_context.Status = RRC_CONNECTED; ue_context_pP->ue_context.Status = NR_RRC_CONNECTED;
// T(T_GNB_RRC_SETUP_COMPLETE,
// T_INT(ctxt_pP->module_id),
// T_INT(ctxt_pP->frame),
// T_INT(ctxt_pP->subframe),
// T_INT(ctxt_pP->rnti));
// if (AMF_MODE_ENABLED) { if (AMF_MODE_ENABLED) {
// rrc_gNB_send_NGAP_NAS_FIRST_REQ(ctxt_pP, ue_context_pP, rrcSetupComplete); rrc_gNB_send_NGAP_NAS_FIRST_REQ(ctxt_pP, ue_context_pP, rrcSetupComplete);
// } else { } else {
rrc_gNB_generate_SecurityModeCommand(ctxt_pP, ue_context_pP); rrc_gNB_generate_SecurityModeCommand(ctxt_pP, ue_context_pP);
// } }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -605,24 +582,26 @@ rrc_gNB_process_RRCReconfigurationComplete( ...@@ -605,24 +582,26 @@ rrc_gNB_process_RRCReconfigurationComplete(
MSC_AS_TIME_ARGS(ctxt_pP), MSC_AS_TIME_ARGS(ctxt_pP),
ue_context_pP->ue_context.rnti); ue_context_pP->ue_context.rnti);
// nr_rrc_pdcp_config_asn1_req(ctxt_pP, #ifndef ITTI_SIM
// SRB_configList, // NULL, nr_rrc_pdcp_config_asn1_req(ctxt_pP,
// DRB_configList, SRB_configList, // NULL,
// DRB_Release_configList2, DRB_configList,
// 0xff, // already configured during the securitymodecommand DRB_Release_configList2,
// kRRCenc, 0xff, // already configured during the securitymodecommand
// kRRCint, kRRCenc,
// kUPenc, kRRCint,
// NULL, kUPenc,
// NULL, NULL,
// NULL); NULL,
// /* Refresh SRBs/DRBs */ NULL);
// nr_rrc_rlc_config_asn1_req(ctxt_pP, /* Refresh SRBs/DRBs */
// SRB_configList, // NULL, nr_rrc_rlc_config_asn1_req(ctxt_pP,
// DRB_configList, SRB_configList, // NULL,
// DRB_Release_configList2, DRB_configList,
// NULL, DRB_Release_configList2,
// NULL); NULL,
NULL);
#endif
/* Loop through DRBs and establish if necessary */ /* Loop through DRBs and establish if necessary */
/* Set the SRB active in UE context */ /* Set the SRB active in UE context */
...@@ -850,8 +829,13 @@ int nr_rrc_gNB_decode_ccch(protocol_ctxt_t *const ctxt_pP, ...@@ -850,8 +829,13 @@ int nr_rrc_gNB_decode_ccch(protocol_ctxt_t *const ctxt_pP,
ue_context_p->ue_context.ng_5G_S_TMSI_Part1 = s_tmsi_part1; ue_context_p->ue_context.ng_5G_S_TMSI_Part1 = s_tmsi_part1;
} }
} }
} //else { } else {
/* TODO */ /* TODO */
memcpy(((uint8_t *) & random_value) + 3,
rrcSetupRequest->ue_Identity.choice.randomValue.buf,
rrcSetupRequest->ue_Identity.choice.randomValue.size);
rrc_gNB_get_next_free_ue_context(ctxt_pP, RC.nrrrc[ctxt_pP->module_id], random_value);
LOG_E(NR_RRC, LOG_E(NR_RRC,
PROTOCOL_NR_RRC_CTXT_UE_FMT" RRCSetupRequest without random UE identity or S-TMSI not supported, let's reject the UE\n", PROTOCOL_NR_RRC_CTXT_UE_FMT" RRCSetupRequest without random UE identity or S-TMSI not supported, let's reject the UE\n",
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP)); PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP));
...@@ -859,7 +843,7 @@ int nr_rrc_gNB_decode_ccch(protocol_ctxt_t *const ctxt_pP, ...@@ -859,7 +843,7 @@ int nr_rrc_gNB_decode_ccch(protocol_ctxt_t *const ctxt_pP,
rrc_gNB_get_ue_context(gnb_rrc_inst, ctxt_pP->rnti), rrc_gNB_get_ue_context(gnb_rrc_inst, ctxt_pP->rnti),
CC_id); CC_id);
break; break;
//} }
} }
if (ue_context_p != NULL) { if (ue_context_p != NULL) {
......
...@@ -584,7 +584,7 @@ int main( int argc, char **argv ) ...@@ -584,7 +584,7 @@ int main( int argc, char **argv )
// wait for end of program // wait for end of program
printf("TYPE <CTRL-C> TO TERMINATE\n"); printf("TYPE <CTRL-C> TO TERMINATE\n");
usleep(10000); usleep(100000);
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt;
struct rrc_gNB_ue_context_s *ue_context_p = NULL; struct rrc_gNB_ue_context_s *ue_context_p = NULL;
...@@ -604,31 +604,6 @@ int main( int argc, char **argv ) ...@@ -604,31 +604,6 @@ int main( int argc, char **argv )
rrc_ue_generate_RRCSetupRequest(&ctxt, 0); rrc_ue_generate_RRCSetupRequest(&ctxt, 0);
#if 0
// test itti sim
usleep(10000);
protocol_ctxt_t ctxt;
struct rrc_gNB_ue_context_s *ue_context_p = NULL;
ue_context_p = rrc_gNB_allocate_new_UE_context(RC.nrrrc[0]);
if(ue_context_p == NULL){
printf("ue_context_p == NULL");
}
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt,
0,
ENB_FLAG_YES,
0,
0,
0);
rrc_gNB_generate_RRCSetup(&ctxt,
ue_context_p,
0);
// end test itti sim
#endif
printf("Entering ITTI signals handler\n"); printf("Entering ITTI signals handler\n");
itti_wait_tasks_end(); itti_wait_tasks_end();
printf("Returned from ITTI signal handler\n"); printf("Returned from ITTI signal handler\n");
......
...@@ -70,6 +70,7 @@ int ngap_gNB_handle_nas_first_req( ...@@ -70,6 +70,7 @@ int ngap_gNB_handle_nas_first_req(
DevAssert(instance_p != NULL); DevAssert(instance_p != NULL);
memset(&pdu, 0, sizeof(pdu)); memset(&pdu, 0, sizeof(pdu));
pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage; pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage = (NGAP_InitiatingMessage_t *)calloc(1,sizeof(NGAP_InitiatingMessage_t));
pdu.choice.initiatingMessage->procedureCode = NGAP_ProcedureCode_id_InitialUEMessage; pdu.choice.initiatingMessage->procedureCode = NGAP_ProcedureCode_id_InitialUEMessage;
pdu.choice.initiatingMessage->criticality = NGAP_Criticality_ignore; pdu.choice.initiatingMessage->criticality = NGAP_Criticality_ignore;
pdu.choice.initiatingMessage->value.present = NGAP_InitiatingMessage__value_PR_InitialUEMessage; pdu.choice.initiatingMessage->value.present = NGAP_InitiatingMessage__value_PR_InitialUEMessage;
...@@ -220,6 +221,8 @@ int ngap_gNB_handle_nas_first_req( ...@@ -220,6 +221,8 @@ int ngap_gNB_handle_nas_first_req(
ie->value.choice.UserLocationInformation.present = NGAP_UserLocationInformation_PR_userLocationInformationNR; ie->value.choice.UserLocationInformation.present = NGAP_UserLocationInformation_PR_userLocationInformationNR;
ie->value.choice.UserLocationInformation.choice.userLocationInformationNR =
CALLOC(1, sizeof(*ie->value.choice.UserLocationInformation.choice.userLocationInformationNR));
userinfo_nr_p = ie->value.choice.UserLocationInformation.choice.userLocationInformationNR; userinfo_nr_p = ie->value.choice.UserLocationInformation.choice.userLocationInformationNR;
/* Set nRCellIdentity. default userLocationInformationNR */ /* Set nRCellIdentity. default userLocationInformationNR */
......
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